omx_vorbisdec_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 <vorbis/codec.h>
#include <math.h>

Go to the source code of this file.

Defines

#define AUDIO_DEC_BASE_NAME   "OMX.st.audio_decoder"
#define AUDIO_DEC_VORBIS_NAME   "OMX.st.audio_decoder.ogg.single"
#define AUDIO_DEC_VORBIS_ROLE   "audio_decoder.ogg"
#define omx_vorbisdec_component_PrivateType_FIELDS

Functions

OMX_ERRORTYPE omx_vorbisdec_component_Constructor (OMX_COMPONENTTYPE *openmaxStandComp, OMX_STRING cComponentName)
OMX_ERRORTYPE omx_vorbisdec_component_Destructor (OMX_COMPONENTTYPE *openmaxStandComp)
OMX_ERRORTYPE omx_vorbisdec_component_Init (OMX_COMPONENTTYPE *openmaxStandComp)
OMX_ERRORTYPE omx_vorbisdec_component_Deinit (OMX_COMPONENTTYPE *openmaxStandComp)
OMX_ERRORTYPE omx_vorbis_decoder_MessageHandler (OMX_COMPONENTTYPE *, internalRequestMessageType *)
void omx_vorbisdec_component_BufferMgmtCallbackVorbis (OMX_COMPONENTTYPE *openmaxStandComp, OMX_BUFFERHEADERTYPE *inputbuffer, OMX_BUFFERHEADERTYPE *outputbuffer)
OMX_ERRORTYPE omx_vorbisdec_component_GetParameter (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR ComponentParameterStructure)
OMX_ERRORTYPE omx_vorbisdec_component_SetParameter (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nParamIndex, OMX_IN OMX_PTR ComponentParameterStructure)
void omx_vorbisdec_component_SetInternalParameters (OMX_COMPONENTTYPE *openmaxStandComp)


Detailed Description

This component implements an Ogg Vorbis decoder. The Ogg Vorbis decoder is based on the libvorbis software library.

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_vorbisdec_component.h.


Define Documentation

#define AUDIO_DEC_BASE_NAME   "OMX.st.audio_decoder"

Definition at line 46 of file omx_vorbisdec_component.h.

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

Definition at line 47 of file omx_vorbisdec_component.h.

#define AUDIO_DEC_VORBIS_ROLE   "audio_decoder.ogg"

Definition at line 48 of file omx_vorbisdec_component.h.

#define omx_vorbisdec_component_PrivateType_FIELDS

Vorbisdec component private structure.

Definition at line 53 of file omx_vorbisdec_component.h.


Function Documentation

OMX_ERRORTYPE omx_vorbis_decoder_MessageHandler ( OMX_COMPONENTTYPE openmaxStandComp,
internalRequestMessageType message 
)

void omx_vorbisdec_component_BufferMgmtCallbackVorbis ( OMX_COMPONENTTYPE openmaxStandComp,
OMX_BUFFERHEADERTYPE inputbuffer,
OMX_BUFFERHEADERTYPE outputbuffer 
)

central buffer management function

Parameters:
inputbuffer contains the input ogg file content
outputbuffer is returned along with its output pcm file content that is produced as a result of this function execution

Fill up the current input buffer when a new buffer has arrived

for each new input buffer --- copy buffer content into into ogg sync state structure data

pcm is a multichannel float vector. In stereo, for example, pcm[0] is left, and pcm[1] is right. samples is the size of each channel. Convert the float values (-1.<=range<=1.) to whatever PCM format and write it out

Definition at line 277 of file omx_vorbisdec_component.c.

References DEB_LEV_ERR, DEB_LEV_FULL_SEQ, DEB_LEV_SIMPLE_SEQ, DEBUG, OMX_BUFFERHEADERTYPE::nAllocLen, OMX_BUFFERHEADERTYPE::nFilledLen, OMX_BUFFERHEADERTYPE::nOffset, OMX_EventPortSettingsChanged, OMX_BUFFERHEADERTYPE::pBuffer, and OMX_COMPONENTTYPE::pComponentPrivate.

Referenced by omx_vorbisdec_component_Constructor().

OMX_ERRORTYPE omx_vorbisdec_component_Constructor ( OMX_COMPONENTTYPE openmaxStandComp,
OMX_STRING  cComponentName 
)

The Constructor

Parameters:
cComponentName is the name of the component to be initialized

we could create our own port structures here fixme maybe the base class could use a "port factory" function pointer?

Domain specific section for the ports.

first we set the parameter common to both formats common parameters related to input port

Allocate Ports and call port constructor.

common parameters related to output port

settings of output port output is pcm audo format - so set the pcm mode settings

some more component private structure initialization

increase the counter of initialized components and check against the maximum limit

now it's time to know the audio coding type of the component if audio coding type is set other than vorbis then error returned

IL client specified an invalid component name

Definition at line 45 of file omx_vorbisdec_component.c.

References OMX_PARAM_PORTDEFINITIONTYPE::audio, AUDIO_DEC_BASE_NAME, AUDIO_DEC_VORBIS_NAME, base_audio_port_Constructor(), OMX_AUDIO_PORTDEFINITIONTYPE::cMIMEType, DEB_LEV_FUNCTION_NAME, DEBUG, DEFAULT_IN_BUFFER_SIZE, DEFAULT_OUT_BUFFER_SIZE, OMX_AUDIO_PARAM_PORTFORMATTYPE::eEncoding, OMX_AUDIO_PORTDEFINITIONTYPE::eEncoding, err, OMX_PARAM_PORTDEFINITIONTYPE::format, OMX_COMPONENTTYPE::GetParameter, MAX_COMPONENT_VORBISDEC, OMX_PARAM_PORTDEFINITIONTYPE::nBufferSize, OMX_AUDIO_ChannelLF, OMX_AUDIO_ChannelRF, OMX_AUDIO_CodingPCM, OMX_AUDIO_CodingUnused, OMX_AUDIO_CodingVORBIS, OMX_AUDIO_PCMModeLinear, 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_vorbis_decoder_MessageHandler(), omx_vorbisdec_component_BufferMgmtCallbackVorbis(), omx_vorbisdec_component_Destructor(), omx_vorbisdec_component_GetParameter(), omx_vorbisdec_component_SetParameter(), OMX_COMPONENTTYPE::pComponentPrivate, omx_base_audio_PortType::sAudioParam, setHeader(), OMX_COMPONENTTYPE::SetParameter, omx_base_audio_PortType::sPortParam, and tsem_init().

Referenced by omx_component_library_Setup().

OMX_ERRORTYPE omx_vorbisdec_component_Deinit ( OMX_COMPONENTTYPE openmaxStandComp  ) 

The Deinitialization function

reset the vorbis decoder related parameters

Definition at line 254 of file omx_vorbisdec_component.c.

References err, OMX_ErrorNone, and OMX_COMPONENTTYPE::pComponentPrivate.

Referenced by omx_vorbis_decoder_MessageHandler().

OMX_ERRORTYPE omx_vorbisdec_component_Destructor ( OMX_COMPONENTTYPE openmaxStandComp  ) 

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

OMX_ERRORTYPE omx_vorbisdec_component_Init ( OMX_COMPONENTTYPE openmaxStandComp  ) 

The Initialization function

Temporary First Output buffer size

initializing vorbis decoder parameters

Definition at line 230 of file omx_vorbisdec_component.c.

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

Referenced by omx_vorbis_decoder_MessageHandler().

void omx_vorbisdec_component_SetInternalParameters ( OMX_COMPONENTTYPE openmaxStandComp  ) 

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


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