#include <omxcore.h>
#include <omx_base_audio_port.h>
#include <omx_alsasink_component.h>
Go to the source code of this file.
Defines | |
#define | MAX_COMPONENT_ALSASINK 1 |
Functions | |
OMX_ERRORTYPE | omx_alsasink_component_Constructor (OMX_COMPONENTTYPE *openmaxStandComp, OMX_STRING cComponentName) |
OMX_ERRORTYPE | omx_alsasink_component_Destructor (OMX_COMPONENTTYPE *openmaxStandComp) |
void | omx_alsasink_component_BufferMgmtCallback (OMX_COMPONENTTYPE *openmaxStandComp, OMX_BUFFERHEADERTYPE *inputbuffer) |
OMX_ERRORTYPE | omx_alsasink_component_SetParameter (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nParamIndex, OMX_IN OMX_PTR ComponentParameterStructure) |
OMX_ERRORTYPE | omx_alsasink_component_GetParameter (OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR ComponentParameterStructure) |
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_alsasink_component.c.
#define MAX_COMPONENT_ALSASINK 1 |
Maximum Number of AlsaSink Instance
Definition at line 35 of file omx_alsasink_component.c.
Referenced by omx_alsasink_component_Constructor().
void omx_alsasink_component_BufferMgmtCallback | ( | OMX_COMPONENTTYPE * | openmaxStandComp, | |
OMX_BUFFERHEADERTYPE * | inputbuffer | |||
) |
This function plays the input buffer. When fully consumed it returns.
Definition at line 182 of file omx_alsasink_component.c.
References DEB_LEV_ERR, DEB_LEV_FULL_SEQ, DEBUG, OMX_BUFFERHEADERTYPE::nFilledLen, OMX_FALSE, OMX_TRUE, OMX_BUFFERHEADERTYPE::pBuffer, and OMX_COMPONENTTYPE::pComponentPrivate.
Referenced by omx_alsasink_component_Constructor().
OMX_ERRORTYPE omx_alsasink_component_Constructor | ( | OMX_COMPONENTTYPE * | openmaxStandComp, | |
OMX_STRING | cComponentName | |||
) |
The Constructor
Allocate Ports and call port constructor.
Domain specific section for the ports.
Definition at line 42 of file omx_alsasink_component.c.
References OMX_PARAM_PORTDEFINITIONTYPE::audio, base_audio_port_Constructor(), DEB_LEV_ERR, DEB_LEV_SIMPLE_SEQ, DEBUG, DEFAULT_OUT_BUFFER_SIZE, OMX_AUDIO_PARAM_PORTFORMATTYPE::eEncoding, OMX_AUDIO_PORTDEFINITIONTYPE::eEncoding, err, OMX_PARAM_PORTDEFINITIONTYPE::format, OMX_COMPONENTTYPE::GetParameter, MAX_COMPONENT_ALSASINK, OMX_PARAM_PORTDEFINITIONTYPE::nBufferSize, OMX_AUDIO_PARAM_PORTFORMATTYPE::nIndex, OMX_AUDIO_PARAM_PORTFORMATTYPE::nPortIndex, omx_alsasink_component_BufferMgmtCallback(), omx_alsasink_component_Destructor(), omx_alsasink_component_GetParameter(), omx_alsasink_component_SetParameter(), OMX_AUDIO_ChannelNone, OMX_AUDIO_CodingPCM, OMX_AUDIO_PCMModeLinear, omx_base_sink_Constructor(), OMX_BASE_SINK_INPUTPORT_INDEX, OMX_EndianLittle, OMX_ErrorHardware, OMX_ErrorInsufficientResources, OMX_ErrorNone, OMX_IndexParamAudioPcm, OMX_NumericalDataSigned, OMX_TRUE, OMX_COMPONENTTYPE::pComponentPrivate, omx_base_audio_PortType::sAudioParam, setHeader(), OMX_COMPONENTTYPE::SetParameter, and omx_base_audio_PortType::sPortParam.
Referenced by omx_component_library_Setup().
OMX_ERRORTYPE omx_alsasink_component_Destructor | ( | OMX_COMPONENTTYPE * | openmaxStandComp | ) |
The Destructor
Definition at line 152 of file omx_alsasink_component.c.
References omx_base_sink_Destructor(), and OMX_COMPONENTTYPE::pComponentPrivate.
Referenced by omx_alsasink_component_Constructor().
OMX_ERRORTYPE omx_alsasink_component_GetParameter | ( | OMX_IN OMX_HANDLETYPE | hComponent, | |
OMX_IN OMX_INDEXTYPE | nParamIndex, | |||
OMX_INOUT OMX_PTR | ComponentParameterStructure | |||
) |
Definition at line 448 of file omx_alsasink_component.c.
References checkHeader(), DEB_LEV_SIMPLE_SEQ, DEBUG, err, OMX_AUDIO_PARAM_PORTFORMATTYPE::nPortIndex, omx_base_component_GetParameter(), OMX_BASE_SINK_INPUTPORT_INDEX, OMX_ErrorBadParameter, OMX_ErrorBadPortIndex, OMX_ErrorNone, OMX_IndexParamAudioInit, OMX_IndexParamAudioPcm, OMX_IndexParamAudioPortFormat, OMX_COMPONENTTYPE::pComponentPrivate, and omx_base_audio_PortType::sAudioParam.
Referenced by omx_alsasink_component_Constructor().
OMX_ERRORTYPE omx_alsasink_component_SetParameter | ( | OMX_IN OMX_HANDLETYPE | hComponent, | |
OMX_IN OMX_INDEXTYPE | nParamIndex, | |||
OMX_IN OMX_PTR | ComponentParameterStructure | |||
) |
Each time we are (re)configuring the hw_params thing we need to reinitialize it, otherwise previous changes will not take effect. e.g.: changing a previously configured sampling rate does not have any effect if we are not calling this each time.
Configure and prepare the ALSA handle
Definition at line 230 of file omx_alsasink_component.c.
References OMX_AUDIO_PARAM_PCMMODETYPE::bInterleaved, DEB_LEV_ERR, DEB_LEV_PARAMS, DEB_LEV_SIMPLE_SEQ, DEBUG, OMX_AUDIO_PARAM_PCMMODETYPE::eEndian, OMX_AUDIO_PARAM_PCMMODETYPE::eNumData, OMX_AUDIO_PARAM_PCMMODETYPE::ePCMMode, err, OMX_AUDIO_PARAM_PCMMODETYPE::nBitPerSample, OMX_AUDIO_PARAM_PCMMODETYPE::nChannels, OMX_AUDIO_PARAM_MP3TYPE::nPortIndex, OMX_AUDIO_PARAM_PCMMODETYPE::nPortIndex, OMX_AUDIO_PARAM_PORTFORMATTYPE::nPortIndex, OMX_AUDIO_PARAM_PCMMODETYPE::nSamplingRate, OMX_AUDIO_PCMModeALaw, OMX_AUDIO_PCMModeLinear, OMX_AUDIO_PCMModeMULaw, omx_base_component_ParameterSanityCheck(), omx_base_component_SetParameter(), OMX_BASE_SINK_INPUTPORT_INDEX, OMX_EndianLittle, OMX_ErrorBadParameter, OMX_ErrorBadPortIndex, OMX_ErrorHardware, OMX_ErrorNone, OMX_IndexParamAudioMp3, OMX_IndexParamAudioPcm, OMX_IndexParamAudioPortFormat, OMX_NumericalDataSigned, OMX_NumericalDataUnsigned, OMX_TRUE, OMX_COMPONENTTYPE::pComponentPrivate, rate, and omx_base_audio_PortType::sAudioParam.
Referenced by omx_alsasink_component_Constructor().