omxparsertest.c File Reference

#include "omxparsertest.h"

Go to the source code of this file.

Defines

#define MPEG4_TYPE_SEL   1
#define AVC_TYPE_SEL   2
#define VIDEO_COMPONENT_NAME_BASE   "OMX.st.video_decoder"
#define AUDIO_COMPONENT_NAME_BASE   "OMX.st.audio_decoder"
#define VIDEO_BASE_ROLE   "video_decoder.avc"
#define AUDIO_BASE_ROLE   "audio_decoder.mp3"
#define VIDEO_DEC_MPEG4_ROLE   "video_decoder.mpeg4"
#define VIDEO_DEC_H264_ROLE   "video_decoder.avc"
#define AUDIO_DEC_MP3_ROLE   "audio_decoder.mp3"
#define AUDIO_DEC_AAC_ROLE   "audio_decoder.aac"
#define VIDEO_SINK   "OMX.st.fbdev.fbdev_sink"
#define COLOR_CONV   "OMX.st.video_colorconv.ffmpeg"
#define AUDIO_SINK   "OMX.st.alsa.alsasink"
#define AUDIO_EFFECT   "OMX.st.volume.component"
#define COMPONENT_NAME_BASE_LEN   20
#define PARSER_3GP   "OMX.st.parser.3gp"
#define extradata_size   1024
#define VIDEO_PORT_INDEX   0
#define AUDIO_PORT_INDEX   1

Functions

int SetPortParametersAudio ()
int SetPortParametersVideo ()
void display_help ()
OMX_ERRORTYPE test_OMX_ComponentNameEnum ()
OMX_ERRORTYPE test_OMX_RoleEnum (OMX_STRING component_name)
OMX_ERRORTYPE test_OMX_ComponentEnumByRole (OMX_STRING role_name)
OMX_ERRORTYPE test_OpenClose (OMX_STRING component_name)
int main (int argc, char **argv)
OMX_ERRORTYPE parser3gpEventHandler (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)
OMX_ERRORTYPE parser3gpFillBufferDone (OMX_OUT OMX_HANDLETYPE hComponent, OMX_OUT OMX_PTR pAppData, OMX_OUT OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE videodecEventHandler (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)
OMX_ERRORTYPE videodecEmptyBufferDone (OMX_OUT OMX_HANDLETYPE hComponent, OMX_OUT OMX_PTR pAppData, OMX_OUT OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE videodecFillBufferDone (OMX_OUT OMX_HANDLETYPE hComponent, OMX_OUT OMX_PTR pAppData, OMX_OUT OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE colorconvEventHandler (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)
OMX_ERRORTYPE colorconvEmptyBufferDone (OMX_OUT OMX_HANDLETYPE hComponent, OMX_OUT OMX_PTR pAppData, OMX_OUT OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE colorconvFillBufferDone (OMX_OUT OMX_HANDLETYPE hComponent, OMX_OUT OMX_PTR pAppData, OMX_OUT OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE fb_sinkEventHandler (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)
OMX_ERRORTYPE fb_sinkEmptyBufferDone (OMX_OUT OMX_HANDLETYPE hComponent, OMX_OUT OMX_PTR pAppData, OMX_OUT OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE audiodecEventHandler (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)
OMX_ERRORTYPE audiodecEmptyBufferDone (OMX_OUT OMX_HANDLETYPE hComponent, OMX_OUT OMX_PTR pAppData, OMX_OUT OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE audiodecFillBufferDone (OMX_OUT OMX_HANDLETYPE hComponent, OMX_OUT OMX_PTR pAppData, OMX_OUT OMX_BUFFERHEADERTYPE *pBuffer)
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)
OMX_ERRORTYPE volumeEmptyBufferDone (OMX_OUT OMX_HANDLETYPE hComponent, OMX_OUT OMX_PTR pAppData, OMX_OUT OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE volumeFillBufferDone (OMX_OUT OMX_HANDLETYPE hComponent, OMX_OUT OMX_PTR pAppData, OMX_OUT OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE audiosinkEventHandler (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)
OMX_ERRORTYPE audiosinkEmptyBufferDone (OMX_OUT OMX_HANDLETYPE hComponent, OMX_OUT OMX_PTR pAppData, OMX_OUT OMX_BUFFERHEADERTYPE *pBuffer)

Variables

OMX_COLOR_FORMATTYPE COLOR_CONV_OUT_RGB_FORMAT = OMX_COLOR_Format24bitRGB888
OMX_BUFFERHEADERTYPEoutBufferParseVideo [2]
OMX_BUFFERHEADERTYPEoutBufferParseAudio [2]
OMX_BUFFERHEADERTYPEinBufferVideoDec [2]
OMX_BUFFERHEADERTYPEoutBufferVideoDec [2]
OMX_BUFFERHEADERTYPEinBufferAudioDec [2]
OMX_BUFFERHEADERTYPEoutBufferAudioDec [2]
OMX_BUFFERHEADERTYPEinBufferColorconv [2]
OMX_BUFFERHEADERTYPEoutBufferColorconv [2]
OMX_BUFFERHEADERTYPEinBufferSinkVideo [2]
OMX_BUFFERHEADERTYPEinBufferVolume [2]
OMX_BUFFERHEADERTYPEoutBufferVolume [2]
OMX_BUFFERHEADERTYPEinBufferSinkAudio [2]
int buffer_in_size = 4096
int buffer_out_size = 640*480*3
OMX_PARAM_PORTDEFINITIONTYPE decparamPortVideo
OMX_PARAM_PORTDEFINITIONTYPE decparamPortAudio
OMX_CALLBACKTYPE videodeccallbacks
OMX_CALLBACKTYPE colorconv_callbacks
OMX_CALLBACKTYPE fbdev_sink_callbacks
OMX_CALLBACKTYPE parser3gpcallbacks
OMX_CALLBACKTYPE audiodeccallbacks
OMX_CALLBACKTYPE audiosinkcallbacks
OMX_CALLBACKTYPE volumecallbacks
OMX_U32 out_width = 0
OMX_U32 new_out_width = 0
OMX_U32 out_height = 0
OMX_U32 new_out_height = 0
FILE * fd = 0
appPrivateTypeappPriv
char * input_file
char * output_file_audio
char * output_file_video
FILE * outfileAudio
FILE * outfileVideo
int flagIsAudioOutputFileExpected
int flagIsVideoOutputFileExpected
int flagDecodedOutputReceived
int flagInputReceived
int flagIsDisplayRequested
int flagSetupTunnel


Detailed Description

Test application that uses five OpenMAX components, a parser3gp, an audio decoder, a video deocder, an alsa sink and a video sink. The application reads a 3gp stream from a file, parses the audio and video content to the respective audio and video decoders. And sends the decoded data to respective audio and video sink components. Only components based on the FFmpeg library are supported. The video formats supported are: MPEG4 (ffmpeg) H264 (ffmpeg) The audio formats supported are: mp3 (ffmpeg) aac (ffmpeg)

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

$Date$ Revision $Rev$ Author $Author$

Definition in file omxparsertest.c.


Define Documentation

#define AUDIO_BASE_ROLE   "audio_decoder.mp3"

Definition at line 46 of file omxparsertest.c.

Referenced by main().

#define AUDIO_COMPONENT_NAME_BASE   "OMX.st.audio_decoder"

Definition at line 44 of file omxparsertest.c.

Referenced by main(), and test_OpenClose().

#define AUDIO_DEC_AAC_ROLE   "audio_decoder.aac"

Definition at line 50 of file omxparsertest.c.

#define AUDIO_DEC_MP3_ROLE   "audio_decoder.mp3"

Definition at line 49 of file omxparsertest.c.

#define AUDIO_EFFECT   "OMX.st.volume.component"

Definition at line 54 of file omxparsertest.c.

#define AUDIO_PORT_INDEX   1

Definition at line 59 of file omxparsertest.c.

#define AUDIO_SINK   "OMX.st.alsa.alsasink"

Definition at line 53 of file omxparsertest.c.

Referenced by main().

#define AVC_TYPE_SEL   2

Definition at line 42 of file omxparsertest.c.

Referenced by main().

#define COLOR_CONV   "OMX.st.video_colorconv.ffmpeg"

Definition at line 52 of file omxparsertest.c.

Referenced by main().

#define COMPONENT_NAME_BASE_LEN   20

Definition at line 55 of file omxparsertest.c.

#define extradata_size   1024

Definition at line 57 of file omxparsertest.c.

#define MPEG4_TYPE_SEL   1

Definition at line 41 of file omxparsertest.c.

Referenced by main().

#define PARSER_3GP   "OMX.st.parser.3gp"

Definition at line 56 of file omxparsertest.c.

Referenced by main().

#define VIDEO_BASE_ROLE   "video_decoder.avc"

Definition at line 45 of file omxparsertest.c.

Referenced by main().

#define VIDEO_COMPONENT_NAME_BASE   "OMX.st.video_decoder"

Definition at line 43 of file omxparsertest.c.

Referenced by main(), and test_OpenClose().

#define VIDEO_DEC_H264_ROLE   "video_decoder.avc"

Definition at line 48 of file omxparsertest.c.

#define VIDEO_DEC_MPEG4_ROLE   "video_decoder.mpeg4"

Definition at line 47 of file omxparsertest.c.

#define VIDEO_PORT_INDEX   0

Definition at line 58 of file omxparsertest.c.

#define VIDEO_SINK   "OMX.st.fbdev.fbdev_sink"

Definition at line 51 of file omxparsertest.c.

Referenced by main().


Function Documentation

OMX_ERRORTYPE audiodecEmptyBufferDone ( OMX_OUT OMX_HANDLETYPE  hComponent,
OMX_OUT OMX_PTR  pAppData,
OMX_OUT OMX_BUFFERHEADERTYPE pBuffer 
)

Definition at line 2147 of file omxparsertest.c.

References appPriv, buffer_in_size, DEB_LEV_ERR, DEB_LEV_FULL_SEQ, DEB_LEV_SIMPLE_SEQ, DEBUG, appPrivateType::eofSem, err, fd, appPrivateType::filereaderhandle, flagIsMadUsingFileReader, flagUsingFFMpeg, OMX_BUFFERHEADERTYPE::nFilledLen, OMX_BUFFERFLAG_EOS, OMX_EmptyThisBuffer, OMX_ErrorNone, OMX_FillThisBuffer, OMX_TRUE, outBufferFileRead1, outBufferFileRead2, outBufferParseAudio, appPrivateType::parser3gphandle, OMX_BUFFERHEADERTYPE::pBuffer, tsem_t::semval, and tsem_up().

OMX_ERRORTYPE audiodecEventHandler ( 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 audio Decoder

Definition at line 2077 of file omxparsertest.c.

References appPriv, appPrivateType::audiodechandle, appPrivateType::audioDecoderEventSem, appPrivateType::audiosinkhandle, buffer_out_size, DEB_LEV_ERR, DEB_LEV_SIMPLE_SEQ, DEBUG, appPrivateType::decoderEventSem, appPrivateType::eofSem, err, flagPlaybackOn, flagSetupTunnel, inBufferSink1, inBufferSink2, OMX_AUDIO_PARAM_PCMMODETYPE::nPortIndex, OMX_PARAM_PORTDEFINITIONTYPE::nPortIndex, OMX_BUFFERFLAG_EOS, OMX_CommandPortDisable, OMX_CommandPortEnable, OMX_CommandStateSet, OMX_ErrorNone, OMX_EventBufferFlag, OMX_EventCmdComplete, OMX_EventPortSettingsChanged, OMX_FreeBuffer, OMX_GetParameter, OMX_IndexParamAudioPcm, OMX_IndexParamPortDefinition, OMX_SendCommand, OMX_SetParameter, OMX_StateExecuting, OMX_StateIdle, OMX_StateInvalid, OMX_StateLoaded, OMX_StatePause, OMX_StateWaitForResources, OMX_UseBuffer, outBufferVolume1, outBufferVolume2, OMX_BUFFERHEADERTYPE::pBuffer, setHeader(), appPrivateType::sinkEventSem, tsem_down(), tsem_up(), appPrivateType::volumeEventSem, and appPrivateType::volumehandle.

OMX_ERRORTYPE audiodecFillBufferDone ( OMX_OUT OMX_HANDLETYPE  hComponent,
OMX_OUT OMX_PTR  pAppData,
OMX_OUT OMX_BUFFERHEADERTYPE pBuffer 
)

Definition at line 2186 of file omxparsertest.c.

References appPriv, DEB_LEV_ERR, DEB_LEV_FUNCTION_NAME, DEBUG, err, flagDecodedOutputReceived, flagDirect, flagIsDisplayRequested, flagOutputReceived, flagPlaybackOn, flagSetupTunnel, inBufferVolume, inBufferVolume1, inBufferVolume2, OMX_BUFFERHEADERTYPE::nFilledLen, OMX_EmptyThisBuffer, OMX_ErrorNone, OMX_FillThisBuffer, outfile, outfileAudio, OMX_BUFFERHEADERTYPE::pBuffer, and appPrivateType::volumehandle.

OMX_ERRORTYPE audiosinkEmptyBufferDone ( OMX_OUT OMX_HANDLETYPE  hComponent,
OMX_OUT OMX_PTR  pAppData,
OMX_OUT OMX_BUFFERHEADERTYPE pBuffer 
)

Definition at line 2437 of file omxparsertest.c.

References appPriv, DEB_LEV_ERR, DEB_LEV_FULL_SEQ, DEB_LEV_PARAMS, DEBUG, DEFAULT_MESSAGES, appPrivateType::eofSem, err, OMX_BUFFERHEADERTYPE::nFilledLen, OMX_ErrorNone, OMX_FillThisBuffer, outBufferVolume, outBufferVolume1, outBufferVolume2, OMX_BUFFERHEADERTYPE::pBuffer, tsem_up(), and appPrivateType::volumehandle.

OMX_ERRORTYPE audiosinkEventHandler ( 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 audio sink

Definition at line 2392 of file omxparsertest.c.

References appPriv, appPrivateType::audioSinkEventSem, DEB_LEV_SIMPLE_SEQ, DEBUG, OMX_CommandPortDisable, OMX_CommandPortEnable, OMX_CommandStateSet, OMX_ErrorNone, OMX_StateExecuting, OMX_StateIdle, OMX_StateInvalid, OMX_StateLoaded, OMX_StatePause, OMX_StateWaitForResources, appPrivateType::sinkEventSem, and tsem_up().

OMX_ERRORTYPE colorconvEmptyBufferDone ( OMX_OUT OMX_HANDLETYPE  hComponent,
OMX_OUT OMX_PTR  pAppData,
OMX_OUT OMX_BUFFERHEADERTYPE pBuffer 
)

Definition at line 1913 of file omxparsertest.c.

References appPriv, DEB_LEV_ERR, DEBUG, appPrivateType::eofSem, err, OMX_BUFFERHEADERTYPE::nFilledLen, OMX_ErrorNone, OMX_FillThisBuffer, outBufferVideoDec, OMX_BUFFERHEADERTYPE::pBuffer, tsem_up(), and appPrivateType::videodechandle.

OMX_ERRORTYPE colorconvEventHandler ( 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 color converter component

Definition at line 1863 of file omxparsertest.c.

References appPriv, appPrivateType::colorconvEventSem, 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 colorconvFillBufferDone ( OMX_OUT OMX_HANDLETYPE  hComponent,
OMX_OUT OMX_PTR  pAppData,
OMX_OUT OMX_BUFFERHEADERTYPE pBuffer 
)

Definition at line 1949 of file omxparsertest.c.

References appPriv, DEB_LEV_ERR, DEBUG, err, flagIsDisplayRequested, flagSetupTunnel, inBufferSinkVideo, OMX_BUFFERHEADERTYPE::nFilledLen, OMX_BUFFERFLAG_EOS, OMX_EmptyThisBuffer, OMX_ErrorNone, OMX_FillThisBuffer, OMX_TRUE, outfileVideo, OMX_BUFFERHEADERTYPE::pBuffer, and appPrivateType::videosinkhandle.

void display_help (  ) 

help display

Definition at line 327 of file omxparsertest.c.

OMX_ERRORTYPE fb_sinkEmptyBufferDone ( OMX_OUT OMX_HANDLETYPE  hComponent,
OMX_OUT OMX_PTR  pAppData,
OMX_OUT OMX_BUFFERHEADERTYPE pBuffer 
)

Definition at line 2042 of file omxparsertest.c.

OMX_ERRORTYPE fb_sinkEventHandler ( 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 video sink component

Definition at line 1992 of file omxparsertest.c.

int main ( int  argc,
char **  argv 
)

Definition at line 507 of file omxparsertest.c.

References appPriv, OMX_PARAM_PORTDEFINITIONTYPE::audio, AUDIO_BASE_ROLE, AUDIO_COMPONENT_NAME_BASE, AUDIO_DEC_AAC_ROLE, AUDIO_DEC_MP3_ROLE, AUDIO_EFFECT, AUDIO_PORT_INDEX, AUDIO_SINK, audiodeccallbacks, appPrivateType::audiodechandle, appPrivateType::audioDecoderEventSem, audiosinkcallbacks, appPrivateType::audioSinkEventSem, appPrivateType::audiosinkhandle, buffer_out_size, COLOR_CONV, colorconv_callbacks, appPrivateType::colorconv_handle, appPrivateType::colorconvEventSem, OMX_PARAM_COMPONENTROLETYPE::cRole, DEB_LEV_ERR, DEB_LEV_PARAMS, DEB_LEV_SIMPLE_SEQ, DEBUG, DEFAULT_MESSAGES, display_help(), OMX_PARAM_BUFFERSUPPLIERTYPE::eBufferSupplier, OMX_VIDEO_PORTDEFINITIONTYPE::eCompressionFormat, OMX_AUDIO_PORTDEFINITIONTYPE::eEncoding, appPrivateType::eofSem, err, fbdev_sink_callbacks, appPrivateType::fbdevSinkEventSem, flagDecodedOutputReceived, flagInputReceived, flagIsAudioOutputFileExpected, flagIsDisplayRequested, flagIsVideoOutputFileExpected, flagSetupTunnel, OMX_PARAM_PORTDEFINITIONTYPE::format, inBufferAudioDec, inBufferColorconv, inBufferSinkAudio, inBufferSinkVideo, inBufferVideoDec, inBufferVolume, input_file, OMX_PARAM_BUFFERSUPPLIERTYPE::nPortIndex, OMX_BS32::nValue, OMX_AllocateBuffer, OMX_AUDIO_CodingAAC, OMX_AUDIO_CodingMP3, OMX_BufferSupplyInput, OMX_CommandPortEnable, OMX_CommandStateSet, OMX_Deinit(), OMX_ErrorNone, OMX_FillThisBuffer, OMX_FreeBuffer, OMX_FreeHandle(), OMX_GetConfig, OMX_GetExtensionIndex, OMX_GetHandle(), OMX_GetParameter, OMX_IndexConfigAudioVolume, OMX_IndexParamCompBufferSupplier, OMX_IndexParamStandardComponentRole, OMX_Init(), OMX_SendCommand, OMX_SetConfig, OMX_SetParameter, OMX_SetupTunnel(), OMX_StateExecuting, OMX_StateIdle, OMX_StateLoaded, OMX_UseBuffer, OMX_VIDEO_CodingAVC, OMX_VIDEO_CodingMPEG4, out_height, out_width, outBufferAudioDec, outBufferColorconv, outBufferParseAudio, outBufferParseVideo, outBufferVideoDec, outBufferVolume, outfileAudio, outfileVideo, output_file_audio, output_file_video, parser3gpcallbacks, appPrivateType::parser3gpEventSem, appPrivateType::parser3gphandle, PARSER_3GP, OMX_BUFFERHEADERTYPE::pBuffer, tsem_t::semval, setHeader(), SetPortParametersAudio(), SetPortParametersVideo(), OMX_AUDIO_CONFIG_VOLUMETYPE::sVolume, test_OMX_ComponentEnumByRole(), test_OMX_ComponentNameEnum(), test_OMX_RoleEnum(), test_OpenClose(), tsem_down(), tsem_init(), OMX_PARAM_PORTDEFINITIONTYPE::video, VIDEO_BASE_ROLE, VIDEO_COMPONENT_NAME_BASE, VIDEO_DEC_H264_ROLE, VIDEO_DEC_MPEG4_ROLE, VIDEO_PORT_INDEX, VIDEO_SINK, videodeccallbacks, appPrivateType::videodechandle, appPrivateType::videoDecoderEventSem, appPrivateType::videosinkhandle, volumecallbacks, appPrivateType::volumeEventSem, and appPrivateType::volumehandle.

OMX_ERRORTYPE parser3gpEventHandler ( 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 parser3gp

Definition at line 1462 of file omxparsertest.c.

References appPriv, AUDIO_PORT_INDEX, appPrivateType::audiodechandle, appPrivateType::audiosinkhandle, appPrivateType::colorconv_handle, DEB_LEV_ERR, DEB_LEV_SIMPLE_SEQ, DEBUG, appPrivateType::eofSem, err, extradata_size, flagIsDisplayRequested, flagSetupTunnel, OMX_ALL, OMX_BUFFERFLAG_EOS, OMX_CommandPortDisable, OMX_CommandPortEnable, OMX_CommandStateSet, OMX_ErrorNone, OMX_EventBufferFlag, OMX_EventCmdComplete, OMX_EventError, OMX_EventPortFormatDetected, OMX_EventPortSettingsChanged, OMX_GetConfig, OMX_GetExtensionIndex, OMX_SendCommand, OMX_SetConfig, OMX_StateExecuting, OMX_StateIdle, OMX_StateInvalid, OMX_StateLoaded, OMX_StatePause, OMX_StateWaitForResources, appPrivateType::parser3gpEventSem, appPrivateType::parser3gphandle, tsem_up(), VIDEO_PORT_INDEX, appPrivateType::videodechandle, appPrivateType::videosinkhandle, and appPrivateType::volumehandle.

OMX_ERRORTYPE parser3gpFillBufferDone ( OMX_OUT OMX_HANDLETYPE  hComponent,
OMX_OUT OMX_PTR  pAppData,
OMX_OUT OMX_BUFFERHEADERTYPE pBuffer 
)

Definition at line 1641 of file omxparsertest.c.

References appPriv, AUDIO_PORT_INDEX, appPrivateType::audiodechandle, DEB_LEV_ERR, DEB_LEV_SIMPLE_SEQ, DEBUG, err, inBufferAudioDec, inBufferVideoDec, OMX_BUFFERHEADERTYPE::nFilledLen, OMX_BUFFERFLAG_EOS, OMX_EmptyThisBuffer, OMX_ErrorNone, OMX_TRUE, OMX_BUFFERHEADERTYPE::pBuffer, VIDEO_PORT_INDEX, and appPrivateType::videodechandle.

int SetPortParametersAudio (  ) 

this function sets the audio deocder, volume and audio sink port characteristics based on the parser3gp output port settings

Definition at line 152 of file omxparsertest.c.

References appPriv, OMX_PARAM_PORTDEFINITIONTYPE::audio, AUDIO_PORT_INDEX, appPrivateType::audiodechandle, DEB_LEV_ERR, DEBUG, decparamPortAudio, OMX_AUDIO_PORTDEFINITIONTYPE::eEncoding, err, OMX_PARAM_PORTDEFINITIONTYPE::format, OMX_PARAM_PORTDEFINITIONTYPE::nPortIndex, OMX_ErrorNone, OMX_GetParameter, OMX_IndexParamPortDefinition, OMX_SetParameter, appPrivateType::parser3gphandle, and setHeader().

Referenced by main().

int SetPortParametersVideo (  ) 

this function sets the video deocder, color converter and video sink port characteristics based on the parser3gp output port settings

setting the color converter and sink component chararacteristics, if selected - both in tunneled as well as non tunneled case

setting the color conv input port width, height it will be same as the video decoder output port width, height

setting the color converter output width height it will be same as input dimensions

setting the input color format of color converter component it will be same as output yuv color format of the decoder component

setting output RGB color format of the color converter component

if video sink component is selected then set its input port settings accroding to the output port settings of the color converter component

Definition at line 204 of file omxparsertest.c.

References appPriv, COLOR_CONV_OUT_RGB_FORMAT, appPrivateType::colorconv_handle, DEB_LEV_ERR, DEB_LEV_SIMPLE_SEQ, DEBUG, decparamPortVideo, OMX_VIDEO_PORTDEFINITIONTYPE::eColorFormat, OMX_VIDEO_PORTDEFINITIONTYPE::eCompressionFormat, err, flagIsDisplayRequested, OMX_PARAM_PORTDEFINITIONTYPE::format, new_out_height, new_out_width, OMX_VIDEO_PORTDEFINITIONTYPE::nFrameHeight, OMX_VIDEO_PORTDEFINITIONTYPE::nFrameWidth, OMX_PARAM_PORTDEFINITIONTYPE::nPortIndex, omx_colorconvPortDefinition, OMX_ErrorBadParameter, OMX_ErrorNone, OMX_GetParameter, OMX_IndexParamPortDefinition, OMX_SetParameter, appPrivateType::parser3gphandle, setHeader(), OMX_PARAM_PORTDEFINITIONTYPE::video, VIDEO_PORT_INDEX, appPrivateType::videodechandle, and appPrivateType::videosinkhandle.

Referenced by main().

OMX_ERRORTYPE test_OMX_ComponentEnumByRole ( OMX_STRING  role_name  ) 

Definition at line 417 of file omxparsertest.c.

References DEB_LEV_ERR, DEBUG, DEFAULT_MESSAGES, err, OMX_ErrorNone, OMX_GetComponentsOfRole(), and OMX_MAX_STRINGNAME_SIZE.

OMX_ERRORTYPE test_OMX_ComponentNameEnum (  ) 

Definition at line 348 of file omxparsertest.c.

References DEBUG, DEFAULT_MESSAGES, err, OMX_ComponentNameEnum(), OMX_ErrorNone, and OMX_MAX_STRINGNAME_SIZE.

OMX_ERRORTYPE test_OMX_RoleEnum ( OMX_STRING  component_name  ) 

Definition at line 371 of file omxparsertest.c.

References DEB_LEV_ERR, DEB_LEV_SIMPLE_SEQ, DEBUG, DEFAULT_MESSAGES, err, OMX_ErrorInvalidComponentName, OMX_ErrorNone, OMX_GetRolesOfComponent(), and OMX_MAX_STRINGNAME_SIZE.

OMX_ERRORTYPE test_OpenClose ( OMX_STRING  component_name  ) 

Definition at line 477 of file omxparsertest.c.

References appPriv, AUDIO_COMPONENT_NAME_BASE, audiodeccallbacks, appPrivateType::audiodechandle, DEB_LEV_ERR, DEBUG, DEFAULT_MESSAGES, err, OMX_ErrorNone, OMX_FreeHandle(), OMX_GetHandle(), VIDEO_COMPONENT_NAME_BASE, videodeccallbacks, and appPrivateType::videodechandle.

OMX_ERRORTYPE videodecEmptyBufferDone ( OMX_OUT OMX_HANDLETYPE  hComponent,
OMX_OUT OMX_PTR  pAppData,
OMX_OUT OMX_BUFFERHEADERTYPE pBuffer 
)

Definition at line 1768 of file omxparsertest.c.

OMX_ERRORTYPE videodecEventHandler ( 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 
)

Definition at line 1698 of file omxparsertest.c.

OMX_ERRORTYPE videodecFillBufferDone ( OMX_OUT OMX_HANDLETYPE  hComponent,
OMX_OUT OMX_PTR  pAppData,
OMX_OUT OMX_BUFFERHEADERTYPE pBuffer 
)

Definition at line 1807 of file omxparsertest.c.

OMX_ERRORTYPE volumeEmptyBufferDone ( OMX_OUT OMX_HANDLETYPE  hComponent,
OMX_OUT OMX_PTR  pAppData,
OMX_OUT OMX_BUFFERHEADERTYPE pBuffer 
)

Definition at line 2293 of file omxparsertest.c.

References appPriv, appPrivateType::audiodechandle, appPrivateType::audiosrchandle, DEB_LEV_ERR, DEB_LEV_FULL_SEQ, DEB_LEV_SIMPLE_SEQ, DEBUG, DEFAULT_MESSAGES, appPrivateType::eofSem, err, OMX_BUFFERHEADERTYPE::nFilledLen, OMX_ErrorNone, OMX_FillThisBuffer, outBufferAudioDec, OMX_BUFFERHEADERTYPE::pBuffer, pOutBuffer, tsem_t::semval, and tsem_up().

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 2240 of file omxparsertest.c.

References appPriv, 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, tsem_up(), and appPrivateType::volumeEventSem.

OMX_ERRORTYPE volumeFillBufferDone ( OMX_OUT OMX_HANDLETYPE  hComponent,
OMX_OUT OMX_PTR  pAppData,
OMX_OUT OMX_BUFFERHEADERTYPE pBuffer 
)

Definition at line 2332 of file omxparsertest.c.

References appPrivateType::alsasink_handle, appPriv, appPrivateType::audiosinkhandle, DEB_LEV_ERR, DEB_LEV_FUNCTION_NAME, DEBUG, DEFAULT_MESSAGES, appPrivateType::eofSem, err, flagDecodedOutputReceived, flagIsDisplayRequested, flagIsSinkRequested, flagSetupTunnel, inBufferSinkAudio, OMX_BUFFERHEADERTYPE::nFilledLen, OMX_BUFFERFLAG_EOS, OMX_EmptyThisBuffer, OMX_ErrorNone, OMX_FillThisBuffer, OMX_TRUE, outfile, outfileAudio, OMX_BUFFERHEADERTYPE::pBuffer, pInBufferSink, and tsem_up().


Variable Documentation

appPrivateType* appPriv

Definition at line 126 of file omxparsertest.c.

OMX_CALLBACKTYPE audiodeccallbacks

Initial value:

 {
  .EventHandler    = audiodecEventHandler,
  .EmptyBufferDone = audiodecEmptyBufferDone,
  .FillBufferDone  = audiodecFillBufferDone
}

Definition at line 104 of file omxparsertest.c.

OMX_CALLBACKTYPE audiosinkcallbacks

Initial value:

 {
  .EventHandler    = audiosinkEventHandler,
  .EmptyBufferDone = audiosinkEmptyBufferDone,
  .FillBufferDone  = NULL
}

Definition at line 110 of file omxparsertest.c.

int buffer_in_size = 4096

Definition at line 72 of file omxparsertest.c.

int buffer_out_size = 640*480*3

Definition at line 73 of file omxparsertest.c.

OMX_COLOR_FORMATTYPE COLOR_CONV_OUT_RGB_FORMAT = OMX_COLOR_Format24bitRGB888

Definition at line 61 of file omxparsertest.c.

Referenced by main(), setPortParameters(), and SetPortParametersVideo().

OMX_CALLBACKTYPE colorconv_callbacks

Initial value:

 { 
  .EventHandler = colorconvEventHandler,
  .EmptyBufferDone = colorconvEmptyBufferDone,
  .FillBufferDone = colorconvFillBufferDone
}

Definition at line 86 of file omxparsertest.c.

OMX_PARAM_PORTDEFINITIONTYPE decparamPortAudio

Definition at line 78 of file omxparsertest.c.

Referenced by SetPortParametersAudio().

OMX_PARAM_PORTDEFINITIONTYPE decparamPortVideo

Definition at line 77 of file omxparsertest.c.

Referenced by SetPortParametersVideo().

OMX_CALLBACKTYPE fbdev_sink_callbacks

Initial value:

 { 
  .EventHandler = fb_sinkEventHandler,
  .EmptyBufferDone = fb_sinkEmptyBufferDone,
  .FillBufferDone = NULL
}

Definition at line 92 of file omxparsertest.c.

Referenced by main().

FILE* fd = 0

Definition at line 125 of file omxparsertest.c.

int flagDecodedOutputReceived

Definition at line 134 of file omxparsertest.c.

int flagInputReceived

Definition at line 135 of file omxparsertest.c.

int flagIsAudioOutputFileExpected

Definition at line 132 of file omxparsertest.c.

Referenced by main().

int flagIsDisplayRequested

Definition at line 136 of file omxparsertest.c.

Referenced by audiodecFillBufferDone(), colorconvFillBufferDone(), main(), parser3gpEventHandler(), SetPortParametersVideo(), videodecFillBufferDone(), and volumeFillBufferDone().

int flagIsVideoOutputFileExpected

Definition at line 133 of file omxparsertest.c.

Referenced by main().

int flagSetupTunnel

Definition at line 137 of file omxparsertest.c.

OMX_BUFFERHEADERTYPE* inBufferAudioDec[2]

Definition at line 65 of file omxparsertest.c.

Referenced by main(), and parser3gpFillBufferDone().

OMX_BUFFERHEADERTYPE* inBufferColorconv[2]

used with color converter if selected

Definition at line 67 of file omxparsertest.c.

Referenced by main(), and videodecFillBufferDone().

OMX_BUFFERHEADERTYPE* inBufferSinkAudio[2]

Definition at line 71 of file omxparsertest.c.

Referenced by main(), and volumeFillBufferDone().

OMX_BUFFERHEADERTYPE* inBufferSinkVideo[2]

Definition at line 68 of file omxparsertest.c.

Referenced by colorconvFillBufferDone(), and main().

OMX_BUFFERHEADERTYPE* inBufferVideoDec[2]

Definition at line 64 of file omxparsertest.c.

Referenced by main(), and parser3gpFillBufferDone().

OMX_BUFFERHEADERTYPE* inBufferVolume[2]

Definition at line 70 of file omxparsertest.c.

Referenced by audiodecFillBufferDone(), and main().

char* input_file

Definition at line 128 of file omxparsertest.c.

OMX_U32 new_out_height = 0

Definition at line 123 of file omxparsertest.c.

Referenced by setPortParameters(), and SetPortParametersVideo().

OMX_U32 new_out_width = 0

Definition at line 122 of file omxparsertest.c.

Referenced by setPortParameters(), and SetPortParametersVideo().

OMX_U32 out_height = 0

Definition at line 123 of file omxparsertest.c.

Referenced by find_resolution(), main(), omx_ffmpeg_colorconv_component_Init(), and setPortParameters().

OMX_U32 out_width = 0

Definition at line 122 of file omxparsertest.c.

Referenced by find_resolution(), main(), omx_ffmpeg_colorconv_component_Init(), and setPortParameters().

OMX_BUFFERHEADERTYPE * outBufferAudioDec[2]

Definition at line 65 of file omxparsertest.c.

Referenced by main(), and volumeEmptyBufferDone().

OMX_BUFFERHEADERTYPE * outBufferColorconv[2]

Definition at line 67 of file omxparsertest.c.

Referenced by fb_sinkEmptyBufferDone(), and main().

OMX_BUFFERHEADERTYPE * outBufferParseAudio[2]

Definition at line 63 of file omxparsertest.c.

Referenced by audiodecEmptyBufferDone(), and main().

OMX_BUFFERHEADERTYPE* outBufferParseVideo[2]

Definition at line 63 of file omxparsertest.c.

Referenced by main(), and videodecEmptyBufferDone().

OMX_BUFFERHEADERTYPE * outBufferVideoDec[2]

Definition at line 64 of file omxparsertest.c.

Referenced by colorconvEmptyBufferDone(), and main().

OMX_BUFFERHEADERTYPE * outBufferVolume[2]

Definition at line 70 of file omxparsertest.c.

Referenced by audiosinkEmptyBufferDone(), and main().

FILE* outfileAudio

Definition at line 130 of file omxparsertest.c.

Referenced by audiodecFillBufferDone(), main(), and volumeFillBufferDone().

FILE * outfileVideo

Definition at line 130 of file omxparsertest.c.

Referenced by colorconvFillBufferDone(), main(), and videodecFillBufferDone().

char * output_file_audio

Definition at line 128 of file omxparsertest.c.

Referenced by main().

char * output_file_video

Definition at line 128 of file omxparsertest.c.

Referenced by main().

OMX_CALLBACKTYPE parser3gpcallbacks

Initial value:

 { 
  .EventHandler    = parser3gpEventHandler,
  .EmptyBufferDone = NULL,
  .FillBufferDone  = parser3gpFillBufferDone
}

Definition at line 98 of file omxparsertest.c.

Referenced by main().

OMX_CALLBACKTYPE videodeccallbacks

Initial value:

 { 
  .EventHandler = videodecEventHandler,
  .EmptyBufferDone = videodecEmptyBufferDone,
  .FillBufferDone = videodecFillBufferDone
}

Definition at line 80 of file omxparsertest.c.

Referenced by main(), and test_OpenClose().

OMX_CALLBACKTYPE volumecallbacks

Initial value:

 {
  .EventHandler    = volumeEventHandler,
  .EmptyBufferDone = volumeEmptyBufferDone,
  .FillBufferDone  = volumeFillBufferDone
}

Definition at line 116 of file omxparsertest.c.


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