omx_audiodec_component.h File Reference

#include <OMX_Types.h>
#include <OMX_Component.h>
#include <OMX_Core.h>
#include <pthread.h>
#include <stdlib.h>
#include <string.h>
#include <omx_base_filter.h>
#include <ffmpeg/avcodec.h>
#include <ffmpeg/avformat.h>

Go to the source code of this file.

Defines

#define AUDIO_DEC_BASE_NAME   "OMX.st.audio_decoder"
#define AUDIO_DEC_MP3_NAME   "OMX.st.audio_decoder.mp3"
#define AUDIO_DEC_VORBIS_NAME   "OMX.st.audio_decoder.ogg"
#define AUDIO_DEC_AAC_NAME   "OMX.st.audio_decoder.aac"
#define AUDIO_DEC_G726_NAME   "OMX.st.audio_decoder.g726"
#define AUDIO_DEC_MP3_ROLE   "audio_decoder.mp3"
#define AUDIO_DEC_VORBIS_ROLE   "audio_decoder.ogg"
#define AUDIO_DEC_AAC_ROLE   "audio_decoder.aac"
#define AUDIO_DEC_G726_ROLE   "audio_decoder.g726"
#define omx_audiodec_component_PrivateType_FIELDS

Functions

OMX_ERRORTYPE omx_audiodec_component_Constructor (OMX_COMPONENTTYPE *openmaxStandComp, OMX_STRING cComponentName)
OMX_ERRORTYPE omx_audiodec_component_Destructor (OMX_COMPONENTTYPE *openmaxStandComp)
OMX_ERRORTYPE omx_audiodec_component_Init (OMX_COMPONENTTYPE *openmaxStandComp)
OMX_ERRORTYPE omx_audiodec_component_Deinit (OMX_COMPONENTTYPE *openmaxStandComp)
OMX_ERRORTYPE omx_audiodec_component_MessageHandler (OMX_COMPONENTTYPE *, internalRequestMessageType *)
void omx_audiodec_component_BufferMgmtCallback (OMX_COMPONENTTYPE *openmaxStandComp, OMX_BUFFERHEADERTYPE *inputbuffer, OMX_BUFFERHEADERTYPE *outputbuffer)
OMX_ERRORTYPE omx_audiodec_component_GetParameter (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR ComponentParameterStructure)
OMX_ERRORTYPE omx_audiodec_component_SetParameter (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nParamIndex, OMX_IN OMX_PTR ComponentParameterStructure)
OMX_ERRORTYPE omx_audiodec_component_ComponentRoleEnum (OMX_IN OMX_HANDLETYPE hComponent, OMX_OUT OMX_U8 *cRole, OMX_IN OMX_U32 nIndex)
void omx_audiodec_component_SetInternalParameters (OMX_COMPONENTTYPE *openmaxStandComp)
OMX_ERRORTYPE omx_audiodec_component_SetConfig (OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nIndex, OMX_PTR pComponentConfigStructure)
OMX_ERRORTYPE omx_audiodec_component_GetExtensionIndex (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_STRING cParameterName, OMX_OUT OMX_INDEXTYPE *pIndexType)


Detailed Description

This component implements an MP3 decoder. The MP3 decoder is based on FFmpeg software library.

Copyright (C) 2007-2008 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
2008-06-27 12:00:23 +0200 (Fri, 27 Jun 2008)
Revision
Rev
554
Author
Author
pankaj_sen

Definition in file omx_audiodec_component.h.


Define Documentation

#define AUDIO_DEC_AAC_NAME   "OMX.st.audio_decoder.aac"

Definition at line 57 of file omx_audiodec_component.h.

Referenced by omx_audiodec_component_Constructor().

#define AUDIO_DEC_AAC_ROLE   "audio_decoder.aac"

Definition at line 61 of file omx_audiodec_component.h.

Referenced by main(), omx_audiodec_component_ComponentRoleEnum(), omx_audiodec_component_GetParameter(), and omx_audiodec_component_SetParameter().

#define AUDIO_DEC_BASE_NAME   "OMX.st.audio_decoder"

Definition at line 54 of file omx_audiodec_component.h.

Referenced by omx_audiodec_component_Constructor(), omx_maddec_component_Constructor(), and omx_vorbisdec_component_Constructor().

#define AUDIO_DEC_G726_NAME   "OMX.st.audio_decoder.g726"

Definition at line 58 of file omx_audiodec_component.h.

Referenced by omx_audiodec_component_Constructor().

#define AUDIO_DEC_G726_ROLE   "audio_decoder.g726"

Definition at line 62 of file omx_audiodec_component.h.

#define AUDIO_DEC_MP3_NAME   "OMX.st.audio_decoder.mp3"

Definition at line 55 of file omx_audiodec_component.h.

Referenced by omx_audiodec_component_Constructor(), and omx_maddec_component_Constructor().

#define AUDIO_DEC_MP3_ROLE   "audio_decoder.mp3"

Definition at line 59 of file omx_audiodec_component.h.

Referenced by main(), omx_audiodec_component_ComponentRoleEnum(), omx_audiodec_component_GetParameter(), omx_audiodec_component_SetParameter(), omx_maddec_component_GetParameter(), and omx_maddec_component_SetParameter().

#define AUDIO_DEC_VORBIS_NAME   "OMX.st.audio_decoder.ogg"

Definition at line 56 of file omx_audiodec_component.h.

Referenced by omx_audiodec_component_Constructor(), and omx_vorbisdec_component_Constructor().

#define AUDIO_DEC_VORBIS_ROLE   "audio_decoder.ogg"

Definition at line 60 of file omx_audiodec_component.h.

Referenced by omx_audiodec_component_ComponentRoleEnum(), omx_audiodec_component_GetParameter(), and omx_audiodec_component_SetParameter().

#define omx_audiodec_component_PrivateType_FIELDS

AudioDec component private structure.

Definition at line 67 of file omx_audiodec_component.h.


Function Documentation

void omx_audiodec_component_BufferMgmtCallback ( OMX_COMPONENTTYPE openmaxStandComp,
OMX_BUFFERHEADERTYPE pInputBuffer,
OMX_BUFFERHEADERTYPE pOutputBuffer 
)

buffer management callback function for MP3 decoding in new standard of FFmpeg library

resetting output length to a predefined value

return output buffer

Definition at line 401 of file omx_audiodec_component.c.

References DEB_LEV_ERR, DEB_LEV_FULL_SEQ, DEB_LEV_FUNCTION_NAME, DEBUG, OMX_BUFFERHEADERTYPE::nFilledLen, OMX_BUFFERHEADERTYPE::nOffset, OMX_AUDIO_AACObjectLC, OMX_AUDIO_AACObjectLTP, OMX_AUDIO_AACObjectMain, OMX_AUDIO_AACObjectNull, OMX_AUDIO_AACObjectSSR, OMX_AUDIO_AACStreamFormatRAW, OMX_AUDIO_CodingAAC, OMX_AUDIO_CodingG726, OMX_AUDIO_CodingMP3, OMX_AUDIO_CodingVORBIS, OMX_EventPortSettingsChanged, OUTPUT_LEN_STANDARD_FFMPEG, OMX_BUFFERHEADERTYPE::pBuffer, and OMX_COMPONENTTYPE::pComponentPrivate.

Referenced by omx_audiodec_component_Constructor().

OMX_ERRORTYPE omx_audiodec_component_ComponentRoleEnum ( OMX_IN OMX_HANDLETYPE  hComponent,
OMX_OUT OMX_U8 cRole,
OMX_IN OMX_U32  nIndex 
)

Definition at line 801 of file omx_audiodec_component.c.

References AUDIO_DEC_AAC_ROLE, AUDIO_DEC_MP3_ROLE, AUDIO_DEC_VORBIS_ROLE, OMX_ErrorNone, and OMX_ErrorUnsupportedIndex.

Referenced by omx_audiodec_component_Constructor().

OMX_ERRORTYPE omx_audiodec_component_Constructor ( OMX_COMPONENTTYPE openmaxStandComp,
OMX_STRING  cComponentName 
)

The Constructor

Calling base filter constructor

Allocate Ports and call port constructor.

Domain specific section for the ports.

first initializing the codec context etc that was done earlier by ffmpeglibinit function

Definition at line 49 of file omx_audiodec_component.c.

References AUDIO_DEC_AAC_NAME, AUDIO_DEC_BASE_NAME, AUDIO_DEC_G726_NAME, AUDIO_DEC_MP3_NAME, AUDIO_DEC_VORBIS_NAME, base_audio_port_Constructor(), OMX_COMPONENTTYPE::ComponentRoleEnum, DEB_LEV_FUNCTION_NAME, DEBUG, DEFAULT_IN_BUFFER_SIZE, DEFAULT_OUT_BUFFER_SIZE, err, OMX_COMPONENTTYPE::GetExtensionIndex, OMX_COMPONENTTYPE::GetParameter, MAX_COMPONENT_AUDIODEC, OMX_AUDIO_ChannelLF, OMX_AUDIO_ChannelRF, OMX_AUDIO_CodingAAC, OMX_AUDIO_CodingG726, OMX_AUDIO_CodingMP3, OMX_AUDIO_CodingPCM, OMX_AUDIO_CodingUnused, OMX_AUDIO_CodingVORBIS, OMX_AUDIO_PCMModeLinear, omx_audiodec_component_BufferMgmtCallback(), omx_audiodec_component_ComponentRoleEnum(), omx_audiodec_component_Destructor(), omx_audiodec_component_GetExtensionIndex(), omx_audiodec_component_GetParameter(), omx_audiodec_component_MessageHandler(), omx_audiodec_component_SetConfig(), omx_audiodec_component_SetInternalParameters(), omx_audiodec_component_SetParameter(), omx_base_filter_Constructor(), OMX_BASE_FILTER_INPUTPORT_INDEX, OMX_BASE_FILTER_OUTPUTPORT_INDEX, OMX_EndianLittle, OMX_ErrorInsufficientResources, OMX_ErrorInvalidComponentName, OMX_ErrorNone, OMX_FALSE, OMX_NumericalDataSigned, OMX_PortDomainAudio, OMX_TRUE, OMX_COMPONENTTYPE::pComponentPrivate, OMX_COMPONENTTYPE::SetConfig, setHeader(), OMX_COMPONENTTYPE::SetParameter, and tsem_init().

Referenced by omx_component_library_Setup().

OMX_ERRORTYPE omx_audiodec_component_Deinit ( OMX_COMPONENTTYPE openmaxStandComp  ) 

The Deinitialization function

Definition at line 383 of file omx_audiodec_component.c.

References err, omx_audiodec_component_ffmpegLibDeInit(), OMX_ErrorNone, OMX_FALSE, and OMX_COMPONENTTYPE::pComponentPrivate.

Referenced by omx_audiodec_component_MessageHandler().

OMX_ERRORTYPE omx_audiodec_component_Destructor ( OMX_COMPONENTTYPE openmaxStandComp  ) 

The destructor

Definition at line 172 of file omx_audiodec_component.c.

References DEB_LEV_FUNCTION_NAME, DEBUG, omx_base_filter_Destructor(), OMX_ErrorNone, OMX_PortDomainAudio, OMX_COMPONENTTYPE::pComponentPrivate, and tsem_deinit().

Referenced by omx_audiodec_component_Constructor().

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

Definition at line 860 of file omx_audiodec_component.c.

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

Referenced by omx_audiodec_component_Constructor().

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

Definition at line 638 of file omx_audiodec_component.c.

References AUDIO_DEC_AAC_ROLE, AUDIO_DEC_MP3_ROLE, AUDIO_DEC_VORBIS_ROLE, checkHeader(), OMX_PARAM_COMPONENTROLETYPE::cRole, DEB_LEV_SIMPLE_SEQ, DEBUG, err, OMX_AUDIO_PARAM_G726TYPE::nPortIndex, OMX_AUDIO_PARAM_VORBISTYPE::nPortIndex, OMX_AUDIO_PARAM_AACPROFILETYPE::nPortIndex, OMX_AUDIO_PARAM_MP3TYPE::nPortIndex, OMX_AUDIO_PARAM_PCMMODETYPE::nPortIndex, OMX_AUDIO_PARAM_PORTFORMATTYPE::nPortIndex, OMX_AUDIO_CodingAAC, OMX_AUDIO_CodingMP3, OMX_AUDIO_CodingVORBIS, omx_base_component_GetParameter(), OMX_ErrorBadParameter, OMX_ErrorBadPortIndex, OMX_ErrorNone, OMX_IndexParamAudioAac, OMX_IndexParamAudioG726, OMX_IndexParamAudioInit, OMX_IndexParamAudioMp3, OMX_IndexParamAudioPcm, OMX_IndexParamAudioPortFormat, OMX_IndexParamAudioVorbis, OMX_IndexParamStandardComponentRole, OMX_PortDomainAudio, OMX_COMPONENTTYPE::pComponentPrivate, and omx_base_audio_PortType::sAudioParam.

Referenced by omx_audiodec_component_Constructor().

OMX_ERRORTYPE omx_audiodec_component_Init ( OMX_COMPONENTTYPE openmaxStandComp  ) 

The Initialization function

Definition at line 362 of file omx_audiodec_component.c.

References err, OMX_BASE_FILTER_OUTPUTPORT_INDEX, OMX_ErrorNone, and OMX_COMPONENTTYPE::pComponentPrivate.

Referenced by omx_audiodec_component_MessageHandler().

OMX_ERRORTYPE omx_audiodec_component_MessageHandler ( OMX_COMPONENTTYPE ,
internalRequestMessageType  
)

Definition at line 755 of file omx_audiodec_component.c.

References DEB_LEV_ERR, DEB_LEV_SIMPLE_SEQ, DEBUG, err, internalRequestMessageType::messageParam, internalRequestMessageType::messageType, omx_audiodec_component_Deinit(), omx_audiodec_component_ffmpegLibDeInit(), omx_audiodec_component_ffmpegLibInit(), omx_audiodec_component_Init(), omx_base_component_MessageHandler(), OMX_CommandStateSet, OMX_ErrorNone, OMX_ErrorNotReady, OMX_FALSE, OMX_StateExecuting, OMX_StateIdle, OMX_StateLoaded, OMX_TRUE, and OMX_COMPONENTTYPE::pComponentPrivate.

Referenced by omx_audiodec_component_Constructor().

OMX_ERRORTYPE omx_audiodec_component_SetConfig ( OMX_HANDLETYPE  hComponent,
OMX_INDEXTYPE  nIndex,
OMX_PTR  pComponentConfigStructure 
)

copy the extradata in the codec context private structure

Definition at line 819 of file omx_audiodec_component.c.

References DEB_LEV_SIMPLE_SEQ, DEBUG, err, OMX_VENDOR_EXTRADATATYPE::nDataSize, OMX_VENDOR_EXTRADATATYPE::nPortIndex, omx_base_component_SetConfig(), OMX_ErrorBadParameter, OMX_ErrorBadPortIndex, OMX_ErrorNone, OMX_IndexVendorAudioExtraData, OMX_COMPONENTTYPE::pComponentPrivate, and OMX_VENDOR_EXTRADATATYPE::pData.

Referenced by omx_audiodec_component_Constructor().

void omx_audiodec_component_SetInternalParameters ( OMX_COMPONENTTYPE openmaxStandComp  ) 

Definition at line 278 of file omx_audiodec_component.c.

References OMX_AUDIO_PARAM_PORTFORMATTYPE::eEncoding, OMX_AUDIO_PARAM_PORTFORMATTYPE::nIndex, OMX_AUDIO_ChannelModeStereo, OMX_AUDIO_CodingAAC, OMX_AUDIO_CodingG726, OMX_AUDIO_CodingMP3, OMX_AUDIO_CodingPCM, OMX_AUDIO_CodingVORBIS, OMX_AUDIO_G726Mode16, OMX_AUDIO_MP3StreamFormatMP1Layer3, OMX_BASE_FILTER_INPUTPORT_INDEX, OMX_BASE_FILTER_OUTPUTPORT_INDEX, OMX_IndexParamAudioAac, OMX_IndexParamAudioG726, OMX_IndexParamAudioMp3, OMX_IndexParamAudioVorbis, OMX_COMPONENTTYPE::pComponentPrivate, omx_base_audio_PortType::sAudioParam, and setHeader().

Referenced by omx_audiodec_component_Constructor(), and omx_audiodec_component_SetParameter().

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

Definition at line 509 of file omx_audiodec_component.c.

References AUDIO_DEC_AAC_ROLE, AUDIO_DEC_MP3_ROLE, AUDIO_DEC_VORBIS_ROLE, OMX_PARAM_COMPONENTROLETYPE::cRole, DEB_LEV_ERR, DEB_LEV_SIMPLE_SEQ, DEBUG, err, OMX_AUDIO_PARAM_G726TYPE::nPortIndex, OMX_AUDIO_PARAM_MP3TYPE::nPortIndex, OMX_AUDIO_PARAM_AACPROFILETYPE::nPortIndex, OMX_AUDIO_PARAM_VORBISTYPE::nPortIndex, OMX_AUDIO_PARAM_PCMMODETYPE::nPortIndex, OMX_AUDIO_PARAM_PORTFORMATTYPE::nPortIndex, OMX_AUDIO_CodingAAC, OMX_AUDIO_CodingMP3, OMX_AUDIO_CodingVORBIS, omx_audiodec_component_SetInternalParameters(), omx_base_component_ParameterSanityCheck(), omx_base_component_SetParameter(), OMX_ErrorBadParameter, OMX_ErrorBadPortIndex, OMX_ErrorNone, OMX_IndexParamAudioAac, OMX_IndexParamAudioG726, OMX_IndexParamAudioMp3, OMX_IndexParamAudioPcm, OMX_IndexParamAudioPortFormat, OMX_IndexParamAudioVorbis, OMX_IndexParamStandardComponentRole, OMX_COMPONENTTYPE::pComponentPrivate, and omx_base_audio_PortType::sAudioParam.

Referenced by omx_audiodec_component_Constructor().


Generated for OpenMAX Bellagio rel. 0.9.0 by  doxygen 1.5.1
SourceForge.net Logo