omxaudiodectest.c File Reference

#include "omxaudiodectest.h"

Go to the source code of this file.

Defines

#define MP3_TYPE_SEL   1
#define VORBIS_TYPE_SEL   2
#define AAC_TYPE_SEL   3
#define COMPONENT_NAME_BASE   "OMX.st.audio_decoder"
#define BASE_ROLE   "audio_decoder.ogg"
#define COMPONENT_NAME_BASE_LEN   20
#define SINK_NAME   "OMX.st.alsa.alsasink"
#define FILE_READER   "OMX.st.audio_filereader"
#define AUDIO_EFFECT   "OMX.st.volume.component"
#define extradata_size   1024

Functions

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 filereaderEventHandler (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 filereaderFillBufferDone (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

appPrivateTypeappPriv
OMX_BUFFERHEADERTYPEoutBufferFileRead1
OMX_BUFFERHEADERTYPEoutBufferFileRead2
OMX_BUFFERHEADERTYPEinBufferAudioDec1
OMX_BUFFERHEADERTYPEinBufferAudioDec2
OMX_BUFFERHEADERTYPEoutBufferAudioDec1
OMX_BUFFERHEADERTYPEoutBufferAudioDec2
OMX_BUFFERHEADERTYPEinBufferVolume1
OMX_BUFFERHEADERTYPEinBufferVolume2
OMX_BUFFERHEADERTYPEoutBufferVolume1
OMX_BUFFERHEADERTYPEoutBufferVolume2
OMX_BUFFERHEADERTYPEinBufferSink1
OMX_BUFFERHEADERTYPEinBufferSink2
int buffer_in_size = 4096
int buffer_out_size = 2*8192
OMX_CALLBACKTYPE audiodeccallbacks
OMX_CALLBACKTYPE audiosinkcallbacks
OMX_CALLBACKTYPE filereadercallbacks
OMX_CALLBACKTYPE volumecallbacks
FILE * fd
FILE * outfile
char * input_file
char * output_file
int selectedType = 0
int flagIsOutputExpected
int flagSetupTunnel
int flagPlaybackOn
int flagOutputReceived
int flagInputReceived
int flagIsMadRequested
int flagIsMadUsingFileReader
int flagDirect
int flagSingleOGGSelected
int flagUsingFFMpeg
int flagIsGain


Define Documentation

#define AAC_TYPE_SEL   3

Definition at line 38 of file omxaudiodectest.c.

Referenced by main().

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

Definition at line 44 of file omxaudiodectest.c.

Referenced by main().

#define BASE_ROLE   "audio_decoder.ogg"

Definition at line 40 of file omxaudiodectest.c.

#define COMPONENT_NAME_BASE   "OMX.st.audio_decoder"

Definition at line 39 of file omxaudiodectest.c.

#define COMPONENT_NAME_BASE_LEN   20

Definition at line 41 of file omxaudiodectest.c.

#define extradata_size   1024

Definition at line 45 of file omxaudiodectest.c.

Referenced by filereaderEventHandler(), and parser3gpEventHandler().

#define FILE_READER   "OMX.st.audio_filereader"

Definition at line 43 of file omxaudiodectest.c.

Referenced by main().

#define MP3_TYPE_SEL   1

Definition at line 36 of file omxaudiodectest.c.

Referenced by main().

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

Definition at line 42 of file omxaudiodectest.c.

Referenced by main().

#define VORBIS_TYPE_SEL   2

Definition at line 37 of file omxaudiodectest.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 1234 of file omxaudiodectest.c.

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 1075 of file omxaudiodectest.c.

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

Definition at line 1301 of file omxaudiodectest.c.

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

Definition at line 1549 of file omxaudiodectest.c.

Referenced by main().

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 1504 of file omxaudiodectest.c.

Referenced by main().

void display_help (  ) 

function prototype declaration display general help

help display

Definition at line 96 of file omxaudiodectest.c.

OMX_ERRORTYPE filereaderEventHandler ( 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 filereaderFillBufferDone ( OMX_OUT OMX_HANDLETYPE  hComponent,
OMX_OUT OMX_PTR  pAppData,
OMX_OUT OMX_BUFFERHEADERTYPE pBuffer 
)

int main ( int  argc,
char **  argv 
)

initializing appPriv structure

initialising openmax

file reader component name -- gethandle

getting the handle of audio decoder

setting the input audio format in file reader

now set the filereader component to idle and executing state

allocation of file reader component's output buffers these two will be used as input buffers of the audio decoder component

the output buffers of file reader component will be used in the audio decoder component as input buffers

freeing all handles and deinit omx

Definition at line 273 of file omxaudiodectest.c.

References AAC_TYPE_SEL, AUDIO_EFFECT, appPrivateType::audiodechandle, appPrivateType::audiosinkhandle, BASE_ROLE, buffer_in_size, buffer_out_size, COMPONENT_NAME_BASE, COMPONENT_NAME_BASE_LEN, DEB_LEV_ERR, DEB_LEV_PARAMS, DEB_LEV_SIMPLE_SEQ, DEBUG, appPrivateType::decoderEventSem, DEFAULT_MESSAGES, display_help(), appPrivateType::eofSem, err, fd, FILE_READER, appPrivateType::filereaderEventSem, appPrivateType::filereaderhandle, flagDirect, flagInputReceived, flagIsGain, flagIsMadRequested, flagIsMadUsingFileReader, flagIsOutputExpected, flagOutputReceived, flagPlaybackOn, flagSetupTunnel, flagSingleOGGSelected, flagUsingFFMpeg, input_file, MP3_TYPE_SEL, OMX_BUFFERHEADERTYPE::nFilledLen, OMX_BUFFERHEADERTYPE::nOffset, OMX_BS32::nValue, OMX_AllocateBuffer, OMX_CommandStateSet, OMX_Deinit(), OMX_EmptyThisBuffer, OMX_ErrorNone, OMX_FillThisBuffer, OMX_FreeBuffer, OMX_FreeHandle(), OMX_GetConfig, OMX_GetExtensionIndex, OMX_GetHandle(), OMX_GetParameter, OMX_IndexConfigAudioVolume, OMX_Init(), OMX_MAX_STRINGNAME_SIZE, OMX_SendCommand, OMX_SetConfig, OMX_SetParameter, OMX_SetupTunnel(), OMX_StateExecuting, OMX_StateIdle, OMX_StateLoaded, OMX_UseBuffer, outfile, output_file, OMX_BUFFERHEADERTYPE::pBuffer, selectedType, tsem_t::semval, SINK_NAME, appPrivateType::sinkEventSem, OMX_AUDIO_CONFIG_VOLUMETYPE::sVolume, test_OMX_ComponentEnumByRole(), test_OMX_ComponentNameEnum(), test_OMX_RoleEnum(), test_OpenClose(), tsem_down(), tsem_init(), appPrivateType::volumeEventSem, appPrivateType::volumehandle, and VORBIS_TYPE_SEL.

OMX_ERRORTYPE test_OMX_ComponentEnumByRole ( OMX_STRING  role_name  ) 

OMX_ERRORTYPE test_OMX_ComponentNameEnum (  ) 

OMX_ERRORTYPE test_OMX_RoleEnum ( OMX_STRING  component_name  ) 

OMX_ERRORTYPE test_OpenClose ( OMX_STRING  component_name  ) 

OMX_ERRORTYPE volumeEmptyBufferDone ( 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 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 1443 of file omxaudiodectest.c.

References appPrivateType::audiosinkhandle, DEB_LEV_ERR, DEB_LEV_FUNCTION_NAME, DEBUG, DEFAULT_MESSAGES, appPrivateType::eofSem, err, flagDirect, flagOutputReceived, flagPlaybackOn, flagSetupTunnel, OMX_BUFFERHEADERTYPE::nFilledLen, OMX_EmptyThisBuffer, OMX_ErrorNone, OMX_FillThisBuffer, outfile, OMX_BUFFERHEADERTYPE::pBuffer, and tsem_up().


Variable Documentation

Definition at line 47 of file omxaudiodectest.c.

Initial value:

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

Definition at line 57 of file omxaudiodectest.c.

Initial value:

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

Definition at line 63 of file omxaudiodectest.c.

Referenced by main().

int buffer_in_size = 4096

int buffer_out_size = 2*8192

Definition at line 54 of file omxaudiodectest.c.

FILE* fd

Initial value:

 { 
  .EventHandler    = filereaderEventHandler,
  .EmptyBufferDone = NULL,
  .FillBufferDone  = filereaderFillBufferDone
}

Definition at line 69 of file omxaudiodectest.c.

Definition at line 267 of file omxaudiodectest.c.

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

Definition at line 264 of file omxaudiodectest.c.

Referenced by main().

Definition at line 270 of file omxaudiodectest.c.

Referenced by main().

Definition at line 265 of file omxaudiodectest.c.

Referenced by main().

Definition at line 266 of file omxaudiodectest.c.

Referenced by audiodecEmptyBufferDone(), and main().

Definition at line 260 of file omxaudiodectest.c.

Definition at line 263 of file omxaudiodectest.c.

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

Definition at line 261 of file omxaudiodectest.c.

Definition at line 268 of file omxaudiodectest.c.

Referenced by main().

Definition at line 269 of file omxaudiodectest.c.

Referenced by audiodecEmptyBufferDone(), filereaderEventHandler(), and main().

Definition at line 50 of file omxaudiodectest.c.

Definition at line 50 of file omxaudiodectest.c.

Definition at line 52 of file omxaudiodectest.c.

Definition at line 52 of file omxaudiodectest.c.

Definition at line 51 of file omxaudiodectest.c.

Definition at line 51 of file omxaudiodectest.c.

char* input_file

Definition at line 82 of file omxaudiodectest.c.

Referenced by main().

Definition at line 50 of file omxaudiodectest.c.

Definition at line 50 of file omxaudiodectest.c.

Definition at line 49 of file omxaudiodectest.c.

Definition at line 49 of file omxaudiodectest.c.

Definition at line 51 of file omxaudiodectest.c.

Definition at line 51 of file omxaudiodectest.c.

FILE * outfile

Definition at line 81 of file omxaudiodectest.c.

char * output_file

Definition at line 82 of file omxaudiodectest.c.

int selectedType = 0

Definition at line 83 of file omxaudiodectest.c.

Referenced by main().

Initial value:

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

Definition at line 75 of file omxaudiodectest.c.


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