#include "omxaudiocapnplay.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 omxaudiocapnplay.c.
#define BASE_ROLE "alsa.alsasrc" |
#define COMPONENT_NAME_BASE "OMX.st.alsa.alsasrc" |
defining global declarations
Definition at line 34 of file omxaudiocapnplay.c.
Referenced by main().
#define COMPONENT_NAME_BASE_LEN 20 |
OMX_ERRORTYPE alsasinkEmptyBufferDone | ( | OMX_OUT OMX_HANDLETYPE | hComponent, | |
OMX_OUT OMX_PTR | pAppData, | |||
OMX_OUT OMX_BUFFERHEADERTYPE * | pBuffer | |||
) |
Definition at line 771 of file omxaudiocapnplay.c.
References DEB_LEV_ERR, DEBUG, appPrivateType::eofSem, err, OMX_BUFFERHEADERTYPE::nFilledLen, OMX_ErrorNone, OMX_FillThisBuffer, OMX_BUFFERHEADERTYPE::pBuffer, tsem_up(), and appPrivateType::volume_handle.
OMX_ERRORTYPE alsasinkEventHandler | ( | OMX_OUT OMX_HANDLETYPE | hComponent, | |
OMX_OUT OMX_PTR | pAppData, | |||
OMX_OUT OMX_EVENTTYPE | eEvent, | |||
OMX_OUT OMX_U32 | Data1, | |||
OMX_OUT OMX_U32 | Data2, | |||
OMX_OUT OMX_PTR | pEventData | |||
) |
callbacks implementation of audio sink component
Definition at line 720 of file omxaudiocapnplay.c.
References appPrivateType::alsasinkEventSem, DEB_LEV_ERR, DEB_LEV_SIMPLE_SEQ, DEBUG, appPrivateType::eofSem, OMX_BUFFERFLAG_EOS, OMX_CommandPortDisable, OMX_CommandPortEnable, OMX_CommandStateSet, OMX_ErrorNone, OMX_EventBufferFlag, OMX_EventCmdComplete, OMX_StateExecuting, OMX_StateIdle, OMX_StateInvalid, OMX_StateLoaded, OMX_StatePause, OMX_StateWaitForResources, and tsem_up().
OMX_ERRORTYPE audiosrcEventHandler | ( | OMX_OUT OMX_HANDLETYPE | hComponent, | |
OMX_OUT OMX_PTR | pAppData, | |||
OMX_OUT OMX_EVENTTYPE | eEvent, | |||
OMX_OUT OMX_U32 | Data1, | |||
OMX_OUT OMX_U32 | Data2, | |||
OMX_OUT OMX_PTR | pEventData | |||
) |
Callbacks implementation of the audio source component
Definition at line 939 of file omxaudiocapnplay.c.
References DEB_LEV_ERR, DEB_LEV_SIMPLE_SEQ, DEBUG, appPrivateType::eofSem, err, OMX_BUFFERFLAG_EOS, OMX_CommandPortDisable, OMX_CommandPortEnable, OMX_CommandStateSet, OMX_ErrorNone, OMX_EventBufferFlag, OMX_EventCmdComplete, OMX_EventPortSettingsChanged, OMX_StateExecuting, OMX_StateIdle, OMX_StateInvalid, OMX_StateLoaded, OMX_StatePause, OMX_StateWaitForResources, appPrivateType::sourceEventSem, and tsem_up().
OMX_ERRORTYPE audiosrcFillBufferDone | ( | OMX_OUT OMX_HANDLETYPE | hComponent, | |
OMX_OUT OMX_PTR | pAppData, | |||
OMX_OUT OMX_BUFFERHEADERTYPE * | pBuffer | |||
) |
if there is volume component component in processing state then send this buffer, in non tunneled case else in non tunneled case, write the output buffer contents in the specified output file
Definition at line 993 of file omxaudiocapnplay.c.
References DEB_LEV_ERR, DEBUG, err, flagIsVolCompRequested, flagSetupTunnel, OMX_BUFFERHEADERTYPE::nFilledLen, OMX_BUFFERFLAG_EOS, OMX_EmptyThisBuffer, OMX_ErrorNone, OMX_FillThisBuffer, OMX_GetState, OMX_StateExecuting, OMX_StatePause, OMX_TRUE, outfile, OMX_BUFFERHEADERTYPE::pBuffer, and appPrivateType::volume_handle.
void display_help | ( | ) |
int main | ( | int | argc, | |
char ** | argv | |||
) |
if volume componenterter component is not selected then sink component will not work, even if specified
output file name check
getting audio source handle
getting volume componenterter component handle, if specified
getting sink component handle - if reqd'
output buffer size calculation based on input dimension speculation
if tunneling option is given then set up the tunnel between the components
sending command to audio source component to go to idle state
in tunnel case, change the volume component and sink comp state to idle
if tunneling option is not given then allocate buffers on audio source output port
in non tunneled case, using buffers in volume component input port, allocated by audio dec component output port
allocating buffers in the volume componenterter compoennt output port
send command to change color onv and sink comp in executing state
sending command to audio source component to go to executing state
state change of all components from executing to idle
sending command to all components to go to loaded state
freeing buffers of volume component and sink component
freeing buffers of audio source input ports
closing the output file
Definition at line 240 of file omxaudiocapnplay.c.
References appPrivateType::alsasink_handle, appPrivateType::alsasinkEventSem, appPrivateType::audiosrchandle, BASE_ROLE, buffer_out_size, channel, COMPONENT_NAME_BASE, DEB_LEV_ERR, DEB_LEV_PARAMS, DEB_LEV_SIMPLE_SEQ, DEBUG, DEFAULT_MESSAGES, display_help(), appPrivateType::eofSem, err, flagDecodedOutputReceived, flagIsOutputExpected, flagIsSinkRequested, flagIsVolCompRequested, flagSetupTunnel, OMX_AUDIO_PARAM_PCMMODETYPE::nChannels, OMX_AUDIO_PARAM_PCMMODETYPE::nSamplingRate, OMX_AllocateBuffer, OMX_CommandStateSet, OMX_Deinit(), OMX_ErrorNone, OMX_FillThisBuffer, OMX_FreeBuffer, OMX_FreeHandle(), OMX_GetHandle(), OMX_GetParameter, OMX_IndexParamAudioPcm, OMX_Init(), OMX_MAX_STRINGNAME_SIZE, OMX_SendCommand, OMX_SetParameter, OMX_SetupTunnel(), OMX_StateExecuting, OMX_StateIdle, OMX_StateLoaded, OMX_TRUE, OMX_UseBuffer, outfile, output_file, OMX_BUFFERHEADERTYPE::pBuffer, rate, setHeader(), appPrivateType::sourceEventSem, test_OMX_ComponentEnumByRole(), test_OMX_ComponentNameEnum(), test_OMX_RoleEnum(), test_OpenClose(), tsem_down(), tsem_init(), appPrivateType::volume_handle, and appPrivateType::volumeEventSem.
OMX_ERRORTYPE test_OMX_ComponentEnumByRole | ( | OMX_STRING | role_name | ) |
Definition at line 177 of file omxaudiocapnplay.c.
References DEB_LEV_ERR, DEBUG, DEFAULT_MESSAGES, err, OMX_ErrorNone, OMX_GetComponentsOfRole(), and OMX_MAX_STRINGNAME_SIZE.
Referenced by main().
OMX_ERRORTYPE test_OMX_ComponentNameEnum | ( | ) |
Definition at line 112 of file omxaudiocapnplay.c.
References DEBUG, DEFAULT_MESSAGES, err, OMX_ComponentNameEnum(), OMX_ErrorNone, and OMX_MAX_STRINGNAME_SIZE.
Referenced by main().
OMX_ERRORTYPE test_OMX_RoleEnum | ( | OMX_STRING | component_name | ) |
Definition at line 135 of file omxaudiocapnplay.c.
References DEB_LEV_ERR, DEB_LEV_SIMPLE_SEQ, DEBUG, DEFAULT_MESSAGES, err, OMX_ErrorInvalidComponentName, OMX_ErrorNone, OMX_GetRolesOfComponent(), and OMX_MAX_STRINGNAME_SIZE.
Referenced by main().
OMX_ERRORTYPE test_OpenClose | ( | OMX_STRING | component_name | ) |
Definition at line 225 of file omxaudiocapnplay.c.
References appPrivateType::audiosrchandle, DEB_LEV_ERR, DEBUG, DEFAULT_MESSAGES, err, OMX_ErrorNone, OMX_FreeHandle(), and OMX_GetHandle().
Referenced by main().
OMX_ERRORTYPE volumeEmptyBufferDone | ( | OMX_OUT OMX_HANDLETYPE | hComponent, | |
OMX_OUT OMX_PTR | pAppData, | |||
OMX_OUT OMX_BUFFERHEADERTYPE * | pBuffer | |||
) |
Definition at line 859 of file omxaudiocapnplay.c.
OMX_ERRORTYPE volumeEventHandler | ( | OMX_OUT OMX_HANDLETYPE | hComponent, | |
OMX_OUT OMX_PTR | pAppData, | |||
OMX_OUT OMX_EVENTTYPE | eEvent, | |||
OMX_OUT OMX_U32 | Data1, | |||
OMX_OUT OMX_U32 | Data2, | |||
OMX_OUT OMX_PTR | pEventData | |||
) |
callback prototypes for color converter
Definition at line 808 of file omxaudiocapnplay.c.
OMX_ERRORTYPE volumeFillBufferDone | ( | OMX_OUT OMX_HANDLETYPE | hComponent, | |
OMX_OUT OMX_PTR | pAppData, | |||
OMX_OUT OMX_BUFFERHEADERTYPE * | pBuffer | |||
) |
if there is no sink component then write buffer content in output file, in non tunneled case else in non tunneled case, call the sink comp handle to process this buffer as its input buffer
Definition at line 896 of file omxaudiocapnplay.c.
Initial value:
{ .EventHandler = alsasinkEventHandler, .EmptyBufferDone = alsasinkEmptyBufferDone, .FillBufferDone = NULL }
Definition at line 48 of file omxaudiocapnplay.c.
global variables
Definition at line 55 of file omxaudiocapnplay.c.
Initial value:
{ .EventHandler = audiosrcEventHandler, .EmptyBufferDone = NULL, .FillBufferDone = audiosrcFillBufferDone }
Definition at line 38 of file omxaudiocapnplay.c.
OMX_U32 buffer_out_size = 16384 |
Definition at line 63 of file omxaudiocapnplay.c.
Referenced by audiodecEventHandler(), main(), and videodecEventHandler().
int channel = 0 |
Definition at line 70 of file omxaudiocapnplay.c.
Referenced by audiodecFillBufferDone(), main(), videodecFillBufferDone(), and volumeFillBufferDone().
Definition at line 72 of file omxaudiocapnplay.c.
Referenced by colorconvFillBufferDone(), main(), setPortParameters(), videodecEventHandler(), and volumeFillBufferDone().
Definition at line 71 of file omxaudiocapnplay.c.
Referenced by audiosrcFillBufferDone(), and main().
int flagSetupTunnel |
Definition at line 73 of file omxaudiocapnplay.c.
Referenced by audiodecEventHandler(), audiodecFillBufferDone(), audiosrcFillBufferDone(), colorconvFillBufferDone(), main(), parser3gpEventHandler(), videodecEventHandler(), videodecFillBufferDone(), videosrcFillBufferDone(), and volumeFillBufferDone().
FILE* outfile |
Definition at line 67 of file omxaudiocapnplay.c.
Referenced by audiodecFillBufferDone(), audiosrcFillBufferDone(), colorconvFillBufferDone(), main(), videodecFillBufferDone(), videoencFillBufferDone(), videosrcFillBufferDone(), and volumeFillBufferDone().
char* output_file |
Definition at line 61 of file omxaudiocapnplay.c.
used with volume componenterter if selected
Definition at line 60 of file omxaudiocapnplay.c.
used with audio source
Definition at line 58 of file omxaudiocapnplay.c.
Definition at line 60 of file omxaudiocapnplay.c.
int rate = 0 |
Definition at line 65 of file omxaudiocapnplay.c.
Referenced by main(), omx_alsasink_component_SetParameter(), and omx_alsasrc_component_SetParameter().
Initial value:
{ .EventHandler = volumeEventHandler, .EmptyBufferDone = volumeEmptyBufferDone, .FillBufferDone = volumeFillBufferDone }
Definition at line 43 of file omxaudiocapnplay.c.