Lines Matching refs:pComponentPrivate

121     WMADEC_COMPONENT_PRIVATE *pComponentPrivate, *pComponentPrivate_CC;
123 pComponentPrivate = pComponent->pComponentPrivate;
124 pComponentPrivate_CC = pComponentPrivate;
127 OMX_PRINT2(pComponentPrivate->dbg, "[WMADECFill_LCMLInitParams] pComponent = %p",pComponent);
128 OMX_PRINT2(pComponentPrivate->dbg, "[WMADECFill_LCMLInitParams] pComponentPrivate = %p",
129 pComponentPrivate);
130 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Entered WMADECFill_LCMLInitParams",__LINE__);
131 OMX_PRINT2(pComponentPrivate->dbg, "%d :: WMADECFill_LCMLInitParams - pComponentPrivate = %p",
132 __LINE__,pComponentPrivate);
133 OMX_PRINT2(pComponentPrivate->dbg, "%d :: WMADECFill_LCMLInitParams - pHandle = %p",__LINE__,
136 nIpBuf = pComponentPrivate->pInputBufferList->numBuffers;
137 pComponentPrivate->nRuntimeInputBuffers = nIpBuf;
139 nOpBuf = pComponentPrivate->pOutputBufferList->numBuffers;
140 pComponentPrivate->nRuntimeOutputBuffers = nOpBuf;
141 nOpBufSize = pComponentPrivate->pPortDef[OUTPUT_PORT]->nBufferSize;
171 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Comp: OMX_WmaDecUtils.c",__LINE__);
174 OMX_MALLOC_SIZE_DSPALIGN(pComponentPrivate->pDynParams, sizeof(WMADEC_UALGParams), WMADEC_UALGParams);
176 pComponentPrivate->first_buffer=1;
180 OMX_MALLOC_SIZE_DSPALIGN(pComponentPrivate->pParams, sizeof(WMADEC_AudioCodecParams), WMADEC_AudioCodecParams);
183 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d:[ALLOC] %p",__LINE__,strmAttr);
187 OMX_ERROR4(pComponentPrivate->dbg, "strmAttr - failed to malloc");
192 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d:[ALLOC] %p",__LINE__,strmAttr);
193 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Comp: OMX_WmaDecUtils.c",__LINE__);
198 strmAttr->uBufsize = pComponentPrivate->pPortDef[OUTPUT_PORT]->nBufferSize;
201 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Comp: OMX_WmaDecUtils.c",__LINE__);
208 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Comp: OMX_WmaDecUtils.c",__LINE__);
216 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Comp: OMX_WmaDecUtils.c",__LINE__);
219 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Comp: OMX_WmaDecUtils.c",__LINE__);
225 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Comp: OMX_WmaDecUtils.c",__LINE__);
248 OMX_PRDSP2(pComponentPrivate->dbg, "FILE MODE");
259 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Comp: OMX_WmaDecUtils.c",__LINE__);
262 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Comp: OMX_WmaDecUtils.c",__LINE__);
269 OMX_PRINT2(pComponentPrivate->dbg, "arr[%d] = %d",i,arr[i]);
278 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Comp: OMX_WmaDecUtils.c",__LINE__);
281 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d:[ALLOC] %p",__LINE__,pTemp_lcml);
282 OMX_PRDSP2(pComponentPrivate->dbg, "Line %d::pTemp_lcml = %p",__LINE__,pTemp_lcml);
292 OMX_PRBUFFER2(pComponentPrivate->dbg, "nIpBuf = %ld",nIpBuf);
308 pTemp->pPlatformPrivate = pHandle->pComponentPrivate;
336 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d:[ALLOC] %p",__LINE__,pTemp_lcml);
358 pTemp->pPlatformPrivate = pHandle->pComponentPrivate;
377 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Exiting WMADECFill_LCMLInitParams",__LINE__);
404 WMADEC_COMPONENT_PRIVATE *pComponentPrivate =
405 (WMADEC_COMPONENT_PRIVATE *)pHandle->pComponentPrivate;
413 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Inside WMADEC_StartComponentThread", __LINE__);
415 pComponentPrivate->bIsStopping = 0;
416 pComponentPrivate->bIsEOFSent = 0;
420 OMX_PRINT2(pComponentPrivate->dbg, "WMADEC_StartComponentThread pComponentPrivate = %p",
421 pComponentPrivate);
423 eError = pipe (pComponentPrivate->cmdDataPipe);
431 eError = pipe (pComponentPrivate->dataPipe);
439 eError = pipe (pComponentPrivate->cmdPipe);
448 eError = pthread_create (&(pComponentPrivate->ComponentThread), &attr,
449 WMADEC_ComponentThread, pComponentPrivate);
451 eError = pthread_create (&(pComponentPrivate->ComponentThread), NULL,
452 WMADEC_ComponentThread, pComponentPrivate);
454 if (eError || !pComponentPrivate->ComponentThread)
459 pComponentPrivate->bCompThreadStarted = 1;
462 pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
463 pComponentPrivate->pHandle->pApplicationPrivate,
490 WMADEC_COMPONENT_PRIVATE *pComponentPrivate = (WMADEC_COMPONENT_PRIVATE *)
491 pHandle->pComponentPrivate;
498 OMX_PRINT1(pComponentPrivate->dbg, "%d :: WMADEC_FreeCompResources", __LINE__);
500 OMX_PRBUFFER1(pComponentPrivate->dbg, "%d:::pComponentPrivate->bPortDefsAllocated = %ld",
501 __LINE__,pComponentPrivate->bPortDefsAllocated);
502 if (pComponentPrivate->bPortDefsAllocated)
504 nIpBuf = pComponentPrivate->pPortDef[INPUT_PORT]->nBufferCountActual;
505 nOpBuf = pComponentPrivate->pPortDef[OUTPUT_PORT]->nBufferCountActual;
508 if (pComponentPrivate->bCompThreadStarted)
510 err = close (pComponentPrivate->dataPipe[0]);
517 err = close (pComponentPrivate->dataPipe[1]);
523 err = close (pComponentPrivate->cmdPipe[0]);
529 err = close (pComponentPrivate->cmdPipe[1]);
535 OMX_PRINT1(pComponentPrivate->dbg, "%d:::[WMADEC_FreeCompResources] ", __LINE__);
536 err = close (pComponentPrivate->cmdDataPipe[0]);
537 OMX_PRINT1(pComponentPrivate->dbg, "%d:::[WMADEC_FreeCompResources] ", __LINE__);
540 OMX_PRINT1(pComponentPrivate->dbg, "%d:::[WMADEC_FreeCompResources] ", __LINE__);
542 OMX_ERROR2(pComponentPrivate->dbg, "%d :: Error while closing cmdPipe",__LINE__);
545 OMX_PRINT1(pComponentPrivate->dbg, "%d:::[WMADEC_FreeCompResources] ", __LINE__);
546 err = close (pComponentPrivate->cmdDataPipe[1]);
547 OMX_PRINT1(pComponentPrivate->dbg, "%d:::[WMADEC_FreeCompResources] ", __LINE__);
550 OMX_PRINT1(pComponentPrivate->dbg, "%d:::[WMADEC_FreeCompResources] ", __LINE__);
552 OMX_ERROR2(pComponentPrivate->dbg, "%d :: Error while closing cmdPipe",__LINE__);
557 if (pComponentPrivate->bPortDefsAllocated)
559 OMX_PRINT1(pComponentPrivate->dbg, "%d:::[WMADEC_FreeCompResources] ", __LINE__);
560 if (pComponentPrivate->pPortDef[INPUT_PORT])
562 OMX_PRINT1(pComponentPrivate->dbg, "%d:::[WMADEC_FreeCompResources] ", __LINE__);
563 OMX_PRCOMM2(pComponentPrivate->dbg, "freeing pComponentPrivate->pPortDef[INPUT_PORT] = \
564 %p",pComponentPrivate->pPortDef[INPUT_PORT]);
565 OMX_MEMFREE_STRUCT(pComponentPrivate->pPortDef[INPUT_PORT]);
567 OMX_PRINT1(pComponentPrivate->dbg, "%d:::[WMADEC_FreeCompResources] ", __LINE__);
569 if (pComponentPrivate->pPortDef[OUTPUT_PORT])
571 OMX_PRINT1(pComponentPrivate->dbg, "%d:::[WMADEC_FreeCompResources] ", __LINE__);
572 OMX_PRCOMM2(pComponentPrivate->dbg, "pComponentPrivate->pPortDef[OUTPUT_PORT] = %p",
573 pComponentPrivate->pPortDef[OUTPUT_PORT]);
574 OMX_MEMFREE_STRUCT(pComponentPrivate->pPortDef[OUTPUT_PORT]);
577 if (pComponentPrivate->wmaParams[INPUT_PORT])
579 OMX_PRCOMM2(pComponentPrivate->dbg, "pComponentPrivate->wmaParams[INPUT_PORT] = %p",
580 pComponentPrivate->wmaParams[INPUT_PORT]);
581 OMX_MEMFREE_STRUCT(pComponentPrivate->wmaParams[INPUT_PORT]);
584 if (pComponentPrivate->wmaParams[OUTPUT_PORT])
586 OMX_PRCOMM2(pComponentPrivate->dbg, "pComponentPrivate->wmaParams[OUTPUT_PORT] = %p",
587 pComponentPrivate->wmaParams[OUTPUT_PORT]);
588 OMX_PRCOMM2(pComponentPrivate->dbg, "wmaParams[OUTPUT_PORT]->nPortIndex = %ld",
589 pComponentPrivate->wmaParams[OUTPUT_PORT]->nPortIndex);
590 OMX_MEMFREE_STRUCT(pComponentPrivate->wmaParams[OUTPUT_PORT]);
591 OMX_PRCOMM2(pComponentPrivate->dbg, "after pComponentPrivate->wmaParams[OUTPUT_PORT] = \
592 %p",pComponentPrivate->wmaParams[OUTPUT_PORT]);
595 pComponentPrivate->bPortDefsAllocated = 0;
597 OMX_PRDSP2(pComponentPrivate->dbg, "\n\n FreeCompResources: Destroying mutexes.\n");
598 pthread_mutex_destroy(&pComponentPrivate->InLoaded_mutex);
599 pthread_cond_destroy(&pComponentPrivate->InLoaded_threshold);
601 pthread_mutex_destroy(&pComponentPrivate->InIdle_mutex);
602 pthread_cond_destroy(&pComponentPrivate->InIdle_threshold);
604 pthread_mutex_destroy(&pComponentPrivate->AlloBuf_mutex);
605 pthread_cond_destroy(&pComponentPrivate->AlloBuf_threshold);
607 OMX_DestroyEvent(&(pComponentPrivate->InLoaded_event));
608 OMX_DestroyEvent(&(pComponentPrivate->InIdle_event));
609 OMX_DestroyEvent(&(pComponentPrivate->AlloBuf_event));
613 OMX_PRINT1(pComponentPrivate->dbg, "Exiting Successfully WMADEC_FreeCompResources()");
637 WMADEC_COMPONENT_PRIVATE *pComponentPrivate = (WMADEC_COMPONENT_PRIVATE *)
638 pHandle->pComponentPrivate;
646 OMX_MEMFREE_STRUCT(pComponentPrivate->strmAttr);
648 OMX_MEMFREE_STRUCT_DSPALIGN(pComponentPrivate->pDynParams, WMADEC_UALGParams);
650 if (pComponentPrivate->dasfmode == 1)
652 OMX_MEMFREE_STRUCT_DSPALIGN(pComponentPrivate->pParams, WMADEC_AudioCodecParams);
655 nIpBuf = pComponentPrivate->nRuntimeInputBuffers;
657 pTemp_lcml = pComponentPrivate->pLcmlBufHeader[INPUT_PORT];
662 OMX_PRDSP2(pComponentPrivate->dbg, "freeing pTemp_lcml->pIpParam = %p", pTemp_lcml->pIpParam);
667 OMX_PRCOMM2(pComponentPrivate->dbg, "freeing pComponentPrivate->pLcmlBufHeader[INPUT_PORT] = %p",
668 pComponentPrivate->pLcmlBufHeader[INPUT_PORT]);
670 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d:[FREE] %p",__LINE__,
671 pComponentPrivate->pLcmlBufHeader[INPUT_PORT]);
673 OMX_MEMFREE_STRUCT(pComponentPrivate->pLcmlBufHeader[INPUT_PORT]);
674 OMX_PRCOMM2(pComponentPrivate->dbg, "freeing pComponentPrivate->pLcmlBufHeader[OUTPUT_PORT] = %p",
675 pComponentPrivate->pLcmlBufHeader[OUTPUT_PORT]);
677 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d:[FREE] %p",__LINE__,
678 pComponentPrivate->pLcmlBufHeader[OUTPUT_PORT]);
680 OMX_MEMFREE_STRUCT(pComponentPrivate->pLcmlBufHeader[OUTPUT_PORT]);
681 OMX_PRINT1(pComponentPrivate->dbg, "Exiting Successfully WMADEC_CleanupInitParams()");
704 WMADEC_COMPONENT_PRIVATE *pComponentPrivate = (WMADEC_COMPONENT_PRIVATE *)
705 pHandle->pComponentPrivate;
712 pComponentPrivate->bIsStopping = 1;
713 write (pComponentPrivate->cmdPipe[1], &pComponentPrivate->bIsStopping, sizeof(OMX_U16));
714 OMX_PRINT1(pComponentPrivate->dbg, "%d:::About to call pthread_join",__LINE__);
715 pthreadError = pthread_join (pComponentPrivate->ComponentThread,
717 OMX_PRDSP2(pComponentPrivate->dbg, "%d:::called pthread_join",__LINE__);
721 OMX_ERROR2(pComponentPrivate->dbg, "%d :: Error while closing Component Thread - pthreadError = %d",
729 OMX_ERROR2(pComponentPrivate->dbg, "%d :: Error while closing Component Thread",__LINE__);
731 OMX_PRINT1(pComponentPrivate->dbg, "Exiting Successfully from Stop Component thread");
741 * @param pComponentPrivate Component private data
751 OMX_U32 WMADECHandleCommand (WMADEC_COMPONENT_PRIVATE *pComponentPrivate)
763 OMX_COMPONENTTYPE *pHandle = (OMX_COMPONENTTYPE *) pComponentPrivate->pHandle;
764 pLcmlHandle = (LCML_DSP_INTERFACE *) pComponentPrivate->pLcmlHandle;
766 OMX_PRINT1(pComponentPrivate->dbg, "WMADECHandleCommand");
767 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Entering WMADECHandleCommand Function - curState = %d",
768 __LINE__,pComponentPrivate->curState);
769 read (pComponentPrivate->cmdPipe[0], &command, sizeof (command));
771 pComponentPrivate->cbInfo.EventHandler (pHandle,
778 OMX_PRCOMM2(pComponentPrivate->dbg, "%d :: Just read from the command pipe",__LINE__);
779 OMX_PRCOMM2(pComponentPrivate->dbg, "%d :: command = %d",__LINE__,command);
780 read (pComponentPrivate->cmdDataPipe[0], &commandData, sizeof (commandData));
782 pComponentPrivate->cbInfo.EventHandler (pHandle,
790 OMX_PRCOMM2(pComponentPrivate->dbg, "%d :: command = %d",__LINE__,command);
791 OMX_PRCOMM2(pComponentPrivate->dbg, "%d :: commandData = %ld",__LINE__,commandData);
794 PERF_ReceivedCommand(pComponentPrivate->pPERFcomp,
807 eError = WMADEC_CommandToIdle(pComponentPrivate);
812 eError = WMADEC_CommandToExecuting(pComponentPrivate);
817 eError = WMADEC_CommandToLoaded(pComponentPrivate);
822 eError = WMADEC_CommandToPause(pComponentPrivate);
828 eError = WMADEC_CommandToWaitForResources(pComponentPrivate);
834 OMX_PRSTATE2(pComponentPrivate->dbg, "%d: WMADECHandleCommand: Cmd OMX_StateInvalid:",
837 if (pComponentPrivate->curState == commandedState)
839 pComponentPrivate->cbInfo.EventHandler (pHandle,
845 OMX_ERROR2(pComponentPrivate->dbg, "%d :: Error: Same State Given by Application",
850 if (pComponentPrivate->curState != OMX_StateWaitForResources &&
851 pComponentPrivate->curState != OMX_StateInvalid &&
852 pComponentPrivate->curState != OMX_StateLoaded)
858 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Comp: OMX_WmaDecUtils.c",__LINE__);
859 pComponentPrivate->curState = OMX_StateInvalid;
861 pComponentPrivate->cbInfo.EventHandler(pHandle,
873 OMX_PRSTATE2(pComponentPrivate->dbg, "%d: WMADECHandleCommand: Cmd OMX_StateMax::",
877 OMX_PRSTATE2(pComponentPrivate->dbg, "%d: WMADECHandleCommand: Cmd Unknown::",
885 OMX_PRBUFFER2(pComponentPrivate->dbg, "command OMX_CommandMarkBuffer received %d",__LINE__);
886 if(!pComponentPrivate->pMarkBuf)
888 OMX_PRBUFFER2(pComponentPrivate->dbg, "command OMX_CommandMarkBuffer received %d",__LINE__);
890 pComponentPrivate->pMarkBuf = (OMX_MARKTYPE *)(commandData);
895 if (!pComponentPrivate->bDisableCommandPending)
898 for (i=0; i < pComponentPrivate->pInputBufferList->numBuffers; i++) {
899 OMX_PRBUFFER2(pComponentPrivate->dbg, "pComponentPrivate->pInputBufferList->bBufferPending[%d] = %ld",i,
900 pComponentPrivate->pInputBufferList->bBufferPending[i]);
901 if (WMADEC_IsPending(pComponentPrivate,pComponentPrivate->pInputBufferList->pBufHdr[i],OMX_DirInput)) {
904 OMX_PRBUFFER2(pComponentPrivate->dbg, "Forcing EmptyBufferDone");
906 PERF_SendingFrame(pComponentPrivate->pPERFcomp,
907 PREF(pComponentPrivate->pInputBufferList->pBufHdr[i], pBuffer),
911 pComponentPrivate->cbInfo.EmptyBufferDone (pComponentPrivate->pHandle,
912 pComponentPrivate->pHandle->pApplicationPrivate,
913 pComponentPrivate->pInputBufferList->pBufHdr[i]);
914 pComponentPrivate->nEmptyBufferDoneCount++;
917 pComponentPrivate->pPortDef[INPUT_PORT]->bEnabled = OMX_FALSE;
922 pComponentPrivate->pPortDef[INPUT_PORT]->bEnabled = OMX_FALSE;
927 pComponentPrivate->pPortDef[OUTPUT_PORT]->bEnabled = OMX_FALSE;
928 if (pComponentPrivate->curState == OMX_StateExecuting)
930 pComponentPrivate->bNoIdleOnStop = OMX_TRUE;
931 if (pComponentPrivate->codecStop_waitingsignal == 0){
932 pthread_mutex_lock(&pComponentPrivate->codecStop_mutex);
937 if (pComponentPrivate->codecStop_waitingsignal == 0){
938 pthread_cond_wait(&pComponentPrivate->codecStop_threshold, &pComponentPrivate->codecStop_mutex);
939 pComponentPrivate->codecStop_waitingsignal = 0;
940 pthread_mutex_unlock(&pComponentPrivate->codecStop_mutex);
944 OMX_PRCOMM2(pComponentPrivate->dbg, "commandData = %ld",commandData);
945 OMX_PRCOMM2(pComponentPrivate->dbg, "pComponentPrivate->pPortDef[INPUT_PORT]->bPopulated = %d",
946 pComponentPrivate->pPortDef[INPUT_PORT]->bPopulated);
947 OMX_PRCOMM2(pComponentPrivate->dbg, "pComponentPrivate->pPortDef[OUTPUT_PORT]->bPopulated = %d",
948 pComponentPrivate->pPortDef[OUTPUT_PORT]->bPopulated);
952 if(!pComponentPrivate->pPortDef[INPUT_PORT]->bPopulated)
955 pComponentPrivate->cbInfo.EventHandler(pHandle,
961 pComponentPrivate->bDisableCommandPending = 0;
965 pComponentPrivate->bDisableCommandPending = 1;
966 pComponentPrivate->bDisableCommandParam = commandData;
972 if (!pComponentPrivate->pPortDef[OUTPUT_PORT]->bPopulated)
975 pComponentPrivate->cbInfo.EventHandler(pHandle,
981 pComponentPrivate->bDisableCommandPending = 0;
985 pComponentPrivate->bDisableCommandPending = 1;
986 pComponentPrivate->bDisableCommandParam = commandData;
991 if (!pComponentPrivate->pPortDef[INPUT_PORT]->bPopulated &&
992 !pComponentPrivate->pPortDef[OUTPUT_PORT]->bPopulated)
996 pComponentPrivate->cbInfo.EventHandler(pHandle,
1003 pComponentPrivate->cbInfo.EventHandler(pHandle,
1009 pComponentPrivate->bDisableCommandPending = 0;
1013 pComponentPrivate->bDisableCommandPending = 1;
1014 pComponentPrivate->bDisableCommandParam = commandData;
1020 if(!pComponentPrivate->bEnableCommandPending){
1024 OMX_PRCOMM2(pComponentPrivate->dbg, "setting input port to enabled");
1025 pComponentPrivate->pPortDef[INPUT_PORT]->bEnabled = OMX_TRUE;
1026 OMX_PRCOMM2(pComponentPrivate->dbg, "pComponentPrivate->pPortDef[INPUT_PORT]->bEnabled = %d",
1027 pComponentPrivate->pPortDef[INPUT_PORT]->bEnabled);
1033 pComponentPrivate->pPortDef[OUTPUT_PORT]->bEnabled = OMX_TRUE;
1034 OMX_PRCOMM2(pComponentPrivate->dbg, "pComponentPrivate->pPortDef[OUTPUT_PORT]->bEnabled = %d",
1035 pComponentPrivate->pPortDef[OUTPUT_PORT]->bEnabled);
1037 if (pComponentPrivate->curState == OMX_StateExecuting && pComponentPrivate->bDspStoppedWhileExecuting){
1038 pComponentPrivate->bDspStoppedWhileExecuting = OMX_FALSE;
1047 OMX_PRSTATE2(pComponentPrivate->dbg, "commandData = %ld",commandData);
1048 OMX_PRSTATE2(pComponentPrivate->dbg, "pComponentPrivate->curState = %d",
1049 pComponentPrivate->curState);
1050 OMX_PRCOMM2(pComponentPrivate->dbg, "pComponentPrivate->pPortDef[INPUT_PORT]->bPopulated = %d",
1051 pComponentPrivate->pPortDef[INPUT_PORT]->bPopulated);
1054 if(pComponentPrivate->curState == OMX_StateLoaded ||
1055 pComponentPrivate->pPortDef[INPUT_PORT]->bPopulated)
1057 if(pComponentPrivate->AlloBuf_waitingsignal)
1059 pthread_mutex_lock(&pComponentPrivate->AlloBuf_mutex);
1060 pComponentPrivate->AlloBuf_waitingsignal = 0;
1061 pthread_cond_signal(&pComponentPrivate->AlloBuf_threshold);
1062 pthread_mutex_unlock(&pComponentPrivate->AlloBuf_mutex);
1064 pComponentPrivate->cbInfo.EventHandler(pHandle,
1069 pComponentPrivate->bEnableCommandPending = 0;
1073 pComponentPrivate->bEnableCommandPending = 1;
1074 pComponentPrivate->bEnableCommandParam = commandData;
1079 if(pComponentPrivate->curState ==
1081 pComponentPrivate->pPortDef[OUTPUT_PORT]->bPopulated)
1083 if(pComponentPrivate->AlloBuf_waitingsignal){
1084 pthread_mutex_lock(&pComponentPrivate->AlloBuf_mutex);
1085 pComponentPrivate->AlloBuf_waitingsignal = 0;
1086 pthread_cond_signal(&pComponentPrivate->AlloBuf_threshold);
1087 pthread_mutex_unlock(&pComponentPrivate->AlloBuf_mutex);
1089 pComponentPrivate->cbInfo.EventHandler(pHandle,
1094 if(pComponentPrivate->reconfigOutputPort){
1095 pComponentPrivate->reconfigOutputPort = 0;
1099 OMX_PRBUFFER2(pComponentPrivate->dbg, "pComponentPrivate->nNumInputBufPending=%ld",pComponentPrivate->nNumInputBufPending);
1100 for (i=0; i < pComponentPrivate->nNumInputBufPending; i++){
1101 if (pComponentPrivate->pInputBufHdrPending[i]){
1103 if (!WMADEC_IsPending(pComponentPrivate,
1104 pComponentPrivate->pInputBufHdrPending[i],
1107 pComponentPrivate,
1108 pComponentPrivate->pInputBufHdrPending[i]->pBuffer,
1111 WMADEC_SetPending(pComponentPrivate,
1112 pComponentPrivate->pInputBufHdrPending[i],
1114 OMX_PRBUFFER2(pComponentPrivate->dbg, "QUEUEING INPUT BUFFER");
1115 OMX_PRBUFFER2(pComponentPrivate->dbg, "nfilledLen= %ld",pComponentPrivate->pInputBufHdrPending[i]->nFilledLen);
1118 (OMX_U8 *)pComponentPrivate->pInputBufHdrPending[i]->pBuffer,
1119 pComponentPrivate->pInputBufHdrPending[i]->nAllocLen,
1120 pComponentPrivate->pInputBufHdrPending[i]->nFilledLen,
1126 OMX_ERROR4(pComponentPrivate->dbg, "ERROR IN QUEUEBUFFER");
1130 pComponentPrivate->lcml_nCntIp++;
1135 pComponentPrivate->nNumInputBufPending=0;
1136 pComponentPrivate->bEnableCommandPending = 0;
1140 pComponentPrivate->bEnableCommandPending = 1;
1141 pComponentPrivate->bEnableCommandParam = commandData;
1146 if(pComponentPrivate->curState == OMX_StateLoaded ||
1147 (pComponentPrivate->pPortDef[INPUT_PORT]->bPopulated &&
1148 pComponentPrivate->pPortDef[OUTPUT_PORT]->bPopulated))
1150 if(pComponentPrivate->AlloBuf_waitingsignal)
1152 pthread_mutex_lock(&pComponentPrivate->AlloBuf_mutex);
1153 pComponentPrivate->AlloBuf_waitingsignal = 0;
1154 pthread_cond_signal(&pComponentPrivate->AlloBuf_threshold);
1155 pthread_mutex_unlock(&pComponentPrivate->AlloBuf_mutex);
1157 pComponentPrivate->cbInfo.EventHandler(pHandle,
1163 pComponentPrivate->cbInfo.EventHandler(pHandle,
1169 pComponentPrivate->bEnableCommandPending = 0;
1170 pComponentPrivate->reconfigOutputPort = 0;
1175 pComponentPrivate->bEnableCommandPending = 1;
1176 pComponentPrivate->bEnableCommandParam = commandData;
1185 if (pComponentPrivate->nUnhandledEmptyThisBuffers == 0) {
1186 pComponentPrivate->bFlushInputPortCommandPending = OMX_FALSE;
1192 if (pComponentPrivate->codecFlush_waitingsignal == 0){
1193 pthread_mutex_lock(&pComponentPrivate->codecFlush_mutex);
1198 if (pComponentPrivate->codecFlush_waitingsignal == 0){
1199 pthread_cond_wait(&pComponentPrivate->codecFlush_threshold, &pComponentPrivate->codecFlush_mutex);
1200 pComponentPrivate->codecFlush_waitingsignal = 0;
1201 pthread_mutex_unlock(&pComponentPrivate->codecFlush_mutex);
1207 pComponentPrivate->bFlushInputPortCommandPending = OMX_TRUE;
1215 if (pComponentPrivate->nUnhandledFillThisBuffers == 0) {
1216 pComponentPrivate->bFlushOutputPortCommandPending = OMX_FALSE;
1223 OMX_PRCOMM2(pComponentPrivate->dbg, "Flushing output port");
1224 if (pComponentPrivate->codecFlush_waitingsignal == 0){
1225 pthread_mutex_lock(&pComponentPrivate->codecFlush_mutex);
1230 if (pComponentPrivate->codecFlush_waitingsignal == 0){
1231 pthread_cond_wait(&pComponentPrivate->codecFlush_threshold, &pComponentPrivate->codecFlush_mutex);
1232 pComponentPrivate->codecFlush_waitingsignal = 0;
1233 pthread_mutex_unlock(&pComponentPrivate->codecFlush_mutex);
1239 pComponentPrivate->bFlushOutputPortCommandPending = OMX_TRUE;
1245 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Exiting WMADECHandleCommand Function",__LINE__);
1246 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Returning %d",__LINE__,eError);
1248 pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
1249 pComponentPrivate->pHandle->pApplicationPrivate,
1263 * @param pComponentPrivate Component private data
1275 WMADEC_COMPONENT_PRIVATE *pComponentPrivate)
1277 OMX_PRBUFFER2(pComponentPrivate->dbg, "At handle data buff from app device string is =%p",pComponentPrivate->sDeviceString);
1278 OMX_PRCOMM2(pComponentPrivate->dbg, "At handle databuff from app pComponentPrivate->pPortDef[OUTPUT_PORT]->bPopulated =%d",
1279 pComponentPrivate->pPortDef[OUTPUT_PORT]->bPopulated);
1290 pComponentPrivate_CC = pComponentPrivate;
1291 pLcmlHandle = (LCML_DSP_INTERFACE *)pComponentPrivate->pLcmlHandle;
1293 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Entering WMADECHandleDataBuf_FromApp Function",__LINE__);
1299 OMX_ERROR4(pComponentPrivate->dbg, "%d :: The PBufHeader is not found in the list", __LINE__);
1305 pComponentPrivate->nUnhandledEmptyThisBuffers--;
1306 if (pComponentPrivate->curState == OMX_StateIdle){
1307 pComponentPrivate->cbInfo.EmptyBufferDone (pComponentPrivate->pHandle,
1308 pComponentPrivate->pHandle->pApplicationPrivate,
1310 OMX_PRBUFFER2(pComponentPrivate->dbg, ":: %d %s In idle state return input buffers", __LINE__, __FUNCTION__);
1313 pPortDefIn = pComponentPrivate->pPortDef[OMX_DirInput];
1316 pComponentPrivate->bBypassDSP = 0;
1317 eError = WMADECGetCorresponding_LCMLHeader(pComponentPrivate,
1323 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Error: Invalid Buffer Came ...",__LINE__);
1327 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d Comp:: Sending Filled Input buffer = %p, %p to LCML",
1330 OMX_PRBUFFER2(pComponentPrivate->dbg, "pBufHeader->nFilledLen :%ld ",pBufHeader->nFilledLen);
1334 PERF_SendingFrame(pComponentPrivate->pPERFcomp,
1340 if(pComponentPrivate->SendAfterEOS == 1){
1342 if(pComponentPrivate->dasfmode == 1)
1345 OMX_PRDSP2(pComponentPrivate->dbg, "%d :: ---- Comp: DASF Functionality is ON ---",__LINE__);
1346 if (pComponentPrivate->pHeaderInfo->iChannel == 1)
1348 pComponentPrivate->pParams->iAudioFormat = WMA_MONO_CHANNEL;
1352 pComponentPrivate->pParams->iAudioFormat = WMA_STEREO_NON_INTERLEAVED;
1354 OMX_PRINT1(pComponentPrivate->dbg, "pParams->iAudioFormat = %d", pComponentPrivate->pParams->iAudioFormat);
1355 pComponentPrivate->pParams->iStrmId = pComponentPrivate->streamID;
1356 pComponentPrivate->pParams->iSamplingRate =
1357 pComponentPrivate->pHeaderInfo->iSamplePerSec;
1359 OMX_PRINT1(pComponentPrivate->dbg, "pParams->iSamplingRate = %ld",
1360 pComponentPrivate->pParams->iSamplingRate);
1361 OMX_PRINT1(pComponentPrivate->dbg, "pParams->iStrmId = %ld",
1362 pComponentPrivate->pParams->iStrmId);
1363 OMX_PRINT1(pComponentPrivate->dbg, "pParams->iAudioFormat = %d",
1364 pComponentPrivate->pParams->iAudioFormat);
1367 pValues[1] = (OMX_U32)pComponentPrivate->pParams;
1374 OMX_ERROR4(pComponentPrivate->dbg, "%d: Error Occurred in Codec StreamControl..",
1383 pComponentPrivate->bConfigData = 1; /* changed the if statement to use the buffer flag, now this flag doesnt do anything
1385 OMX_PRCOMM2(pComponentPrivate->dbg, "%d :: UTIL: Before parsing ",__LINE__);
1386 eError=WMADEC_Parser( pBufHeader->pBuffer,pComponentPrivate->rcaheader, pComponentPrivate->dbg);
1387 OMX_PRCOMM2(pComponentPrivate->dbg, "%d :: UTIL: After parsing ", __LINE__);
1390 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Error: Parsing invalid ...",__LINE__);
1394 OMX_ERROR2(pComponentPrivate->dbg, "OLD: pComponentPrivate->wmaParams[OUTPUT_PORT]->nSamplingRate=%ld ",pComponentPrivate->wmaParams[OUTPUT_PORT]->nSamplingRate);
1395 /* if(pComponentPrivate->wma_op->nSamplingRate != iSamplePerSec){
1396 pComponentPrivate->wma_op->nSamplingRate=iSamplePerSec;
1397 pComponentPrivate->reconfigOutputPort=1;
1398 OMX_ERROR4(pComponentPrivate->dbg, "=================RECONFIGURATION NEEDED===============");
1399 OMX_ERROR4(pComponentPrivate->dbg, "NEW: pComponentPrivate->wmaParams[OUTPUT_PORT]->nSamplingRate=%d ",pComponentPrivate->wmaParams[OUTPUT_PORT]->nSamplingRate);
1401 if(pComponentPrivate->wma_op->nChannels != iChannel){
1402 pComponentPrivate->wma_op->nChannels = iChannel;
1403 pComponentPrivate->reconfigOutputPort=1;
1404 OMX_ERROR4(pComponentPrivate->dbg, "=================RECONFIGURATION NEEDED===============");
1406 if(pComponentPrivate->reconfigOutputPort){
1407 pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
1408 pComponentPrivate->pHandle->pApplicationPrivate,
1413 OMX_ERROR4(pComponentPrivate->dbg, "================= sent reconfig event to client==============="); */
1415 pComponentPrivate->cbInfo.EmptyBufferDone (
1416 pComponentPrivate->pHandle,
1417 pComponentPrivate->pHandle->pApplicationPrivate,
1420 pComponentPrivate->nEmptyBufferDoneCount++;
1423 pComponentPrivate->bConfigData = 0;
1427 if( pComponentPrivate->dasfmode )
1429 pComponentPrivate->pDynParams->iOutputFormat = WMA_IAUDIO_BLOCK; /* EAUDIO_BLOCKED */
1433 pComponentPrivate->pDynParams->iOutputFormat = WMA_IAUDIO_INTERLEAVED; /* EAUDIO_INTERLEAVED */
1435 pComponentPrivate->pDynParams->size = sizeof( WMADEC_UALGParams );
1438 cmdValues[1] = (OMX_U32)( pComponentPrivate->pDynParams );
1445 OMX_ERROR4(pComponentPrivate->dbg, "%d: Error Occurred in Codec algctrl..", __LINE__);
1448 pComponentPrivate->bBypassDSP = 0;
1450 eError = LCML_ControlCodec(((LCML_DSP_INTERFACE*)(pComponentPrivate->pLcmlHandle))->pCodecinterfacehandle,
1454 OMX_ERROR4(pComponentPrivate->dbg, "%d: Error Occurred in Codec Start..", __LINE__);
1457 pComponentPrivate->SendAfterEOS = 0;
1461 pComponentPrivate->SendAfterEOS = 1;
1462 pComponentPrivate->InputEosSet = 1;
1463 pComponentPrivate->pOutputBufferList->EosFlagSent = 0;
1464 OMX_PRINT1(pComponentPrivate->dbg, "%d :: OMX_WmaDec_Utils.c : pComponentPrivate->SendAfterEOS %d",__LINE__,pComponentPrivate->SendAfterEOS);
1467 pComponentPrivate->arrBufIndexTick[pComponentPrivate->IpBufindex] = pBufHeader->nTickCount;
1469 pComponentPrivate->arrBufIndex[pComponentPrivate->IpBufindex] = pBufHeader->nTimeStamp;
1470 pComponentPrivate->IpBufindex++;
1471 pComponentPrivate->IpBufindex %= pComponentPrivate->pPortDef[OUTPUT_PORT]->nBufferCountActual;
1472 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d :: Output Buffer TimeStamp %lld", __LINE__, pComponentPrivate->arrBufIndex[pComponentPrivate->IpBufindex]);
1474 if(pComponentPrivate->first_buffer)
1476 pComponentPrivate->rcaheader->iPayload=pBufHeader->nFilledLen;
1477 pComponentPrivate->rcaheader->iMaxPacketSize = pComponentPrivate->rcaheader->iPayload+31;
1480 memcpy(pBufHeader->pBuffer + 16, &pComponentPrivate->rcaheader->iMaxPacketSize, 2);
1481 memcpy(pBufHeader->pBuffer + 36, &pComponentPrivate->rcaheader->iTypeSpecific, 4);
1482 memcpy(pBufHeader->pBuffer + 42, &pComponentPrivate->rcaheader->iFormatTag, 2);
1483 memcpy(pBufHeader->pBuffer + 44, &pComponentPrivate->rcaheader->iChannel, 2);
1484 memcpy(pBufHeader->pBuffer + 46, &pComponentPrivate->rcaheader->iSamplePerSec, 4);
1485 memcpy(pBufHeader->pBuffer + 50, &pComponentPrivate->rcaheader->iAvgBytesPerSec, 4);
1486 memcpy(pBufHeader->pBuffer + 54, &pComponentPrivate->rcaheader->iBlockAlign, 2);
1487 memcpy(pBufHeader->pBuffer + 56, &pComponentPrivate->rcaheader->iValidBitsPerSample, 2);
1488 memcpy(pBufHeader->pBuffer + 64, &pComponentPrivate->rcaheader->iEncodeOptV, 2);
1489 memcpy(pBufHeader->pBuffer + 71, &pComponentPrivate->rcaheader->iPayload, 4);
1491 pComponentPrivate->first_buffer=0;
1497 memcpy(pBufHeader->pBuffer + 1, &pComponentPrivate->rcaheader->iPayload, 4);
1500 OMX_PRBUFFER2(pComponentPrivate->dbg, "Before sending input buffer");
1501 OMX_PRBUFFER2(pComponentPrivate->dbg, "pBufHeader->nFilledLen=%ld",pBufHeader->nFilledLen);
1503 if (pComponentPrivate->curState == OMX_StateExecuting)
1505 if(!pComponentPrivate->bDspStoppedWhileExecuting)
1507 if (!WMADEC_IsPending(pComponentPrivate,pBufHeader,OMX_DirInput))
1509 if(!pComponentPrivate->reconfigOutputPort){
1510 WMADEC_SetPending(pComponentPrivate,pBufHeader,OMX_DirInput);
1521 OMX_ERROR4(pComponentPrivate->dbg, "ERROR IN QUEUEBUFFER");
1522 OMX_ERROR4(pComponentPrivate->dbg, "%d ::IssuingDSP IP: Error Occurred",
1527 pComponentPrivate->lcml_nCntIp++;
1531 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d :: UTIL: Bypassing the sending of input buffers to lcml",__LINE__);
1532 pComponentPrivate->pInputBufHdrPending[pComponentPrivate->nNumInputBufPending++] = pBufHeader;
1533 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d :: UTIL: pComponentPrivate->nNumInputBufPending=%ld",__LINE__,
1534 pComponentPrivate->nNumInputBufPending);
1535 /*pComponentPrivate->cbInfo.EmptyBufferDone (pComponentPrivate->pHandle,
1536 pComponentPrivate->pHandle->pApplicationPrivate,
1540 OMX_PRBUFFER2(pComponentPrivate->dbg, "Don't queue buffers during a reconfig");
1547 PERF_SendingFrame(pComponentPrivate->pPERFcomp,
1553 pComponentPrivate->cbInfo.EmptyBufferDone (pComponentPrivate->pHandle,
1554 pComponentPrivate->pHandle->pApplicationPrivate,
1559 else if (pComponentPrivate->curState == OMX_StatePause)
1561 pComponentPrivate->pInputBufHdrPending[pComponentPrivate->nNumInputBufPending++] =
1567 pComponentPrivate->bBypassDSP = 1;
1568 OMX_PRBUFFER2(pComponentPrivate->dbg, "Forcing EmptyBufferDone");
1570 PERF_SendingFrame(pComponentPrivate->pPERFcomp,
1571 PREF(pComponentPrivate->pInputBufferList->pBufHdr[0], pBuffer),
1575 pComponentPrivate->cbInfo.EmptyBufferDone (pComponentPrivate->pHandle,
1576 pComponentPrivate->pHandle->pApplicationPrivate,
1577 pComponentPrivate->pInputBufferList->pBufHdr[0]);
1579 pComponentPrivate->nEmptyBufferDoneCount++;
1585 pComponentPrivate->pOutputBufferList->pBufHdr[0]->pMarkData =
1587 pComponentPrivate->pOutputBufferList->pBufHdr[0]->hMarkTargetComponent =
1591 if (pBufHeader->hMarkTargetComponent == pComponentPrivate->pHandle &&
1594 pComponentPrivate_CC->cbInfo.EventHandler(pComponentPrivate->pHandle,
1595 pComponentPrivate->pHandle->pApplicationPrivate,
1599 if (pComponentPrivate->bFlushInputPortCommandPending)
1601 OMX_SendCommand(pComponentPrivate->pHandle,
1607 pComponentPrivate->nUnhandledFillThisBuffers--;
1608 if (pComponentPrivate->curState == OMX_StateIdle){
1609 pComponentPrivate->cbInfo.FillBufferDone (pComponentPrivate->pHandle,
1610 pComponentPrivate->pHandle->pApplicationPrivate,
1612 OMX_PRBUFFER2(pComponentPrivate->dbg, ":: %d %s In idle state return output buffers", __LINE__, __FUNCTION__);
1615 OMX_PRBUFFER2(pComponentPrivate->dbg, "Sending output buffer to LCML ");
1616 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d Comp:: Sending Emptied Output buffer=%p to LCML",
1625 if (pComponentPrivate->bBypassDSP == 0) {
1626 if (pComponentPrivate->curState == OMX_StateExecuting) {
1627 if(!(pComponentPrivate->reconfigInputPort || pComponentPrivate->reconfigOutputPort)){
1628 if (!WMADEC_IsPending(pComponentPrivate,pBufHeader,OMX_DirOutput)){
1629 if(!pComponentPrivate->bDspStoppedWhileExecuting){
1630 WMADEC_SetPending(pComponentPrivate,pBufHeader,OMX_DirOutput);
1631 pComponentPrivate->LastOutputBufferHdrQueued = pBufHeader;
1641 OMX_ERROR4(pComponentPrivate->dbg, "%d :: IssuingDSP OP: Error Occurred",
1646 pComponentPrivate->lcml_nOpBuf++;
1650 pComponentPrivate->pOutputBufHdrPending[pComponentPrivate->nNumOutputBufPending++] = pBufHeader;
1651 OMX_PRBUFFER2(pComponentPrivate->dbg, "Don't queue while doing a reconfig:: output buffer, num pending = %ld", pComponentPrivate->nNumOutputBufPending);
1653 }else if (pComponentPrivate->curState == OMX_StatePause) {
1654 pComponentPrivate->pOutputBufHdrPending[pComponentPrivate->nNumOutputBufPending++] = pBufHeader;
1657 if (pComponentPrivate->bFlushOutputPortCommandPending) {
1658 OMX_SendCommand( pComponentPrivate->pHandle, OMX_CommandFlush, 1, NULL);
1663 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d : BufferHeader %p, Buffer %p Unknown ..........",
1668 OMX_PRINT1(pComponentPrivate->dbg, "%d : Exiting from WMADECHandleDataBuf_FromApp ",__LINE__);
1670 pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
1671 pComponentPrivate->pHandle->pApplicationPrivate,
1696 WMADEC_COMPONENT_PRIVATE *pComponentPrivate = pBufHeader->pPlatformPrivate;
1701 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Entering WMADECGetBufferDirection Function",__LINE__);
1702 OMX_PRINT1(pComponentPrivate->dbg, "%d :: pComponentPrivate = %p",__LINE__,pComponentPrivate);
1704 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d :: WMADECGetBufferDirection Function",__LINE__);
1705 OMX_PRINT1(pComponentPrivate->dbg, "%d :: pComponentPrivate = %p",__LINE__,pComponentPrivate);
1706 OMX_PRBUFFER1(pComponentPrivate->dbg, "%d :: pComponentPrivate->pInputBufferList = %p",
1707 __LINE__,pComponentPrivate->pInputBufferList);
1708 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d :: pComponentPrivate->pInputBufferList->numBuffers = %d",
1709 __LINE__,pComponentPrivate->pInputBufferList->numBuffers);
1711 nBuf = pComponentPrivate->pInputBufferList->numBuffers;
1714 pBuf = pComponentPrivate->pInputBufferList->pBufHdr[i];
1718 OMX_ERROR2(pComponentPrivate->dbg, "%d :: Buffer %p is INPUT BUFFER",__LINE__, pBufHeader);
1725 nBuf = pComponentPrivate->pOutputBufferList->numBuffers;
1729 pBuf = pComponentPrivate->pOutputBufferList->pBufHdr[i];
1733 OMX_ERROR2(pComponentPrivate->dbg, "%d :: Buffer %p is OUTPUT BUFFER",__LINE__,
1742 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Buffer %p is Not Found in the List",__LINE__,
1748 OMX_ERROR1(pComponentPrivate->dbg, "%d :: Exiting WMADECGetBufferDirection Function",__LINE__);
1750 pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
1751 pComponentPrivate->pHandle->pApplicationPrivate,
1772 OMX_ERRORTYPE WMADECHandleDataBuf_FromLCML(WMADEC_COMPONENT_PRIVATE* pComponentPrivate, LCML_WMADEC_BUFHEADERTYPE* msgBuffer)
1777 OMX_COMPONENTTYPE* pHandle = (OMX_COMPONENTTYPE*)pComponentPrivate->pHandle;
1778 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Entering WMADECHandleDataBuf_FromLCML Function",__LINE__);
1779 OMX_PRINT2(pComponentPrivate->dbg, "%d :: pComponentPrivate = %p",__LINE__, pComponentPrivate);
1780 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Entering WMADECHandleDataBuf_FromLCML Function", __LINE__);
1784 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Error While reading from the LCML Pipe",__LINE__);
1789 OMX_PRINT2(pComponentPrivate->dbg, "%d :: Entering WMADECHandleDataBuf_FromLCML Function",__LINE__);
1791 if (!(pComponentPrivate->bIsStopping))
1795 OMX_PRCOMM2(pComponentPrivate->dbg, "%d: Component Sending Empty Input buffer%p to App",__LINE__,msgBuffer->buffer);
1796 OMX_PRCOMM2(pComponentPrivate->dbg, "Sending Empty INPUT BUFFER to App = %p", msgBuffer->buffer->pBuffer);
1799 PERF_SendingFrame(pComponentPrivate->pPERFcomp,
1804 pComponentPrivate->cbInfo.EmptyBufferDone (pHandle,
1808 pComponentPrivate->nEmptyBufferDoneCount++;
1812 OMX_PRCOMM2(pComponentPrivate->dbg, "%d: Component Sending Filled Output buffer%p to App size = %ld",
1815 PERF_SendingFrame(pComponentPrivate->pPERFcomp,
1822 msgBuffer->buffer->nTickCount = (OMX_U32)pComponentPrivate->arrBufIndexTick[pComponentPrivate->OpBufindex];
1825 msgBuffer->buffer->nTimeStamp = (OMX_TICKS)pComponentPrivate->arrBufIndex[pComponentPrivate->OpBufindex];
1826 pComponentPrivate->OpBufindex++;
1827 pComponentPrivate->OpBufindex %= pComponentPrivate->pPortDef[OUTPUT_PORT]->nBufferCountActual;
1829 pComponentPrivate->cbInfo.FillBufferDone (pHandle,
1833 pComponentPrivate->nOutStandingFillDones--;
1834 OMX_PRSTATE2(pComponentPrivate->dbg, "nOutstandingFillDones = %ld\n", pComponentPrivate->nOutStandingFillDones);
1838 OMX_PRINT2(pComponentPrivate->dbg, "%d :: Wrong Direction dir = %d", __LINE__,msgBuffer->eDir);
1839 OMX_PRDSP2(pComponentPrivate->dbg, "%d: Component Got buffer %p From LCML", __LINE__,msgBuffer->buffer);
1846 OMX_PRINT2(pComponentPrivate->dbg, "%d :: Entering WMADECHandleDataBuf_FromLCML Function",
1850 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d: Component Sending Empty Input buffer%p to App",
1852 OMX_PRCOMM2(pComponentPrivate->dbg, "Sending Empty INPUT BUFFER to App = %p",
1856 PERF_SendingFrame(pComponentPrivate->pPERFcomp,
1861 pComponentPrivate->cbInfo.EmptyBufferDone (pHandle,
1864 pComponentPrivate->nEmptyBufferDoneCount++;
1868 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d: Component Sending Filled Output buffer%p to App",
1870 OMX_PRBUFFER2(pComponentPrivate->dbg, "Sending Filled OUTPUT BUFFER to App = %p",
1874 PERF_SendingBuffer(pComponentPrivate->pPERFcomp,
1879 pComponentPrivate->cbInfo.FillBufferDone (pHandle,
1882 pComponentPrivate->nOutStandingFillDones--;
1883 OMX_PRCOMM2(pComponentPrivate->dbg, "nOutstandingFillDones = %ld\n", pComponentPrivate->nOutStandingFillDones);
1887 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Exiting WMADECHandleDataBuf_FromLCML Function",
1920 (WMADEC_COMPONENT_PRIVATE*)((LCML_DSP_INTERFACE*)args[6])->pComponentPrivate;
2336 OMX_ERRORTYPE WMADECGetCorresponding_LCMLHeader(WMADEC_COMPONENT_PRIVATE *pComponentPrivate,
2350 pComponentPrivate_CC = pComponentPrivate;
2362 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Inside WMADECGetCorresponding_LCMLHeader..",__LINE__);
2363 OMX_PRINT2(pComponentPrivate->dbg, "%d :: eDir = %d",__LINE__,eDir);
2367 OMX_PRINT1(pComponentPrivate->dbg, "%d :: pComponentPrivate_CC = %p",__LINE__,
2369 OMX_PRCOMM2(pComponentPrivate->dbg, "%d :: pComponentPrivate_CC->pLcmlBufHeader[INPUT_PORT] = %p",
2373 OMX_PRBUFFER1(pComponentPrivate->dbg, "%d :: nIpBuf = %d",__LINE__,nIpBuf);
2376 OMX_PRBUFFER1(pComponentPrivate->dbg, "pBuffer = %p",pBuffer);
2377 OMX_PRBUFFER1(pComponentPrivate->dbg, "pLcmlBufHeader->buffer->pBuffer = %p",
2382 OMX_ERROR2(pComponentPrivate->dbg, "%d::Corresponding LCML Header Found",__LINE__);
2392 OMX_PRBUFFER1(pComponentPrivate->dbg, "pBuffer = %p",pBuffer);
2393 OMX_PRBUFFER2(pComponentPrivate->dbg, "pLcmlBufHeader->buffer- = %p",pLcmlBufHeader->buffer);
2394 OMX_PRBUFFER2(pComponentPrivate->dbg, "pLcmlBufHeader->buffer->pBuffer = %p",
2396 OMX_PRBUFFER1(pComponentPrivate->dbg, "%d :: nOpBuf = %d",__LINE__,nOpBuf);
2402 OMX_PRBUFFER1(pComponentPrivate->dbg, "pBuffer = %p",pBuffer);
2403 OMX_PRBUFFER2(pComponentPrivate->dbg, "pLcmlBufHeader->buffer->pBuffer = %p",
2406 OMX_ERROR2(pComponentPrivate->dbg, "%d::Corresponding LCML Header Found",__LINE__);
2414 OMX_PRINT1(pComponentPrivate->dbg, "%d:: Invalid Buffer Type :: exiting...",__LINE__);
2431 OMX_HANDLETYPE WMADECGetLCMLHandle(WMADEC_COMPONENT_PRIVATE *pComponentPrivate)
2458 OMX_ERROR4(pComponentPrivate->dbg, "eError != OMX_ErrorNone...");
2463 ((LCML_DSP_INTERFACE*)pHandle)->pComponentPrivate = pComponentPrivate;
2473 OMX_HANDLETYPE WMADECGetLCMLHandle(WMADEC_COMPONENT_PRIVATE *pComponentPrivate)
2484 OMX_ERROR4(pComponentPrivate->dbg, "BML Load Failed!!!");
2500 OMX_ERROR4(pComponentPrivate->dbg, "eError != OMX_ErrorNone...");
2505 ((LCML_DSP_INTERFACE*)pHandle)->pComponentPrivate = pComponentPrivate;
2518 OMX_ERRORTYPE WMADECFreeLCMLHandle(WMADEC_COMPONENT_PRIVATE *pComponentPrivate)
2524 if (pComponentPrivate->bLcmlHandleOpened)
2526 retValue = dlclose(pComponentPrivate->pLcmlHandle);
2532 pComponentPrivate->bLcmlHandleOpened = 0;
2541 OMX_ERRORTYPE WMADECFreeLCMLHandle(WMADEC_COMPONENT_PRIVATE *pComponentPrivate)
2547 if (pComponentPrivate->bLcmlHandleOpened)
2550 retValue = FreeLibrary(pComponentPrivate->pLcmlHandle);
2555 pComponentPrivate->bLcmlHandleOpened = 0;
2574 OMX_ERRORTYPE WMADEC_CommandToIdle(WMADEC_COMPONENT_PRIVATE *pComponentPrivate)
2576 OMX_COMPONENTTYPE *pHandle = (OMX_COMPONENTTYPE *) pComponentPrivate->pHandle;
2577 OMX_HANDLETYPE pLcmlHandle = pComponentPrivate->pLcmlHandle;
2593 OMX_PRINT1(pComponentPrivate->dbg, "%d: WMADECHandleCommand: Cmd Idle ",__LINE__);
2594 OMX_PRINT2(pComponentPrivate->dbg, "curstate = %d",pComponentPrivate->curState);
2595 if (pComponentPrivate->curState == OMX_StateIdle)
2597 pComponentPrivate->cbInfo.EventHandler (pHandle, pHandle->pApplicationPrivate,
2600 OMX_ERROR2(pComponentPrivate->dbg, "%d :: Error: Same State Given by Application",__LINE__);
2602 else if (pComponentPrivate->curState == OMX_StateLoaded)
2605 PERF_Boundary(pComponentPrivate->pPERFcomp,PERF_BoundaryStart | PERF_BoundarySetup);
2607 if (pComponentPrivate->dasfmode == 1)
2609 pComponentPrivate->pPortDef[OUTPUT_PORT]->bEnabled= FALSE;
2610 pComponentPrivate->pPortDef[OUTPUT_PORT]->bPopulated= FALSE;
2612 if(pComponentPrivate->streamID == 0)
2614 OMX_ERROR4(pComponentPrivate->dbg, "**************************************");
2615 OMX_ERROR4(pComponentPrivate->dbg, ":: Error = OMX_ErrorInsufficientResources");
2616 OMX_ERROR4(pComponentPrivate->dbg, "**************************************");
2618 pComponentPrivate->curState = OMX_StateInvalid;
2620 pComponentPrivate->cbInfo.EventHandler(pHandle,
2631 OMX_PRCOMM2(pComponentPrivate->dbg, "%d :: In while loop OMX_StateLoaded [INPUT_PORT]->bPopulated %d ",
2632 __LINE__,pComponentPrivate->pPortDef[INPUT_PORT]->bPopulated);
2633 OMX_PRCOMM2(pComponentPrivate->dbg, "%d :: In while loop OMX_StateLoaded [INPUT_PORT]->bEnabled %d ",
2634 __LINE__,pComponentPrivate->pPortDef[INPUT_PORT]->bEnabled);
2635 OMX_PRCOMM2(pComponentPrivate->dbg, "%d :: In while loop OMX_StateLoaded [OUTPUT_PORT]->bPopulated %d ",
2636 __LINE__,pComponentPrivate->pPortDef[OUTPUT_PORT]->bPopulated);
2637 OMX_PRCOMM2(pComponentPrivate->dbg, "%d :: In while loop OMX_StateLoaded [OUTPUT_PORT]->bEnabled %d ",
2638 __LINE__,pComponentPrivate->pPortDef[OUTPUT_PORT]->bEnabled);
2640 if (pComponentPrivate->pPortDef[INPUT_PORT]->bPopulated &&
2641 pComponentPrivate->pPortDef[INPUT_PORT]->bEnabled)
2646 if (!pComponentPrivate->pPortDef[INPUT_PORT]->bPopulated &&
2647 !pComponentPrivate->pPortDef[INPUT_PORT]->bEnabled)
2652 if (pComponentPrivate->pPortDef[OUTPUT_PORT]->bPopulated &&
2653 pComponentPrivate->pPortDef[OUTPUT_PORT]->bEnabled)
2658 if (!pComponentPrivate->pPortDef[OUTPUT_PORT]->bPopulated &&
2659 !pComponentPrivate->pPortDef[OUTPUT_PORT]->bEnabled)
2669 pComponentPrivate->InLoaded_readytoidle = 1;
2671 pthread_mutex_lock(&pComponentPrivate->InLoaded_mutex);
2672 pthread_cond_wait(&pComponentPrivate->InLoaded_threshold,
2673 &pComponentPrivate->InLoaded_mutex);
2675 pthread_mutex_unlock(&pComponentPrivate->InLoaded_mutex);
2677 OMX_WaitForEvent(&(pComponentPrivate->InLoaded_event));
2681 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Inside WMADECHandleCommand",__LINE__);
2683 pLcmlHandle = (OMX_HANDLETYPE) WMADECGetLCMLHandle(pComponentPrivate);
2684 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Inside WMADECHandleCommand",__LINE__);
2687 OMX_ERROR4(pComponentPrivate->dbg, "%d :: LCML Handle is NULL........exiting..",__LINE__);
2696 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Error returned from WMADECFill_LCMLInitParams()",
2701 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Comp: OMX_WmaDecUtils.c",__LINE__);
2702 pComponentPrivate->pLcmlHandle = (LCML_DSP_INTERFACE *)pLcmlHandle;
2706 OMX_PRDSP2(pComponentPrivate->dbg, "%d :: Calling LCML_InitMMCodec...",__LINE__);
2710 OMX_PRSTATE2(pComponentPrivate->dbg, "WMA decoder support TeeDN");
2711 OMX_PRDSP2(pComponentPrivate->dbg, "pComponentPrivate Before calling InitMMCodec = %p",
2712 pComponentPrivate);
2714 OMX_PRINT1(pComponentPrivate->dbg, "&pComponentPrivate = %p",&pComponentPrivate);
2715 OMX_PRDSP2(pComponentPrivate->dbg, "pLcmlHandle = %p",pLcmlHandle);
2716 OMX_PRINT2(pComponentPrivate->dbg, "p = %p",p);
2717 OMX_PRDSP1(pComponentPrivate->dbg, "pLcmlHandle->pCodecinterfacehandle = %p",
2721 p,&pLcmlHandle,(void *)p,&cb,(OMX_STRING)pComponentPrivate->sDeviceString);
2722 OMX_PRDSP2(pComponentPrivate->dbg, "pComponentPrivate After calling InitMMCodec = %p",
2723 pComponentPrivate);
2727 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Error returned from LCML_Init() error = %d",__LINE__, eError);
2730 pComponentPrivate->cbInfo.EventHandler (pHandle,
2743 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Error : InitMMCodec failed...>>>>>> ",__LINE__);
2753 OMX_ERROR4(pComponentPrivate->dbg, "Failed to set Mapping State");
2759 OMX_PRCOMM2(pComponentPrivate->dbg, "%d :: WMADEC: About to call RMProxy_SendCommand", __LINE__);
2760 pComponentPrivate->rmproxyCallback.RMPROXY_Callback =
2763 if (pComponentPrivate->curState != OMX_StateWaitForResources){
2768 OMX_PRDSP2(pComponentPrivate->dbg, "%d :: WMADEC: RMProxy_SendCommand returned %d",
2773 pComponentPrivate->curState = OMX_StateIdle;
2774 pComponentPrivate->cbInfo.EventHandler( pHandle,
2778 pComponentPrivate->curState,
2781 PERF_Boundary(pComponentPrivate->pPERFcomp,PERF_BoundaryComplete |
2791 pComponentPrivate->curState = OMX_StateWaitForResources;
2792 pComponentPrivate->cbInfo.EventHandler(pHandle,
2796 pComponentPrivate->curState,
2798 OMX_ERROR2(pComponentPrivate->dbg, "%d :: WMADEC: Error - insufficient resources", __LINE__);
2801 OMX_PRSTATE2(pComponentPrivate->dbg, "Setting to OMX_StateIdle - Line %d",__LINE__);
2802 pComponentPrivate->curState = OMX_StateIdle;
2803 pComponentPrivate->cbInfo.EventHandler( pHandle,
2807 pComponentPrivate->curState,
2811 OMX_PRSTATE2(pComponentPrivate->dbg, "%d :: WMADEC: State has been Set to Idle",__LINE__);
2814 PERF_Boundary(pComponentPrivate->pPERFcomp,PERF_BoundaryComplete |
2819 else if (pComponentPrivate->curState == OMX_StateExecuting)
2824 pLcmlHandle = (LCML_DSP_INTERFACE*)pComponentPrivate->pLcmlHandle;
2827 OMX_ERROR2(pComponentPrivate->dbg, "Error occurred in Codec mapping flush!");
2832 PERF_Boundary(pComponentPrivate->pPERFcomp,PERF_BoundaryComplete |
2836 OMX_PRINT2(pComponentPrivate->dbg, "%d :: WMADEC: About to set bIsStopping bit", __LINE__);
2837 if (pComponentPrivate->codecStop_waitingsignal == 0){
2838 pthread_mutex_lock(&pComponentPrivate->codecStop_mutex);
2843 if (pComponentPrivate->codecStop_waitingsignal == 0){
2844 pthread_cond_wait(&pComponentPrivate->codecStop_threshold, &pComponentPrivate->codecStop_mutex);
2845 pComponentPrivate->codecStop_waitingsignal = 0; // reset the wait condition for next time
2846 pthread_mutex_unlock(&pComponentPrivate->codecStop_mutex);
2850 OMX_ERROR4(pComponentPrivate->dbg, "%d: Error Occurred in Codec Stop..", __LINE__);
2854 OMX_PRSTATE2(pComponentPrivate->dbg, "%d: Codec has been stopped", __LINE__);
2857 else if(pComponentPrivate->curState == OMX_StatePause)
2860 OMX_PRDSP2(pComponentPrivate->dbg, "%d :: Comp: Stop Command Received",__LINE__);
2863 pLcmlHandle = (LCML_DSP_INTERFACE*)pComponentPrivate->pLcmlHandle;
2866 OMX_ERROR2(pComponentPrivate->dbg, "Error occurred in Codec mapping flush!");
2871 PERF_Boundary(pComponentPrivate->pPERFcomp,PERF_BoundaryComplete |
2875 if (pComponentPrivate->codecStop_waitingsignal == 0){
2876 pthread_mutex_lock(&pComponentPrivate->codecStop_mutex);
2881 if (pComponentPrivate->codecStop_waitingsignal == 0){
2882 pthread_cond_wait(&pComponentPrivate->codecStop_threshold, &pComponentPrivate->codecStop_mutex);
2883 pComponentPrivate->codecStop_waitingsignal = 0;
2884 pthread_mutex_unlock(&pComponentPrivate->codecStop_mutex);
2886 pComponentPrivate->curState = OMX_StateIdle;
2894 OMX_ERROR4(pComponentPrivate->dbg, "%d :: ERROR: Send Comman Failed", __LINE__);
2899 OMX_PRSTATE2(pComponentPrivate->dbg, "%d :: The component is stopped",__LINE__);
2900 pComponentPrivate->cbInfo.EventHandler (pHandle,
2903 pComponentPrivate->curState,
2909 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Comp: OMX_WmaDecUtils.c",__LINE__);
2910 pComponentPrivate->cbInfo.EventHandler(pHandle,
2920 pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
2921 pComponentPrivate->pHandle->pApplicationPrivate,
2943 OMX_ERRORTYPE WMADEC_CommandToLoaded(WMADEC_COMPONENT_PRIVATE *pComponentPrivate)
2947 (OMX_COMPONENTTYPE *) pComponentPrivate->pHandle;
2948 OMX_HANDLETYPE pLcmlHandle = pComponentPrivate->pLcmlHandle;
2951 OMX_PRINT1(pComponentPrivate->dbg, "%d: WMADECHandleCommand: Cmd Loaded - curState = %d",
2952 __LINE__,pComponentPrivate->curState);
2953 if (pComponentPrivate->curState == OMX_StateLoaded)
2955 pComponentPrivate->cbInfo.EventHandler (pHandle,
2961 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Error: Same State Given by Application",__LINE__);
2964 OMX_PRBUFFER1(pComponentPrivate->dbg, "%d: pComponentPrivate->pInputBufferList->numBuffers = %d",
2965 __LINE__,pComponentPrivate->pInputBufferList->numBuffers);
2966 OMX_PRBUFFER1(pComponentPrivate->dbg, "%d: pComponentPrivate->pOutputBufferList->numBuffers = %d",
2967 __LINE__,pComponentPrivate->pOutputBufferList->numBuffers);
2969 if (pComponentPrivate->curState == OMX_StateWaitForResources)
2971 OMX_PRDSP2(pComponentPrivate->dbg, "%d: WMADECHandleCommand: Cmd Loaded",__LINE__);
2974 PERF_Boundary(pComponentPrivate->pPERFcomp,PERF_BoundaryStart | PERF_BoundaryCleanup);
2976 pComponentPrivate->curState = OMX_StateLoaded;
2979 PERF_Boundary(pComponentPrivate->pPERFcomp,PERF_BoundaryComplete | PERF_BoundaryCleanup);
2981 pComponentPrivate->cbInfo.EventHandler (pHandle,
2985 pComponentPrivate->curState,
2989 OMX_PRSTATE2(pComponentPrivate->dbg, "%d :: In side OMX_StateLoaded State: ",__LINE__);
2990 if (pComponentPrivate->curState != OMX_StateIdle &&
2991 pComponentPrivate->curState != OMX_StateWaitForResources)
2993 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Comp: OMX_WmaDecUtils.c",__LINE__);
2994 pComponentPrivate->cbInfo.EventHandler (pHandle,
3000 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Error: Invalid State Given by Application",__LINE__);
3004 PERF_Boundary(pComponentPrivate->pPERFcomp,PERF_BoundaryStart | PERF_BoundaryCleanup);
3006 OMX_PRBUFFER1(pComponentPrivate->dbg, "pComponentPrivate->pInputBufferList->numBuffers = %d",
3007 pComponentPrivate->pInputBufferList->numBuffers);
3008 OMX_PRBUFFER1(pComponentPrivate->dbg, "pComponentPrivate->pOutputBufferList->numBuffers = %d",
3009 pComponentPrivate->pOutputBufferList->numBuffers);
3012 OMX_PRDSP2(pComponentPrivate->dbg, "HandleCommand - in while(1) loop");
3013 if (!pComponentPrivate->pInputBufferList->numBuffers &&
3014 !pComponentPrivate->pOutputBufferList->numBuffers)
3018 pComponentPrivate->InIdle_goingtoloaded = 1;
3020 pthread_mutex_lock(&pComponentPrivate->InIdle_mutex);
3021 pthread_cond_wait(&pComponentPrivate->InIdle_threshold,
3022 &pComponentPrivate->InIdle_mutex);
3023 pthread_mutex_unlock(&pComponentPrivate->InIdle_mutex);
3025 OMX_WaitForEvent(&(pComponentPrivate->InIdle_event));
3032 OMX_PRSTATE1(pComponentPrivate->dbg, "%d :: In side OMX_StateLoaded State: ",__LINE__);
3035 OMX_PRSTATE1(pComponentPrivate->dbg, "%d :: In side OMX_StateLoaded State: ",__LINE__);
3038 OMX_ERROR4(pComponentPrivate->dbg, "%d : Error: in Destroying the codec: no. %x",__LINE__, eError);
3041 OMX_PRDSP1(pComponentPrivate->dbg, "%d: WMADECHandleCommand: Cmd Loaded",__LINE__);
3043 PERF_SendingCommand(pComponentPrivate->pPERF, -1, 0, PERF_ModuleComponent);
3046 pComponentPrivate->bInitParamsInitialized = 0;
3048 pComponentPrivate->bLoadedCommandPending = OMX_FALSE;
3053 pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
3054 pComponentPrivate->pHandle->pApplicationPrivate,
3077 OMX_ERRORTYPE WMADEC_CommandToExecuting(WMADEC_COMPONENT_PRIVATE *pComponentPrivate)
3080 OMX_COMPONENTTYPE *pHandle = (OMX_COMPONENTTYPE *) pComponentPrivate->pHandle;
3081 OMX_HANDLETYPE pLcmlHandle = pComponentPrivate->pLcmlHandle;
3093 OMX_PRINT1(pComponentPrivate->dbg, "%d: WMADECHandleCommand: Cmd Executing ",__LINE__);
3094 if (pComponentPrivate->curState == OMX_StateExecuting)
3096 pComponentPrivate->cbInfo.EventHandler (pHandle,
3102 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Error: Same State Given by Application",__LINE__);
3105 else if (pComponentPrivate->curState == OMX_StateIdle)
3107 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Comp: OMX_WmaDecUtils.c",__LINE__);
3111 pComponentPrivate->nNumInputBufPending = 0;
3112 pComponentPrivate->nNumOutputBufPending = 0;
3113 if(pComponentPrivate->dasfmode == 1)
3116 OMX_PRDSP2(pComponentPrivate->dbg, "%d :: ---- Comp: DASF Functionality is ON ---",__LINE__);
3117 if (pComponentPrivate->pHeaderInfo->iChannel == 1)
3119 pComponentPrivate->pParams->iAudioFormat = WMA_MONO_CHANNEL;
3123 pComponentPrivate->pParams->iAudioFormat = WMA_STEREO_NON_INTERLEAVED;
3125 OMX_PRINT1(pComponentPrivate->dbg, "pParams->iAudioFormat = %d", pComponentPrivate->pParams->iAudioFormat);
3126 pComponentPrivate->pParams->iStrmId = pComponentPrivate->streamID;
3127 pComponentPrivate->pParams->iSamplingRate =
3128 pComponentPrivate->pHeaderInfo->iSamplePerSec;
3130 OMX_PRINT1(pComponentPrivate->dbg, "pParams->iSamplingRate = %ld",
3131 pComponentPrivate->pParams->iSamplingRate);
3132 OMX_PRINT1(pComponentPrivate->dbg, "pParams->iStrmId = %ld",
3133 pComponentPrivate->pParams->iStrmId);
3134 OMX_PRINT1(pComponentPrivate->dbg, "pParams->iAudioFormat = %d",
3135 pComponentPrivate->pParams->iAudioFormat);
3138 pValues[1] = (OMX_U32)pComponentPrivate->pParams;
3145 OMX_ERROR4(pComponentPrivate->dbg, "%d: Error Occurred in Codec StreamControl..",
3150 if( pComponentPrivate->dasfmode )
3152 OMX_PRDSP2(pComponentPrivate->dbg, "Setting WMA_IAUDIO_BLOCK");
3153 pComponentPrivate->pDynParams->iOutputFormat = WMA_IAUDIO_BLOCK; /* EAUDIO_BLOCKED */
3157 OMX_PRDSP1(pComponentPrivate->dbg, "Setting WMA_IAUDIO_INTERLEAVED");
3158 pComponentPrivate->pDynParams->iOutputFormat = WMA_IAUDIO_INTERLEAVED; /* EAUDIO_INTERLEAVED */
3160 pComponentPrivate->pDynParams->size = sizeof( WMADEC_UALGParams );
3163 cmdValues[1] = (OMX_U32)( pComponentPrivate->pDynParams );
3172 OMX_ERROR4(pComponentPrivate->dbg, "%d: Error Occurred in Codec algctrl..", __LINE__);
3175 pComponentPrivate->bBypassDSP = 0;
3177 eError = LCML_ControlCodec(((LCML_DSP_INTERFACE*)(pComponentPrivate->pLcmlHandle))->pCodecinterfacehandle,
3182 OMX_ERROR4(pComponentPrivate->dbg, "%d: Error Occurred in Codec Start..", __LINE__);
3185 OMX_PRSTATE2(pComponentPrivate->dbg, ": Codec Has Been Started ");
3187 pComponentPrivate->SendAfterEOS = 1; /*Enrique Zertuche, added because it wasnt set compared with the mp3*/
3189 else if (pComponentPrivate->curState == OMX_StatePause)
3191 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Comp: OMX_WmaDecUtils.c",__LINE__);
3196 OMX_ERROR4(pComponentPrivate->dbg, "Error While Resuming the codec");
3199 if (pComponentPrivate->nNumInputBufPending <
3200 pComponentPrivate->pInputBufferList->numBuffers)
3202 pComponentPrivate->nNumInputBufPending = pComponentPrivate->pInputBufferList->numBuffers;
3205 for (i=0; i < pComponentPrivate->nNumInputBufPending; i++)
3207 if (pComponentPrivate->pInputBufHdrPending[i])
3209 if (!WMADEC_IsPending(pComponentPrivate,
3210 pComponentPrivate->pInputBufHdrPending[i],
3214 pComponentPrivate,
3215 pComponentPrivate->pInputBufHdrPending[i]->pBuffer,
3218 WMADEC_SetPending(pComponentPrivate,
3219 pComponentPrivate->pInputBufHdrPending[i],
3224 pComponentPrivate->pInputBufHdrPending[i]->pBuffer,
3225 pComponentPrivate->pInputBufHdrPending[i]->nAllocLen,
3226 pComponentPrivate->pInputBufHdrPending[i]->nFilledLen,
3233 pComponentPrivate->nNumInputBufPending = 0;
3234 if (pComponentPrivate->nNumOutputBufPending <
3235 pComponentPrivate->pOutputBufferList->numBuffers)
3237 pComponentPrivate->nNumOutputBufPending =
3238 pComponentPrivate->pOutputBufferList->numBuffers;
3240 for (i=0; i < pComponentPrivate->nNumOutputBufPending; i++)
3242 if (pComponentPrivate->pOutputBufHdrPending[i])
3244 if (!WMADEC_IsPending(pComponentPrivate,
3245 pComponentPrivate->pOutputBufHdrPending[i],
3249 pComponentPrivate,
3250 pComponentPrivate->pOutputBufHdrPending[i]->pBuffer,
3253 WMADEC_SetPending(pComponentPrivate,
3254 pComponentPrivate->pOutputBufHdrPending[i],
3257 pComponentPrivate->LastOutputBufferHdrQueued =
3258 pComponentPrivate->pOutputBufHdrPending[i];
3262 pComponentPrivate->pOutputBufHdrPending[i]->pBuffer,
3263 pComponentPrivate->pOutputBufHdrPending[i]->nAllocLen,
3264 pComponentPrivate->pOutputBufHdrPending[i]->nFilledLen,
3271 pComponentPrivate->nNumOutputBufPending = 0;
3275 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Comp: OMX_WmaDecUtils.c",__LINE__);
3276 pComponentPrivate->cbInfo.EventHandler (pHandle,
3282 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Error: Invalid State Given by Application",__LINE__);
3292 pComponentPrivate->curState = OMX_StateExecuting;
3294 PERF_Boundary(pComponentPrivate->pPERFcomp,PERF_BoundaryStart |
3298 OMX_PRINT1(pComponentPrivate->dbg, "About to call EventHandler");
3299 pComponentPrivate->cbInfo.EventHandler( pHandle, pHandle->pApplicationPrivate,
3301 pComponentPrivate->curState, NULL);
3304 pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
3305 pComponentPrivate->pHandle->pApplicationPrivate,
3328 OMX_ERRORTYPE WMADEC_CommandToPause(WMADEC_COMPONENT_PRIVATE *pComponentPrivate)
3332 (OMX_COMPONENTTYPE *) pComponentPrivate->pHandle;
3333 OMX_HANDLETYPE pLcmlHandle = pComponentPrivate->pLcmlHandle;
3339 OMX_PRINT1(pComponentPrivate->dbg, "%d: WMADECHandleCommand: Cmd Pause",__LINE__);
3340 if (pComponentPrivate->curState == OMX_StatePause)
3342 pComponentPrivate->cbInfo.EventHandler (pHandle, pHandle->pApplicationPrivate,
3346 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Error: Same State Given by Application",__LINE__);
3349 if (pComponentPrivate->curState != OMX_StateExecuting &&
3350 pComponentPrivate->curState != OMX_StateIdle)
3352 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Comp: OMX_WmaDecUtils.c",__LINE__);
3354 pComponentPrivate->cbInfo.EventHandler (pHandle,
3361 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Error: Invalid State Given by Application",__LINE__);
3365 PERF_Boundary(pComponentPrivate->pPERFcomp,PERF_BoundaryComplete | PERF_BoundarySteadyState);
3367 OMX_PRSTATE1(pComponentPrivate->dbg, "About to command to pause");
3373 OMX_ERROR4(pComponentPrivate->dbg, "%d : Error: in Pausing the codec",__LINE__);
3387 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Comp: OMX_WmaDecUtils.c\n",__LINE__);
3390 pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
3391 pComponentPrivate->pHandle->pApplicationPrivate,
3414 OMX_ERRORTYPE WMADEC_CommandToWaitForResources(WMADEC_COMPONENT_PRIVATE *pComponentPrivate)
3417 OMX_COMPONENTTYPE *pHandle = (OMX_COMPONENTTYPE *) pComponentPrivate->pHandle;
3421 if (pComponentPrivate->curState == OMX_StateWaitForResources)
3423 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Comp: OMX_WmaDecUtils.c",__LINE__);
3425 pComponentPrivate->cbInfo.EventHandler (pHandle,
3432 OMX_ERROR2(pComponentPrivate->dbg, "%d :: Error: Same State Given by Application",__LINE__);
3434 else if (pComponentPrivate->curState == OMX_StateLoaded)
3436 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Comp: OMX_WmaDecUtils.c",__LINE__);
3437 pComponentPrivate->curState = OMX_StateWaitForResources;
3439 pComponentPrivate->cbInfo.EventHandler(pHandle,
3443 pComponentPrivate->curState,
3448 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Comp: OMX_WmaDecUtils.c",__LINE__);
3450 pComponentPrivate->cbInfo.EventHandler(pHandle,
3475 void WMADEC_SetPending(WMADEC_COMPONENT_PRIVATE *pComponentPrivate,
3484 for (i=0; i < pComponentPrivate->pInputBufferList->numBuffers; i++)
3486 if (pBufHdr == pComponentPrivate->pInputBufferList->pBufHdr[i])
3488 pComponentPrivate->pInputBufferList->bBufferPending[i] = 1;
3489 OMX_PRBUFFER2(pComponentPrivate->dbg, "*******************INPUT BUFFER %d IS PENDING \
3496 for (i=0; i < pComponentPrivate->pOutputBufferList->numBuffers; i++)
3498 if (pBufHdr == pComponentPrivate->pOutputBufferList->pBufHdr[i])
3500 pComponentPrivate->pOutputBufferList->bBufferPending[i] = 1;
3501 OMX_PRBUFFER2(pComponentPrivate->dbg, "*******************OUTPUT BUFFER %d IS PENDING \
3522 void WMADEC_ClearPending(WMADEC_COMPONENT_PRIVATE *pComponentPrivate,
3531 for (i=0; i < pComponentPrivate->pInputBufferList->numBuffers; i++)
3533 if (pBufHdr == pComponentPrivate->pInputBufferList->pBufHdr[i])
3535 pComponentPrivate->pInputBufferList->bBufferPending[i] = 0;
3536 OMX_PRBUFFER1(pComponentPrivate->dbg, "*******************INPUT BUFFER %d IS RECLAIMED\
3543 for (i=0; i < pComponentPrivate->pOutputBufferList->numBuffers; i++)
3545 if (pBufHdr == pComponentPrivate->pOutputBufferList->pBufHdr[i])
3547 pComponentPrivate->pOutputBufferList->bBufferPending[i] = 0;
3548 OMX_PRBUFFER1(pComponentPrivate->dbg, "*******************OUTPUT BUFFER %d IS RECLAIMED******************************",i);
3568 OMX_U32 WMADEC_IsPending(WMADEC_COMPONENT_PRIVATE *pComponentPrivate,
3577 for (i=0; i < pComponentPrivate->pInputBufferList->numBuffers; i++)
3579 if (pBufHdr == pComponentPrivate->pInputBufferList->pBufHdr[i])
3581 return pComponentPrivate->pInputBufferList->bBufferPending[i];
3587 for (i=0; i < pComponentPrivate->pOutputBufferList->numBuffers; i++)
3589 if (pBufHdr == pComponentPrivate->pOutputBufferList->pBufHdr[i])
3591 return pComponentPrivate->pOutputBufferList->bBufferPending[i];
3612 OMX_U32 WMADEC_IsValid(WMADEC_COMPONENT_PRIVATE *pComponentPrivate,
3621 for (i=0; i < pComponentPrivate->pInputBufferList->numBuffers; i++)
3623 if (pBuffer == pComponentPrivate->pInputBufferList->pBufHdr[i]->pBuffer)
3631 for (i=0; i < pComponentPrivate->pOutputBufferList->numBuffers; i++)
3633 if (pBuffer == pComponentPrivate->pOutputBufferList->pBufHdr[i]->pBuffer)
3667 WMADEC_COMPONENT_PRIVATE *pComponentPrivate = pHandle->pComponentPrivate;
3669 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Entered WMADECFill_LCMLInitParams",__LINE__);
3670 OMX_PRDSP1(pComponentPrivate->dbg, "%d :: WMADECFill_LCMLInitParams - pComponentPrivate = %p",
3671 __LINE__,pComponentPrivate);
3672 OMX_PRDSP1(pComponentPrivate->dbg, "%d :: WMADECFill_LCMLInitParams - pHandle = %p",
3675 nIpBuf = pComponentPrivate->pInputBufferList->numBuffers;
3678 nOpBuf = pComponentPrivate->pOutputBufferList->numBuffers;
3679 nOpBufSize = pComponentPrivate->pPortDef[OUTPUT_BUFFER]->nBufferSize;
3682 OMX_PRBUFFER1(pComponentPrivate->dbg, "nIpBuf = %ld",nIpBuf);
3683 OMX_PRBUFFER1(pComponentPrivate->dbg, "nOpBuf = %ld",nOpBuf);
3685 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Comp: OMX_WmaDecUtils.c",__LINE__);
3688 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d:[ALLOC] %p",__LINE__,pTemp_lcml);
3689 OMX_PRDSP1(pComponentPrivate->dbg, "Line %d::pTemp_lcml = %p",__LINE__,pTemp_lcml);
3693 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Memory Allocation Failed",__LINE__);
3698 pComponentPrivate->pLcmlBufHeader[INPUT_PORT] = pTemp_lcml;
3700 OMX_PRBUFFER1(pComponentPrivate->dbg, "nIpBuf = %ld",nIpBuf);
3704 pTemp = pComponentPrivate->pInputBufferList->pBufHdr[i];
3710 pTemp->pPlatformPrivate = pHandle->pComponentPrivate;
3726 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Error: Malloc Failed...Exiting..",__LINE__);
3742 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d:[ALLOC] %p",__LINE__,pTemp_lcml);
3746 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Memory Allocation Failed",__LINE__);
3751 pComponentPrivate->pLcmlBufHeader[OUTPUT_PORT] = pTemp_lcml;
3753 pComponentPrivate->pOutputBufferList->EosFlagSent = 0;
3754 pComponentPrivate->InputEosSet = 0;
3758 pTemp = pComponentPrivate->pOutputBufferList->pBufHdr[i];
3764 pComponentPrivate->nVersion = pTemp->nVersion.nVersion;
3765 pTemp->pPlatformPrivate = pHandle->pComponentPrivate;
3777 pComponentPrivate->bPortDefsAllocated = 1;
3779 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Exiting WMADECFill_LCMLInitParams",__LINE__);
3781 pComponentPrivate->bInitParamsInitialized = 1;
3887 void WMADEC_HandleUSNError (WMADEC_COMPONENT_PRIVATE *pComponentPrivate, OMX_U32 arg)
3898 OMX_ERROR4(pComponentPrivate->dbg, "Algorithm Error" );
3905 OMX_PRDSP2(pComponentPrivate->dbg, "%d :: GOT MESSAGE IUALG_WARN_PLAYCOMPLETED\n", __LINE__);
3906 pComponentPrivate->pOutputBufferList->EosFlagSent = 1;
3907 pComponentPrivate->cbInfo.EventHandler(
3908 pComponentPrivate->pHandle,
3909 pComponentPrivate->pHandle->pApplicationPrivate,
3927 OMX_ERROR4(pComponentPrivate->dbg, "Algorithm Error, cannot recover" );
3928 pComponentPrivate->bIsInvalidState=OMX_TRUE;
3929 pComponentPrivate->curState = OMX_StateInvalid;
3930 pHandle = pComponentPrivate->pHandle;
3931 pComponentPrivate->cbInfo.EventHandler(pHandle,
3954 pCompPrivate = (WMADEC_COMPONENT_PRIVATE *)pHandle->pComponentPrivate;