omxaudiomixertest.c File Reference

#include "omxaudiomixertest.h"
#include "ctype.h"

Go to the source code of this file.

Defines

#define SINK_NAME   "OMX.st.alsa.alsasink"
#define BUFFER_COUNT_ACTUAL   2
#define FRAME_SIZE   1152*2*2

Functions

void display_help ()
int main (int argc, char **argv)
OMX_ERRORTYPE audiomixerEventHandler (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_IN OMX_PTR pEventData)
OMX_ERRORTYPE audiomixerEmptyBufferDone (OMX_OUT OMX_HANDLETYPE hComponent, OMX_OUT OMX_PTR pAppData, OMX_OUT OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE audiomixerFillBufferDone (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_CALLBACKTYPE callbacks
OMX_CALLBACKTYPE audiosinkcallbacks
appPrivateTypeappPriv
int fd = 0
int fd1 = 0
unsigned int filesize
unsigned int filesize1
int flagIsOutputExpected
int flagOutputReceived
int flagInputReceived
int flagIsGain [4]
int flagPlaybackOn
int flagSetupTunnel
int flagSampleRate
int flagChannel
char * input_file [2]
char * output_file
FILE * outfile
OMX_BUFFERHEADERTYPEinBuffer [4]
OMX_BUFFERHEADERTYPEoutBuffer [2]
OMX_BUFFERHEADERTYPEinBufferSink [2]


Detailed Description

This simple test application take one or more input stream/s. passes these streams to an audio mixer component and stores the mixed output in another output 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

Date
2008-06-27 12:00:23 +0200 (Fri, 27 Jun 2008)
Revision
Rev
554
Author
Author
pankaj_sen

This simple test application take one or more input stream/s. passes these streams to an audio mixer component and stores the mixed output in another output 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

Date
2008-07-03 10:00:23 +0200 (Thu, 03 Jul 2008)
Revision
Rev
559
Author
Author
gsent

Definition in file omxaudiomixertest.c.


Define Documentation

#define BUFFER_COUNT_ACTUAL   2

Definition at line 35 of file omxaudiomixertest.c.

Referenced by main().

#define FRAME_SIZE   1152*2*2

Definition at line 36 of file omxaudiomixertest.c.

Referenced by audiomixerEmptyBufferDone(), and main().

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

Definition at line 34 of file omxaudiomixertest.c.


Function Documentation

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

Definition at line 666 of file omxaudiomixertest.c.

References DEB_LEV_FULL_SEQ, DEB_LEV_SIMPLE_SEQ, DEBUG, appPrivateType::eofSem, err, fd1, FRAME_SIZE, OMX_BUFFERFLAG_EOS, OMX_EmptyThisBuffer, OMX_ErrorNone, OMX_FALSE, OMX_TRUE, and tsem_up().

OMX_ERRORTYPE audiomixerEventHandler ( 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_IN OMX_PTR  pEventData 
)

Definition at line 616 of file omxaudiomixertest.c.

References DEB_LEV_SIMPLE_SEQ, DEBUG, appPrivateType::eofSem, appPrivateType::eventSem, 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 audiomixerFillBufferDone ( OMX_OUT OMX_HANDLETYPE  hComponent,
OMX_OUT OMX_PTR  pAppData,
OMX_OUT OMX_BUFFERHEADERTYPE pBuffer 
)

Definition at line 747 of file omxaudiomixertest.c.

References appPrivateType::audiosinkhandle, DEB_LEV_ERR, DEB_LEV_FULL_SEQ, DEBUG, err, OMX_BUFFERHEADERTYPE::nFilledLen, OMX_EmptyThisBuffer, OMX_ErrorNone, OMX_FillThisBuffer, and OMX_BUFFERHEADERTYPE::pBuffer.

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

Definition at line 850 of file omxaudiomixertest.c.

References DEB_LEV_ERR, DEB_LEV_FULL_SEQ, DEB_LEV_PARAMS, DEBUG, DEFAULT_MESSAGES, appPrivateType::eofSem, err, appPrivateType::handle, OMX_BUFFERHEADERTYPE::nFilledLen, OMX_ErrorNone, OMX_FillThisBuffer, OMX_BUFFERHEADERTYPE::pBuffer, and tsem_up().

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 805 of file omxaudiomixertest.c.

References 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().

void display_help (  ) 

function prototype declaration display general help

help display

Definition at line 59 of file omxaudiomixertest.c.

int main ( int  argc,
char **  argv 
)

Ask the core for a handle to the audio mixer component

Get the number of ports

Schedule a couple of buffers to be filled on the output port The callback itself will re-schedule them.

Definition at line 94 of file omxaudiomixertest.c.

References appPrivateType::audiosinkhandle, BUFFER_COUNT_ACTUAL, BUFFER_IN_SIZE, appPrivateType::condition, DEB_LEV_ERR, DEB_LEV_PARAMS, DEB_LEV_SIMPLE_SEQ, DEBUG, DEFAULT_MESSAGES, display_help(), appPrivateType::eofSem, err, appPrivateType::eventSem, fd1, FRAME_SIZE, appPrivateType::handle, appPrivateType::mutex, OMX_PARAM_PORTDEFINITIONTYPE::nBufferCountActual, OMX_AUDIO_PARAM_PCMMODETYPE::nChannels, OMX_BUFFERHEADERTYPE::nFilledLen, OMX_PARAM_PORTDEFINITIONTYPE::nPortIndex, OMX_AUDIO_PARAM_PCMMODETYPE::nPortIndex, OMX_AUDIO_CONFIG_VOLUMETYPE::nPortIndex, OMX_PORT_PARAM_TYPE::nPorts, OMX_AUDIO_PARAM_PCMMODETYPE::nSamplingRate, OMX_BS32::nValue, OMX_AllocateBuffer, OMX_CommandPortDisable, OMX_CommandPortEnable, OMX_CommandStateSet, OMX_EmptyThisBuffer, OMX_ErrorNone, OMX_FALSE, OMX_FillThisBuffer, OMX_FreeBuffer, OMX_FreeHandle(), OMX_GetConfig, OMX_GetHandle(), OMX_GetParameter, OMX_IndexConfigAudioVolume, OMX_IndexParamAudioInit, OMX_IndexParamAudioPcm, OMX_IndexParamPortDefinition, OMX_Init(), OMX_SendCommand, OMX_SetConfig, OMX_SetParameter, OMX_SetupTunnel(), OMX_StateExecuting, OMX_StateIdle, OMX_StateLoaded, OMX_TRUE, OMX_UseBuffer, OMX_BUFFERHEADERTYPE::pBuffer, setHeader(), SINK_NAME, appPrivateType::sinkEventSem, OMX_AUDIO_CONFIG_VOLUMETYPE::sVolume, tsem_down(), and tsem_init().


Variable Documentation

appPrivateType* appPriv

Definition at line 75 of file omxaudiomixertest.c.

OMX_CALLBACKTYPE audiosinkcallbacks

Initial value:

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

Definition at line 43 of file omxaudiomixertest.c.

OMX_CALLBACKTYPE callbacks

Initial value:

 { .EventHandler = audiomixerEventHandler,
                               .EmptyBufferDone = audiomixerEmptyBufferDone,
                               .FillBufferDone = audiomixerFillBufferDone,
}

Definition at line 38 of file omxaudiomixertest.c.

int fd = 0

Definition at line 76 of file omxaudiomixertest.c.

int fd1 = 0

Definition at line 76 of file omxaudiomixertest.c.

Referenced by audiomixerEmptyBufferDone(), and main().

unsigned int filesize

Definition at line 77 of file omxaudiomixertest.c.

Referenced by main(), and volcEmptyBufferDone().

unsigned int filesize1

Definition at line 77 of file omxaudiomixertest.c.

int flagChannel

Definition at line 85 of file omxaudiomixertest.c.

int flagInputReceived

Definition at line 80 of file omxaudiomixertest.c.

int flagIsGain[4]

Definition at line 81 of file omxaudiomixertest.c.

int flagIsOutputExpected

Definition at line 78 of file omxaudiomixertest.c.

int flagOutputReceived

Definition at line 79 of file omxaudiomixertest.c.

int flagPlaybackOn

Definition at line 82 of file omxaudiomixertest.c.

int flagSampleRate

Definition at line 84 of file omxaudiomixertest.c.

int flagSetupTunnel

Definition at line 83 of file omxaudiomixertest.c.

OMX_BUFFERHEADERTYPE* inBuffer[4]

Definition at line 90 of file omxaudiomixertest.c.

OMX_BUFFERHEADERTYPE * inBufferSink[2]

Definition at line 90 of file omxaudiomixertest.c.

char* input_file[2]

Definition at line 86 of file omxaudiomixertest.c.

OMX_BUFFERHEADERTYPE * outBuffer[2]

Definition at line 90 of file omxaudiomixertest.c.

FILE* outfile

Definition at line 88 of file omxaudiomixertest.c.

char * output_file

Definition at line 86 of file omxaudiomixertest.c.


Generated for OpenMAX Bellagio rel. 0.9.0 by  doxygen 1.5.1
SourceForge.net Logo