OpenMAXBellagio 0.9.3
omx_audiomixer_component.c File Reference
#include <omxcore.h>
#include <omx_base_audio_port.h>
#include <omx_audiomixer_component.h>
#include <OMX_Audio.h>

Go to the source code of this file.

Defines

#define GAIN_VALUE   100.0f

Functions

OMX_ERRORTYPE omx_audio_mixer_component_Constructor (OMX_COMPONENTTYPE *openmaxStandComp, OMX_STRING cComponentName)
OMX_ERRORTYPE omx_audio_mixer_component_Destructor (OMX_COMPONENTTYPE *openmaxStandComp)
void omx_audio_mixer_component_BufferMgmtCallback (OMX_COMPONENTTYPE *openmaxStandComp, OMX_BUFFERHEADERTYPE *pInBuffer, OMX_BUFFERHEADERTYPE *pOutBuffer)
OMX_ERRORTYPE omx_audio_mixer_component_SetConfig (OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nIndex, OMX_PTR pComponentConfigStructure)
OMX_ERRORTYPE omx_audio_mixer_component_GetConfig (OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nIndex, OMX_PTR pComponentConfigStructure)
OMX_ERRORTYPE omx_audio_mixer_component_SetParameter (OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nParamIndex, OMX_PTR ComponentParameterStructure)
OMX_ERRORTYPE omx_audio_mixer_component_GetParameter (OMX_HANDLETYPE hComponent, OMX_INDEXTYPE nParamIndex, OMX_PTR ComponentParameterStructure)
int checkAnyPortBeingFlushed (omx_audio_mixer_component_PrivateType *omx_audio_mixer_component_Private)
void * omx_audio_mixer_BufferMgmtFunction (void *param)

Define Documentation

#define GAIN_VALUE   100.0f

src/components/audio_effects/omx_audiomixer_component.c

OpenMAX audio mixer control component. This component implements a mixer that mixes multiple audio PCM streams and produces a single output stream.

Copyright (C) 2008-2009 STMicroelectronics Copyright (C) 2008-2009 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

Definition at line 33 of file omx_audiomixer_component.c.

Referenced by omx_audio_mixer_component_Constructor().


Function Documentation

void* omx_audio_mixer_BufferMgmtFunction ( void *  param)

This is the central function for component processing,overridden for audio mixer. It is executed in a separate thread, is synchronized with semaphores at each port, those are released each time a new buffer is available on the given port.

Definition at line 399 of file omx_audiomixer_component.c.

References omx_audio_mixer_component_PrivateType::bMgmtSem, omx_audio_mixer_component_PrivateType::bStateSem, omx_audio_mixer_component_PrivateType::BufferMgmtCallback, omx_audio_mixer_component_PrivateType::callbackData, omx_audio_mixer_component_PrivateType::callbacks, checkAnyPortBeingFlushed(), DEB_LEV_ERR, DEB_LEV_FULL_SEQ, DEB_LEV_FUNCTION_NAME, DEB_LEV_SIMPLE_SEQ, DEBUG, dequeue(), OMX_CALLBACKTYPE::EventHandler, omx_audio_mixer_component_PrivateType::flush_all_condition, omx_audio_mixer_component_PrivateType::flush_condition, OMX_MARKTYPE::hMarkTargetComponent, MAX_PORTS, OMX_PORT_PARAM_TYPE::nPorts, OMX_BUFFERFLAG_EOS, OMX_EventBufferFlag, OMX_EventMark, OMX_FALSE, OMX_PortDomainAudio, OMX_StateExecuting, OMX_StateIdle, OMX_StateInvalid, OMX_StateLoaded, OMX_StatePause, OMX_TransStateExecutingToIdle, OMX_TransStateLoadedToIdle, OMX_TransStatePauseToIdle, OMX_TRUE, omx_base_PortType::pBufferSem, OMX_COMPONENTTYPE::pComponentPrivate, omx_audio_mixer_component_PrivateType::pMark, OMX_MARKTYPE::pMarkData, PORT_IS_BEING_FLUSHED, PORT_IS_ENABLED, omx_audio_mixer_component_PrivateType::ports, omx_audio_mixer_component_PrivateType::sPortTypesParam, omx_audio_mixer_component_PrivateType::state, omx_audio_mixer_component_PrivateType::transientState, tsem_down(), tsem_up(), and tsem_wait().

Referenced by omx_audio_mixer_component_Constructor().

OMX_ERRORTYPE omx_audio_mixer_component_Constructor ( OMX_COMPONENTTYPE openmaxStandComp,
OMX_STRING  cComponentName 
)

Calling base filter constructor

Allocate Ports and call port constructor.

Domain specific section for the ports.

< Is the volume to be set in linear (0.100) or logarithmic scale (mB)

< minimum for value (i.e. nValue >= nMin)

Definition at line 35 of file omx_audiomixer_component.c.

References base_audio_port_Constructor(), OMX_AUDIO_PARAM_PCMMODETYPE::bInterleaved, OMX_AUDIO_CONFIG_VOLUMETYPE::bLinear, omx_audio_mixer_component_PrivateType::BufferMgmtCallback, omx_audio_mixer_component_PrivateType::BufferMgmtFunction, multiResourceDescriptor::CPUResourceRequested, omx_audio_mixer_component_PrivateType::currentQualityLevel, DEB_LEV_FUNCTION_NAME, DEBUG, DEFAULT_OUT_BUFFER_SIZE, omx_audio_mixer_component_PrivateType::destructor, OMX_AUDIO_PARAM_PCMMODETYPE::eEndian, OMX_AUDIO_PARAM_PCMMODETYPE::eNumData, OMX_AUDIO_PARAM_PCMMODETYPE::ePCMMode, err, omx_audio_mixer_component_PortType::gain, GAIN_VALUE, OMX_COMPONENTTYPE::GetConfig, OMX_COMPONENTTYPE::GetParameter, MAX_MIXER_COMPONENTS, MAX_PORTS, multiResourceDescriptor::MemoryResourceRequested, MIXER_COMP_NAME, MIXER_QUALITY_LEVELS, omx_audio_mixer_component_PrivateType::multiResourceLevel, OMX_AUDIO_PARAM_PCMMODETYPE::nBitPerSample, OMX_PARAM_PORTDEFINITIONTYPE::nBufferSize, OMX_AUDIO_PARAM_PCMMODETYPE::nChannels, OMX_BS32::nMax, OMX_BS32::nMin, OMX_AUDIO_CONFIG_VOLUMETYPE::nPortIndex, OMX_AUDIO_PARAM_PCMMODETYPE::nPortIndex, OMX_PORT_PARAM_TYPE::nPorts, omx_audio_mixer_component_PrivateType::nqualitylevels, OMX_AUDIO_PARAM_PCMMODETYPE::nSamplingRate, OMX_PORT_PARAM_TYPE::nStartPortNumber, OMX_BS32::nValue, omx_audio_mixer_BufferMgmtFunction(), omx_audio_mixer_component_BufferMgmtCallback(), omx_audio_mixer_component_Destructor(), omx_audio_mixer_component_GetConfig(), omx_audio_mixer_component_GetParameter(), omx_audio_mixer_component_SetConfig(), omx_audio_mixer_component_SetParameter(), OMX_AUDIO_PCMModeLinear, omx_base_filter_Constructor(), OMX_EndianBig, OMX_ErrorInsufficientResources, OMX_ErrorNone, OMX_FALSE, OMX_NumericalDataSigned, OMX_PortDomainAudio, OMX_TRUE, omx_audio_mixer_component_PortType::pAudioPcmMode, OMX_COMPONENTTYPE::pComponentPrivate, omx_audio_mixer_component_PrivateType::ports, RM_RegisterComponent(), OMX_COMPONENTTYPE::SetConfig, setHeader(), OMX_COMPONENTTYPE::SetParameter, omx_audio_mixer_component_PortType::sPortParam, omx_audio_mixer_component_PrivateType::sPortTypesParam, OMX_AUDIO_CONFIG_VOLUMETYPE::sVolume, and omx_audio_mixer_component_PortType::sVolume.

Referenced by omx_component_library_Setup().