00001
00030 #ifndef _OMX_MP3DEC_COMPONENT_H_
00031 #define _OMX_MP3DEC_COMPONENT_H_
00032
00033 #include <OMX_Types.h>
00034 #include <OMX_Component.h>
00035 #include <OMX_Core.h>
00036 #include <pthread.h>
00037 #include <stdlib.h>
00038 #include <string.h>
00039 #include <omx_base_filter.h>
00040
00041 #include <ffmpeg/avcodec.h>
00042 #include <ffmpeg/avformat.h>
00043
00044 #define AUDIO_DEC_BASE_NAME "OMX.st.audio_decoder"
00045 #define AUDIO_DEC_MP3_NAME "OMX.st.audio_decoder.mp3"
00046 #define AUDIO_DEC_VORBIS_NAME "OMX.st.audio_decoder.ogg"
00047 #define AUDIO_DEC_AAC_NAME "OMX.st.audio_decoder.aac"
00048 #define AUDIO_DEC_MP3_ROLE "audio_decoder.mp3"
00049 #define AUDIO_DEC_VORBIS_ROLE "audio_decoder.ogg"
00050 #define AUDIO_DEC_AAC_ROLE "audio_decoder.aac"
00051
00054 DERIVEDCLASS(omx_audiodec_component_PrivateType, omx_base_filter_PrivateType)
00055 #define omx_audiodec_component_PrivateType_FIELDS omx_base_filter_PrivateType_FIELDS \
00056 \
00057 AVCodec *avCodec; \
00058 \
00059 AVCodecContext *avCodecContext; \
00060 \
00061 tsem_t* avCodecSyncSem; \
00062 \
00063 OMX_AUDIO_PARAM_MP3TYPE pAudioMp3; \
00064 \
00065 OMX_AUDIO_PARAM_VORBISTYPE pAudioVorbis; \
00066 \
00067 OMX_AUDIO_PARAM_AACPROFILETYPE pAudioAac; \
00068 \
00069 OMX_AUDIO_PARAM_PCMMODETYPE pAudioPcmMode; \
00070 \
00071 OMX_BOOL avcodecReady; \
00072 \
00073 OMX_U16 minBufferLength; \
00074 \
00075 OMX_U8* inputCurrBuffer;\
00076 \
00077 OMX_U32 inputCurrLength;\
00078 \
00079 OMX_U8* internalOutputBuffer;\
00080 \
00081 OMX_S32 isFirstBuffer;\
00082 \
00083 OMX_S32 positionInOutBuf; \
00084 \
00085 OMX_S32 isNewBuffer; \
00086 \
00087 OMX_U32 audio_coding_type; \
00088 \
00089 OMX_U8* extradata; \
00090 \
00091 OMX_U32 extradata_size;
00092 ENDCLASS(omx_audiodec_component_PrivateType)
00093
00094
00095 OMX_ERRORTYPE omx_audiodec_component_Constructor(OMX_COMPONENTTYPE *openmaxStandComp,OMX_STRING cComponentName);
00096 OMX_ERRORTYPE omx_audiodec_component_Destructor(OMX_COMPONENTTYPE *openmaxStandComp);
00097 OMX_ERRORTYPE omx_audiodec_component_Init(OMX_COMPONENTTYPE *openmaxStandComp);
00098 OMX_ERRORTYPE omx_audiodec_component_Deinit(OMX_COMPONENTTYPE *openmaxStandComp);
00099 OMX_ERRORTYPE omx_audiodec_component_MessageHandler(OMX_COMPONENTTYPE*,internalRequestMessageType*);
00100
00101 void omx_audiodec_component_BufferMgmtCallback(
00102 OMX_COMPONENTTYPE *openmaxStandComp,
00103 OMX_BUFFERHEADERTYPE* inputbuffer,
00104 OMX_BUFFERHEADERTYPE* outputbuffer);
00105
00106 OMX_ERRORTYPE omx_audiodec_component_GetParameter(
00107 OMX_IN OMX_HANDLETYPE hComponent,
00108 OMX_IN OMX_INDEXTYPE nParamIndex,
00109 OMX_INOUT OMX_PTR ComponentParameterStructure);
00110
00111 OMX_ERRORTYPE omx_audiodec_component_SetParameter(
00112 OMX_IN OMX_HANDLETYPE hComponent,
00113 OMX_IN OMX_INDEXTYPE nParamIndex,
00114 OMX_IN OMX_PTR ComponentParameterStructure);
00115
00116 OMX_ERRORTYPE omx_audiodec_component_ComponentRoleEnum(
00117 OMX_IN OMX_HANDLETYPE hComponent,
00118 OMX_OUT OMX_U8 *cRole,
00119 OMX_IN OMX_U32 nIndex);
00120
00121 void omx_audiodec_component_SetInternalParameters(OMX_COMPONENTTYPE *openmaxStandComp);
00122
00123 OMX_ERRORTYPE omx_audiodec_component_SetConfig(
00124 OMX_HANDLETYPE hComponent,
00125 OMX_INDEXTYPE nIndex,
00126 OMX_PTR pComponentConfigStructure);
00127
00128 OMX_ERRORTYPE omx_audiodec_component_GetExtensionIndex(
00129 OMX_IN OMX_HANDLETYPE hComponent,
00130 OMX_IN OMX_STRING cParameterName,
00131 OMX_OUT OMX_INDEXTYPE* pIndexType);
00132
00133
00134 #endif