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;
92  char c;
93 
94  gain[0]=gain[1]=gain[2]=gain[3]=100;
95  fd[0] = fd[1] = fd[2] = fd[3] = 0;
96  bEOS[0] = bEOS[1] = bEOS[2] = bEOS[3] = OMX_FALSE;
97  /* Obtain file descriptor */
98  if(argc < 2){
99  display_help();
100  } else {
102  flagOutputReceived = 0;
103  flagInputReceived = 0;
104  flagIsGain[0] = 0;
105  flagIsGain[1] = 0;
106  flagIsGain[2] = 0;
107  flagIsGain[3] = 0;
108  flagSampleRate = 0;
109  flagChannel = 0;
110 
111  argn_dec = 1;
112  while (argn_dec<argc) {
113  if (*(argv[argn_dec]) =='-') {
114  if (flagIsOutputExpected) {
115  display_help();
116  }
117  switch (*(argv[argn_dec]+1)) {
118  case 'h':
119  display_help();
120  break;
121  case 'o':
123  break;
124  case 'g':
125  index_gain = atoi(argv[argn_dec]+2);
126  if(index_gain > 3) {
127  DEBUG(DEFAULT_MESSAGES, "-g%i is not valid\n", index_gain);
128  index_gain = 0;
129  }
130  flagIsGain[index_gain] = 1;
131  break;
132  case 'r':
133  flagSampleRate = 1;
134  break;
135  case 'n':
136  flagChannel = 1;
137  break;
138  default:
139  display_help();
140  }
141  } else {
142  if (flagIsGain[index_gain]) {
143  gain[index_gain] = (int)atoi(argv[argn_dec]);
144  DEBUG(DEFAULT_MESSAGES, "gain[%d]=%d\n", index_gain, gain[index_gain]);
145  flagIsGain[index_gain] = 0;
146  if(gain[index_gain] > 100) {
147  DEBUG(DEFAULT_MESSAGES, "Gain of stream %i should be between [0..100]\n", index_gain);
148  gain[index_gain] = 100;
149  }
150  index_gain = 0;
151  } else if (flagIsOutputExpected) {
152  output_file = malloc(strlen(argv[argn_dec]) * sizeof(char) + 1);
153  strcpy(output_file,argv[argn_dec]);
155  flagOutputReceived = 1;
156  } else if (flagSampleRate) {
157  flagSampleRate = 0;
158  } else if (flagChannel) {
159  flagChannel = 0;
160  } else {
161  if (index_files>3) {
162  DEBUG(DEB_LEV_ERR, "Too many input files. Only first four are accepted\n");
163  } else {
164  input_file[index_files] = malloc(strlen(argv[argn_dec]) * sizeof(char) + 1);
165  strcpy(input_file[index_files],argv[argn_dec]);
166  flagInputReceived = 1;
167  index_files++;
168  }
169  }
170  }
171  argn_dec++;
172  }
173  if (!flagInputReceived) {
174  display_help();
175  }
176  DEBUG(DEFAULT_MESSAGES, "Input files %s %s %s %s \n", input_file[0], input_file[1], input_file[2], input_file[3]);
177  DEBUG(DEFAULT_MESSAGES, " to ");
178  if (flagOutputReceived) {
180  } else {
181  DEBUG(DEFAULT_MESSAGES, " Audio Sink\n");
182  }
183  }
184 
185  if(input_file[0]== NULL) {
186  DEBUG(DEB_LEV_ERR, "Provide at least an input file\n");
187  exit(1);
188  }
189 
190  for (i = 0; i<index_files; i++) {
191  fd[i] = open(input_file[i], O_RDONLY);
192  if(fd[i] < 0){
193  DEBUG(DEB_LEV_ERR, "Error opening input file %i\n", i);
194  exit(1);
195  }
196  }
197 
198  if (flagOutputReceived) {
199  outfile = fopen(output_file,"wb");
200  if(outfile == NULL) {
201  DEBUG(DEB_LEV_ERR, "Error at opening the output file");
202  exit(1);
203  }
204  }
205 
206 
207  for (i = 0; i<index_files; i++) {
208  filesize[i] = getFileSize(fd[i]);
209  }
210 
211  /* Initialize application private data */
212  appPriv = malloc(sizeof(appPrivateType));
213  pthread_cond_init(&appPriv->condition, NULL);
214  pthread_mutex_init(&appPriv->mutex, NULL);
215  appPriv->eventSem = malloc(sizeof(tsem_t));
217  appPriv->eofSem = malloc(sizeof(tsem_t));
218  tsem_init(appPriv->eofSem, 0);
219  iBufferDropped[0] = 0;
220  iBufferDropped[1] = 0;
221  iBufferDropped[2] = 0;
222  iBufferDropped[3] = 0;
223 
224  err = OMX_Init();
225  if(err != OMX_ErrorNone) {
226  DEBUG(DEB_LEV_ERR, "OMX_Init() failed\n");
227  exit(1);
228  }
230  err = OMX_GetHandle(&appPriv->handle, "OMX.st.audio.mixer", NULL , &callbacks);
231  if(err != OMX_ErrorNone) {
232  DEBUG(DEB_LEV_ERR, "Audio Mixer OMX_GetHandle failed\n");
233  exit(1);
234  }
235 
236  /*Max 4 input stream*/
237  for(j=0;j<4;j++) {
238  isPortDisabled[j] = OMX_FALSE;
239  if((gain[j] >= 0) && (gain[j] <100)) {
240  sVolume.nPortIndex = j;
242  if(err!=OMX_ErrorNone) {
243  DEBUG(DEB_LEV_ERR,"Error %08x In OMX_GetConfig %i \n",err, j);
244  }
245  sVolume.sVolume.nValue = gain[j];
246  DEBUG(DEFAULT_MESSAGES, "Setting Gain[%i] %d \n",(int)j, gain[j]);
248  if(err!=OMX_ErrorNone) {
249  DEBUG(DEB_LEV_ERR,"Error %08x In OMX_SetConfig %i \n",err, j);
250  }
251  }
252  }
253 
255  setHeader(&sParam, sizeof(OMX_PORT_PARAM_TYPE));
257  if(err != OMX_ErrorNone){
258  DEBUG(DEB_LEV_ERR, "Error in getting OMX_PORT_PARAM_TYPE parameter\n");
259  exit(1);
260  }
261  DEBUG(DEFAULT_MESSAGES, "Audio Mixer has %d ports\n",(int)sParam.nPorts);
262 
263 // disable unused ports
264  for (j = index_files; j<4; j++) {
265  isPortDisabled[j] = OMX_TRUE;
268  DEBUG(DEFAULT_MESSAGES, "Port %i disabled\n", j);
269  }
270  for (j = 0; j < index_files; j++) {
271  setHeader(&sPortDef, sizeof(OMX_PARAM_PORTDEFINITIONTYPE));
272  sPortDef.nPortIndex = j;
274 
275  sPortDef.nBufferCountActual = 2;
277  if(err != OMX_ErrorNone){
278  DEBUG(DEB_LEV_ERR, "Error in getting OMX_PORT_PARAM_TYPE parameter\n");
279  exit(1);
280  }
281  }
282 
284 
285  for (j=0; j<8; j++) {
286  inBuffer[j] = 0;
287  }
288  outBuffer[0] = outBuffer[1] = NULL;
289 
290 
291  for(j=0; j<index_files; j++) {
293  if (err != OMX_ErrorNone) {
294  DEBUG(DEB_LEV_ERR, "Error on AllocateBuffer %i %p on port %i\n", j*2, inBuffer[j*2], j);
295  exit(1);
296  }
297  err = OMX_AllocateBuffer(appPriv->handle, &inBuffer[j * 2 + 1], j, NULL, BUFFER_IN_SIZE);
298  if (err != OMX_ErrorNone) {
299  DEBUG(DEB_LEV_ERR, "Error on AllocateBuffer %i %p on port %i\n", j*2+1, inBuffer[j*2+1], j);
300  exit(1);
301  }
302  }
303 
305  if (err != OMX_ErrorNone) {
306  DEBUG(DEB_LEV_ERR, "Error on AllocateBuffer 0 %p on port 4\n", outBuffer[0]);
307  exit(1);
308  }
310  if (err != OMX_ErrorNone) {
311  DEBUG(DEB_LEV_ERR, "Error on AllocateBuffer 1 %p on port 4\n", outBuffer[1]);
312  exit(1);
313  }
314 
316 
318 
319  /* Wait for commands to complete */
321 
322  for (i = 0; i<index_files; i++) {
323  data_read = read(fd[i], inBuffer[i*2]->pBuffer, FRAME_SIZE);
324  inBuffer[i*2]->nFilledLen = data_read;
325  filesize[i] -= data_read;
326  data_read = read(fd[i], inBuffer[i*2+1]->pBuffer, FRAME_SIZE);
327  inBuffer[i*2+1]->nFilledLen = data_read;
328  filesize[i] -= data_read;
329  }
330 
331 
332  for (i = 0; i<index_files; i++) {
335  }
336 
342 
343  /*Port Disable option available in case of direct play out only*/
344  if(!flagOutputReceived) {
345  DEBUG(DEFAULT_MESSAGES, "\nIf you want to disabled port enter port number[0..3]: else Enter 'q' \n\n");
346  while(!bEOS[0] || !bEOS[1] || !bEOS[2] || !bEOS[3]) {
347  DEBUG(DEFAULT_MESSAGES, "Port status 0=%i, 1=%i, 2=%i, 3=%i\n",isPortDisabled[0], isPortDisabled[1], isPortDisabled[2], isPortDisabled[3]);
348  DEBUG(DEFAULT_MESSAGES, "Port play 0=%i, 1=%i, 2=%i, 3=%i\n",bEOS[0], bEOS[1], bEOS[2], bEOS[3]);
349  DEBUG(DEFAULT_MESSAGES, "Entry : ");
350  c = getchar();
351  if(c=='\n') {
352  continue;
353  } else if(c == 'q') {
354  DEBUG(DEFAULT_MESSAGES,"No port to disable\n");
355  break;
356  } else {
357  i= (int)atoi(&c);
358  if(i>=0 && i<4) {
359  DEBUG(DEFAULT_MESSAGES,"Disabling/Enabling Port %i\n", i);
360  if (isPortDisabled[i] == OMX_TRUE) {
365  isPortDisabled[i] = OMX_FALSE;
366  data_read = read(fd[i], inBuffer[i*2]->pBuffer, FRAME_SIZE);
367  inBuffer[i*2]->nFilledLen = data_read;
368  data_read = read(fd[i], inBuffer[i*2+1]->pBuffer, FRAME_SIZE);
369  inBuffer[i*2+1]->nFilledLen = data_read;
370  //Sending Empty buffer
373  } else {
374  isPortDisabled[i] = OMX_TRUE;
376  while(iBufferDropped[i]!=2) {
377  usleep(10000);
378  }
379  for(j=0;j<BUFFER_COUNT_ACTUAL;j++) {
381  }
383  iBufferDropped[i] = 0;
384  }
385  } else {
386  DEBUG(DEFAULT_MESSAGES,"Either Port %i is already disabled or not valid\n",i);
387  }
388  }
389  }
390  }
391 
392  DEBUG(DEFAULT_MESSAGES, "Waiting for EOS\n");
393  if(isPortDisabled[0] == OMX_FALSE) {
395  DEBUG(DEFAULT_MESSAGES, "Received EOS 1\n");
396  }
397  if(isPortDisabled[1] == OMX_FALSE) {
399  DEBUG(DEFAULT_MESSAGES, "Received EOS 2\n");
400  }
401  if(isPortDisabled[2] == OMX_FALSE) {
403  DEBUG(DEFAULT_MESSAGES, "Received EOS 3\n");
404  }
405  if(isPortDisabled[3] == OMX_FALSE) {
407  DEBUG(DEFAULT_MESSAGES, "Received EOS 4\n");
408  }
409 
411  /* Wait for commands to complete */
413 
415  for(j=0; j<index_files; j++) {
416  if(isPortDisabled[j] == OMX_FALSE) {
418  err = OMX_FreeBuffer(appPriv->handle, j, inBuffer[j*2+1]);
419  }
420  }
421 
422  for(j=0;j<BUFFER_COUNT_ACTUAL;j++) {
424  }
425 
426  /* Wait for commands to complete */
428 
430 
431  free(appPriv->eventSem);
432  free(appPriv);
433 
434  if (flagOutputReceived) {
435  if(fclose(outfile) != 0) {
436  DEBUG(DEB_LEV_ERR,"Error in closing output file\n");
437  exit(1);
438  }
439  free(output_file);
440  }
441  for (i = 0; i<index_files; i++) {
442  close(fd[i]);
443  free(input_file[i]);
444  }
445 
446  return 0;
447 }
448 
449 /* Callbacks implementation */
451  OMX_HANDLETYPE hComponent,
452  OMX_PTR pAppData,
453  OMX_EVENTTYPE eEvent,
454  OMX_U32 Data1,
455  OMX_U32 Data2,
456  OMX_PTR pEventData) {
457 
458  DEBUG(DEB_LEV_SIMPLE_SEQ, "Hi there, I am in the %s callback\n", __func__);
459  if(eEvent == OMX_EventCmdComplete) {
460  if (Data1 == OMX_CommandStateSet) {
461  DEBUG(DEB_LEV_SIMPLE_SEQ, "Volume Component State changed in ");
462  switch ((int)Data2) {
463  case OMX_StateInvalid:
464  DEBUG(DEB_LEV_SIMPLE_SEQ, "OMX_StateInvalid\n");
465  break;
466  case OMX_StateLoaded:
467  DEBUG(DEB_LEV_SIMPLE_SEQ, "OMX_StateLoaded\n");
468  break;
469  case OMX_StateIdle:
470  DEBUG(DEB_LEV_SIMPLE_SEQ, "OMX_StateIdle\n");
471  break;
472  case OMX_StateExecuting:
473  DEBUG(DEB_LEV_SIMPLE_SEQ, "OMX_StateExecuting\n");
474  break;
475  case OMX_StatePause:
476  DEBUG(DEB_LEV_SIMPLE_SEQ, "OMX_StatePause\n");
477  break;
479  DEBUG(DEB_LEV_SIMPLE_SEQ, "OMX_StateWaitForResources\n");
480  break;
481  }
483  } else if (Data1 == OMX_CommandPortEnable){
485  } else if (Data1 == OMX_CommandPortDisable){
487  }
488  } else if(eEvent == OMX_EventBufferFlag) {
489  DEBUG(DEB_LEV_SIMPLE_SEQ, "OMX_EventBufferFlag\n");
490  if((int)Data2 == OMX_BUFFERFLAG_EOS) {
492  }
493  } else {
494  DEBUG(DEB_LEV_SIMPLE_SEQ, "Param1 is %i\n", (int)Data1);
495  DEBUG(DEB_LEV_SIMPLE_SEQ, "Param2 is %i\n", (int)Data2);
496  }
497 
498  return OMX_ErrorNone;
499 }
500 
502  OMX_HANDLETYPE hComponent,
503  OMX_PTR pAppData,
504  OMX_BUFFERHEADERTYPE* pBuffer) {
505 
506  int data_read;
507 
508 
509  DEBUG(DEB_LEV_FULL_SEQ, "Hi there, I am in the %s callback from the port %i\n", __func__, (int)pBuffer->nInputPortIndex);
510 
511  if(isPortDisabled[pBuffer->nInputPortIndex] == OMX_FALSE) {
512  data_read = read(fd[pBuffer->nInputPortIndex], pBuffer->pBuffer, FRAME_SIZE);
513  pBuffer->nFilledLen = data_read;
514  pBuffer->nOffset = 0;
515  filesize[pBuffer->nInputPortIndex] -= data_read;
516  DEBUG(DEB_LEV_SIMPLE_SEQ, "Sending from file %i data read=%d\n", (int)pBuffer->nInputPortIndex, data_read);
517  if (data_read <= 0) {
518  DEBUG(DEB_LEV_SIMPLE_SEQ, "In the %s no more input data available\n", __func__);
519  ++iBufferDropped[pBuffer->nInputPortIndex];
520  if(iBufferDropped[pBuffer->nInputPortIndex]==2) {
521  DEBUG(DEB_LEV_SIMPLE_SEQ, "In %s Dropping Empty This buffer to Audio Mixer Stream %i\n", __func__, (int)pBuffer->nInputPortIndex);
522  return OMX_ErrorNone;
523  } else if(iBufferDropped[pBuffer->nInputPortIndex]>2) {
524  DEBUG(DEB_LEV_SIMPLE_SEQ, "In %s Dropping Empty This buffer to Audio Mixer Stream %i\n", __func__, (int)pBuffer->nInputPortIndex);
525  return OMX_ErrorNone;
526  }
527  pBuffer->nFilledLen=0;
528  pBuffer->nFlags = OMX_BUFFERFLAG_EOS;
529  bEOS[pBuffer->nInputPortIndex]=OMX_TRUE;
530  DEBUG(DEB_LEV_SIMPLE_SEQ, "In %s Sending EOS for Stream %i\n", __func__, (int)pBuffer->nInputPortIndex);
531  OMX_EmptyThisBuffer(hComponent, pBuffer);
532  return OMX_ErrorNone;
533  }
534  } else {
535  ++iBufferDropped[pBuffer->nInputPortIndex];
536  return OMX_ErrorNone;
537  }
538  if(!bEOS[pBuffer->nInputPortIndex]) {
539  DEBUG(DEB_LEV_FULL_SEQ, "Empty buffer %p\n", pBuffer);
540  OMX_EmptyThisBuffer(hComponent, pBuffer);
541  }else {
542  DEBUG(DEB_LEV_FULL_SEQ, "In %s Dropping Empty This buffer to Audio Mixer\n", __func__);
543  }
544 
545  return OMX_ErrorNone;
546 }
547 
549  OMX_HANDLETYPE hComponent,
550  OMX_PTR pAppData,
551  OMX_BUFFERHEADERTYPE* pBuffer) {
552 
553  int i;
554 
555  DEBUG(DEB_LEV_FULL_SEQ, "Hi there, I am in the %s callback. Got buflen %i for buffer at 0x%p\n",
556  __func__, (int)pBuffer->nFilledLen, pBuffer);
557 
558  /* Output data to standard output */
559  if(pBuffer != NULL) {
560  if (pBuffer->nFilledLen == 0) {
561  DEBUG(DEB_LEV_ERR, "Ouch! In %s: no data in the output buffer!\n", __func__);
562  return OMX_ErrorNone;
563  }
564  if (flagOutputReceived) {
565  if(pBuffer->nFilledLen > 0) {
566  fwrite(pBuffer->pBuffer, 1, pBuffer->nFilledLen, outfile);
567  }
568  } else {
569  for(i=0;i<pBuffer->nFilledLen;i++) {
570  putchar(*(char*)(pBuffer->pBuffer + i));
571  }
572  }
573  pBuffer->nFilledLen = 0;
574  /* Reschedule the fill buffer request */
575  if(!bEOS[0] || !bEOS[1] || !bEOS[2] || !bEOS[3]) {
576  OMX_FillThisBuffer(hComponent, pBuffer);
577  } else {
578  DEBUG(DEB_LEV_FULL_SEQ, "In %s Dropping Fill This buffer to Audio Mixer\n", __func__);
579  }
580  } else {
581  DEBUG(DEB_LEV_ERR, "Ouch! In %s: had NULL buffer to output...\n", __func__);
582  }
583  return OMX_ErrorNone;
584 }
585 
590 static int getFileSize(int fd) {
591 
592  struct stat input_file_stat;
593  int err;
594 
595  /* Obtain input file length */
596  err = fstat(fd, &input_file_stat);
597  if(err){
598  DEBUG(DEB_LEV_ERR, "fstat failed");
599  exit(-1);
600  }
601  return input_file_stat.st_size;
602 }
OMX_GetParameter
#define OMX_GetParameter( hComponent, nParamIndex, pComponentParameterStructure)
Definition: OMX_Core.h:786
OMX_VERSIONTYPE::nRevision
OMX_U8 nRevision
Definition: OMX_Types.h:334
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:479
OMX_AUDIO_CONFIG_VOLUMETYPE::sVolume
OMX_BS32 sVolume
Definition: OMX_Audio.h:1018
OMX_StatePause
Definition: OMX_Core.h:107
DEB_LEV_FULL_SEQ
#define DEB_LEV_FULL_SEQ
Definition: omx_comp_debug_levels.h:54
omxaudiomixertest.h
BUFFER_COUNT_ACTUAL
#define BUFFER_COUNT_ACTUAL
Definition: omxaudiomixertest.c:30
OMX_IndexParamAudioInit
Definition: OMX_Index.h:64
OMX_ERRORTYPE
OMX_ERRORTYPE
Definition: OMX_Core.h:126
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
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
Definition: OMX_Index.h:128
audiomixerEmptyBufferDone
OMX_ERRORTYPE audiomixerEmptyBufferDone(OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_BUFFERHEADERTYPE *pBuffer)
Definition: omxaudiomixertest.c:501
flagIsGain
int flagIsGain[4]
Definition: omxaudiomixertest.c:69
OMX_CALLBACKTYPE
Definition: OMX_Core.h:497
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
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:450
OMX_BUFFERHEADERTYPE::nFilledLen
OMX_U32 nFilledLen
Definition: OMX_Core.h:405
OMX_VERSIONTYPE::nVersionMinor
OMX_U8 nVersionMinor
Definition: OMX_Types.h:333
OMX_HANDLETYPE
void * OMX_HANDLETYPE
Definition: OMX_Types.h:295
appPrivateType
Definition: omxaudiomixertest.h:54
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
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
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_VERSIONTYPE::s
struct OMX_VERSIONTYPE::@1 s
OMX_BUFFERHEADERTYPE::nInputPortIndex
OMX_U32 nInputPortIndex
Definition: OMX_Core.h:441
OMX_VERSIONTYPE::nStep
OMX_U8 nStep
Definition: OMX_Types.h:335
OMX_VERSIONTYPE
Definition: OMX_Types.h:328
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
Definition: OMX_Core.h:485
OMX_VERSIONTYPE::nVersionMajor
OMX_U8 nVersionMajor
Definition: OMX_Types.h:332
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
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
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:548
display_help
void display_help()
Definition: omxaudiomixertest.c:48
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:398
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
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
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
Definition: OMX_Core.h:53
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