#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 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;
}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

