Go to the documentation of this file.
30 #define BUFFER_COUNT_ACTUAL 2
31 #define FRAME_SIZE 1152*2*2 // 1152 samples* 2 channels * 2byte/16bits per channel
50 printf(
"Usage: omxaudiomixertest [-o outfile] [-gi gain] -t -r 44100 -n 2 filename0 [filename1 filename2 filename3]\n");
52 printf(
" -o outfile: If this option is specified, the output stream is written to outfile\n");
53 printf(
" otherwise redirected to std output\n");
54 printf(
" -gi : Gain of stream i[0..3] data [0...100]\n");
55 printf(
" -r 44100 : Sample Rate [Default 44100]\n");
56 printf(
" -n 2 : Number of channel [Default 2]\n\n");
57 printf(
" -h : Displays this help\n");
78 static int iBufferDropped[4];
80 int main(
int argc,
char** argv) {
90 int index_files = 0, index_gain = 0;
94 gain[0]=gain[1]=gain[2]=gain[3]=100;
112 while (argn_dec<argc) {
113 if (*(argv[argn_dec]) ==
'-') {
117 switch (*(argv[argn_dec]+1)) {
125 index_gain = atoi(argv[argn_dec]+2);
143 gain[index_gain] = (int)atoi(argv[argn_dec]);
146 if(gain[index_gain] > 100) {
148 gain[index_gain] = 100;
152 output_file = malloc(strlen(argv[argn_dec]) *
sizeof(
char) + 1);
164 input_file[index_files] = malloc(strlen(argv[argn_dec]) *
sizeof(
char) + 1);
165 strcpy(
input_file[index_files],argv[argn_dec]);
190 for (i = 0; i<index_files; i++) {
207 for (i = 0; i<index_files; i++) {
219 iBufferDropped[0] = 0;
220 iBufferDropped[1] = 0;
221 iBufferDropped[2] = 0;
222 iBufferDropped[3] = 0;
239 if((gain[j] >= 0) && (gain[j] <100)) {
264 for (j = index_files; j<4; j++) {
270 for (j = 0; j < index_files; j++) {
285 for (j=0; j<8; j++) {
291 for(j=0; j<index_files; j++) {
322 for (i = 0; i<index_files; i++) {
332 for (i = 0; i<index_files; i++) {
345 DEBUG(
DEFAULT_MESSAGES,
"\nIf you want to disabled port enter port number[0..3]: else Enter 'q' \n\n");
347 DEBUG(
DEFAULT_MESSAGES,
"Port status 0=%i, 1=%i, 2=%i, 3=%i\n",isPortDisabled[0], isPortDisabled[1], isPortDisabled[2], isPortDisabled[3]);
353 }
else if(c ==
'q') {
360 if (isPortDisabled[i] ==
OMX_TRUE) {
376 while(iBufferDropped[i]!=2) {
383 iBufferDropped[i] = 0;
415 for(j=0; j<index_files; j++) {
441 for (i = 0; i<index_files; i++) {
462 switch ((
int)Data2) {
517 if (data_read <= 0) {
559 if(pBuffer != NULL) {
561 DEBUG(
DEB_LEV_ERR,
"Ouch! In %s: no data in the output buffer!\n", __func__);
570 putchar(*(
char*)(pBuffer->
pBuffer + i));
581 DEBUG(
DEB_LEV_ERR,
"Ouch! In %s: had NULL buffer to output...\n", __func__);
590 static int getFileSize(
int fd) {
592 struct stat input_file_stat;
596 err = fstat(
fd, &input_file_stat);
601 return input_file_stat.st_size;
#define OMX_GetParameter( hComponent, nParamIndex, pComponentParameterStructure)
void tsem_up(tsem_t *tsem)
#define OMX_AllocateBuffer( hComponent, ppBuffer, nPortIndex, pAppPrivate, nSizeBytes)
#define DEBUG(n, fmt, args...)
OMX_ERRORTYPE(* EventHandler)(OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_PTR pAppData, OMX_IN OMX_EVENTTYPE eEvent, OMX_IN OMX_U32 nData1, OMX_IN OMX_U32 nData2, OMX_IN OMX_PTR pEventData)
#define BUFFER_COUNT_ACTUAL
OMX_ERRORTYPE audiomixerEmptyBufferDone(OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_BUFFERHEADERTYPE *pBuffer)
OMX_ERRORTYPE audiomixerEventHandler(OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_EVENTTYPE eEvent, OMX_U32 Data1, OMX_U32 Data2, OMX_PTR pEventData)
#define OMX_EmptyThisBuffer( hComponent, pBuffer)
#define OMX_SendCommand( hComponent, Cmd, nParam, pCmdData)
#define OMX_SetParameter( hComponent, nParamIndex, pComponentParameterStructure)
void tsem_down(tsem_t *tsem)
OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_GetHandle(OMX_OUT OMX_HANDLETYPE *pHandle, OMX_IN OMX_STRING cComponentName, OMX_IN OMX_PTR pAppData, OMX_IN OMX_CALLBACKTYPE *pCallBacks)
OMX_U32 nBufferCountActual
OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_FreeHandle(OMX_IN OMX_HANDLETYPE hComponent)
#define DEB_LEV_SIMPLE_SEQ
OMX_BUFFERHEADERTYPE * inBuffer[8]
OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Init(void)
The OMX_Init standard function.
struct OMX_VERSIONTYPE::@1 s
int main(int argc, char **argv)
#define OMX_BUFFERFLAG_EOS
int tsem_init(tsem_t *tsem, unsigned int val)
OMX_ERRORTYPE audiomixerFillBufferDone(OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_BUFFERHEADERTYPE *pBuffer)
OMX_BUFFERHEADERTYPE * inBufferSink[2]
#define OMX_FreeBuffer( hComponent, nPortIndex, pBuffer)
#define OMX_SetConfig( hComponent, nConfigIndex, pComponentConfigStructure)
#define OMX_GetConfig( hComponent, nConfigIndex, pComponentConfigStructure)
#define OMX_FillThisBuffer( hComponent, pBuffer)
OMX_BUFFERHEADERTYPE * outBuffer[2]
OMX_CALLBACKTYPE callbacks
void setHeader(OMX_PTR header, OMX_U32 size)
Simply fills the first two fields in any OMX structure with the size and the version.
Generated for OpenMAX Bellagio rel. 0.9.3 by
1.5.1