28 #include <bellagio/extension_struct.h> 54 printf(
"Usage: omxvolcontroltest [-o outfile] [-g gain] filename\n");
56 printf(
" -o outfile: If this option is specified, the output stream is written to outfile\n");
57 printf(
" otherwise redirected to std output\n");
58 printf(
" -g: Gain of PCM data [0...100]\n");
59 printf(
" -h: Displays this help\n");
72 int main(
int argc,
char** argv) {
95 while (argn_dec<argc) {
96 if (*(argv[argn_dec]) ==
'-') {
100 switch (*(argv[argn_dec]+1)) {
115 gain = (int)atoi(argv[argn_dec]);
127 input_file = malloc(strlen(argv[argn_dec]) + 1);
147 perror(
"Error opening input file\n");
198 if((gain >= 0) && (gain <100)) {
242 inBuffer1 = inBuffer2 = outBuffer1 = outBuffer2 = NULL;
350 switch ((
int)Data2) {
394 static int iBufferDropped=0;
401 if (data_read <= 0) {
404 if(iBufferDropped>=2) {
436 if(pBuffer != NULL) {
438 DEBUG(
DEB_LEV_ERR,
"Ouch! In %s: no data in the output buffer!\n", __func__);
447 putchar(*(
char*)(pBuffer->
pBuffer + i));
452 DEBUG(
DEB_LEV_ERR,
"Ouch! In %s: had NULL buffer to output...\n", __func__);
465 static int getFileSize(
int fd) {
467 struct stat input_file_stat;
471 err = fstat(
fd, &input_file_stat);
476 return input_file_stat.st_size;
#define OMX_AllocateBuffer( hComponent, ppBuffer, nPortIndex, pAppPrivate, nSizeBytes)
#define DEB_LEV_SIMPLE_SEQ
OMX_ERRORTYPE volcEmptyBufferDone(OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_BUFFERHEADERTYPE *pBuffer)
OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Init(void)
The OMX_Init standard function.
#define DEBUG(n, fmt, args...)
struct OMX_VERSIONTYPE::@1 s
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)
int main(int argc, char **argv)
void tsem_up(tsem_t *tsem)
void setHeader(OMX_PTR header, OMX_U32 size)
Simply fills the first two fields in any OMX structure with the size and the version.
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)
#define OMX_GetExtensionIndex( hComponent, cParameterName, pIndexType)
OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_FreeHandle(OMX_IN OMX_HANDLETYPE hComponent)
#define OMX_BUFFERFLAG_EOS
OMX_CALLBACKTYPE callbacks
long int nThreadBufferMngtID
OMX_ERRORTYPE volcFillBufferDone(OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_BUFFERHEADERTYPE *pBuffer)
OMX_U32 nBufferCountActual
int tsem_init(tsem_t *tsem, unsigned int val)
OMX_ERRORTYPE volcEventHandler(OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_EVENTTYPE eEvent, OMX_U32 Data1, OMX_U32 Data2, OMX_PTR pEventData)
#define OMX_SetParameter( hComponent, nParamIndex, pComponentParameterStructure)
#define OMX_SendCommand( hComponent, Cmd, nParam, pCmdData)
#define OMX_GetParameter( hComponent, nParamIndex, pComponentParameterStructure)
#define OMX_GetConfig( hComponent, nConfigIndex, pComponentConfigStructure)
long int nThreadMessageID
#define OMX_SetConfig( hComponent, nConfigIndex, pComponentConfigStructure)
#define OMX_FreeBuffer( hComponent, nPortIndex, pBuffer)
#define OMX_EmptyThisBuffer( hComponent, pBuffer)
#define OMX_FillThisBuffer( hComponent, pBuffer)