#ifndef __OMX_TYPE1_DEC_COMP_INTF_H__
#define __OMX_TYPE1_DEC_COMP_INTF_H__

#include "OMX_Types.h"
#include "omx_common_dec_comp_intf.h"

typedef enum
{
    OMX_BASE_AUDIO_CHANNEL_POSITION_NONE,                 //!< OMX_BASEAUDIO_CHANNEL_POSITION_NONE
    OMX_BASE_AUDIO_CHANNEL_POSITION_LEFT,                 //!< OMX_BASEAUDIO_CHANNEL_POSITION_LEFT
    OMX_BASE_AUDIO_CHANNEL_POSITION_RIGHT,                //!< OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT
    OMX_BASE_AUDIO_CHANNEL_POSITION_CENTER,               //!< OMX_BASEAUDIO_CHANNEL_POSITION_CENTER
    OMX_BASE_AUDIO_CHANNEL_POSITION_LFE,                  //!< OMX_BASEAUDIO_CHANNEL_POSITION_LFE
    OMX_BASE_AUDIO_CHANNEL_POSITION_LEFT_SURROUND,        //!< OMX_BASEAUDIO_CHANNEL_POSITION_LEFT_SURROUND
    OMX_BASE_AUDIO_CHANNEL_POSITION_RIGHT_SURROUND,       //!< OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT_SURROUND
    OMX_BASE_AUDIO_CHANNEL_POSITION_LEFT_REAR_SURROUND,   //!< OMX_BASEAUDIO_CHANNEL_POSITION_LEFT_REAR_SURROUND
    OMX_BASE_AUDIO_CHANNEL_POSITION_RIGHT_REAR_SURROUND,  //!< OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT_REAR_SURROUND
    OMX_BASE_AUDIO_CHANNEL_POSITION_LEFT_TOP_FRONT,       //!< OMX_BASEAUDIO_CHANNEL_POSITION_LEFT_TOP_FRONT
    OMX_BASE_AUDIO_CHANNEL_POSITION_RIGHT_TOP_FRONT,      //!< OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT_TOP_FRONT
    OMX_BASE_AUDIO_CHANNEL_POSITION_LEFT_TOP_MIDDLE,      //!< OMX_BASEAUDIO_CHANNEL_POSITION_LEFT_TOP_MIDDLE
    OMX_BASE_AUDIO_CHANNEL_POSITION_RIGHT_TOP_MIDDLE,     //!< OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT_TOP_MIDDLE
    OMX_BASE_AUDIO_CHANNEL_POSITION_LEFT_TOP_REAR,        //!< OMX_BASEAUDIO_CHANNEL_POSITION_LEFT_TOP_REAR
    OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT_TOP_REAR,       //!< OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT_TOP_REAR
    OMX_BASEAUDIO_CHANNEL_POSITION_LEFT_SCREEN,          //!< OMX_BASEAUDIO_CHANNEL_POSITION_LEFT_SCREEN
    OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT_SCREEN,         //!< OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT_SCREEN
    OMX_BASEAUDIO_CHANNEL_POSITION_LEFT_CENTER,          //!< OMX_BASEAUDIO_CHANNEL_POSITION_LEFT_CENTER
    OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT_CENTER,         //!< OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT_CENTER
    OMX_BASEAUDIO_CHANNEL_POSITION_LEFT_WIDE,            //!< OMX_BASEAUDIO_CHANNEL_POSITION_LEFT_WIDE
    OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT_WIDE,           //!< OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT_WIDE
    OMX_BASEAUDIO_CHANNEL_POSITION_LEFT_SURROUND_1,      //!< OMX_BASEAUDIO_CHANNEL_POSITION_LEFT_SURROUND_1
    OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT_SURROUND_1,     //!< OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT_SURROUND_1
    OMX_BASEAUDIO_CHANNEL_POSITION_LEFT_SURROUND_2,      //!< OMX_BASEAUDIO_CHANNEL_POSITION_LEFT_SURROUND_2
    OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT_SURROUND_2,     //!< OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT_SURROUND_2
    OMX_BASEAUDIO_CHANNEL_POSITION_LEFT_REAR_SURROUND_1, //!< OMX_BASEAUDIO_CHANNEL_POSITION_LEFT_REAR_SURROUND_1
    OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT_REAR_SURROUND_1,//!< OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT_REAR_SURROUND_1
    OMX_BASEAUDIO_CHANNEL_POSITION_LEFT_REAR_SURROUND_2, //!< OMX_BASEAUDIO_CHANNEL_POSITION_LEFT_REAR_SURROUND_2
    OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT_REAR_SURROUND_2,//!< OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT_REAR_SURROUND_2
    OMX_BASEAUDIO_CHANNEL_POSITION_LEFT_CENTER_SURROUND, //!< OMX_BASEAUDIO_CHANNEL_POSITION_LEFT_CENTER_SURROUND
    OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT_CENTER_SURROUND,//!< OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT_CENTER_SURROUND
    OMX_BASEAUDIO_CHANNEL_POSITION_CENTER_SURROUND,      //!< OMX_BASEAUDIO_CHANNEL_POSITION_CENTER_SURROUND
    OMX_BASEAUDIO_CHANNEL_POSITION_LEFT_FRONT_HEIGHT,    //!< OMX_BASEAUDIO_CHANNEL_POSITION_LEFT_FRONT_HEIGHT
    OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT_FRONT_HEIGHT,   //!< OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT_FRONT_HEIGHT
    OMX_BASEAUDIO_CHANNEL_POSITION_LEFT_REAR_HEIGHT,     //!< OMX_BASEAUDIO_CHANNEL_POSITION_LEFT_REAR_HEIGHT
    OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT_REAR_HEIGHT,    //!< OMX_BASEAUDIO_CHANNEL_POSITION_RIGHT_REAR_HEIGHT
    OMX_BASEAUDIO_CHANNEL_POSITION_SINGLE_HEIGHT         //!< OMX_BASEAUDIO_CHANNEL_POSITION_SINGLE_HEIGHT
}Audio_channel_position;

typedef struct __TYPE1_DEC_PCM_INFO
{
    OMX_U32 u4SampleNumPerChannel;
    OMX_U32 u4BitsPerSample;
    OMX_U32 u4NeedBytesPerSample;
    OMX_U32 u4SampleIsLittleEnd;
    pcm_access_mode eAccessMode;
    OMX_U32 u4ChannelConfig0;    //[15:12/Lsr][11:8/C][7:4/R][3:0/L]
    OMX_U32 u4ChannelConfig1;    //[15:12/Rsr][11:8/LFE][7:4/Rs][3:0/Ls]
    OMX_U32 u4ChannelConfig2;    //[15:12/Ch12][11:8/Ch11][7:4/Ch10][3:0/Ch9]
    OMX_U32 u4ChannelConfig3;    //[15:12/Ch16][11:8/Ch15][7:4/Ch14][3:0/Ch13]
    OMX_U32 u4ChannelNum;
    OMX_U32 u4SampleRate;
	Audio_channel_position audio_channel_position[36];
}TYPE1_DEC_PCM_INFO;

typedef struct __TYPE1_DEC_INPUT_BUF
{
    OMX_PTR pvBuf;
    OMX_U32 u4BufByteSize;
}TYPE1_DEC_INPUT_BUF;

typedef struct __TYPE1_DEC_OUTPUT_BUF
{
    TYPE1_DEC_PCM_INFO ePcmInfo;
    OMX_PTR pvPcmBuf;
    OMX_U32 u4BufUsedByteSize;
    OMX_U32 u4BufTotalByteSize;
}TYPE1_DEC_OUTPUT_BUF;

/*
typedef struct __dec_type1_callback_intf
{
    OMX_HANDLETYPE handle;
    OMX_S32 (*decoder_event_notify)(OMX_HANDLETYPE handle, DECODER_EVENT_NOTIFY_TYPE eventnfy, OMX_PTR nfystruct);
}dec_type1_callback_intf;
*/

typedef struct __TYPE1_DEC_ACTION_INTF
{
    OMX_S32 (*decoder_init)(OMX_PTR *ppvDecSelfData, OMX_PTR pvDecInitInfo, OMX_U32 u4DecInitInfoSize);
    //OMX_S32 (*decoder_reinit)(OMX_PTR decselfdataptr);
    //OMX_S32 (*set_callback)(OMX_PTR decselfdata, dec_type1_callback_intf* cbintf);
    OMX_S32 (*set_parameter)(OMX_PTR pvDecSelfData, COMMON_DEC_PARAM_TYPE eParamType, OMX_PTR pvParamStruct);
    OMX_S32 (*get_parameter)(OMX_PTR pvDecSelfData, COMMON_DEC_PARAM_TYPE eParamType, OMX_PTR pvParamStruct);
    OMX_S32 (*decode)(OMX_PTR pvDecSelfData, TYPE1_DEC_INPUT_BUF *ptInput, TYPE1_DEC_OUTPUT_BUF *ptOutput,
                      OMX_U32 *pu4InputBufConsumed, OMX_BOOL *peIsDecInfoChg, AUD_NOTIFY_INFO *pInfo);
    OMX_S32 (*decoder_uninit)(OMX_PTR pvDecSelfData);
}TYPE1_DEC_ACTION_INTF;

typedef struct __type1_dec_component
{
    char *pcName;
    char *pcNameSpecific;
    char *pcRoleSpecific;
    AUD_DEC_FMT_T eDecFmtId;
    TYPE1_DEC_ACTION_INTF tDecActionIntf;
}type1_dec_component;

OMX_S32 get_decoder_component_description(type1_dec_component **ppDecComp);

#endif

