#include <OMX_Types.h>
#include <OMX_Component.h>
#include <OMX_Core.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <omx_base_filter.h>
#include <omx_base_audio_port.h>
Go to the source code of this file.
Copyright (C) 2008 STMicroelectronics Copyright (C) 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
Definition in file omx_audiomixer_component.h.
#define MAX_CHANNEL 6 |
Definition at line 43 of file omx_audiomixer_component.h.
#define MAX_PORTS 5 |
Definition at line 42 of file omx_audiomixer_component.h.
Referenced by omx_audio_mixer_BufferMgmtFunction(), and omx_audio_mixer_component_Constructor().
#define omx_audio_mixer_component_PortType_FIELDS |
Value:
omx_base_audio_PortType_FIELDS \ \ OMX_AUDIO_PARAM_PCMMODETYPE pAudioPcmMode; \ \ float gain; \ \ OMX_AUDIO_CONFIG_VOLUMETYPE sVolume; \ \ OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE sChannelVolume[MAX_CHANNEL];
Definition at line 48 of file omx_audiomixer_component.h.
#define omx_audio_mixer_component_PrivateType_FIELDS omx_base_filter_PrivateType_FIELDS \ |
Twoport component private structure. see the define above
Definition at line 63 of file omx_audiomixer_component.h.
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.
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 358 of file omx_audiomixer_component.c.
References DEB_LEV_ERR, DEB_LEV_FULL_SEQ, DEB_LEV_FUNCTION_NAME, DEB_LEV_SIMPLE_SEQ, DEBUG, dequeue(), MAX_PORTS, OMX_BUFFERFLAG_EOS, OMX_EventBufferFlag, OMX_EventMark, OMX_FALSE, OMX_PortDomainAudio, OMX_StateExecuting, OMX_StateIdle, OMX_StateInvalid, OMX_StateLoaded, OMX_StatePause, OMX_TransStateLoadedToIdle, OMX_TRUE, OMX_COMPONENTTYPE::pComponentPrivate, PORT_IS_BEING_FLUSHED, PORT_IS_ENABLED, tsem_down(), and tsem_wait().
Referenced by omx_audio_mixer_component_Constructor().
void omx_audio_mixer_component_BufferMgmtCallback | ( | OMX_COMPONENTTYPE * | openmaxStandComp, | |
OMX_BUFFERHEADERTYPE * | pInBuffer, | |||
OMX_BUFFERHEADERTYPE * | pOutBuffer | |||
) |
This function is used to process the input buffer and provide one output buffer
Definition at line 165 of file omx_audiomixer_component.c.
References OMX_BUFFERHEADERTYPE::nFilledLen, OMX_BUFFERHEADERTYPE::nInputPortIndex, OMX_PortDomainAudio, OMX_BUFFERHEADERTYPE::pBuffer, OMX_COMPONENTTYPE::pComponentPrivate, and PORT_IS_ENABLED.
Referenced by omx_audio_mixer_component_Constructor().
OMX_ERRORTYPE omx_audio_mixer_component_Constructor | ( | OMX_COMPONENTTYPE * | openmaxStandComp, | |
OMX_STRING | cComponentName | |||
) |
This class is empty for the time being
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 49 of file omx_audiomixer_component.c.
References base_audio_port_Constructor(), DEB_LEV_FUNCTION_NAME, DEBUG, DEFAULT_OUT_BUFFER_SIZE, err, GAIN_VALUE, OMX_COMPONENTTYPE::GetConfig, OMX_COMPONENTTYPE::GetParameter, MAX_COMPONENT_AUDIO_MIXER, MAX_PORTS, 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_COMPONENTTYPE::pComponentPrivate, OMX_COMPONENTTYPE::SetConfig, setHeader(), and OMX_COMPONENTTYPE::SetParameter.
Referenced by omx_component_library_Setup().
OMX_ERRORTYPE omx_audio_mixer_component_Destructor | ( | OMX_COMPONENTTYPE * | openmaxStandComp | ) |
The destructor
Definition at line 141 of file omx_audiomixer_component.c.
References DEB_LEV_FUNCTION_NAME, DEBUG, omx_base_filter_Destructor(), OMX_ErrorNone, OMX_PortDomainAudio, and OMX_COMPONENTTYPE::pComponentPrivate.
Referenced by omx_audio_mixer_component_Constructor().
OMX_ERRORTYPE omx_audio_mixer_component_GetConfig | ( | OMX_IN OMX_HANDLETYPE | hComponent, | |
OMX_IN OMX_INDEXTYPE | nIndex, | |||
OMX_INOUT OMX_PTR | pComponentConfigStructure | |||
) |
Definition at line 233 of file omx_audiomixer_component.c.
References err, OMX_AUDIO_CONFIG_VOLUMETYPE::nPortIndex, omx_base_component_GetConfig(), OMX_ErrorBadPortIndex, OMX_ErrorNone, OMX_IndexConfigAudioVolume, OMX_PortDomainAudio, OMX_COMPONENTTYPE::pComponentPrivate, and OMX_AUDIO_CONFIG_VOLUMETYPE::sVolume.
Referenced by omx_audio_mixer_component_Constructor().
OMX_ERRORTYPE omx_audio_mixer_component_GetParameter | ( | OMX_IN OMX_HANDLETYPE | hComponent, | |
OMX_IN OMX_INDEXTYPE | nParamIndex, | |||
OMX_INOUT OMX_PTR | ComponentParameterStructure | |||
) |
Definition at line 299 of file omx_audiomixer_component.c.
References checkHeader(), DEB_LEV_SIMPLE_SEQ, DEBUG, err, OMX_AUDIO_PARAM_PCMMODETYPE::nPortIndex, OMX_AUDIO_PARAM_PORTFORMATTYPE::nPortIndex, omx_base_component_GetParameter(), OMX_ErrorBadParameter, OMX_ErrorBadPortIndex, OMX_ErrorNone, OMX_IndexParamAudioInit, OMX_IndexParamAudioPcm, OMX_IndexParamAudioPortFormat, OMX_PortDomainAudio, and OMX_COMPONENTTYPE::pComponentPrivate.
Referenced by omx_audio_mixer_component_Constructor().
OMX_ERRORTYPE omx_audio_mixer_component_SetConfig | ( | OMX_IN OMX_HANDLETYPE | hComponent, | |
OMX_IN OMX_INDEXTYPE | nIndex, | |||
OMX_IN OMX_PTR | pComponentConfigStructure | |||
) |
setting configurations
Definition at line 200 of file omx_audiomixer_component.c.
References DEB_LEV_SIMPLE_SEQ, DEBUG, err, OMX_AUDIO_CONFIG_VOLUMETYPE::nPortIndex, OMX_BS32::nValue, omx_base_component_SetConfig(), OMX_ErrorBadParameter, OMX_ErrorBadPortIndex, OMX_ErrorNone, OMX_IndexConfigAudioVolume, OMX_PortDomainAudio, OMX_COMPONENTTYPE::pComponentPrivate, and OMX_AUDIO_CONFIG_VOLUMETYPE::sVolume.
Referenced by omx_audio_mixer_component_Constructor().
OMX_ERRORTYPE omx_audio_mixer_component_SetParameter | ( | OMX_IN OMX_HANDLETYPE | hComponent, | |
OMX_IN OMX_INDEXTYPE | nParamIndex, | |||
OMX_IN OMX_PTR | ComponentParameterStructure | |||
) |
Definition at line 259 of file omx_audiomixer_component.c.
References DEB_LEV_ERR, DEB_LEV_SIMPLE_SEQ, DEBUG, err, OMX_AUDIO_PARAM_PORTFORMATTYPE::nPortIndex, omx_base_component_ParameterSanityCheck(), omx_base_component_SetParameter(), OMX_ErrorBadParameter, OMX_ErrorBadPortIndex, OMX_ErrorNone, OMX_IndexParamAudioPortFormat, OMX_PortDomainAudio, and OMX_COMPONENTTYPE::pComponentPrivate.
Referenced by omx_audio_mixer_component_Constructor().