#include <omxcore.h>
#include <omx_base_audio_port.h>
#include <omx_audiodec_component.h>
#include <OMX_Audio.h>
#include <config.h>
Go to the source code of this file.
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_audiodec_component.c.
#define MAX_COMPONENT_AUDIODEC 4 |
modification to include audio formats
Definition at line 39 of file omx_audiodec_component.c.
Referenced by omx_audiodec_component_Constructor().
#define OUTPUT_LEN_STANDARD_FFMPEG 192000 |
output length arguement passed along decoding function
Definition at line 42 of file omx_audiodec_component.c.
Referenced by omx_audiodec_component_BufferMgmtCallback().
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 373 of file omx_audiodec_component.c.
References DEB_LEV_ERR, DEB_LEV_FULL_SEQ, 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_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 743 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_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_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_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 355 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 166 of file omx_audiodec_component.c.
References DEB_LEV_FUNCTION_NAME, DEBUG, omx_base_filter_Destructor(), OMX_ErrorNone, OMX_COMPONENTTYPE::pComponentPrivate, and tsem_deinit().
Referenced by omx_audiodec_component_Constructor().
void omx_audiodec_component_ffmpegLibDeInit | ( | omx_audiodec_component_PrivateType * | omx_audiodec_component_Private | ) |
It Deinitializates the FFmpeg framework, and close the FFmpeg MP3 decoder
Definition at line 255 of file omx_audiodec_component.c.
Referenced by omx_audiodec_component_Deinit(), and omx_audiodec_component_MessageHandler().
OMX_ERRORTYPE omx_audiodec_component_ffmpegLibInit | ( | omx_audiodec_component_PrivateType * | omx_audiodec_component_Private | ) |
It initializates the FFmpeg framework, and opens an FFmpeg audiodecoder of type specified by IL client - currently only used for MP3 decoding
Definition at line 206 of file omx_audiodec_component.c.
References DEB_LEV_ERR, DEB_LEV_SIMPLE_SEQ, DEBUG, OMX_AUDIO_CodingAAC, OMX_AUDIO_CodingMP3, OMX_AUDIO_CodingVORBIS, OMX_ErrorComponentNotFound, OMX_ErrorInsufficientResources, OMX_ErrorNone, and tsem_up().
Referenced by omx_audiodec_component_MessageHandler().
OMX_ERRORTYPE omx_audiodec_component_GetExtensionIndex | ( | OMX_IN OMX_HANDLETYPE | hComponent, | |
OMX_IN OMX_STRING | cParameterName, | |||
OMX_OUT OMX_INDEXTYPE * | pIndexType | |||
) |
Definition at line 802 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 592 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_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_IndexParamAudioInit, 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().
OMX_ERRORTYPE omx_audiodec_component_Init | ( | OMX_COMPONENTTYPE * | openmaxStandComp | ) |
The Initialization function
Definition at line 334 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 * | openmaxStandComp, | |
internalRequestMessageType * | message | |||
) |
Definition at line 697 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 761 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 262 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_CodingMP3, OMX_AUDIO_CodingPCM, OMX_AUDIO_CodingVORBIS, OMX_AUDIO_MP3StreamFormatMP1Layer3, OMX_BASE_FILTER_INPUTPORT_INDEX, OMX_BASE_FILTER_OUTPUTPORT_INDEX, OMX_IndexParamAudioAac, 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 478 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_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_IndexParamAudioMp3, OMX_IndexParamAudioPcm, OMX_IndexParamAudioPortFormat, OMX_IndexParamAudioVorbis, OMX_IndexParamStandardComponentRole, OMX_COMPONENTTYPE::pComponentPrivate, and omx_base_audio_PortType::sAudioParam.
Referenced by omx_audiodec_component_Constructor().