00001
00031 #ifndef _OMX_FILEREADER_COMPONENT_H_
00032 #define _OMX_FILEREADER_COMPONENT_H_
00033
00034 #include <OMX_Types.h>
00035 #include <OMX_Component.h>
00036 #include <OMX_Core.h>
00037 #include <OMX_Audio.h>
00038 #include <pthread.h>
00039 #include <omx_base_source.h>
00040 #include <string.h>
00041
00042
00043 #include <ffmpeg/avcodec.h>
00044 #include <ffmpeg/avformat.h>
00045 #include <ffmpeg/avio.h>
00046
00048 #define MAX_NUM_OF_filereader_component_INSTANCES 1
00049
00053 DERIVEDCLASS(omx_filereader_component_PrivateType, omx_base_source_PrivateType)
00054 #define omx_filereader_component_PrivateType_FIELDS omx_base_source_PrivateType_FIELDS \
00055 \
00056 OMX_TIME_CONFIG_TIMESTAMPTYPE sTimeStamp; \
00057 \
00058 AVFormatContext *avformatcontext; \
00059 \
00060 AVFormatParameters *avformatparameters; \
00061 \
00062 AVInputFormat *avinputformat; \
00063 \
00064 AVPacket pkt; \
00065 \
00066 OMX_STRING sInputFileName; \
00067 \
00068 OMX_U32 audio_coding_type; \
00069 \
00070 tsem_t* avformatSyncSem; \
00071 \
00072 OMX_BOOL avformatReady; \
00073 \
00074 OMX_BOOL bIsEOSSent;
00075 ENDCLASS(omx_filereader_component_PrivateType)
00076
00077
00078 OMX_ERRORTYPE omx_filereader_component_Constructor(OMX_COMPONENTTYPE *openmaxStandComp,OMX_STRING cComponentName);
00079 OMX_ERRORTYPE omx_filereader_component_Destructor(OMX_COMPONENTTYPE *openmaxStandComp);
00080 OMX_ERRORTYPE omx_filereader_component_MessageHandler(OMX_COMPONENTTYPE*,internalRequestMessageType*);
00081 OMX_ERRORTYPE omx_filereader_component_Init(OMX_COMPONENTTYPE *openmaxStandComp);
00082 OMX_ERRORTYPE omx_filereader_component_Deinit(OMX_COMPONENTTYPE *openmaxStandComp);
00083
00084
00085 void omx_filereader_component_BufferMgmtCallback(
00086 OMX_COMPONENTTYPE *openmaxStandComp,
00087 OMX_BUFFERHEADERTYPE* outputbuffer);
00088
00089 OMX_ERRORTYPE omx_filereader_component_GetParameter(
00090 OMX_IN OMX_HANDLETYPE hComponent,
00091 OMX_IN OMX_INDEXTYPE nParamIndex,
00092 OMX_INOUT OMX_PTR ComponentParameterStructure);
00093
00094 OMX_ERRORTYPE omx_filereader_component_SetParameter(
00095 OMX_IN OMX_HANDLETYPE hComponent,
00096 OMX_IN OMX_INDEXTYPE nParamIndex,
00097 OMX_IN OMX_PTR ComponentParameterStructure);
00098
00099 OMX_ERRORTYPE omx_filereader_component_SetConfig(
00100 OMX_IN OMX_HANDLETYPE hComponent,
00101 OMX_IN OMX_INDEXTYPE nIndex,
00102 OMX_IN OMX_PTR pComponentConfigStructure);
00103
00104 OMX_ERRORTYPE omx_filereader_component_GetConfig(
00105 OMX_IN OMX_HANDLETYPE hComponent,
00106 OMX_IN OMX_INDEXTYPE nIndex,
00107 OMX_IN OMX_PTR pComponentConfigStructure);
00108
00109 OMX_ERRORTYPE omx_filereader_component_GetExtensionIndex(
00110 OMX_IN OMX_HANDLETYPE hComponent,
00111 OMX_IN OMX_STRING cParameterName,
00112 OMX_OUT OMX_INDEXTYPE* pIndexType);
00113
00114 #endif
00115