OpenMAXBellagio  0.9.3
omxaudiomixertest.c
Go to the documentation of this file.
1 
28 #include "omxaudiomixertest.h"
29 
30 #define BUFFER_COUNT_ACTUAL 2
31 #define FRAME_SIZE 1152*2*2 // 1152 samples* 2 channels * 2byte/16bits per channel
32 
34  .EmptyBufferDone = audiomixerEmptyBufferDone,
35  .FillBufferDone = audiomixerFillBufferDone,
36 };
37 
38 static void setHeader(OMX_PTR header, OMX_U32 size) {
39  OMX_VERSIONTYPE* ver = (OMX_VERSIONTYPE*)(header + sizeof(OMX_U32));
40  *((OMX_U32*)header) = size;
41 
45  ver->s.nStep = VERSIONSTEP;
46 }
47 
48 void display_help() {
49  printf("\n");
50  printf("Usage: omxaudiomixertest [-o outfile] [-gi gain] -t -r 44100 -n 2 filename0 [filename1 filename2 filename3]\n");
51  printf("\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");
58  printf("\n");
59  exit(1);
60 }
61 
62 /* Application private date: should go in the component field (segs...) */
64 int fd[4];
65 unsigned int filesize[4];
69 int flagIsGain[4];
74 FILE *outfile;
75 
77 static OMX_BOOL isPortDisabled[4];
78 static int iBufferDropped[4];
79 
80 int main(int argc, char** argv) {
81 
82  OMX_PORT_PARAM_TYPE sParam;
83  OMX_U32 data_read;
84  int j;
85  int i=0;
88  int gain[4];
89  int argn_dec;
90  int index_files = 0, index_gain = 0;
91  OMX_U32 srate=0,nchannel=0;
93  char c;
94 
95  gain[0]=gain[1]=gain[2]=gain[3]=100;
96  fd[0] = fd[1] = fd[2] = fd[3] = 0;
97  bEOS[0] = bEOS[1] = bEOS[2] = bEOS[3] = OMX_FALSE;
98  /* Obtain file descriptor */
99  if(argc < 2){
100  display_help();
101  } else {
103  flagOutputReceived = 0;
104  flagInputReceived = 0;
105  flagIsGain[0] = 0;
106  flagIsGain[1] = 0;
107  flagIsGain[2] = 0;
108  flagIsGain[3] = 0;
109  flagSampleRate = 0;
110  flagChannel = 0;
111 
112  argn_dec = 1;
113  while (argn_dec<argc) {
114  if (*(argv[argn_dec]) =='-') {
115  if (flagIsOutputExpected) {
116  display_help();
117  }
118  switch (*(argv[argn_dec]+1)) {
119  case 'h':
120  display_help();
121  break;
122  case 'o':
124  break;
125  case 'g':
126  index_gain = atoi(argv[argn_dec]+2);
127  if(index_gain > 3) {
128  DEBUG(DEFAULT_MESSAGES, "-g%i is not valid\n", index_gain);
129  index_gain = 0;
130  }
131  flagIsGain[index_gain] = 1;
132  break;
133  case 'r':
134  flagSampleRate = 1;
135  break;
136  case 'n':
137  flagChannel = 1;
138  break;
139  default:
140  display_help();
141  }
142  } else {
143  if (flagIsGain[index_gain]) {
144  gain[index_gain] = (int)atoi(argv[argn_dec]);
145  DEBUG(DEFAULT_MESSAGES, "gain[%d]=%d\n", index_gain, gain[index_gain]);
146  flagIsGain[index_gain] = 0;
147  if(gain[index_gain] > 100) {
148  DEBUG(DEFAULT_MESSAGES, "Gain of stream %i should be between [0..100]\n", index_gain);
149  gain[index_gain] = 100;
150  }
151  index_gain = 0;
152  } else if (flagIsOutputExpected) {
153  output_file = malloc(strlen(argv[argn_dec]) * sizeof(char) + 1);
154  strcpy(output_file,argv[argn_dec]);
156  flagOutputReceived = 1;
157  } else if (flagSampleRate) {
158  srate = (int)atoi(argv[argn_dec]);
159  flagSampleRate = 0;
160  } else if (flagChannel) {
161  nchannel = (int)atoi(argv[argn_dec]);
162  flagChannel = 0;
163  } else {
164  if (index_files>3) {
165  DEBUG(DEB_LEV_ERR, "Too many input files. Only first four are accepted\n");
166  } else {
167  input_file[index_files] = malloc(strlen(argv[argn_dec]) * sizeof(char) + 1);
168  strcpy(input_file[index_files],argv[argn_dec]);
169  flagInputReceived = 1;
170  index_files++;
171  }
172  }
173  }
174  argn_dec++;
175  }
176  if (!flagInputReceived) {
177  display_help();
178  }
179  DEBUG(DEFAULT_MESSAGES, "Input files %s %s %s %s \n", input_file[0], input_file[1], input_file[2], input_file[3]);
180  DEBUG(DEFAULT_MESSAGES, " to ");
181  if (flagOutputReceived) {
183  } else {
184  DEBUG(DEFAULT_MESSAGES, " Audio Sink\n");
185  }
186  }
187 
188  if(input_file[0]== NULL) {
189  DEBUG(DEB_LEV_ERR, "Provide at least an input file\n");
190  exit(1);
191  }
192 
193  for (i = 0; i<index_files; i++) {
194  fd[i] = open(input_file[i], O_RDONLY);
195  if(fd[i] < 0){
196  DEBUG(DEB_LEV_ERR, "Error opening input file %i\n", i);
197  exit(1);
198  }
199  }
200 
201  if (flagOutputReceived) {
202  outfile = fopen(output_file,"wb");
203  if(outfile == NULL) {
204  DEBUG(DEB_LEV_ERR, "Error at opening the output file");
205  exit(1);
206  }
207  }
208 
209 
210  for (i = 0; i<index_files; i++) {
211  filesize[i] = getFileSize(fd[i]);
212  }
213 
214  /* Initialize application private data */
215  appPriv = malloc(sizeof(appPrivateType));
216  pthread_cond_init(&appPriv->condition, NULL);
217  pthread_mutex_init(&appPriv->mutex, NULL);
218  appPriv->eventSem = malloc(sizeof(tsem_t));
220  appPriv->eofSem = malloc(sizeof(tsem_t));
221  tsem_init(appPriv->eofSem, 0);
222  iBufferDropped[0] = 0;
223  iBufferDropped[1] = 0;
224  iBufferDropped[2] = 0;
225  iBufferDropped[3] = 0;
226 
227  err = OMX_Init();
228  if(err != OMX_ErrorNone) {
229  DEBUG(DEB_LEV_ERR, "OMX_Init() failed\n");
230  exit(1);
231  }
233  err = OMX_GetHandle(&appPriv->handle, "OMX.st.audio.mixer", NULL , &callbacks);
234  if(err != OMX_ErrorNone) {
235  DEBUG(DEB_LEV_ERR, "Audio Mixer OMX_GetHandle failed\n");
236  exit(1);
237  }
238 
239  /*Max 4 input stream*/
240  for(j=0;j<4;j++) {
241  isPortDisabled[j] = OMX_FALSE;
242  if((gain[j] >= 0) && (gain[j] <100)) {
243  sVolume.nPortIndex = j;
245  if(err!=OMX_ErrorNone) {
246  DEBUG(DEB_LEV_ERR,"Error %08x In OMX_GetConfig %i \n",err, j);
247  }
248  sVolume.sVolume.nValue = gain[j];
249  DEBUG(DEFAULT_MESSAGES, "Setting Gain[%i] %d \n",(int)j, gain[j]);
251  if(err!=OMX_ErrorNone) {
252  DEBUG(DEB_LEV_ERR,"Error %08x In OMX_SetConfig %i \n",err, j);
253  }
254  }
255  }
256 
258  setHeader(&sParam, sizeof(OMX_PORT_PARAM_TYPE));
260  if(err != OMX_ErrorNone){
261  DEBUG(DEB_LEV_ERR, "Error in getting OMX_PORT_PARAM_TYPE parameter\n");
262  exit(1);
263  }
264  DEBUG(DEFAULT_MESSAGES, "Audio Mixer has %d ports\n",(int)sParam.nPorts);
265 
266 // disable unused ports
267  for (j = index_files; j<4; j++) {
268  isPortDisabled[j] = OMX_TRUE;
271  DEBUG(DEFAULT_MESSAGES, "Port %i disabled\n", j);
272  }
273  for (j = 0; j < index_files; j++) {
274  setHeader(&sPortDef, sizeof(OMX_PARAM_PORTDEFINITIONTYPE));
275  sPortDef.nPortIndex = j;
277 
278  sPortDef.nBufferCountActual = 2;
280  if(err != OMX_ErrorNone){
281  DEBUG(DEB_LEV_ERR, "Error in getting OMX_PORT_PARAM_TYPE parameter\n");
282  exit(1);
283  }
284  }
285 
287 
288  for (j=0; j<8; j++) {
289  inBuffer[j] = 0;
290  }
291  outBuffer[0] = outBuffer[1] = NULL;
292 
293 
294  for(j=0; j<index_files; j++) {
296  if (err != OMX_ErrorNone) {
297  DEBUG(DEB_LEV_ERR, "Error on AllocateBuffer %i %p on port %i\n", j*2, inBuffer[j*2], j);
298  exit(1);
299  }
300  err = OMX_AllocateBuffer(appPriv->handle, &inBuffer[j * 2 + 1], j, NULL, BUFFER_IN_SIZE);
301  if (err != OMX_ErrorNone) {
302  DEBUG(DEB_LEV_ERR, "Error on AllocateBuffer %i %p on port %i\n", j*2+1, inBuffer[j*2+1], j);
303  exit(1);
304  }
305  }
306 
308  if (err != OMX_ErrorNone) {
309  DEBUG(DEB_LEV_ERR, "Error on AllocateBuffer 0 %p on port 4\n", outBuffer[0]);
310  exit(1);
311  }
313  if (err != OMX_ErrorNone) {
314  DEBUG(DEB_LEV_ERR, "Error on AllocateBuffer 1 %p on port 4\n", outBuffer[1]);
315  exit(1);
316  }
317 
319 
321 
322  /* Wait for commands to complete */
324 
325  for (i = 0; i<index_files; i++) {
326  data_read = read(fd[i], inBuffer[i*2]->pBuffer, FRAME_SIZE);
327  inBuffer[i*2]->nFilledLen = data_read;
328  filesize[i] -= data_read;
329  data_read = read(fd[i], inBuffer[i*2+1]->pBuffer, FRAME_SIZE);
330  inBuffer[i*2+1]->nFilledLen = data_read;
331  filesize[i] -= data_read;
332  }
333 
334 
335  for (i = 0; i<index_files; i++) {
338  }
339 
345 
346  /*Port Disable option available in case of direct play out only*/
347  if(!flagOutputReceived) {
348  DEBUG(DEFAULT_MESSAGES, "\nIf you want to disabled port enter port number[0..3]: else Enter 'q' \n\n");
349  while(!bEOS[0] || !bEOS[1] || !bEOS[2] || !bEOS[3]) {
350  DEBUG(DEFAULT_MESSAGES, "Port status 0=%i, 1=%i, 2=%i, 3=%i\n",isPortDisabled[0], isPortDisabled[1], isPortDisabled[2], isPortDisabled[3]);
351  DEBUG(DEFAULT_MESSAGES, "Port play 0=%i, 1=%i, 2=%i, 3=%i\n",bEOS[0], bEOS[1], bEOS[2], bEOS[3]);
352  DEBUG(DEFAULT_MESSAGES, "Entry : ");
353  c = getchar();
354  if(c=='\n') {
355  continue;
356  } else if(c == 'q') {
357  DEBUG(DEFAULT_MESSAGES,"No port to disable\n");
358  break;
359  } else {
360  i= (int)atoi(&c);
361  if(i>=0 && i<4) {
362  DEBUG(DEFAULT_MESSAGES,"Disabling/Enabling Port %i\n", i);
363  if (isPortDisabled[i] == OMX_TRUE) {
368  isPortDisabled[i] = OMX_FALSE;
369  data_read = read(fd[i], inBuffer[i*2]->pBuffer, FRAME_SIZE);
370  inBuffer[i*2]->nFilledLen = data_read;
371  data_read = read(fd[i], inBuffer[i*2+1]->pBuffer, FRAME_SIZE);
372  inBuffer[i*2+1]->nFilledLen = data_read;
373  //Sending Empty buffer
376  } else {
377  isPortDisabled[i] = OMX_TRUE;
379  while(iBufferDropped[i]!=2) {
380  usleep(10000);
381  }
382  for(j=0;j<BUFFER_COUNT_ACTUAL;j++) {
384  }
386  iBufferDropped[i] = 0;
387  }
388  } else {
389  DEBUG(DEFAULT_MESSAGES,"Either Port %i is already disabled or not valid\n",i);
390  }
391  }
392  }
393  }
394 
395  DEBUG(DEFAULT_MESSAGES, "Waiting for EOS\n");
396  if(isPortDisabled[0] == OMX_FALSE) {
398  DEBUG(DEFAULT_MESSAGES, "Received EOS 1\n");
399  }
400  if(isPortDisabled[1] == OMX_FALSE) {
402  DEBUG(DEFAULT_MESSAGES, "Received EOS 2\n");
403  }
404  if(isPortDisabled[2] == OMX_FALSE) {
406  DEBUG(DEFAULT_MESSAGES, "Received EOS 3\n");
407  }
408  if(isPortDisabled[3] == OMX_FALSE) {
410  DEBUG(DEFAULT_MESSAGES, "Received EOS 4\n");
411  }
412 
414  /* Wait for commands to complete */
416 
418  for(j=0; j<index_files; j++) {
419  if(isPortDisabled[j] == OMX_FALSE) {
421  err = OMX_FreeBuffer(appPriv->handle, j, inBuffer[j*2+1]);
422  }
423  }
424 
425  for(j=0;j<BUFFER_COUNT_ACTUAL;j++) {
427  }
428 
429  /* Wait for commands to complete */
431 
433 
434  free(appPriv->eventSem);
435  free(appPriv);
436 
437  if (flagOutputReceived) {
438  if(fclose(outfile) != 0) {
439  DEBUG(DEB_LEV_ERR,"Error in closing output file\n");
440  exit(1);
441  }
442  free(output_file);
443  }
444  for (i = 0; i<index_files; i++) {
445  close(fd[i]);
446  free(input_file[i]);
447  }
448 
449  return 0;
450 }
451 
452 /* Callbacks implementation */
454  OMX_HANDLETYPE hComponent,
455  OMX_PTR pAppData,
456  OMX_EVENTTYPE eEvent,
457  OMX_U32 Data1,
458  OMX_U32 Data2,
459  OMX_PTR pEventData) {
460 
461  DEBUG(DEB_LEV_SIMPLE_SEQ, "Hi there, I am in the %s callback\n", __func__);
462  if(eEvent == OMX_EventCmdComplete) {
463  if (Data1 == OMX_CommandStateSet) {
464  DEBUG(DEB_LEV_SIMPLE_SEQ, "Volume Component State changed in ");
465  switch ((int)Data2) {
466  case OMX_StateInvalid:
467  DEBUG(DEB_LEV_SIMPLE_SEQ, "OMX_StateInvalid\n");
468  break;
469  case OMX_StateLoaded:
470  DEBUG(DEB_LEV_SIMPLE_SEQ, "OMX_StateLoaded\n");
471  break;
472  case OMX_StateIdle:
473  DEBUG(DEB_LEV_SIMPLE_SEQ, "OMX_StateIdle\n");
474  break;
475  case OMX_StateExecuting:
476  DEBUG(DEB_LEV_SIMPLE_SEQ, "OMX_StateExecuting\n");
477  break;
478  case OMX_StatePause:
479  DEBUG(DEB_LEV_SIMPLE_SEQ, "OMX_StatePause\n");
480  break;
482  DEBUG(DEB_LEV_SIMPLE_SEQ, "OMX_StateWaitForResources\n");
483  break;
484  }
486  } else if (Data1 == OMX_CommandPortEnable){
488  } else if (Data1 == OMX_CommandPortDisable){
490  }
491  } else if(eEvent == OMX_EventBufferFlag) {
492  DEBUG(DEB_LEV_SIMPLE_SEQ, "OMX_EventBufferFlag\n");
493  if((int)Data2 == OMX_BUFFERFLAG_EOS) {
495  }
496  } else {
497  DEBUG(DEB_LEV_SIMPLE_SEQ, "Param1 is %i\n", (int)Data1);
498  DEBUG(DEB_LEV_SIMPLE_SEQ, "Param2 is %i\n", (int)Data2);
499  }
500 
501  return OMX_ErrorNone;
502 }
503 
505  OMX_HANDLETYPE hComponent,
506  OMX_PTR pAppData,
507  OMX_BUFFERHEADERTYPE* pBuffer) {
508 
510  int data_read;
511 
512 
513  DEBUG(DEB_LEV_FULL_SEQ, "Hi there, I am in the %s callback from the port %i\n", __func__, (int)pBuffer->nInputPortIndex);
514 
515  if(isPortDisabled[pBuffer->nInputPortIndex] == OMX_FALSE) {
516  data_read = read(fd[pBuffer->nInputPortIndex], pBuffer->pBuffer, FRAME_SIZE);
517  pBuffer->nFilledLen = data_read;
518  pBuffer->nOffset = 0;
519  filesize[pBuffer->nInputPortIndex] -= data_read;
520  DEBUG(DEB_LEV_SIMPLE_SEQ, "Sending from file %i data read=%d\n", (int)pBuffer->nInputPortIndex, data_read);
521  if (data_read <= 0) {
522  DEBUG(DEB_LEV_SIMPLE_SEQ, "In the %s no more input data available\n", __func__);
523  ++iBufferDropped[pBuffer->nInputPortIndex];
524  if(iBufferDropped[pBuffer->nInputPortIndex]==2) {
525  DEBUG(DEB_LEV_SIMPLE_SEQ, "In %s Dropping Empty This buffer to Audio Mixer Stream %i\n", __func__, (int)pBuffer->nInputPortIndex);
526  return OMX_ErrorNone;
527  } else if(iBufferDropped[pBuffer->nInputPortIndex]>2) {
528  DEBUG(DEB_LEV_SIMPLE_SEQ, "In %s Dropping Empty This buffer to Audio Mixer Stream %i\n", __func__, (int)pBuffer->nInputPortIndex);
529  return OMX_ErrorNone;
530  }
531  pBuffer->nFilledLen=0;
532  pBuffer->nFlags = OMX_BUFFERFLAG_EOS;
533  bEOS[pBuffer->nInputPortIndex]=OMX_TRUE;
534  DEBUG(DEB_LEV_SIMPLE_SEQ, "In %s Sending EOS for Stream %i\n", __func__, (int)pBuffer->nInputPortIndex);
535  err = OMX_EmptyThisBuffer(hComponent, pBuffer);
536  return OMX_ErrorNone;
537  }
538  } else {
539  ++iBufferDropped[pBuffer->nInputPortIndex];
540  return OMX_ErrorNone;
541  }
542  if(!bEOS[pBuffer->nInputPortIndex]) {
543  DEBUG(DEB_LEV_FULL_SEQ, "Empty buffer %p\n", pBuffer);
544  err = OMX_EmptyThisBuffer(hComponent, pBuffer);
545  }else {
546  DEBUG(DEB_LEV_FULL_SEQ, "In %s Dropping Empty This buffer to Audio Mixer\n", __func__);
547  }
548 
549  return OMX_ErrorNone;
550 }
551 
553  OMX_HANDLETYPE hComponent,
554  OMX_PTR pAppData,
555  OMX_BUFFERHEADERTYPE* pBuffer) {
556 
558  int i;
559 
560  DEBUG(DEB_LEV_FULL_SEQ, "Hi there, I am in the %s callback. Got buflen %i for buffer at 0x%p\n",
561  __func__, (int)pBuffer->nFilledLen, pBuffer);
562 
563  /* Output data to standard output */
564  if(pBuffer != NULL) {
565  if (pBuffer->nFilledLen == 0) {
566  DEBUG(DEB_LEV_ERR, "Ouch! In %s: no data in the output buffer!\n", __func__);
567  return OMX_ErrorNone;
568  }
569  if (flagOutputReceived) {
570  if(pBuffer->nFilledLen > 0) {
571  fwrite(pBuffer->pBuffer, 1, pBuffer->nFilledLen, outfile);
572  }
573  } else {
574  for(i=0;i<pBuffer->nFilledLen;i++) {
575  putchar(*(char*)(pBuffer->pBuffer + i));
576  }
577  }
578  pBuffer->nFilledLen = 0;
579  /* Reschedule the fill buffer request */
580  if(!bEOS[0] || !bEOS[1] || !bEOS[2] || !bEOS[3]) {
581  err = OMX_FillThisBuffer(hComponent, pBuffer);
582  } else {
583  DEBUG(DEB_LEV_FULL_SEQ, "In %s Dropping Fill This buffer to Audio Mixer\n", __func__);
584  }
585  } else {
586  DEBUG(DEB_LEV_ERR, "Ouch! In %s: had NULL buffer to output...\n", __func__);
587  }
588  return OMX_ErrorNone;
589 }
590 
595 static int getFileSize(int fd) {
596 
597  struct stat input_file_stat;
598  int err;
599 
600  /* Obtain input file length */
601  err = fstat(fd, &input_file_stat);
602  if(err){
603  DEBUG(DEB_LEV_ERR, "fstat failed");
604  exit(-1);
605  }
606  return input_file_stat.st_size;
607 }
OMX_GetParameter
#define OMX_GetParameter( hComponent, nParamIndex, pComponentParameterStructure)
Definition: OMX_Core.h:786
OMX_VERSIONTYPE::nRevision
OMX_U8 nRevision
Definition: OMX_Types.h:346
tsem_up
void tsem_up(tsem_t *tsem)
Definition: tsemaphore.c:110
OMX_AllocateBuffer
#define OMX_AllocateBuffer( hComponent, ppBuffer, nPortIndex, pAppPrivate, nSizeBytes)
Definition: OMX_Core.h:1028
DEBUG
#define DEBUG(n, fmt, args...)
Definition: omx_comp_debug_levels.h:77
OMX_CALLBACKTYPE::EventHandler
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)
Definition: OMX_Core.h:530
OMX_EVENTTYPE
OMX_EVENTTYPE
Definition: OMX_Core.h:480
OMX_AUDIO_CONFIG_VOLUMETYPE::sVolume
OMX_BS32 sVolume
Definition: OMX_Audio.h:1018
OMX_StatePause
@ OMX_StatePause
Definition: OMX_Core.h:107
DEB_LEV_FULL_SEQ
#define DEB_LEV_FULL_SEQ
Definition: omx_comp_debug_levels.h:54
OMX_VERSIONTYPE::s
struct OMX_VERSIONTYPE::@0 s
omxaudiomixertest.h
BUFFER_COUNT_ACTUAL
#define BUFFER_COUNT_ACTUAL
Definition: omxaudiomixertest.c:30
OMX_IndexParamAudioInit
@ OMX_IndexParamAudioInit
Definition: OMX_Index.h:64
OMX_ERRORTYPE
OMX_ERRORTYPE
Definition: OMX_Core.h:127
VERSIONSTEP
#define VERSIONSTEP
Definition: omxaudiomixertest.h:51
OMX_BUFFERHEADERTYPE::nOffset
OMX_U32 nOffset
Definition: OMX_Core.h:407
OMX_U32
unsigned long OMX_U32
Definition: OMX_Types.h:145
OMX_TRUE
@ OMX_TRUE
Definition: OMX_Types.h:191
appPrivateType::eofSem
tsem_t * eofSem
Definition: omxaudiomixertest.h:60
flagSampleRate
int flagSampleRate
Definition: omxaudiomixertest.c:70
VERSIONMINOR
#define VERSIONMINOR
Definition: omxaudiomixertest.h:49
OMX_IndexConfigAudioVolume
@ OMX_IndexConfigAudioVolume
Definition: OMX_Index.h:128
audiomixerEmptyBufferDone
OMX_ERRORTYPE audiomixerEmptyBufferDone(OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_BUFFERHEADERTYPE *pBuffer)
Definition: omxaudiomixertest.c:504
flagIsGain
int flagIsGain[4]
Definition: omxaudiomixertest.c:69
OMX_CALLBACKTYPE
Definition: OMX_Core.h:498
DEB_LEV_ERR
#define DEB_LEV_ERR
Definition: omx_comp_debug_levels.h:39
output_file
char * output_file
Definition: omxaudiomixertest.c:72
OMX_PORT_PARAM_TYPE
Definition: OMX_Core.h:471
filesize
unsigned int filesize[4]
Definition: omxaudiomixertest.c:65
OMX_CommandPortEnable
@ OMX_CommandPortEnable
Definition: OMX_Core.h:54
flagOutputReceived
int flagOutputReceived
Definition: omxaudiomixertest.c:67
audiomixerEventHandler
OMX_ERRORTYPE audiomixerEventHandler(OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_EVENTTYPE eEvent, OMX_U32 Data1, OMX_U32 Data2, OMX_PTR pEventData)
Definition: omxaudiomixertest.c:453
OMX_BUFFERHEADERTYPE::nFilledLen
OMX_U32 nFilledLen
Definition: OMX_Core.h:405
OMX_VERSIONTYPE::nVersionMinor
OMX_U8 nVersionMinor
Definition: OMX_Types.h:345
OMX_HANDLETYPE
void * OMX_HANDLETYPE
Definition: OMX_Types.h:295
appPrivateType
Definition: omxaudiomixertest.h:54
OMX_EventCmdComplete
@ OMX_EventCmdComplete
Definition: OMX_Core.h:481
OMX_PARAM_PORTDEFINITIONTYPE::nPortIndex
OMX_U32 nPortIndex
Definition: OMX_Component.h:64
OMX_EmptyThisBuffer
#define OMX_EmptyThisBuffer( hComponent, pBuffer)
Definition: OMX_Core.h:1096
OMX_SendCommand
#define OMX_SendCommand( hComponent, Cmd, nParam, pCmdData)
Definition: OMX_Core.h:745
OMX_IndexParamPortDefinition
@ OMX_IndexParamPortDefinition
Definition: OMX_Index.h:88
OMX_SetParameter
#define OMX_SetParameter( hComponent, nParamIndex, pComponentParameterStructure)
Definition: OMX_Core.h:825
tsem_down
void tsem_down(tsem_t *tsem)
Definition: tsemaphore.c:97
OMX_GetHandle
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_PARAM_PORTDEFINITIONTYPE::nBufferCountActual
OMX_U32 nBufferCountActual
Definition: OMX_Component.h:66
OMX_FreeHandle
OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_FreeHandle(OMX_IN OMX_HANDLETYPE hComponent)
DEFAULT_MESSAGES
#define DEFAULT_MESSAGES
Definition: omx_comp_debug_levels.h:64
OMX_AUDIO_CONFIG_VOLUMETYPE
Definition: OMX_Audio.h:1008
OMX_StateInvalid
@ OMX_StateInvalid
Definition: OMX_Core.h:94
BUFFER_IN_SIZE
#define BUFFER_IN_SIZE
Definition: omxaudiomixertest.h:65
DEB_LEV_SIMPLE_SEQ
#define DEB_LEV_SIMPLE_SEQ
Definition: omx_comp_debug_levels.h:48
inBuffer
OMX_BUFFERHEADERTYPE * inBuffer[8]
Definition: omxaudiomixertest.c:76
OMX_Init
OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Init(void)
The OMX_Init standard function.
Definition: omxcore.c:94
appPrivateType::eventSem
tsem_t * eventSem
Definition: omxaudiomixertest.h:59
OMX_BUFFERHEADERTYPE::nInputPortIndex
OMX_U32 nInputPortIndex
Definition: OMX_Core.h:441
OMX_VERSIONTYPE::nStep
OMX_U8 nStep
Definition: OMX_Types.h:347
OMX_VERSIONTYPE
Definition: OMX_Types.h:341
OMX_BS32::nValue
OMX_S32 nValue
Definition: OMX_Types.h:263
OMX_PTR
void * OMX_PTR
Definition: OMX_Types.h:199
OMX_BOOL
OMX_BOOL
Definition: OMX_Types.h:189
appPrivateType::condition
pthread_cond_t condition
Definition: omxaudiomixertest.h:55
FRAME_SIZE
#define FRAME_SIZE
Definition: omxaudiomixertest.c:31
flagIsOutputExpected
int flagIsOutputExpected
Definition: omxaudiomixertest.c:66
OMX_BUFFERHEADERTYPE::nFlags
OMX_U32 nFlags
Definition: OMX_Core.h:438
appPrivateType::mutex
pthread_mutex_t mutex
Definition: omxaudiomixertest.h:56
input_file
char * input_file[4]
Definition: omxaudiomixertest.c:72
VERSIONMAJOR
#define VERSIONMAJOR
Definition: omxaudiomixertest.h:48
flagInputReceived
int flagInputReceived
Definition: omxaudiomixertest.c:68
OMX_EventBufferFlag
@ OMX_EventBufferFlag
Definition: OMX_Core.h:485
OMX_VERSIONTYPE::nVersionMajor
OMX_U8 nVersionMajor
Definition: OMX_Types.h:344
tsem_t
Definition: tsemaphore.h:38
main
int main(int argc, char **argv)
Definition: omxaudiomixertest.c:80
OMX_BUFFERFLAG_EOS
#define OMX_BUFFERFLAG_EOS
Definition: OMX_Core.h:299
fd
int fd[4]
Definition: omxaudiomixertest.c:64
OMX_StateExecuting
@ OMX_StateExecuting
Definition: OMX_Core.h:105
OMX_PORT_PARAM_TYPE::nPorts
OMX_U32 nPorts
Definition: OMX_Core.h:474
tsem_init
int tsem_init(tsem_t *tsem, unsigned int val)
Definition: tsemaphore.c:39
err
OMX_ERRORTYPE err
Definition: omxvolcontroltest.c:34
OMX_FALSE
@ OMX_FALSE
Definition: OMX_Types.h:190
bEOS
OMX_BOOL bEOS[4]
Definition: omxaudiomixertest.c:73
audiomixerFillBufferDone
OMX_ERRORTYPE audiomixerFillBufferDone(OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_BUFFERHEADERTYPE *pBuffer)
Definition: omxaudiomixertest.c:552
display_help
void display_help()
Definition: omxaudiomixertest.c:48
OMX_StateWaitForResources
@ OMX_StateWaitForResources
Definition: OMX_Core.h:108
inBufferSink
OMX_BUFFERHEADERTYPE * inBufferSink[2]
Definition: omxaudiomixertest.c:76
OMX_AUDIO_CONFIG_VOLUMETYPE::nPortIndex
OMX_U32 nPortIndex
Definition: OMX_Audio.h:1011
OMX_BUFFERHEADERTYPE
Definition: OMX_Core.h:399
OMX_ErrorNone
@ OMX_ErrorNone
Definition: OMX_Core.h:128
OMX_FreeBuffer
#define OMX_FreeBuffer( hComponent, nPortIndex, pBuffer)
Definition: OMX_Core.h:1064
appPrivateType::handle
OMX_HANDLETYPE handle
Definition: omxaudiomixertest.h:61
OMX_SetConfig
#define OMX_SetConfig( hComponent, nConfigIndex, pComponentConfigStructure)
Definition: OMX_Core.h:897
OMX_GetConfig
#define OMX_GetConfig( hComponent, nConfigIndex, pComponentConfigStructure)
Definition: OMX_Core.h:861
VERSIONREVISION
#define VERSIONREVISION
Definition: omxaudiomixertest.h:50
OMX_CommandStateSet
@ OMX_CommandStateSet
Definition: OMX_Core.h:51
appPriv
appPrivateType * appPriv
Definition: omxaudiomixertest.c:63
outfile
FILE * outfile
Definition: omxaudiomixertest.c:74
OMX_BUFFERHEADERTYPE::pBuffer
OMX_U8 * pBuffer
Definition: OMX_Core.h:402
flagChannel
int flagChannel
Definition: omxaudiomixertest.c:71
OMX_StateIdle
@ OMX_StateIdle
Definition: OMX_Core.h:102
OMX_FillThisBuffer
#define OMX_FillThisBuffer( hComponent, pBuffer)
Definition: OMX_Core.h:1126
outBuffer
OMX_BUFFERHEADERTYPE * outBuffer[2]
Definition: omxaudiomixertest.c:76
OMX_CommandPortDisable
@ OMX_CommandPortDisable
Definition: OMX_Core.h:53
OMX_StateLoaded
@ OMX_StateLoaded
Definition: OMX_Core.h:97
callbacks
OMX_CALLBACKTYPE callbacks
Definition: omxaudiomixertest.c:33
setHeader
void setHeader(OMX_PTR header, OMX_U32 size)
Simply fills the first two fields in any OMX structure with the size and the version.
Definition: omx_base_component.c:746
OMX_PARAM_PORTDEFINITIONTYPE
Definition: OMX_Component.h:61

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