omx_filereader_component.h File Reference

#include <OMX_Types.h>
#include <OMX_Component.h>
#include <OMX_Core.h>
#include <OMX_Audio.h>
#include <pthread.h>
#include <omx_base_source.h>
#include <string.h>
#include <ffmpeg/avcodec.h>
#include <ffmpeg/avformat.h>
#include <ffmpeg/avio.h>

Go to the source code of this file.

Defines

#define MAX_NUM_OF_filereader_component_INSTANCES   1
#define omx_filereader_component_PrivateType_FIELDS

Functions

OMX_ERRORTYPE omx_filereader_component_Constructor (OMX_COMPONENTTYPE *openmaxStandComp, OMX_STRING cComponentName)
OMX_ERRORTYPE omx_filereader_component_Destructor (OMX_COMPONENTTYPE *openmaxStandComp)
OMX_ERRORTYPE omx_filereader_component_MessageHandler (OMX_COMPONENTTYPE *, internalRequestMessageType *)
OMX_ERRORTYPE omx_filereader_component_Init (OMX_COMPONENTTYPE *openmaxStandComp)
OMX_ERRORTYPE omx_filereader_component_Deinit (OMX_COMPONENTTYPE *openmaxStandComp)
void omx_filereader_component_BufferMgmtCallback (OMX_COMPONENTTYPE *openmaxStandComp, OMX_BUFFERHEADERTYPE *outputbuffer)
OMX_ERRORTYPE omx_filereader_component_GetParameter (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR ComponentParameterStructure)
OMX_ERRORTYPE omx_filereader_component_SetParameter (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nParamIndex, OMX_IN OMX_PTR ComponentParameterStructure)
OMX_ERRORTYPE omx_filereader_component_SetConfig (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nIndex, OMX_IN OMX_PTR pComponentConfigStructure)
OMX_ERRORTYPE omx_filereader_component_GetConfig (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nIndex, OMX_IN OMX_PTR pComponentConfigStructure)
OMX_ERRORTYPE omx_filereader_component_GetExtensionIndex (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_STRING cParameterName, OMX_OUT OMX_INDEXTYPE *pIndexType)


Detailed Description

OpenMAX file reader component. This component is a file reader that detects the input file format so that client calls the appropriate decoder.

Copyright (C) 2007 STMicroelectronics Copyright (C) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

$Date$ Revision $Rev$ Author $Author$

Definition in file omx_filereader_component.h.


Define Documentation

#define MAX_NUM_OF_filereader_component_INSTANCES   1

Maximum number of base_component component instances

Definition at line 48 of file omx_filereader_component.h.

#define omx_filereader_component_PrivateType_FIELDS

Value:

omx_base_source_PrivateType_FIELDS \ \
  OMX_TIME_CONFIG_TIMESTAMPTYPE sTimeStamp; \ \
  AVFormatContext *avformatcontext; \ \
  AVFormatParameters *avformatparameters; \ \
  AVInputFormat *avinputformat; \ \
  AVPacket pkt; \ \
  OMX_STRING sInputFileName; \ \
  OMX_U32 audio_coding_type; \ \
  tsem_t* avformatSyncSem; \ \
  OMX_BOOL avformatReady;  \ \
  OMX_BOOL bIsEOSSent;
Filereader component private structure. see the define above

Definition at line 54 of file omx_filereader_component.h.


Function Documentation

void omx_filereader_component_BufferMgmtCallback ( OMX_COMPONENTTYPE openmaxStandComp,
OMX_BUFFERHEADERTYPE pOutputBuffer 
)

This function processes the input file and returns packet by packet as an output data this packet is used in audio decoder component for decoding

copying the packetized data in the output buffer that will be decoded in the decoder component

return the current output buffer

Definition at line 265 of file omx_filereader_component.c.

References DEB_LEV_ERR, DEB_LEV_FULL_SEQ, DEB_LEV_FUNCTION_NAME, DEB_LEV_SIMPLE_SEQ, DEBUG, OMX_BUFFERHEADERTYPE::nFilledLen, OMX_BUFFERHEADERTYPE::nFlags, OMX_BUFFERHEADERTYPE::nOffset, OMX_BUFFERHEADERTYPE::nTimeStamp, OMX_BUFFERFLAG_EOS, OMX_FALSE, OMX_StateExecuting, OMX_TRUE, OMX_BUFFERHEADERTYPE::pBuffer, OMX_COMPONENTTYPE::pComponentPrivate, and tsem_down().

OMX_ERRORTYPE omx_filereader_component_Constructor ( OMX_COMPONENTTYPE openmaxStandComp,
OMX_STRING  cComponentName 
)

The Constructor

Allocate Ports and call port constructor.

for the moment, the file reader works with audio component so the domain is set to audio in future it may be assigned after checking the input file format or there can be seperate file reader of video component

Definition at line 44 of file omx_filereader_component.c.

References DEB_LEV_FUNCTION_NAME, DEBUG, err, omx_base_source_Constructor(), OMX_ErrorInsufficientResources, OMX_ErrorNone, and OMX_COMPONENTTYPE::pComponentPrivate.

Referenced by omx_component_library_Setup().

OMX_ERRORTYPE omx_filereader_component_Deinit ( OMX_COMPONENTTYPE openmaxStandComp  ) 

The DeInitialization function

closing input file

Definition at line 246 of file omx_filereader_component.c.

References DEB_LEV_FUNCTION_NAME, DEBUG, OMX_ErrorNone, OMX_FALSE, OMX_COMPONENTTYPE::pComponentPrivate, and tsem_reset().

Referenced by omx_filereader_component_MessageHandler().

OMX_ERRORTYPE omx_filereader_component_Destructor ( OMX_COMPONENTTYPE openmaxStandComp  ) 

The Destructor

Definition at line 129 of file omx_filereader_component.c.

References DEB_LEV_FUNCTION_NAME, DEBUG, omx_base_source_Destructor(), OMX_COMPONENTTYPE::pComponentPrivate, and tsem_deinit().

OMX_ERRORTYPE omx_filereader_component_GetConfig ( OMX_IN OMX_HANDLETYPE  hComponent,
OMX_IN OMX_INDEXTYPE  nIndex,
OMX_IN OMX_PTR  pComponentConfigStructure 
)

setting configurations

Definition at line 520 of file omx_filereader_component.c.

References OMX_VENDOR_EXTRADATATYPE::nDataSize, OMX_VENDOR_EXTRADATATYPE::nPortIndex, omx_base_component_GetConfig(), OMX_ErrorNone, OMX_IndexVendorAudioExtraData, OMX_COMPONENTTYPE::pComponentPrivate, and OMX_VENDOR_EXTRADATATYPE::pData.

OMX_ERRORTYPE omx_filereader_component_GetExtensionIndex ( OMX_IN OMX_HANDLETYPE  hComponent,
OMX_IN OMX_STRING  cParameterName,
OMX_OUT OMX_INDEXTYPE pIndexType 
)

Definition at line 542 of file omx_filereader_component.c.

References DEB_LEV_FUNCTION_NAME, DEBUG, OMX_ErrorBadParameter, OMX_ErrorNone, OMX_IndexVendorAudioExtraData, and OMX_IndexVendorFileReadInputFilename.

OMX_ERRORTYPE omx_filereader_component_GetParameter ( OMX_IN OMX_HANDLETYPE  hComponent,
OMX_IN OMX_INDEXTYPE  nParamIndex,
OMX_INOUT OMX_PTR  ComponentParameterStructure 
)

Definition at line 404 of file omx_filereader_component.c.

References checkHeader(), DEB_LEV_SIMPLE_SEQ, DEBUG, err, OMX_AUDIO_PARAM_PORTFORMATTYPE::nPortIndex, omx_base_component_GetParameter(), OMX_BASE_SOURCE_OUTPUTPORT_INDEX, OMX_ErrorBadParameter, OMX_ErrorBadPortIndex, OMX_ErrorNone, OMX_IndexParamAudioInit, OMX_IndexParamAudioPortFormat, OMX_IndexVendorFileReadInputFilename, OMX_COMPONENTTYPE::pComponentPrivate, and omx_base_audio_PortType::sAudioParam.

OMX_ERRORTYPE omx_filereader_component_Init ( OMX_COMPONENTTYPE openmaxStandComp  ) 

The Initialization function

initialization of file reader component private data structures

opening the input file whose name is already set via setParameter

initialization for buff mgmt callback function

send callback regarding codec context extradata which will be required to open the codec in the audio decoder component

Definition at line 160 of file omx_filereader_component.c.

References DEB_LEV_ERR, DEB_LEV_FUNCTION_NAME, DEB_LEV_SIMPLE_SEQ, DEBUG, OMX_VENDOR_EXTRADATATYPE::nDataSize, OMX_VENDOR_EXTRADATATYPE::nPortIndex, OMX_AUDIO_CodingAAC, OMX_AUDIO_CodingMP3, OMX_AUDIO_CodingVORBIS, OMX_ErrorBadParameter, OMX_ErrorFormatNotDetected, OMX_ErrorNone, OMX_EventError, OMX_EventPortFormatDetected, OMX_EventPortSettingsChanged, OMX_FALSE, OMX_IndexParamAudioPortFormat, OMX_IndexParamCommonExtraQuantData, OMX_TRUE, OMX_COMPONENTTYPE::pComponentPrivate, OMX_VENDOR_EXTRADATATYPE::pData, and tsem_up().

Referenced by omx_filereader_component_MessageHandler().

OMX_ERRORTYPE omx_filereader_component_MessageHandler ( OMX_COMPONENTTYPE openmaxStandComp,
internalRequestMessageType message 
)

This function initializes and deinitializes the library related initialization needed for file parsing

Definition at line 451 of file omx_filereader_component.c.

References DEB_LEV_ERR, DEB_LEV_SIMPLE_SEQ, DEBUG, err, internalRequestMessageType::messageParam, internalRequestMessageType::messageType, omx_base_component_MessageHandler(), OMX_CommandStateSet, OMX_ErrorNone, omx_filereader_component_Deinit(), omx_filereader_component_Init(), OMX_StateExecuting, OMX_StateIdle, and OMX_COMPONENTTYPE::pComponentPrivate.

OMX_ERRORTYPE omx_filereader_component_SetConfig ( OMX_IN OMX_HANDLETYPE  hComponent,
OMX_IN OMX_INDEXTYPE  nIndex,
OMX_IN OMX_PTR  pComponentConfigStructure 
)

setting configurations

Definition at line 481 of file omx_filereader_component.c.

References checkHeader(), DEB_LEV_ERR, DEBUG, err, OMX_TIME_CONFIG_TIMESTAMPTYPE::nPortIndex, omx_base_component_SetConfig(), OMX_ErrorBadPortIndex, OMX_ErrorNone, OMX_IndexConfigTimePosition, and OMX_COMPONENTTYPE::pComponentPrivate.

OMX_ERRORTYPE omx_filereader_component_SetParameter ( OMX_IN OMX_HANDLETYPE  hComponent,
OMX_IN OMX_INDEXTYPE  nParamIndex,
OMX_IN OMX_PTR  ComponentParameterStructure 
)

Definition at line 316 of file omx_filereader_component.c.

References DEB_LEV_ERR, DEB_LEV_SIMPLE_SEQ, DEBUG, DEFAULT_FILENAME_LENGTH, err, OMX_AUDIO_PARAM_MP3TYPE::nPortIndex, OMX_AUDIO_PARAM_PORTFORMATTYPE::nPortIndex, OMX_AUDIO_CodingMP3, OMX_AUDIO_CodingVORBIS, omx_base_component_ParameterSanityCheck(), OMX_BASE_SOURCE_OUTPUTPORT_INDEX, OMX_ErrorBadParameter, OMX_ErrorBadPortIndex, OMX_ErrorNone, OMX_FALSE, OMX_IndexParamAudioMp3, OMX_IndexParamAudioPortFormat, OMX_IndexVendorFileReadInputFilename, OMX_COMPONENTTYPE::pComponentPrivate, and omx_base_audio_PortType::sAudioParam.


Generated for OpenMAX Bellagio rel. 0.3.5-svn by  doxygen 1.5.1
SourceForge.net Logo