00001 00031 #ifndef _OMX_MADDEC_COMPONENT_H_ 00032 #define _OMX_MADDEC_COMPONENT_H_ 00033 00034 #include <OMX_Types.h> 00035 #include <OMX_Component.h> 00036 #include <OMX_Core.h> 00037 #include <pthread.h> 00038 #include <stdlib.h> 00039 #include <string.h> 00040 #include <omx_base_filter.h> 00041 00042 //specific include files 00043 #include <mad.h> 00044 00045 #define AUDIO_DEC_BASE_NAME "OMX.st.audio_decoder" 00046 #define AUDIO_DEC_MP3_NAME "OMX.st.audio_decoder.mp3.mad" 00047 #define AUDIO_DEC_MP3_ROLE "mad_decoder.mp3" 00048 00051 DERIVEDCLASS(omx_maddec_component_PrivateType, omx_base_filter_PrivateType) 00052 #define omx_maddec_component_PrivateType_FIELDS omx_base_filter_PrivateType_FIELDS \ 00053 \ 00054 struct mad_stream *stream; \ 00055 \ 00056 struct mad_frame *frame; \ 00057 \ 00058 struct mad_synth *synth; \ 00059 \ 00060 tsem_t* madDecSyncSem; \ 00061 \ 00062 OMX_AUDIO_PARAM_MP3TYPE pAudioMp3; \ 00063 \ 00064 OMX_AUDIO_PARAM_PCMMODETYPE pAudioPcmMode; \ 00065 \ 00066 OMX_BOOL maddecReady; \ 00067 \ 00068 OMX_U16 minBufferLength; \ 00069 \ 00070 OMX_U8* inputCurrBuffer;\ 00071 \ 00072 OMX_U32 inputCurrLength;\ 00073 \ 00074 OMX_U8* internalOutputBuffer;\ 00075 \ 00076 OMX_S32 isFirstBuffer;\ 00077 \ 00078 OMX_S32 positionInOutBuf; \ 00079 \ 00080 OMX_S32 isNewBuffer; \ 00081 \ 00082 OMX_U32 audio_coding_type; \ 00083 \ 00084 OMX_BUFFERHEADERTYPE *temporary_buffer; \ 00085 \ 00086 OMX_U32 need_mad_stream; \ 00087 \ 00088 OMX_U8* temp_input_buffer; 00089 ENDCLASS(omx_maddec_component_PrivateType) 00090 00091 //------------------------------------------------------------------------------------------------------------------- 00092 00093 00094 /* Component private entry points declaration */ 00095 OMX_ERRORTYPE omx_maddec_component_Constructor(OMX_COMPONENTTYPE *openmaxStandComp,OMX_STRING cComponentName); 00096 OMX_ERRORTYPE omx_maddec_component_Destructor(OMX_COMPONENTTYPE *openmaxStandComp); 00097 OMX_ERRORTYPE omx_maddec_component_Init(OMX_COMPONENTTYPE *openmaxStandComp); 00098 OMX_ERRORTYPE omx_maddec_component_Deinit(OMX_COMPONENTTYPE *openmaxStandComp); 00099 OMX_ERRORTYPE omx_mad_decoder_MessageHandler(OMX_COMPONENTTYPE*,internalRequestMessageType*); 00100 00101 void omx_maddec_component_BufferMgmtCallback( 00102 OMX_COMPONENTTYPE *openmaxStandComp, 00103 OMX_BUFFERHEADERTYPE* inputbuffer, 00104 OMX_BUFFERHEADERTYPE* outputbuffer); 00105 00106 OMX_ERRORTYPE omx_maddec_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_maddec_component_SetParameter( 00112 OMX_IN OMX_HANDLETYPE hComponent, 00113 OMX_IN OMX_INDEXTYPE nParamIndex, 00114 OMX_IN OMX_PTR ComponentParameterStructure); 00115 00116 void omx_maddec_component_SetInternalParameters(OMX_COMPONENTTYPE *openmaxStandComp); 00117 00118 #endif