Lines Matching refs:pComponentPrivate

120     AACDEC_COMPONENT_PRIVATE *pComponentPrivate = (AACDEC_COMPONENT_PRIVATE *)pHandle->pComponentPrivate;
124 pComponentPrivate->nRuntimeInputBuffers = 0;
125 pComponentPrivate->nRuntimeOutputBuffers = 0;
127 OMX_PRDSP2(pComponentPrivate->dbg, "%d:::pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]->bPopulated = %d\n",
128 __LINE__,pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]->bPopulated);
129 OMX_PRDSP2(pComponentPrivate->dbg, "%d:::pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]->bEnabled = %d\n",
130 __LINE__,pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]->bEnabled);
131 OMX_PRDSP2(pComponentPrivate->dbg, "%d:::pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->bPopulated = %d\n",
132 __LINE__,pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->bPopulated);
133 OMX_PRDSP2(pComponentPrivate->dbg, "%d:::pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->bEnabled = %d\n",
134 __LINE__,pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->bEnabled);
136 pComponentPrivate->strmAttr = NULL;
137 nIpBuf = pComponentPrivate->pInputBufferList->numBuffers;
138 pComponentPrivate->nRuntimeInputBuffers = nIpBuf;
139 nOpBuf = pComponentPrivate->pOutputBufferList->numBuffers;
140 pComponentPrivate->nRuntimeOutputBuffers = nOpBuf;
141 nIpBufSize = pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]->nBufferSize;
142 nOpBufSize = pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->nBufferSize;
144 OMX_PRBUFFER2(pComponentPrivate->dbg, "Input Buffer Count = %ld\n",nIpBuf);
145 OMX_PRBUFFER2(pComponentPrivate->dbg, "Input Buffer Size = %ld\n",nIpBufSize);
146 OMX_PRBUFFER2(pComponentPrivate->dbg, "Output Buffer Count = %ld\n",nOpBuf);
147 OMX_PRBUFFER2(pComponentPrivate->dbg, "Output Buffer Size = %ld\n",nOpBufSize);
181 OMX_PRINT1(pComponentPrivate->dbg, "DLL name0 = %s\n",plcml_Init->NodeInfo.AllUUIDs[0].DllName);
182 OMX_PRINT1(pComponentPrivate->dbg, "DLL name1 = %s\n",plcml_Init->NodeInfo.AllUUIDs[1].DllName);
183 OMX_PRINT1(pComponentPrivate->dbg, "DLL name2 = %s\n",plcml_Init->NodeInfo.AllUUIDs[2].DllName);
187 if(pComponentPrivate->dasfmode == 1) {
196 pComponentPrivate->strmAttr = strmAttr;
197 OMX_PRDSP2(pComponentPrivate->dbg, "%d :: AAC DECODER IS RUNNING UNDER DASF MODE \n",__LINE__);
202 strmAttr->uBufsize = pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->nBufferSize;/*Changed for DASF AAC*/
203 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d::strmAttr->uBufsize:%d\n",__LINE__,strmAttr->uBufsize);
213 if (pComponentPrivate->dasfmode == 0){
214 OMX_PRCOMM2(pComponentPrivate->dbg, "%d :: FILE MODE CREATE PHASE PARAMETERS\n",__LINE__);
223 if(pComponentPrivate->nOpBit == 1){
226 arr[8] = pComponentPrivate->framemode; /*Frame mode enable */
229 OMX_PRDSP2(pComponentPrivate->dbg, "%d :: DASF MODE CREATE PHASE PARAMETERS\n",__LINE__);
238 if(pComponentPrivate->nOpBit == 1) {
241 arr[8] = pComponentPrivate->framemode; /*Frame mode enable */
248 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d :: bufAlloced = %lu\n",__LINE__,pComponentPrivate->bufAlloced);
254 pComponentPrivate->pLcmlBufHeader[INPUT_PORT_AACDEC] = pTemp_lcml;
257 pTemp = pComponentPrivate->pInputBufferList->pBufHdr[i];
264 pComponentPrivate->nVersion = pTemp->nVersion.nVersion;
266 pTemp->pPlatformPrivate = pHandle->pComponentPrivate;
282 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d ::Comp: InBuffHeader[%d] = %p\n", __LINE__, i, pTemp);
283 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d ::Comp: >>>> InputBuffHeader[%d]->pBuffer = %p\n",
285 OMX_PRDSP2(pComponentPrivate->dbg, "%d ::Comp: Ip : pTemp_lcml[%d] = %p\n", __LINE__, i, pTemp_lcml);
292 pComponentPrivate->pLcmlBufHeader[OUTPUT_PORT_AACDEC] = pTemp_lcml;
295 pTemp = pComponentPrivate->pOutputBufferList->pBufHdr[i];
301 pTemp->pPlatformPrivate = pHandle->pComponentPrivate;
316 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d ::Comp: >>>>>>>>>>>>> OutBuffHeader[%d] = %p\n",
318 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d ::Comp: >>>> OutBuffHeader[%d]->pBuffer = %p\n",
320 OMX_PRDSP2(pComponentPrivate->dbg, "%d ::Comp: Op : pTemp_lcml[%d] = %p\n", __LINE__, i, pTemp_lcml);
323 pComponentPrivate->bPortDefsAllocated = 1;
324 if (pComponentPrivate->aacParams->eAACProfile == OMX_AUDIO_AACObjectHE){
325 pComponentPrivate->SBR = 1;
326 } else if (pComponentPrivate->aacParams->eAACProfile == OMX_AUDIO_AACObjectHE_PS){
327 pComponentPrivate->parameteric_stereo = PARAMETRIC_STEREO_AACDEC;
330 OMX_MALLOC_SIZE_DSPALIGN(pComponentPrivate->pParams,sizeof (USN_AudioCodecParams),
333 OMX_MALLOC_SIZE_DSPALIGN(pComponentPrivate->AACDEC_UALGParam,sizeof (MPEG4AACDEC_UALGParams),
337 pComponentPrivate->nLcml_nCntIp = 0;
338 pComponentPrivate->nLcml_nCntOpReceived = 0;
341 pComponentPrivate->bInitParamsInitialized = 1;
369 AACDEC_COMPONENT_PRIVATE *pComponentPrivate =
370 (AACDEC_COMPONENT_PRIVATE *)pHandle->pComponentPrivate;
379 pComponentPrivate->lcml_nOpBuf = 0;
380 pComponentPrivate->lcml_nIpBuf = 0;
381 pComponentPrivate->app_nBuf = 0;
382 pComponentPrivate->num_Op_Issued = 0;
383 pComponentPrivate->num_Sent_Ip_Buff = 0;
384 pComponentPrivate->num_Reclaimed_Op_Buff = 0;
385 pComponentPrivate->bIsEOFSent = 0;
386 pComponentPrivate->first_output_buf_rcv = 0;
388 nRet = pipe (pComponentPrivate->dataPipe);
393 nRet = pipe (pComponentPrivate->cmdPipe);
398 nRet = pipe (pComponentPrivate->cmdDataPipe);
405 nRet = pthread_create (&(pComponentPrivate->ComponentThread), &attr, AACDEC_ComponentThread, pComponentPrivate);
407 nRet = pthread_create (&(pComponentPrivate->ComponentThread), NULL, AACDEC_ComponentThread, pComponentPrivate);
409 if ((0 != nRet) || (!pComponentPrivate->ComponentThread)) {
413 pComponentPrivate->bCompThreadStarted = 1;
440 AACDEC_COMPONENT_PRIVATE *pComponentPrivate = (AACDEC_COMPONENT_PRIVATE *)
441 pHandle->pComponentPrivate;
446 OMX_PRINT1(pComponentPrivate->dbg, "%d:::pComponentPrivate->bPortDefsAllocated = %ld\n", __LINE__,pComponentPrivate->bPortDefsAllocated);
447 if (pComponentPrivate->bPortDefsAllocated) {
448 nIpBuf = pComponentPrivate->pInputBufferList->numBuffers;
449 nOpBuf = pComponentPrivate->pOutputBufferList->numBuffers;
451 OMX_PRDSP2(pComponentPrivate->dbg, "%d :: Closing pipes.....\n",__LINE__);
453 nRet = close (pComponentPrivate->dataPipe[0]);
458 nRet = close (pComponentPrivate->dataPipe[1]);
463 nRet = close (pComponentPrivate->cmdPipe[0]);
468 nRet = close (pComponentPrivate->cmdPipe[1]);
473 nRet = close (pComponentPrivate->cmdDataPipe[0]);
478 nRet = close (pComponentPrivate->cmdDataPipe[1]);
483 if (pComponentPrivate->bPortDefsAllocated) {
484 OMX_MEMFREE_STRUCT(pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]);
485 OMX_MEMFREE_STRUCT(pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]);
486 OMX_MEMFREE_STRUCT(pComponentPrivate->aacParams);
487 OMX_MEMFREE_STRUCT(pComponentPrivate->pcmParams);
488 OMX_MEMFREE_STRUCT(pComponentPrivate->pCompPort[INPUT_PORT_AACDEC]->pPortFormat);
489 OMX_MEMFREE_STRUCT(pComponentPrivate->pCompPort[OUTPUT_PORT_AACDEC]->pPortFormat);
490 OMX_MEMFREE_STRUCT(pComponentPrivate->pCompPort[INPUT_PORT_AACDEC]);
491 OMX_MEMFREE_STRUCT(pComponentPrivate->pCompPort[OUTPUT_PORT_AACDEC]);
492 OMX_MEMFREE_STRUCT(pComponentPrivate->sPortParam);
493 OMX_MEMFREE_STRUCT(pComponentPrivate->pPriorityMgmt);
494 OMX_MEMFREE_STRUCT(pComponentPrivate->pInputBufferList);
495 OMX_MEMFREE_STRUCT(pComponentPrivate->pOutputBufferList);
496 OMX_MEMFREE_STRUCT(pComponentPrivate->componentRole);
500 pComponentPrivate->bPortDefsAllocated = 0;
503 OMX_PRDSP2(pComponentPrivate->dbg, "\n\n FreeCompResources: Destroying threads.\n\n");
504 pthread_mutex_destroy(&pComponentPrivate->InLoaded_mutex);
505 pthread_cond_destroy(&pComponentPrivate->InLoaded_threshold);
507 pthread_mutex_destroy(&pComponentPrivate->InIdle_mutex);
508 pthread_cond_destroy(&pComponentPrivate->InIdle_threshold);
510 pthread_mutex_destroy(&pComponentPrivate->AlloBuf_mutex);
511 pthread_cond_destroy(&pComponentPrivate->AlloBuf_threshold);
513 pthread_mutex_destroy(&pComponentPrivate->codecStop_mutex);
514 pthread_cond_destroy(&pComponentPrivate->codecStop_threshold);
516 pthread_mutex_destroy(&pComponentPrivate->codecFlush_mutex);
517 pthread_cond_destroy(&pComponentPrivate->codecFlush_threshold);
519 OMX_DestroyEvent(&(pComponentPrivate->InLoaded_event));
520 OMX_DestroyEvent(&(pComponentPrivate->InIdle_event));
521 OMX_DestroyEvent(&(pComponentPrivate->AlloBuf_event));
533 * @param pComponentPrivate This is component's private date structure.
548 OMX_U32 AACDEC_HandleCommand (AACDEC_COMPONENT_PRIVATE *pComponentPrivate)
552 OMX_COMPONENTTYPE *pHandle = (OMX_COMPONENTTYPE *) pComponentPrivate->pHandle;
556 OMX_HANDLETYPE pLcmlHandle = pComponentPrivate->pLcmlHandle;
568 OMX_PRINT1(pComponentPrivate->dbg, "%d :: >>> Entering HandleCommand Function\n",__LINE__);
569 OMX_PRSTATE1(pComponentPrivate->dbg, "%d :: UTIL: pComponentPrivate->curState = %d\n",__LINE__,pComponentPrivate->curState);
571 ret = read (pComponentPrivate->cmdPipe[0], &command, sizeof (command));
573 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Error in Reading from the Data pipe\n", __LINE__);
575 pComponentPrivate->cbInfo.EventHandler (pHandle,
584 ret = read (pComponentPrivate->cmdDataPipe[0], &commandData, sizeof (commandData));
586 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Error in Reading from the Data pipe\n", __LINE__);
588 pComponentPrivate->cbInfo.EventHandler (pHandle,
596 OMX_PRDSP1(pComponentPrivate->dbg, "---------------------------------------------\n");
597 OMX_PRDSP1(pComponentPrivate->dbg, "%d :: command = %d\n",__LINE__,command);
598 OMX_PRDSP1(pComponentPrivate->dbg, "%d :: commandData = %ld\n",__LINE__,commandData);
599 OMX_PRDSP1(pComponentPrivate->dbg, "---------------------------------------------\n");
602 PERF_ReceivedCommand(pComponentPrivate->pPERFcomp,
610 if (pComponentPrivate->curState == commandedState) {
611 pComponentPrivate->cbInfo.EventHandler ( pHandle,
618 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Error: Same State Given by \
627 OMX_PRDSP2(pComponentPrivate->dbg, "%d: HandleCommand: Cmd Idle \n",__LINE__);
629 if (pComponentPrivate->curState == OMX_StateLoaded || pComponentPrivate->curState == OMX_StateWaitForResources) {
634 PERF_Boundary(pComponentPrivate->pPERFcomp,PERF_BoundaryStart | PERF_BoundarySetup);
636 if (pComponentPrivate->dasfmode == 1) {
637 pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->bEnabled= FALSE;
638 pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->bPopulated= FALSE;
639 if(pComponentPrivate->streamID == 0) {
640 OMX_ERROR4(pComponentPrivate->dbg, "**************************************\n");
641 OMX_ERROR4(pComponentPrivate->dbg, ":: Error = OMX_ErrorInsufficientResources\n");
642 OMX_ERROR4(pComponentPrivate->dbg, "**************************************\n");
644 pComponentPrivate->curState = OMX_StateInvalid;
645 pComponentPrivate->cbInfo.EventHandler(pHandle,
655 OMX_PRCOMM2(pComponentPrivate->dbg, "%d:::pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]->bPopulated = %d\n",
656 __LINE__,pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]->bPopulated);
657 OMX_PRCOMM2(pComponentPrivate->dbg, "%d:::pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]->bEnabled = %d\n",
658 __LINE__,pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]->bEnabled);
659 OMX_PRCOMM2(pComponentPrivate->dbg, "%d:::pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->bPopulated = %d\n",
660 __LINE__,pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->bPopulated);
661 OMX_PRCOMM2(pComponentPrivate->dbg, "%d:::pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->bEnabled = %d\n",
662 __LINE__,pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->bEnabled);
664 if (pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]->bPopulated &&
665 pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]->bEnabled) {
669 if (!pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]->bPopulated &&
670 !pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]->bEnabled) {
674 if (pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->bPopulated &&
675 pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->bEnabled) {
679 if (!pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->bPopulated &&
680 !pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->bEnabled) {
685 pComponentPrivate->InLoaded_readytoidle = 1;
691 pthread_mutex_lock(&pComponentPrivate->InLoaded_mutex);
692 pthread_cond_wait(&pComponentPrivate->InLoaded_threshold, &pComponentPrivate->InLoaded_mutex);
693 pthread_mutex_unlock(&pComponentPrivate->InLoaded_mutex);
695 OMX_WaitForEvent(&(pComponentPrivate->InLoaded_event));
699 pLcmlHandle = (OMX_HANDLETYPE) AACDEC_GetLCMLHandle(pComponentPrivate);
701 OMX_ERROR4(pComponentPrivate->dbg, ":: LCML Handle is NULL........exiting..\n");
702 pComponentPrivate->curState = OMX_StateInvalid;
703 pComponentPrivate->cbInfo.EventHandler( pHandle,
714 OMX_ERROR4(pComponentPrivate->dbg, ":: Error returned from Fill_LCMLInitParams()\n");
715 pComponentPrivate->curState = OMX_StateInvalid;
716 pComponentPrivate->cbInfo.EventHandler( pHandle,
725 pComponentPrivate->pLcmlHandle = (LCML_DSP_INTERFACE *)pLcmlHandle;
730 p,&pLcmlHandle,(void *)p,&cb, (OMX_STRING)pComponentPrivate->sDeviceString);
732 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Error : InitMMCodec failed...>>>>>> \n",__LINE__);
735 pComponentPrivate->cbInfo.EventHandler (pHandle,
747 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Error : InitMMCodec failed...>>>>>> \n",__LINE__);
756 OMX_ERROR4(pComponentPrivate->dbg, "Failed to set Mapping State\n");
763 pComponentPrivate->rmproxyCallback.RMPROXY_Callback =
765 if (pComponentPrivate->curState != OMX_StateWaitForResources){
771 &(pComponentPrivate->rmproxyCallback));
775 PERF_Boundary(pComponentPrivate->pPERFcomp,PERF_BoundaryComplete | PERF_BoundarySetup);
777 pComponentPrivate->curState = OMX_StateIdle;
784 pComponentPrivate->cbInfo.EventHandler(pHandle,
788 pComponentPrivate->curState,
794 pComponentPrivate->curState = OMX_StateWaitForResources;
795 pComponentPrivate->cbInfo.EventHandler(pHandle,
799 pComponentPrivate->curState,
810 pComponentPrivate->curState = OMX_StateIdle;
811 pComponentPrivate->cbInfo.EventHandler(pHandle,
815 pComponentPrivate->curState,
821 PERF_Boundary(pComponentPrivate->pPERFcomp,PERF_BoundaryComplete | PERF_BoundarySetup);
823 pComponentPrivate->curState = OMX_StateIdle;
824 pComponentPrivate->cbInfo.EventHandler(pHandle,
828 pComponentPrivate->curState,
832 } else if (pComponentPrivate->curState == OMX_StateExecuting) {
835 PERF_Boundary(pComponentPrivate->pPERFcomp,PERF_BoundaryComplete | PERF_BoundarySteadyState);
837 OMX_PRDSP2(pComponentPrivate->dbg, "%d :: In HandleCommand: Stopping the codec\n",__LINE__);
838 pComponentPrivate->bDspStoppedWhileExecuting = OMX_TRUE;
839 pComponentPrivate->bNoIdleOnStop = OMX_TRUE;
840 if (pComponentPrivate->codecStop_waitingsignal == 0){
841 pthread_mutex_lock(&pComponentPrivate->codecStop_mutex);
845 if (pComponentPrivate->codecStop_waitingsignal == 0){
846 pthread_cond_wait(&pComponentPrivate->codecStop_threshold, &pComponentPrivate->codecStop_mutex);
847 pComponentPrivate->codecStop_waitingsignal = 0;
848 pthread_mutex_unlock(&pComponentPrivate->codecStop_mutex);
851 OMX_ERROR4(pComponentPrivate->dbg, ": Error Occurred in Codec Stop..\n");
852 pComponentPrivate->curState = OMX_StateInvalid;
853 pComponentPrivate->cbInfo.EventHandler( pHandle,
863 pLcmlHandle = (LCML_DSP_INTERFACE*)pComponentPrivate->pLcmlHandle;
866 OMX_ERROR4(pComponentPrivate->dbg, "Error occurred in Codec mapping flush!\n");
870 } else if (pComponentPrivate->curState == OMX_StatePause) {
874 pLcmlHandle = (LCML_DSP_INTERFACE*)pComponentPrivate->pLcmlHandle;
877 OMX_ERROR4(pComponentPrivate->dbg, "Error occurred in Codec mapping flush!\n");
882 PERF_Boundary(pComponentPrivate->pPERFcomp,PERF_BoundaryComplete | PERF_BoundarySteadyState);
884 OMX_PRDSP2(pComponentPrivate->dbg, "%d :: Comp: Stop Command Received\n",__LINE__);
885 OMX_PRDSP2(pComponentPrivate->dbg, "%d: AACDECUTILS::About to call LCML_ControlCodec\n",__LINE__);
886 pComponentPrivate->bNoIdleOnStop = OMX_TRUE;
887 if (pComponentPrivate->codecStop_waitingsignal == 0){
888 pthread_mutex_lock(&pComponentPrivate->codecStop_mutex);
892 if (pComponentPrivate->codecStop_waitingsignal == 0){
893 pthread_cond_wait(&pComponentPrivate->codecStop_threshold, &pComponentPrivate->codecStop_mutex);
894 pComponentPrivate->codecStop_waitingsignal = 0; // reset the wait condition for next time
895 pthread_mutex_unlock(&pComponentPrivate->codecStop_mutex);
898 OMX_ERROR4(pComponentPrivate->dbg, ": Error Occurred in Codec Stop..\n");
899 pComponentPrivate->curState = OMX_StateInvalid;
900 pComponentPrivate->cbInfo.EventHandler( pHandle,
909 pComponentPrivate->curState = OMX_StateIdle;
913 OMX_PRDSP2(pComponentPrivate->dbg, "%d :: The component is stopped\n",__LINE__);
914 pComponentPrivate->cbInfo.EventHandler( pHandle,
918 pComponentPrivate->curState,
921 OMX_ERROR4(pComponentPrivate->dbg, "%d: Comp: Sending ErrorNotification: Invalid State\n",__LINE__);
922 pComponentPrivate->cbInfo.EventHandler(pHandle,
933 OMX_PRDSP2(pComponentPrivate->dbg, "%d: HandleCommand: Cmd Executing \n",__LINE__);
934 if (pComponentPrivate->curState == OMX_StateIdle) {
935 if(!pComponentPrivate->bConfigData){
944 pComponentPrivate->AACDEC_UALGParam->size = sizeof(MPEG4AACDEC_UALGParams);
945 if(pComponentPrivate->dasfmode == 1) {
946 pComponentPrivate->pParams->unAudioFormat = STEREO_NONINTERLEAVED_STREAM_AACDEC;
947 if(pComponentPrivate->aacParams->nChannels == OMX_AUDIO_ChannelModeMono) {
948 pComponentPrivate->pParams->unAudioFormat = MONO_STREAM_AACDEC;
949 OMX_PRINT2(pComponentPrivate->dbg, "MONO MODE\n");
952 pComponentPrivate->pParams->ulSamplingFreq = pComponentPrivate->aacParams->nSampleRate;
953 pComponentPrivate->pParams->unUUID = pComponentPrivate->streamID;
955 OMX_PRINT2(pComponentPrivate->dbg, "%d ::pComponentPrivate->pParams->unAudioFormat = %d\n",
956 __LINE__,pComponentPrivate->pParams->unAudioFormat);
957 OMX_PRINT2(pComponentPrivate->dbg, "%d ::pComponentPrivate->pParams->ulSamplingFreq = %ld\n",
958 __LINE__,pComponentPrivate->aacParams->nSampleRate);
961 pValues[1] = (OMX_U32)pComponentPrivate->pParams;
966 OMX_ERROR4(pComponentPrivate->dbg, "%d: Error Occurred in Codec StreamControl..\n",__LINE__);
967 pComponentPrivate->curState = OMX_StateInvalid;
968 pComponentPrivate->cbInfo.EventHandler( pHandle,
978 OMX_PRINT2(pComponentPrivate->dbg, "%d :: pComponentPrivate->dualMonoMode %lu \n",__LINE__,pComponentPrivate->dualMonoMode);
979 OMX_PRINT2(pComponentPrivate->dbg, "%d :: pComponentPrivate->parameteric_stereo %lu \n",
980 __LINE__,pComponentPrivate->parameteric_stereo);
981 OMX_PRINT2(pComponentPrivate->dbg, "%d :: pComponentPrivate->SBR %lu \n",__LINE__,pComponentPrivate->SBR);
982 if(pComponentPrivate->parameteric_stereo == PARAMETRIC_STEREO_AACDEC){
983 if(pComponentPrivate->dasfmode == 1){
984 pComponentPrivate->AACDEC_UALGParam->lOutputFormat = EAUDIO_BLOCK;
986 if(pComponentPrivate->pcmParams->bInterleaved){
987 pComponentPrivate->AACDEC_UALGParam->lOutputFormat = EAUDIO_INTERLEAVED;
989 pComponentPrivate->AACDEC_UALGParam->lOutputFormat = EAUDIO_BLOCK;
992 pComponentPrivate->AACDEC_UALGParam->iEnablePS = 1;/*Added for eAAC*/
993 pComponentPrivate->AACDEC_UALGParam->dualMonoMode = pComponentPrivate->dualMonoMode;
994 pComponentPrivate->AACDEC_UALGParam->lSamplingRateIdx = AACDec_GetSampleRateIndexL(pComponentPrivate->aacParams->nSampleRate);
995 pComponentPrivate->AACDEC_UALGParam->bRawFormat = 0;
996 if(pComponentPrivate->aacParams->eAACStreamFormat == OMX_AUDIO_AACStreamFormatRAW){
997 pComponentPrivate->AACDEC_UALGParam->bRawFormat = 1;
999 pComponentPrivate->AACDEC_UALGParam->DownSampleSbr = 1;
1001 OMX_PRINT2(pComponentPrivate->dbg, "Inside the non parametric stereo\n");
1002 if(pComponentPrivate->dasfmode == 1){
1003 pComponentPrivate->AACDEC_UALGParam->lOutputFormat = EAUDIO_BLOCK;
1005 if(pComponentPrivate->pcmParams->bInterleaved){
1006 pComponentPrivate->AACDEC_UALGParam->lOutputFormat = EAUDIO_INTERLEAVED;
1008 pComponentPrivate->AACDEC_UALGParam->lOutputFormat = EAUDIO_BLOCK;
1011 pComponentPrivate->AACDEC_UALGParam->iEnablePS = 0;
1012 pComponentPrivate->AACDEC_UALGParam->dualMonoMode = pComponentPrivate->dualMonoMode;
1013 pComponentPrivate->AACDEC_UALGParam->lSamplingRateIdx = AACDec_GetSampleRateIndexL(pComponentPrivate->aacParams->nSampleRate);
1014 pComponentPrivate->AACDEC_UALGParam->bRawFormat = 0;
1015 if(pComponentPrivate->aacParams->eAACStreamFormat == OMX_AUDIO_AACStreamFormatRAW){
1016 pComponentPrivate->AACDEC_UALGParam->bRawFormat = 1;
1018 pComponentPrivate->AACDEC_UALGParam->DownSampleSbr = 0;
1019 if(pComponentPrivate->SBR ){
1020 pComponentPrivate->AACDEC_UALGParam->DownSampleSbr = 1;
1024 OMX_PRINT2(pComponentPrivate->dbg, "%d::pComponentPrivate->AACDEC_UALGParam->lOutputFormat::%ld\n",
1025 __LINE__,pComponentPrivate->AACDEC_UALGParam->lOutputFormat);
1026 OMX_PRINT2(pComponentPrivate->dbg, "%d::pComponentPrivate->AACDEC_UALGParam->DownSampleSbr::%ld\n",
1027 __LINE__,pComponentPrivate->AACDEC_UALGParam->DownSampleSbr);
1028 OMX_PRINT2(pComponentPrivate->dbg, "%d::pComponentPrivate->AACDEC_UALGParam->iEnablePS::%ld\n",
1029 __LINE__,pComponentPrivate->AACDEC_UALGParam->iEnablePS);
1030 OMX_PRINT2(pComponentPrivate->dbg, "%d::pComponentPrivate->AACDEC_UALGParam->lSamplingRateIdx::%ld\n",
1031 __LINE__,pComponentPrivate->AACDEC_UALGParam->lSamplingRateIdx);
1032 OMX_PRINT2(pComponentPrivate->dbg, "%d::pComponentPrivate->SBR::%lu\n",__LINE__,pComponentPrivate->SBR);
1033 OMX_PRINT2(pComponentPrivate->dbg, "%d::pComponentPrivate->AACDEC_UALGParam->dualMonoMode::%ld\n",
1034 __LINE__,pComponentPrivate->AACDEC_UALGParam->dualMonoMode);
1035 OMX_PRINT2(pComponentPrivate->dbg, "%d::pComponentPrivate->AACDEC_UALGParam->bRawFormat::%ld\n",
1036 __LINE__,pComponentPrivate->AACDEC_UALGParam->bRawFormat);
1038 pValues1[1] = (OMX_U32)pComponentPrivate->AACDEC_UALGParam;
1044 OMX_ERROR4(pComponentPrivate->dbg, "%d: Error Occurred in Codec StreamControl..\n",__LINE__);
1045 pComponentPrivate->curState = OMX_StateInvalid;
1046 pComponentPrivate->cbInfo.EventHandler(pHandle,
1054 OMX_PRDSP2(pComponentPrivate->dbg, "%d :: Algcontrol has been sent to DSP\n",__LINE__);
1055 pComponentPrivate->bDspStoppedWhileExecuting = OMX_FALSE;
1059 OMX_ERROR4(pComponentPrivate->dbg, "%d: Error Occurred in Codec Start..\n",__LINE__);
1063 } else if (pComponentPrivate->curState == OMX_StatePause) {
1065 OMX_PRDSP2(pComponentPrivate->dbg, "%d: UTILS: Resume Command Came from App\n",__LINE__);
1066 OMX_PRDSP2(pComponentPrivate->dbg, "%d: UTILS::About to call LCML_ControlCodec\n",__LINE__);
1070 OMX_ERROR4(pComponentPrivate->dbg, "Error While Resuming the codec\n");
1071 pComponentPrivate->curState = OMX_StateInvalid;
1072 pComponentPrivate->cbInfo.EventHandler( pHandle,
1081 for (i=0; i < pComponentPrivate->nNumInputBufPending; i++) {
1082 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d pComponentPrivate->pInputBufHdrPending[%lu] = %d\n",__LINE__,i,
1083 pComponentPrivate->pInputBufHdrPending[i] != NULL);
1084 if (pComponentPrivate->pInputBufHdrPending[i] != NULL) {
1086 AACDEC_GetCorresponding_LCMLHeader(pComponentPrivate,
1087 pComponentPrivate->pInputBufHdrPending[i]->pBuffer,
1090 AACDEC_SetPending(pComponentPrivate,
1091 pComponentPrivate->pInputBufHdrPending[i],
1094 OMX_PRBUFFER2(pComponentPrivate->dbg,
1098 pComponentPrivate->pInputBufHdrPending[i]->pBuffer,
1099 pComponentPrivate->pInputBufHdrPending[i]->nAllocLen,
1100 pComponentPrivate->pInputBufHdrPending[i]->nFilledLen,
1105 OMX_ERROR4(pComponentPrivate->dbg, ": Error Occurred in LCML QueueBuffer for input\n");
1106 pComponentPrivate->curState = OMX_StateInvalid;
1107 pComponentPrivate->cbInfo.EventHandler( pHandle,
1117 pComponentPrivate->nNumInputBufPending = 0;
1118 for (i=0; i < pComponentPrivate->nNumOutputBufPending; i++) {
1119 OMX_PRDSP2(pComponentPrivate->dbg, "%d pComponentPrivate->pOutputBufHdrPending[%lu] = %p\n",__LINE__,i,
1120 pComponentPrivate->pOutputBufHdrPending[i]);
1121 if (pComponentPrivate->pOutputBufHdrPending[i] != NULL) {
1123 AACDEC_GetCorresponding_LCMLHeader(pComponentPrivate,pComponentPrivate->pOutputBufHdrPending[i]->pBuffer,
1125 AACDEC_SetPending(pComponentPrivate,pComponentPrivate->pOutputBufHdrPending[i],OMX_DirOutput,__LINE__);
1126 OMX_PRDSP2(pComponentPrivate->dbg, "Calling LCML_QueueBuffer Line %d\n",__LINE__);
1129 pComponentPrivate->pOutputBufHdrPending[i]->pBuffer,
1130 pComponentPrivate->pOutputBufHdrPending[i]->nAllocLen,
1136 OMX_ERROR4(pComponentPrivate->dbg, ": Error Occurred in LCML QueueBuffer for output\n");
1137 pComponentPrivate->curState = OMX_StateInvalid;
1138 pComponentPrivate->cbInfo.EventHandler( pHandle,
1148 pComponentPrivate->nNumOutputBufPending = 0;
1150 pComponentPrivate->cbInfo.EventHandler ( pHandle,
1156 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Error: Invalid State Given by Application\n",__LINE__);
1159 OMX_PRSTATE2(pComponentPrivate->dbg, "****************** Component State Set to Executing\n\n");
1168 pComponentPrivate->curState = OMX_StateExecuting;
1170 PERF_Boundary(pComponentPrivate->pPERFcomp,PERF_BoundaryStart | PERF_BoundarySteadyState);
1172 pComponentPrivate->cbInfo.EventHandler( pHandle,
1176 pComponentPrivate->curState,
1181 OMX_PRDSP2(pComponentPrivate->dbg, "%d: HandleCommand: Cmd Loaded\n",__LINE__);
1182 if (pComponentPrivate->curState == OMX_StateWaitForResources ){
1183 OMX_PRSTATE2(pComponentPrivate->dbg, "****************** Component State Set to Loaded\n\n");
1185 PERF_Boundary(pComponentPrivate->pPERFcomp,PERF_BoundaryStart | PERF_BoundaryCleanup);
1187 pComponentPrivate->curState = OMX_StateLoaded;
1189 PERF_Boundary(pComponentPrivate->pPERFcomp,PERF_BoundaryComplete | PERF_BoundaryCleanup);
1191 pComponentPrivate->cbInfo.EventHandler ( pHandle,
1195 pComponentPrivate->curState,
1197 OMX_PRDSP2(pComponentPrivate->dbg, "%d :: Tansitioning from WaitFor to Loaded\n",__LINE__);
1201 if (pComponentPrivate->curState != OMX_StateIdle) {
1202 pComponentPrivate->cbInfo.EventHandler ( pHandle,
1208 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Error: Invalid State Given by \
1213 PERF_Boundary(pComponentPrivate->pPERFcomp,PERF_BoundaryStart | PERF_BoundaryCleanup);
1216 OMX_PRSTATE2(pComponentPrivate->dbg,
1219 pComponentPrivate->curState);
1220 OMX_PRBUFFER2(pComponentPrivate->dbg,
1221 "pComponentPrivate->pInputBufferList->numBuffers = %lu\n",
1222 pComponentPrivate->pInputBufferList->numBuffers);
1223 OMX_PRBUFFER2(pComponentPrivate->dbg,
1224 "pComponentPrivate->pOutputBufferList->numBuffers = %lu\n",
1225 pComponentPrivate->pOutputBufferList->numBuffers);
1227 if (pComponentPrivate->pInputBufferList->numBuffers || pComponentPrivate->pOutputBufferList->numBuffers) {
1228 pComponentPrivate->InIdle_goingtoloaded = 1;
1230 pthread_mutex_lock(&pComponentPrivate->InIdle_mutex);
1231 pthread_cond_wait(&pComponentPrivate->InIdle_threshold, &pComponentPrivate->InIdle_mutex);
1232 pthread_mutex_unlock(&pComponentPrivate->InIdle_mutex);
1234 OMX_WaitForEvent(&(pComponentPrivate->InIdle_event));
1236 pComponentPrivate->bLoadedCommandPending = OMX_FALSE;
1242 PERF_SendingCommand(pComponentPrivate->pPERF, -1, 0, PERF_ModuleComponent);
1246 pComponentPrivate->bInitParamsInitialized = 0;
1250 OMX_PRSTATE2(pComponentPrivate->dbg, "%d: HandleCommand: Cmd Pause: Cur State = %d\n",__LINE__,
1251 pComponentPrivate->curState);
1253 if ((pComponentPrivate->curState != OMX_StateExecuting) &&
1254 (pComponentPrivate->curState != OMX_StateIdle)) {
1255 pComponentPrivate->cbInfo.EventHandler ( pHandle,
1261 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Error: Invalid State Given by \
1266 PERF_Boundary(pComponentPrivate->pPERFcomp,PERF_BoundaryComplete | PERF_BoundarySteadyState);
1269 OMX_PRDSP2(pComponentPrivate->dbg, "%d: AACDECUTILS::About to call LCML_ControlCodec\n",__LINE__);
1274 pComponentPrivate->curState = OMX_StateInvalid;
1275 pComponentPrivate->cbInfo.EventHandler( pHandle,
1281 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Error pausing codec\n",__LINE__);
1292 OMX_PRDSP2(pComponentPrivate->dbg, "%d :: Component: Codec Is Paused\n",__LINE__);
1296 OMX_PRDSP2(pComponentPrivate->dbg, "%d: HandleCommand: Cmd : OMX_StateWaitForResources\n",__LINE__);
1297 if (pComponentPrivate->curState == OMX_StateLoaded) {
1306 pComponentPrivate->curState = OMX_StateWaitForResources;
1307 OMX_PRDSP2(pComponentPrivate->dbg, "%d: Transitioning from Loaded to OMX_StateWaitForResources\n",__LINE__);
1308 pComponentPrivate->cbInfo.EventHandler( pHandle,
1312 pComponentPrivate->curState,
1316 pComponentPrivate->cbInfo.EventHandler( pHandle,
1322 OMX_ERROR4(pComponentPrivate->dbg, "%d :: state transition error\n",__LINE__);
1327 OMX_PRDSP2(pComponentPrivate->dbg, "%d: HandleCommand: Cmd OMX_StateInvalid:\n",__LINE__);
1328 if (pComponentPrivate->curState != OMX_StateWaitForResources &&
1329 pComponentPrivate->curState != OMX_StateInvalid &&
1330 pComponentPrivate->curState != OMX_StateLoaded) {
1336 pComponentPrivate->curState = OMX_StateInvalid;
1337 pComponentPrivate->cbInfo.EventHandler( pHandle,
1343 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Component: Invalid State\n",__LINE__);
1350 OMX_PRDSP2(pComponentPrivate->dbg, "%d: HandleCommand: Cmd OMX_StateMax::\n",__LINE__);
1356 if(!pComponentPrivate->pMarkBuf) {
1357 pComponentPrivate->pMarkBuf = (OMX_MARKTYPE *)(commandData);
1360 if (!pComponentPrivate->bDisableCommandPending) {
1362 for (i=0; i < pComponentPrivate->pInputBufferList->numBuffers; i++) {
1363 OMX_PRBUFFER2(pComponentPrivate->dbg, "pComponentPrivate->pInputBufferList->bBufferPending[%lu] = %lu\n",i,
1364 pComponentPrivate->pInputBufferList->bBufferPending[i]);
1365 if (AACDEC_IsPending(pComponentPrivate,pComponentPrivate->pInputBufferList->pBufHdr[i],OMX_DirInput)) {
1367 PERF_SendingFrame(pComponentPrivate->pPERFcomp,
1368 PREF(pComponentPrivate->pInputBufferList->pBufHdr[i], pBuffer),
1372 OMX_PRBUFFER2(pComponentPrivate->dbg, "Forcing EmptyBufferDone\n");
1373 pComponentPrivate->cbInfo.EmptyBufferDone (pComponentPrivate->pHandle,
1374 pComponentPrivate->pHandle->pApplicationPrivate,
1375 pComponentPrivate->pInputBufferList->pBufHdr[i]);
1376 pComponentPrivate->nEmptyBufferDoneCount++;
1377 SignalIfAllBuffersAreReturned(pComponentPrivate);
1380 pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]->bEnabled = OMX_FALSE;
1383 pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]->bEnabled = OMX_FALSE;
1386 pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->bEnabled = OMX_FALSE;
1389 OMX_PRCOMM2(pComponentPrivate->dbg, "commandData = %ld\n",commandData);
1390 OMX_PRCOMM2(pComponentPrivate->dbg, "pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]->bPopulated = %d\n",
1391 pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]->bPopulated);
1392 OMX_PRCOMM2(pComponentPrivate->dbg, "pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->bPopulated = %d\n",
1393 pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->bPopulated);
1394 OMX_PRCOMM2(pComponentPrivate->dbg, "pComponentPrivate->bDisableCommandPending = %ld\n",pComponentPrivate->bDisableCommandPending);
1397 if(!pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]->bPopulated){
1399 pComponentPrivate->cbInfo.EventHandler( pHandle,
1405 pComponentPrivate->bDisableCommandPending = 0;
1409 pComponentPrivate->bDisableCommandPending = 1;
1410 pComponentPrivate->bDisableCommandParam = commandData;
1415 if (!pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->bPopulated){
1416 OMX_PRCOMM2(pComponentPrivate->dbg, "Disable Output port completed\n\n");
1417 pComponentPrivate->cbInfo.EventHandler( pHandle,
1424 pComponentPrivate->bDisableCommandPending = 0;
1427 pComponentPrivate->bDisableCommandPending = 1;
1428 pComponentPrivate->bDisableCommandParam = commandData;
1433 if (!pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]->bPopulated &&
1434 !pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->bPopulated){
1436 pComponentPrivate->cbInfo.EventHandler( pHandle,
1443 pComponentPrivate->cbInfo.EventHandler( pHandle,
1449 pComponentPrivate->bDisableCommandPending = 0;
1452 pComponentPrivate->bDisableCommandPending = 1;
1453 pComponentPrivate->bDisableCommandParam = commandData;
1455 OMX_PRINT2(pComponentPrivate->dbg, "pComponentPrivate->bDisableCommandParam = %ld\n", pComponentPrivate->bDisableCommandParam);
1459 OMX_PRCOMM2(pComponentPrivate->dbg, "received port enable command\n");
1460 if(!pComponentPrivate->bEnableCommandPending) {
1463 OMX_PRCOMM2(pComponentPrivate->dbg, "setting input port to enabled\n");
1464 pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]->bEnabled = OMX_TRUE;
1465 OMX_PRCOMM2(pComponentPrivate->dbg, "pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]->bEnabled = %d\n",
1466 pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]->bEnabled);
1468 if(pComponentPrivate->AlloBuf_waitingsignal){
1469 pComponentPrivate->AlloBuf_waitingsignal = 0;
1476 if(pComponentPrivate->curState == OMX_StateExecuting) {
1479 pComponentPrivate->bDspStoppedWhileExecuting = OMX_FALSE;
1481 OMX_PRCOMM2(pComponentPrivate->dbg, "setting output port to enabled\n");
1482 pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->bEnabled = OMX_TRUE;
1483 OMX_PRCOMM2(pComponentPrivate->dbg, "pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->bEnabled = %d\n",
1484 pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->bEnabled);
1489 if (pComponentPrivate->curState == OMX_StateLoaded ||
1490 pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]->bPopulated) {
1491 pComponentPrivate->cbInfo.EventHandler(pHandle,
1497 pComponentPrivate->bEnableCommandPending = 0;
1498 pComponentPrivate->reconfigInputPort = 0;
1500 if(pComponentPrivate->AlloBuf_waitingsignal){
1501 pComponentPrivate->AlloBuf_waitingsignal = 0;
1503 pthread_mutex_lock(&pComponentPrivate->AlloBuf_mutex);
1504 pthread_cond_signal(&pComponentPrivate->AlloBuf_threshold);
1505 pthread_mutex_unlock(&pComponentPrivate->AlloBuf_mutex);
1507 OMX_SignalEvent(&(pComponentPrivate->AlloBuf_event));
1517 for (i=0; i < pComponentPrivate->nNumInputBufPending; i++) {
1518 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d pComponentPrivate->pInputBufHdrPending[%lu] = %d\n",__LINE__,i,
1519 pComponentPrivate->pInputBufHdrPending[i] != NULL);
1520 if (pComponentPrivate->pInputBufHdrPending[i] != NULL) {
1522 AACDEC_GetCorresponding_LCMLHeader(pComponentPrivate,pComponentPrivate->pInputBufHdrPending[i]->pBuffer,
1524 AACDEC_SetPending(pComponentPrivate,pComponentPrivate->pInputBufHdrPending[i],OMX_DirInput,__LINE__);
1525 OMX_PRDSP2(pComponentPrivate->dbg, "Calling LCML_QueueBuffer Line %d\n",__LINE__);
1528 pComponentPrivate->pInputBufHdrPending[i]->pBuffer,
1529 pComponentPrivate->pInputBufHdrPending[i]->nAllocLen,
1530 pComponentPrivate->pInputBufHdrPending[i]->nFilledLen,
1535 OMX_ERROR4(pComponentPrivate->dbg, ": Error Occurred in LCML QueueBuffer for input\n");
1536 pComponentPrivate->curState = OMX_StateInvalid;
1537 pComponentPrivate->cbInfo.EventHandler( pHandle,
1547 pComponentPrivate->nNumInputBufPending = 0;
1552 pComponentPrivate->bEnableCommandPending = 1;
1553 pComponentPrivate->bEnableCommandParam = commandData;
1557 if ((pComponentPrivate->curState == OMX_StateLoaded) ||
1558 (pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->bPopulated)){
1559 OMX_PRCOMM2(pComponentPrivate->dbg, "Command port enable completed\n\n");
1560 pComponentPrivate->cbInfo.EventHandler( pHandle,
1566 if(pComponentPrivate->AlloBuf_waitingsignal){
1567 pComponentPrivate->AlloBuf_waitingsignal = 0;
1569 pthread_mutex_lock(&pComponentPrivate->AlloBuf_mutex);
1570 pthread_cond_signal(&pComponentPrivate->AlloBuf_threshold);
1571 pthread_mutex_unlock(&pComponentPrivate->AlloBuf_mutex);
1573 OMX_SignalEvent(&(pComponentPrivate->AlloBuf_event));
1580 for (i=0; i < pComponentPrivate->nNumOutputBufPending; i++) {
1581 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d pComponentPrivate->pOutputBufHdrPending[%lu] = %p\n",__LINE__,i,
1582 pComponentPrivate->pOutputBufHdrPending[i]);
1583 if (pComponentPrivate->pOutputBufHdrPending[i] != NULL) {
1585 AACDEC_GetCorresponding_LCMLHeader(pComponentPrivate,pComponentPrivate->pOutputBufHdrPending[i]->pBuffer,
1587 AACDEC_SetPending(pComponentPrivate,pComponentPrivate->pOutputBufHdrPending[i],OMX_DirOutput,__LINE__);
1588 OMX_PRBUFFER2(pComponentPrivate->dbg, "Calling LCML_QueueBuffer Line %d\n",__LINE__);
1591 pComponentPrivate->pOutputBufHdrPending[i]->pBuffer,
1592 pComponentPrivate->pOutputBufHdrPending[i]->nAllocLen,
1598 OMX_ERROR4(pComponentPrivate->dbg, ": Error Occurred in LCML QueueBuffer for input\n");
1599 pComponentPrivate->curState = OMX_StateInvalid;
1600 pComponentPrivate->cbInfo.EventHandler( pHandle,
1610 pComponentPrivate->nNumOutputBufPending = 0;
1611 pComponentPrivate->bEnableCommandPending = 0;
1612 pComponentPrivate->reconfigOutputPort = 0;
1615 pComponentPrivate->bEnableCommandPending = 1;
1616 pComponentPrivate->bEnableCommandParam = commandData;
1620 if (pComponentPrivate->curState == OMX_StateLoaded ||
1621 (pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]->bPopulated &&
1622 pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->bPopulated)){
1623 pComponentPrivate->cbInfo.EventHandler(pHandle,
1629 pComponentPrivate->reconfigInputPort = 0;
1630 pComponentPrivate->cbInfo.EventHandler(pHandle,
1637 if(pComponentPrivate->AlloBuf_waitingsignal){
1638 pComponentPrivate->AlloBuf_waitingsignal = 0;
1640 pthread_mutex_lock(&pComponentPrivate->AlloBuf_mutex);
1641 pthread_cond_signal(&pComponentPrivate->AlloBuf_threshold);
1642 pthread_mutex_unlock(&pComponentPrivate->AlloBuf_mutex);
1644 OMX_SignalEvent(&(pComponentPrivate->AlloBuf_event));
1647 pComponentPrivate->reconfigOutputPort = 0;
1648 pComponentPrivate->bEnableCommandPending = 0;
1653 for (i=0; i < pComponentPrivate->nNumInputBufPending; i++) {
1654 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d pComponentPrivate->pInputBufHdrPending[%lu] = %d\n",__LINE__,i,
1655 pComponentPrivate->pInputBufHdrPending[i] != NULL);
1656 if (pComponentPrivate->pInputBufHdrPending[i] != NULL) {
1658 AACDEC_GetCorresponding_LCMLHeader(pComponentPrivate,pComponentPrivate->pInputBufHdrPending[i]->pBuffer,
1660 AACDEC_SetPending(pComponentPrivate,pComponentPrivate->pInputBufHdrPending[i],OMX_DirInput,__LINE__);
1661 OMX_PRBUFFER2(pComponentPrivate->dbg, "Calling LCML_QueueBuffer Line %d\n",__LINE__);
1664 pComponentPrivate->pInputBufHdrPending[i]->pBuffer,
1665 pComponentPrivate->pInputBufHdrPending[i]->nAllocLen,
1666 pComponentPrivate->pInputBufHdrPending[i]->nFilledLen,
1671 OMX_ERROR4(pComponentPrivate->dbg, ": Error Occurred in LCML QueueBuffer for input\n");
1672 pComponentPrivate->curState = OMX_StateInvalid;
1673 pComponentPrivate->cbInfo.EventHandler( pHandle,
1683 pComponentPrivate->nNumInputBufPending = 0;
1684 for (i=0; i < pComponentPrivate->nNumOutputBufPending; i++) {
1685 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d pComponentPrivate->pOutputBufHdrPending[%lu] = %p\n",__LINE__,i,
1686 pComponentPrivate->pOutputBufHdrPending[i]);
1687 if (pComponentPrivate->pOutputBufHdrPending[i] != NULL) {
1689 AACDEC_GetCorresponding_LCMLHeader(pComponentPrivate,pComponentPrivate->pOutputBufHdrPending[i]->pBuffer,
1691 AACDEC_SetPending(pComponentPrivate,pComponentPrivate->pOutputBufHdrPending[i],OMX_DirOutput,__LINE__);
1692 OMX_PRDSP2(pComponentPrivate->dbg, "Calling LCML_QueueBuffer Line %d\n",__LINE__);
1695 pComponentPrivate->pOutputBufHdrPending[i]->pBuffer,
1696 pComponentPrivate->pOutputBufHdrPending[i]->nAllocLen,
1702 OMX_ERROR4(pComponentPrivate->dbg, ": Error Occurred in LCML QueueBuffer for input\n");
1703 pComponentPrivate->curState = OMX_StateInvalid;
1704 pComponentPrivate->cbInfo.EventHandler( pHandle,
1714 pComponentPrivate->nNumOutputBufPending = 0;
1717 pComponentPrivate->bEnableCommandPending = 1;
1718 pComponentPrivate->bEnableCommandParam = commandData;
1724 pthread_mutex_lock(&pComponentPrivate->AlloBuf_mutex);
1725 pthread_cond_signal(&pComponentPrivate->AlloBuf_threshold);
1726 pthread_mutex_unlock(&pComponentPrivate->AlloBuf_mutex);
1728 OMX_SignalEvent(&(pComponentPrivate->AlloBuf_event));
1734 OMX_ERROR2(pComponentPrivate->dbg, "Flushing input port:: unhandled ETB's = %ld, handled ETB's = %ld\n", pComponentPrivate->nUnhandledEmptyThisBuffers, pComponentPrivate->nHandledEmptyThisBuffers);
1735 if (pComponentPrivate->nUnhandledEmptyThisBuffers == pComponentPrivate->nHandledEmptyThisBuffers) {
1736 pComponentPrivate->bFlushInputPortCommandPending = OMX_FALSE;
1737 pComponentPrivate->first_buff = 0;
1738 OMX_PRCOMM2(pComponentPrivate->dbg, "about to be Flushing input port\n");
1739 if (pComponentPrivate->num_Sent_Ip_Buff){ //no buffers have been sent yet, no need to flush SN
1744 OMX_PRCOMM2(pComponentPrivate->dbg, "Flushing input port DSP\n");
1745 if (pComponentPrivate->codecFlush_waitingsignal == 0){
1746 pthread_mutex_lock(&pComponentPrivate->codecFlush_mutex);
1750 if (pComponentPrivate->codecFlush_waitingsignal == 0){
1751 pthread_cond_wait(&pComponentPrivate->codecFlush_threshold, &pComponentPrivate->codecFlush_mutex);
1752 pComponentPrivate->codecFlush_waitingsignal = 0;
1753 pthread_mutex_unlock(&pComponentPrivate->codecFlush_mutex);
1760 OMX_ERROR2(pComponentPrivate->dbg, "skipped DSP, Flushing input port\n");
1761 for (i=0; i < pComponentPrivate->nNumInputBufPending; i++) {
1763 PERF_SendingFrame(pComponentPrivate->pPERFcomp,
1764 PREF(pComponentPrivate->pInputBufHdrPending[i],pBuffer),
1769 pComponentPrivate->cbInfo.EmptyBufferDone (pComponentPrivate->pHandle,
1770 pComponentPrivate->pHandle->pApplicationPrivate,
1771 pComponentPrivate->pInputBufHdrPending[i]);
1772 pComponentPrivate->pInputBufHdrPending[i] = NULL;
1773 pComponentPrivate->nEmptyBufferDoneCount++;
1774 SignalIfAllBuffersAreReturned(pComponentPrivate);
1776 pComponentPrivate->nNumInputBufPending=0;
1777 pComponentPrivate->cbInfo.EventHandler(pHandle,
1785 pComponentPrivate->bFlushInputPortCommandPending = OMX_TRUE;
1789 OMX_ERROR2(pComponentPrivate->dbg, "Flushing output port:: unhandled FTB's = %ld, handled FTB's = %ld\n", pComponentPrivate->nUnhandledFillThisBuffers, pComponentPrivate->nHandledFillThisBuffers);
1790 if (pComponentPrivate->nUnhandledFillThisBuffers == pComponentPrivate->nHandledFillThisBuffers) {
1791 pComponentPrivate->bFlushOutputPortCommandPending = OMX_FALSE;
1792 if (pComponentPrivate->first_output_buf_rcv != 0) {
1793 pComponentPrivate->first_buff = 0;
1794 pComponentPrivate->first_output_buf_rcv = 0;
1796 OMX_ERROR2(pComponentPrivate->dbg, "About to be Flushing output port\n");
1797 if(pComponentPrivate->num_Op_Issued && !pComponentPrivate->reconfigOutputPort ){ //no buffers sent to DSP yet
1802 OMX_ERROR2(pComponentPrivate->dbg, "Flushing output port dsp\n");
1803 if (pComponentPrivate->codecFlush_waitingsignal == 0){
1804 pthread_mutex_lock(&pComponentPrivate->codecFlush_mutex);
1808 if (pComponentPrivate->codecFlush_waitingsignal == 0){
1809 pthread_cond_wait(&pComponentPrivate->codecFlush_threshold, &pComponentPrivate->codecFlush_mutex);
1810 pComponentPrivate->codecFlush_waitingsignal = 0;
1811 pthread_mutex_unlock(&pComponentPrivate->codecFlush_mutex);
1817 OMX_ERROR2(pComponentPrivate->dbg, "skipped dsp flush, Flushing output port\n");
1819 for (i=0; i < pComponentPrivate->nNumOutputBufPending; i++) {
1821 PERF_SendingFrame(pComponentPrivate->pPERFcomp,
1822 PREF(pComponentPrivate->pOutputBufHdrPending[i],pBuffer),
1823 PREF(pComponentPrivate->pOutputBufHdrPending[i],nFilledLen),
1827 pComponentPrivate->cbInfo.FillBufferDone (pComponentPrivate->pHandle,
1828 pComponentPrivate->pHandle->pApplicationPrivate,
1829 pComponentPrivate->pOutputBufHdrPending[i]
1831 pComponentPrivate->nOutStandingFillDones--;
1832 pComponentPrivate->nFillBufferDoneCount++;
1833 SignalIfAllBuffersAreReturned(pComponentPrivate);
1834 pComponentPrivate->pOutputBufHdrPending[i] = NULL;
1836 pComponentPrivate->nNumOutputBufPending=0;
1838 pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
1839 pComponentPrivate->pHandle->pApplicationPrivate,
1848 pComponentPrivate->bFlushOutputPortCommandPending = OMX_TRUE;
1859 AACDEC_COMPONENT_PRIVATE *pComponentPrivate)
1874 pComponentPrivate->aacParams->eAACProfile = OMX_AUDIO_AACObjectHE;
1877 pComponentPrivate->aacParams->eAACProfile = OMX_AUDIO_AACObjectHE_PS;
1880 pComponentPrivate->aacParams->eAACProfile = OMX_AUDIO_AACObjectLTP;
1884 pComponentPrivate->aacParams->eAACProfile = OMX_AUDIO_AACObjectLC;
1890 pComponentPrivate->AACDEC_UALGParam->lSamplingRateIdx = iSampleRateIndex;
1892 if(pComponentPrivate->pcmParams->nSamplingRate != AACDec_GetSampleRatebyIndex(iSampleRateIndex)){
1894 pComponentPrivate->aacParams->nSampleRate = AACDec_GetSampleRatebyIndex(iSampleRateIndex);
1895 pComponentPrivate->pcmParams->nSamplingRate = pComponentPrivate->aacParams->nSampleRate;
1896 OMX_PRDSP2(pComponentPrivate->dbg, "New Sample rate detected:: %ld (%ld)\n",pComponentPrivate->AACDEC_UALGParam->lSamplingRateIdx,
1897 pComponentPrivate->pcmParams->nSamplingRate);
1898 pComponentPrivate->reconfigOutputPort = OMX_TRUE;
1902 pComponentPrivate->pcmParams->nChannels = AACDEC_GetBits(&nBitPosition, 4, pHeaderStream, OMX_TRUE);
1903 OMX_PRINT2(pComponentPrivate->dbg, "nChannels %ld\n",pComponentPrivate->pcmParams->nChannels);
1905 pComponentPrivate->pcmParams->nChannels = 2;
1917 OMX_PRDSP2(pComponentPrivate->dbg, "OBJECTTYPE_HE detected!\n");
1918 pComponentPrivate->aacParams->eAACProfile = OMX_AUDIO_AACObjectHE;
1921 OMX_PRDSP2(pComponentPrivate->dbg, "OBJECTTYPE_HE2 detected!\n");
1922 pComponentPrivate->aacParams->eAACProfile = OMX_AUDIO_AACObjectHE_PS;
1924 pComponentPrivate->SBR = AACDEC_GetBits(&nBitPosition, 1, pHeaderStream, OMX_TRUE);
1925 if(pComponentPrivate->SBR){
1927 OMX_PRDSP2(pComponentPrivate->dbg, "sbrPresentFlag detected, externsionSamplingFrequency %ld\n",
1930 OMX_PRDSP2(pComponentPrivate->dbg, "sbrPresentFlag not present! %ld\n",pComponentPrivate->pcmParams->nSamplingRate);
1935 OMX_PRDSP2(pComponentPrivate->dbg, "%s: Parsing AudioSpecificConfig() %d\n",__FUNCTION__, __LINE__);
1936 OMX_PRDSP1(pComponentPrivate->dbg, "%s: profile=%d", __FUNCTION__, iObjectType);
1937 OMX_PRDSP1(pComponentPrivate->dbg, "%s: iSampleRateIndex=%d", __FUNCTION__, iSampleRateIndex);
1938 OMX_PRDSP1(pComponentPrivate->dbg, "%s: nFilledLen=%ld", __FUNCTION__, pBufHeader->nFilledLen);
1942 pComponentPrivate->cbInfo.EmptyBufferDone (pComponentPrivate->pHandle,
1943 pComponentPrivate->pHandle->pApplicationPrivate,
1945 pComponentPrivate->nEmptyBufferDoneCount++;
1946 SignalIfAllBuffersAreReturned(pComponentPrivate);
1960 * @param *pComponentPrivate This is component's private date structure.
1976 AACDEC_COMPONENT_PRIVATE *pComponentPrivate)
1990 pBufHeader->pPlatformPrivate = pComponentPrivate;
1993 OMX_ERROR4(pComponentPrivate->dbg, "%d :: The pBufHeader is not found in the list\n",__LINE__);
1997 pComponentPrivate->nHandledEmptyThisBuffers++;
1998 if (pComponentPrivate->curState == OMX_StateIdle){
1999 pComponentPrivate->cbInfo.EmptyBufferDone (pComponentPrivate->pHandle,
2000 pComponentPrivate->pHandle->pApplicationPrivate,
2002 pComponentPrivate->nEmptyBufferDoneCount++;
2003 SignalIfAllBuffersAreReturned(pComponentPrivate);
2004 OMX_PRBUFFER2(pComponentPrivate->dbg, ":: %d %s In idle state return input buffers\n", __LINE__, __FUNCTION__);
2007 LCML_DSP_INTERFACE *pLcmlHandle = (LCML_DSP_INTERFACE *)pComponentPrivate->pLcmlHandle;
2009 pPortDefIn = pComponentPrivate->pPortDef[OMX_DirInput];
2010 eError = AACDEC_GetCorresponding_LCMLHeader(pComponentPrivate,pBufHeader->pBuffer, OMX_DirInput, &pLcmlHdr);
2012 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Error: Invalid Buffer Came ...\n",__LINE__);
2015 OMX_PRBUFFER1(pComponentPrivate->dbg, "%d:::IN:: pBufHeader->nFilledLen = %ld\n",__LINE__, pBufHeader->nFilledLen);
2018 pComponentPrivate->bBypassDSP = 0;
2019 OMX_PRDSP2(pComponentPrivate->dbg, "%d:::Calling LCML_QueueBuffer\n",__LINE__);
2022 PERF_SendingFrame(pComponentPrivate->pPERFcomp,PREF(pBufHeader,pBuffer),
2029 OMX_PRINT2(pComponentPrivate->dbg, "%d :: bConcealBuffer Is Set Here....\n",__LINE__);
2033 if(pComponentPrivate->SendAfterEOS == 1){
2034 pComponentPrivate->AACDEC_UALGParam->size = sizeof(MPEG4AACDEC_UALGParams);
2035 if(pComponentPrivate->dasfmode == 1) {
2036 pComponentPrivate->pParams->unAudioFormat = STEREO_NONINTERLEAVED_STREAM_AACDEC;
2037 if(pComponentPrivate->aacParams->nChannels == OMX_AUDIO_ChannelModeMono) {
2038 pComponentPrivate->pParams->unAudioFormat = MONO_STREAM_AACDEC;
2041 pComponentPrivate->pParams->ulSamplingFreq = pComponentPrivate->aacParams->nSampleRate;
2042 pComponentPrivate->pParams->unUUID = pComponentPrivate->streamID;
2045 pValues[1] = (OMX_U32)pComponentPrivate->pParams;
2050 OMX_ERROR4(pComponentPrivate->dbg, "%d: Error Occurred in Codec StreamControl..\n",__LINE__);
2051 pComponentPrivate->curState = OMX_StateInvalid;
2052 pComponentPrivate->cbInfo.EventHandler( pComponentPrivate->pHandle,
2053 pComponentPrivate->pHandle->pApplicationPrivate,
2066 pComponentPrivate->bConfigData = 1;
2067 AACDEC_ParseHeader(pBufHeader,pComponentPrivate);
2070 if(pComponentPrivate->reconfigInputPort || pComponentPrivate->reconfigOutputPort){
2071 if(pComponentPrivate->reconfigInputPort && pComponentPrivate->reconfigOutputPort){
2080 pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
2081 pComponentPrivate->pHandle->pApplicationPrivate,
2089 pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
2090 pComponentPrivate->pHandle->pApplicationPrivate,
2097 OMX_PRBUFFER2(pComponentPrivate->dbg, "After EBD::pComponentPrivate->nFillBufferDoneCount = %ld\n", pComponentPrivate->nFillBufferDoneCount);
2098 pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
2099 pComponentPrivate->pHandle->pApplicationPrivate,
2101 pComponentPrivate->reconfigOutputPort ? AACDEC_OUTPUT_PORT : AACDEC_INPUT_PORT,
2106 OMX_PRBUFFER2(pComponentPrivate->dbg, "After PortSettingsChangedEvent::pComponentPrivate->nFillBufferDoneCount = %ld\n\n", pComponentPrivate->nFillBufferDoneCount);
2107 pComponentPrivate->bConfigData = 0;
2111 pComponentPrivate->AACDEC_UALGParam->bRawFormat = 1;
2114 pComponentPrivate->AACDEC_UALGParam->lOutputFormat = EAUDIO_INTERLEAVED;
2116 switch(pComponentPrivate->aacParams->eAACProfile){
2118 pComponentPrivate->AACDEC_UALGParam->iEnablePS = 0;
2119 pComponentPrivate->AACDEC_UALGParam->DownSampleSbr = 1;
2122 pComponentPrivate->AACDEC_UALGParam->iEnablePS = 1;
2123 pComponentPrivate->AACDEC_UALGParam->DownSampleSbr = 1;
2124 pComponentPrivate->parameteric_stereo = PARAMETRIC_STEREO_AACDEC;
2127 pComponentPrivate->AACDEC_UALGParam->iEnablePS = 1;
2128 pComponentPrivate->AACDEC_UALGParam->DownSampleSbr = 1;
2132 OMX_PRDSP2(pComponentPrivate->dbg, "%s: IN Switch::ObjectLC\n", __FUNCTION__);
2133 pComponentPrivate->AACDEC_UALGParam->iEnablePS = 1;
2137 pComponentPrivate->AACDEC_UALGParam->DownSampleSbr = 1;
2144 if(pComponentPrivate->parameteric_stereo == PARAMETRIC_STEREO_AACDEC){
2145 if(pComponentPrivate->dasfmode == 1){
2146 pComponentPrivate->AACDEC_UALGParam->lOutputFormat = EAUDIO_BLOCK;
2149 pComponentPrivate->AACDEC_UALGParam->lOutputFormat = EAUDIO_INTERLEAVED;
2151 pComponentPrivate->AACDEC_UALGParam->iEnablePS = 1;/*Added for eAAC*/
2152 pComponentPrivate->AACDEC_UALGParam->dualMonoMode = pComponentPrivate->dualMonoMode;
2153 pComponentPrivate->AACDEC_UALGParam->lSamplingRateIdx = AACDec_GetSampleRateIndexL(pComponentPrivate->aacParams->nSampleRate);
2154 pComponentPrivate->AACDEC_UALGParam->bRawFormat = 0;
2155 if(pComponentPrivate->aacParams->eAACStreamFormat == OMX_AUDIO_AACStreamFormatRAW){
2156 pComponentPrivate->AACDEC_UALGParam->bRawFormat = 1;
2158 pComponentPrivate->AACDEC_UALGParam->DownSampleSbr = 1;
2161 if(pComponentPrivate->dasfmode == 1){
2162 pComponentPrivate->AACDEC_UALGParam->lOutputFormat = EAUDIO_BLOCK;
2165 pComponentPrivate->AACDEC_UALGParam->lOutputFormat = EAUDIO_INTERLEAVED;
2167 pComponentPrivate->AACDEC_UALGParam->iEnablePS = 0;
2168 pComponentPrivate->AACDEC_UALGParam->dualMonoMode = pComponentPrivate->dualMonoMode;
2169 pComponentPrivate->AACDEC_UALGParam->lSamplingRateIdx = AACDec_GetSampleRateIndexL(pComponentPrivate->aacParams->nSampleRate);
2172 pComponentPrivate->AACDEC_UALGParam->bRawFormat = 0;
2173 if(pComponentPrivate->aacParams->eAACStreamFormat == OMX_AUDIO_AACStreamFormatRAW){
2174 pComponentPrivate->AACDEC_UALGParam->bRawFormat = 1;
2176 pComponentPrivate->AACDEC_UALGParam->DownSampleSbr = 0;
2177 if(pComponentPrivate->SBR ){
2178 pComponentPrivate->AACDEC_UALGParam->DownSampleSbr = 1;
2183 OMX_PRCOMM2(pComponentPrivate->dbg, "Sending codec config params ::: \n");
2184 OMX_PRCOMM2(pComponentPrivate->dbg, "pComponentPrivate->AACDEC_UALGParam->dualMonoMode = %ld\n", pComponentPrivate->AACDEC_UALGParam->dualMonoMode);
2185 OMX_PRCOMM2(pComponentPrivate->dbg, "pComponentPrivate->AACDEC_UALGParam->lSamplingRateIdx = %ld\n", pComponentPrivate->AACDEC_UALGParam->lSamplingRateIdx);
2186 OMX_PRCOMM2(pComponentPrivate->dbg, "pComponentPrivate->AACDEC_UALGParam->iEnablePS = %ld\n", pComponentPrivate->AACDEC_UALGParam->iEnablePS);
2187 OMX_PRCOMM2(pComponentPrivate->dbg, "pComponentPrivate->AACDEC_UALGParam->DownSampleSbr = %ld\n", pComponentPrivate->AACDEC_UALGParam->DownSampleSbr);
2188 OMX_PRCOMM2(pComponentPrivate->dbg, "pComponentPrivate->AACDEC_UALGParam->bRawFormat = %ld\n", pComponentPrivate->AACDEC_UALGParam->bRawFormat);
2189 OMX_PRCOMM2(pComponentPrivate->dbg, "Codec params summary complete ::: \n");
2193 pValues1[1] = (OMX_U32)pComponentPrivate->AACDEC_UALGParam;
2195 OMX_PRDSP2(pComponentPrivate->dbg, "LCML_ControlCodec called to send config data\n");
2199 pComponentPrivate->curState = OMX_StateInvalid;
2200 pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
2201 pComponentPrivate->pHandle->pApplicationPrivate,
2206 OMX_ERROR4(pComponentPrivate->dbg, "ERROR::LCML_ControlCodec called to send config data\n");
2210 pComponentPrivate->bDspStoppedWhileExecuting = OMX_FALSE;
2214 OMX_ERROR4(pComponentPrivate->dbg, "%d: Error Occurred in Codec Start..\n",__LINE__);
2218 pComponentPrivate->SendAfterEOS = 0;
2219 OMX_PRINT2(pComponentPrivate->dbg, "sample rate %ld\n",pComponentPrivate->pcmParams->nSamplingRate);
2223 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d :: bLastBuffer Is Set Here....\n",__LINE__);
2225 pComponentPrivate->bIsEOFSent = 1;
2226 pComponentPrivate->SendAfterEOS = 1;
2231 pComponentPrivate->arrBufIndex[pComponentPrivate->IpBufindex] = pBufHeader->nTimeStamp;
2233 pComponentPrivate->arrBufIndexTick[pComponentPrivate->IpBufindex] = pBufHeader->nTickCount;
2234 pComponentPrivate->IpBufindex++;
2235 pComponentPrivate->IpBufindex %= pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]->nBufferCountActual;
2237 if(!pComponentPrivate->framemode){
2238 if(pComponentPrivate->first_buff == 0){
2239 pComponentPrivate->first_TS = pBufHeader->nTimeStamp;
2240 OMX_PRBUFFER2(pComponentPrivate->dbg, "in ts-%ld\n",pBufHeader->nTimeStamp);
2241 pComponentPrivate->first_buff = 1;
2244 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d Comp:: Sending Filled Input buffer = %p, %p\
2246 if (pComponentPrivate->curState == OMX_StateExecuting) {
2247 if (!AACDEC_IsPending(pComponentPrivate,pBufHeader,OMX_DirInput)) {
2248 if(!(pComponentPrivate->bDspStoppedWhileExecuting || pComponentPrivate->bNoIdleOnStop)) {
2249 if(!pComponentPrivate->reconfigInputPort){
2250 AACDEC_SetPending(pComponentPrivate,pBufHeader,OMX_DirInput,__LINE__);
2251 OMX_PRBUFFER2(pComponentPrivate->dbg, "Calling LCML_QueueBuffer Line %d\n",__LINE__);
2252 OMX_PRBUFFER2(pComponentPrivate->dbg, "input pBufHeader->nFilledLen = %ld\n\n", pBufHeader->nFilledLen);
2262 OMX_ERROR4(pComponentPrivate->dbg, ": Error Occurred in LCML QueueBuffer for input\n");
2263 pComponentPrivate->curState = OMX_StateInvalid;
2264 pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
2265 pComponentPrivate->pHandle->pApplicationPrivate,
2275 OMX_PRBUFFER4(pComponentPrivate->dbg, "DON'T queue buffers during a reconfig!!\n");
2276 pComponentPrivate->pInputBufHdrPending[pComponentPrivate->nNumInputBufPending++] = pBufHeader;
2279 OMX_ERROR4(pComponentPrivate->dbg, "%d ::Comp: SetBuff: IP: Error Occurred\n",__LINE__);
2285 PERF_SendingFrame(pComponentPrivate->pPERFcomp,
2290 OMX_PRBUFFER2(pComponentPrivate->dbg, ":: %d %s DSP is stopping, returning input buffer \n",
2292 pComponentPrivate->cbInfo.EmptyBufferDone (pComponentPrivate->pHandle,
2293 pComponentPrivate->pHandle->pApplicationPrivate,
2296 pComponentPrivate->nEmptyBufferDoneCount++;
2297 SignalIfAllBuffersAreReturned(pComponentPrivate);
2300 pComponentPrivate->lcml_nCntIp++;
2301 pComponentPrivate->lcml_nIpBuf++;
2302 pComponentPrivate->num_Sent_Ip_Buff++;
2303 OMX_PRCOMM2(pComponentPrivate->dbg, "Sending Input buffer to Codec\n");
2305 }else if (pComponentPrivate->curState == OMX_StatePause){
2306 pComponentPrivate->pInputBufHdrPending[pComponentPrivate->nNumInputBufPending++] = pBufHeader;
2309 pComponentPrivate->bBypassDSP = 1;
2310 OMX_PRBUFFER2(pComponentPrivate->dbg, "Forcing EmptyBufferDone\n");
2312 PERF_SendingFrame(pComponentPrivate->pPERFcomp,
2313 PREF(pComponentPrivate->pInputBufferList->pBufHdr[0], pBuffer),
2317 pComponentPrivate->cbInfo.EmptyBufferDone (pComponentPrivate->pHandle,
2318 pComponentPrivate->pHandle->pApplicationPrivate,
2319 pComponentPrivate->pInputBufferList->pBufHdr[0]
2321 pComponentPrivate->nEmptyBufferDoneCount++;
2322 SignalIfAllBuffersAreReturned(pComponentPrivate);
2325 OMX_PRDSP2(pComponentPrivate->dbg, "%d:Detected pBufHeader->pMarkData\n",__LINE__);
2326 pComponentPrivate->pMarkData = pBufHeader->pMarkData;
2327 pComponentPrivate->hMarkTargetComponent = pBufHeader->hMarkTargetComponent;
2328 pComponentPrivate->pOutputBufferList->pBufHdr[0]->pMarkData = pBufHeader->pMarkData;
2329 pComponentPrivate->pOutputBufferList->pBufHdr[0]->hMarkTargetComponent = pBufHeader->hMarkTargetComponent;
2330 if(pBufHeader->hMarkTargetComponent == pComponentPrivate->pHandle && pBufHeader->pMarkData){
2331 pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
2332 pComponentPrivate->pHandle->pApplicationPrivate,
2339 if (pComponentPrivate->bFlushInputPortCommandPending) {
2340 OMX_SendCommand(pComponentPrivate->pHandle,OMX_CommandFlush,0,NULL);
2343 pComponentPrivate->nHandledFillThisBuffers++;
2344 if (pComponentPrivate->curState == OMX_StateIdle){
2345 pComponentPrivate->cbInfo.FillBufferDone (pComponentPrivate->pHandle,
2346 pComponentPrivate->pHandle->pApplicationPrivate,
2348 pComponentPrivate->nFillBufferDoneCount++;
2349 SignalIfAllBuffersAreReturned(pComponentPrivate);
2350 OMX_PRBUFFER2(pComponentPrivate->dbg, ":: %d %s In idle state return output buffers\n", __LINE__, __FUNCTION__);
2353 LCML_DSP_INTERFACE *pLcmlHandle = (LCML_DSP_INTERFACE *)pComponentPrivate->pLcmlHandle;
2355 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d : pComponentPrivate->lcml_nOpBuf = %ld\n",__LINE__,pComponentPrivate->lcml_nOpBuf);
2356 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d : pComponentPrivate->lcml_nIpBuf = %ld\n",__LINE__,pComponentPrivate->lcml_nIpBuf);
2357 eError = AACDEC_GetCorresponding_LCMLHeader(pComponentPrivate,pBufHeader->pBuffer, OMX_DirOutput, &pLcmlHdr);
2359 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Error: Invalid Buffer Came ...\n",__LINE__);
2362 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d:::Calling LCML_QueueBuffer\n",__LINE__);
2364 PERF_SendingFrame(pComponentPrivate->pPERFcomp,
2369 if (pComponentPrivate->bBypassDSP == 0) {
2370 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d Comp:: Sending Emptied Output buffer=%p to LCML\n",__LINE__,pBufHeader);
2371 if (pComponentPrivate->curState == OMX_StateExecuting) {
2372 OMX_PRDSP2(pComponentPrivate->dbg, "%d Comp:: in AACDEC UTILS pLcmlHandle->pCodecinterfacehandle= %p\n",
2374 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d Comp:: in AACDEC UTILS EMMCodecOuputBuffer = %u\n",__LINE__,EMMCodecOuputBuffer);
2375 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d OUT:: pBufHeader->nFilledLen = %ld\n",__LINE__,pBufHeader->nFilledLen);
2376 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d Comp:: in AACDEC UTILS pBufHeader->nAllocLen = %lu\n",__LINE__,pBufHeader->nAllocLen);
2377 OMX_PRBUFFER2(pComponentPrivate->dbg, "pComponentPrivate->numPendingBuffers = %lu\n",pComponentPrivate->numPendingBuffers);
2379 if (!AACDEC_IsPending(pComponentPrivate,pBufHeader,OMX_DirOutput) &&
2380 (pComponentPrivate->numPendingBuffers < pComponentPrivate->pOutputBufferList->numBuffers)) {
2381 if (!(pComponentPrivate->bDspStoppedWhileExecuting || pComponentPrivate->bNoIdleOnStop)){
2382 if(!pComponentPrivate->reconfigOutputPort){
2383 AACDEC_SetPending(pComponentPrivate,pBufHeader,OMX_DirOutput,__LINE__);
2393 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Comp:: SetBuff OP: Error Occurred\n", __LINE__);
2395 pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
2396 pComponentPrivate->pHandle->pApplicationPrivate,
2404 pComponentPrivate->lcml_nCntOp++;
2405 pComponentPrivate->lcml_nOpBuf++;
2406 pComponentPrivate->num_Op_Issued++;
2409 pComponentPrivate->pOutputBufHdrPending[pComponentPrivate->nNumOutputBufPending++] = pBufHeader;
2410 OMX_PRDSP2(pComponentPrivate->dbg, "Reconfig:: byPassDSP!!\n");
2413 OMX_PRBUFFER2(pComponentPrivate->dbg, ":: %d %s DSP is stopping, returning output buffer \n",
2415 pComponentPrivate->cbInfo.FillBufferDone (pComponentPrivate->pHandle,
2416 pComponentPrivate->pHandle->pApplicationPrivate,
2418 pComponentPrivate->nFillBufferDoneCount++;
2419 SignalIfAllBuffersAreReturned(pComponentPrivate);
2423 else if (pComponentPrivate->curState == OMX_StatePause) {
2425 pComponentPrivate->pOutputBufHdrPending[pComponentPrivate->nNumOutputBufPending++] = pBufHeader;
2428 if (pComponentPrivate->bFlushOutputPortCommandPending) {
2429 OMX_SendCommand( pComponentPrivate->pHandle,
2435 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d : BufferHeader %p, Buffer %p Unknown ..........\n",__LINE__,pBufHeader, pBufHeader->pBuffer);
2439 OMX_PRINT1(pComponentPrivate->dbg, "%d : Exiting from HandleDataBuf_FromApp: %x \n",__LINE__,eError);
2441 OMX_ERROR4(pComponentPrivate->dbg, "%d : Error = OMX_ErrorBadParameter\n",__LINE__);
2471 AACDEC_COMPONENT_PRIVATE *pComponentPrivate = pBufHeader->pPlatformPrivate;
2472 OMX_U32 nBuf = pComponentPrivate->pInputBufferList->numBuffers;
2478 pBuf = pComponentPrivate->pInputBufferList->pBufHdr[i];
2481 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Buffer %p is INPUT BUFFER\n",__LINE__, pBufHeader);
2487 nBuf = pComponentPrivate->pOutputBufferList->numBuffers;
2490 pBuf = pComponentPrivate->pOutputBufferList->pBufHdr[i];
2493 OMX_PRINT1(pComponentPrivate->dbg, "%d :: Buffer %p is OUTPUT BUFFER\n",__LINE__, pBufHeader);
2539 AACDEC_COMPONENT_PRIVATE* pComponentPrivate = NULL;
2549 pComponentPrivate = (AACDEC_COMPONENT_PRIVATE*)((LCML_DSP_INTERFACE*)args[6])->pComponentPrivate;
2554 OMX_PRDSP2(pComponentPrivate->dbg, "[LCML CALLBACK EVENT] EMMCodecDspError\n");
2558 OMX_PRDSP2(pComponentPrivate->dbg, "[LCML CALLBACK EVENT] EMMCodecInternalError\n");
2562 OMX_PRDSP2(pComponentPrivate->dbg, "[LCML CALLBACK EVENT] EMMCodecInitError\n");
2566 OMX_PRDSP2(pComponentPrivate->dbg, "[LCML CALLBACK EVENT] EMMCodecDspMessageRecieved\n");
2570 OMX_PRDSP2(pComponentPrivate->dbg, "[LCML CALLBACK EVENT] EMMCodecBufferProcessed\n");
2574 OMX_PRDSP2(pComponentPrivate->dbg, "[LCML CALLBACK EVENT] EMMCodecProcessingStarted\n");
2578 OMX_PRDSP2(pComponentPrivate->dbg, "[LCML CALLBACK EVENT] EMMCodecProcessingPaused\n");
2582 OMX_PRDSP2(pComponentPrivate->dbg, "[LCML CALLBACK EVENT] EMMCodecProcessingStoped\n");
2586 OMX_PRDSP2(pComponentPrivate->dbg, "[LCML CALLBACK EVENT] EMMCodecProcessingEof\n");
2590 OMX_PRDSP2(pComponentPrivate->dbg, "[LCML CALLBACK EVENT] EMMCodecBufferNotProcessed\n");
2594 OMX_PRDSP2(pComponentPrivate->dbg, "[LCML CALLBACK EVENT] EMMCodecAlgCtrlAck\n");
2598 OMX_PRDSP2(pComponentPrivate->dbg, "[LCML CALLBACK EVENT] EMMCodecStrmCtrlAck\n");
2604 OMX_PRBUFFER2(pComponentPrivate->dbg, " :: Inside the LCML_Callback EMMCodecInputBuffer\n");
2605 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d :: Input: pBuffer = %p\n",__LINE__, pBuffer);
2606 eError = AACDEC_GetCorresponding_LCMLHeader(pComponentPrivate, pBuffer, OMX_DirInput, &pLcmlHdr);
2608 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Error: Invalid Buffer Came ...\n",__LINE__);
2611 OMX_PRCOMM2(pComponentPrivate->dbg, "%d :: Input: pLcmlHeader = %p\n",__LINE__, pLcmlHdr);
2612 OMX_PRCOMM2(pComponentPrivate->dbg, "%d :: Input: pLcmlHdr->eDir = %u\n",__LINE__, pLcmlHdr->eDir);
2613 OMX_PRCOMM2(pComponentPrivate->dbg, "%d :: Input: *pLcmlHdr->eDir = %u\n",__LINE__, pLcmlHdr->eDir);
2614 OMX_PRCOMM2(pComponentPrivate->dbg, "%d :: Input: Filled Len = %ld\n",__LINE__, pLcmlHdr->pBufHdr->nFilledLen);
2616 PERF_ReceivedFrame(pComponentPrivate->pPERFcomp,
2621 pComponentPrivate->lcml_nCntIpRes++;
2622 AACDEC_ClearPending(pComponentPrivate,pLcmlHdr->pBufHdr,OMX_DirInput,__LINE__);
2625 PERF_SendingFrame(pComponentPrivate->pPERFcomp,
2631 pComponentPrivate->cbInfo.EmptyBufferDone (pComponentPrivate->pHandle,
2632 pComponentPrivate->pHandle->pApplicationPrivate,
2634 pComponentPrivate->nEmptyBufferDoneCount++;
2635 SignalIfAllBuffersAreReturned(pComponentPrivate);
2636 pComponentPrivate->lcml_nIpBuf--;
2637 pComponentPrivate->app_nBuf++;
2640 OMX_PRINT2(pComponentPrivate->dbg, " :: Inside the LCML_Callback EMMCodecOuputBuffer\n");
2641 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d :: Output: pBufferr = %p\n",__LINE__, pBuffer);
2642 if (!AACDEC_IsValid(pComponentPrivate,pBuffer,OMX_DirOutput)) {
2644 PERF_SendingFrame(pComponentPrivate->pPERFcomp,
2645 pComponentPrivate->pOutputBufferList->pBufHdr[pComponentPrivate->nInvalidFrameCount]->pBuffer,
2646 pComponentPrivate->pOutputBufferList->pBufHdr[pComponentPrivate->nInvalidFrameCount]->nFilledLen,
2649 pComponentPrivate->cbInfo.FillBufferDone (pComponentPrivate->pHandle,
2650 pComponentPrivate->pHandle->pApplicationPrivate,
2651 pComponentPrivate->pOutputBufferList->pBufHdr[pComponentPrivate->nInvalidFrameCount++]
2653 pComponentPrivate->nFillBufferDoneCount++;
2654 pComponentPrivate->numPendingBuffers--;
2655 SignalIfAllBuffersAreReturned(pComponentPrivate);
2657 pComponentPrivate->nOutStandingFillDones++;
2658 eError = AACDEC_GetCorresponding_LCMLHeader(pComponentPrivate, pBuffer, OMX_DirOutput, &pLcmlHdr);
2660 OMX_ERROR4(pComponentPrivate->dbg, "%d :: Error: Invalid Buffer Came ...\n",__LINE__);
2664 OMX_PRCOMM2(pComponentPrivate->dbg, "%d :: Output: pLcmlHeader = %p\n",__LINE__, pLcmlHdr);
2665 OMX_PRCOMM2(pComponentPrivate->dbg, "%d :: Output: pLcmlHdr->eDir = %u\n",__LINE__, pLcmlHdr->eDir);
2666 OMX_PRCOMM2(pComponentPrivate->dbg, "%d :: Output: Filled Len = %ld\n",__LINE__, pLcmlHdr->pBufHdr->nFilledLen);
2667 OMX_PRCOMM2(pComponentPrivate->dbg, "%d :: Output: pLcmlHeader->pBufHdr = %p\n",__LINE__, pLcmlHdr->pBufHdr);
2668 pComponentPrivate->lcml_nCntOpReceived++;
2669 pComponentPrivate->first_output_buf_rcv = 1;
2671 PERF_ReceivedFrame(pComponentPrivate->pPERFcomp,
2675 pComponentPrivate->nLcml_nCntOpReceived++;
2676 if ((pComponentPrivate->nLcml_nCntIp >= 1) && (pComponentPrivate->nLcml_nCntOpReceived == 1)) {
2677 PERF_Boundary(pComponentPrivate->pPERFcomp,
2681 AACDEC_ClearPending(pComponentPrivate,pLcmlHdr->pBufHdr,OMX_DirOutput,__LINE__);
2682 if (pComponentPrivate->pMarkData) {
2683 pLcmlHdr->pBufHdr->pMarkData = pComponentPrivate->pMarkData;
2684 pLcmlHdr->pBufHdr->hMarkTargetComponent = pComponentPrivate->hMarkTargetComponent;
2686 pComponentPrivate->num_Reclaimed_Op_Buff++;
2688 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d : UTIL: Adding EOS flag to the output buffer\n",__LINE__);
2690 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d : UTIL:: pLcmlHdr->pBufHdr = %p\n",__LINE__,pLcmlHdr->pBufHdr);
2691 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d : UTIL:: pLcmlHdr->pBufHdr->nFlags = %x\n",__LINE__,(int)pLcmlHdr->pBufHdr->nFlags);
2692 pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
2693 pComponentPrivate->pHandle->pApplicationPrivate,
2697 pComponentPrivate->bIsEOFSent = 0;
2698 OMX_PRINT2(pComponentPrivate->dbg, "%d : UTIL: EOS flag has been propagated\n",__LINE__);
2701 OMX_PRBUFFER2(pComponentPrivate->dbg, "pLcmlHdr->pBufHdr = 0x%p\n",pLcmlHdr->pBufHdr);
2703 if(pComponentPrivate->framemode){
2705 pLcmlHdr->pBufHdr->nTimeStamp = (OMX_TICKS)pComponentPrivate->arrBufIndex[pComponentPrivate->OpBufindex];
2707 if(pComponentPrivate->first_buff == 1){
2708 pComponentPrivate->first_buff = 2;
2709 pLcmlHdr->pBufHdr->nTimeStamp = pComponentPrivate->first_TS;
2710 pComponentPrivate->temp_TS = pLcmlHdr->pBufHdr->nTimeStamp;
2712 if(pComponentPrivate->pcmParams->nChannels == 2) {/* OMX_AUDIO_ChannelModeStereo */
2713 time_stmp = pLcmlHdr->pBufHdr->nFilledLen / (2 * (pComponentPrivate->pcmParams->nBitPerSample / 8));
2715 time_stmp = pLcmlHdr->pBufHdr->nFilledLen / (1 * (pComponentPrivate->pcmParams->nBitPerSample / 8));
2717 time_stmp = (time_stmp / pComponentPrivate->pcmParams->nSamplingRate) * 1000000;
2719 pComponentPrivate->temp_TS += (OMX_U32)time_stmp;
2720 pLcmlHdr->pBufHdr->nTimeStamp = pComponentPrivate->temp_TS;
2723 OMX_PRBUFFER2(pComponentPrivate->dbg, "outs-%lld\n",pLcmlHdr->pBufHdr->nTimeStamp);
2726 pLcmlHdr->pBufHdr->nTickCount = (OMX_U32)pComponentPrivate->arrBufIndexTick[pComponentPrivate->OpBufindex];
2727 pComponentPrivate->OpBufindex++;
2728 pComponentPrivate->OpBufindex %= pComponentPrivate->pPortDef[OMX_DirInput]->nBufferCountActual;
2732 PERF_SendingBuffer(pComponentPrivate->pPERFcomp,
2738 if(pComponentPrivate->reconfigOutputPort){
2741 pComponentPrivate->cbInfo.FillBufferDone (pComponentPrivate->pHandle,
2742 pComponentPrivate->pHandle->pApplicationPrivate,
2745 pComponentPrivate->nFillBufferDoneCount++;
2746 SignalIfAllBuffersAreReturned(pComponentPrivate);
2749 pComponentPrivate->nOutStandingFillDones--;
2750 pComponentPrivate->lcml_nOpBuf--;
2751 pComponentPrivate->app_nBuf++;
2759 for (i = 0; i < pComponentPrivate->nNumInputBufPending; i++) {
2760 pComponentPrivate->cbInfo.EmptyBufferDone (pComponentPrivate->pHandle,
2761 pComponentPrivate->pHandle->pApplicationPrivate,
2762 pComponentPrivate->pInputBufHdrPending[i]);
2763 pComponentPrivate->pInputBufHdrPending[i] = NULL;
2764 pComponentPrivate->nEmptyBufferDoneCount++;
2765 SignalIfAllBuffersAreReturned(pComponentPrivate);
2767 pComponentPrivate->nNumInputBufPending = 0;
2768 for (i=0; i < pComponentPrivate->nNumOutputBufPending; i++) {
2769 pComponentPrivate->cbInfo.FillBufferDone (pComponentPrivate->pHandle,
2770 pComponentPrivate->pHandle->pApplicationPrivate,
2771 pComponentPrivate->pOutputBufHdrPending[i]);
2772 pComponentPrivate->nOutStandingFillDones--;
2773 pComponentPrivate->pOutputBufHdrPending[i] = NULL;
2774 pComponentPrivate->nFillBufferDoneCount++;
2775 SignalIfAllBuffersAreReturned(pComponentPrivate);
2777 pComponentPrivate->nNumOutputBufPending=0;
2778 pthread_mutex_lock(&pComponentPrivate->codecStop_mutex);
2779 if(pComponentPrivate->codecStop_waitingsignal == 0){
2780 pComponentPrivate->codecStop_waitingsignal = 1;
2781 pthread_cond_signal(&pComponentPrivate->codecStop_threshold);
2782 OMX_PRDSP2(pComponentPrivate->dbg,"stop ack. received. stop waiting for sending disable command completed\n");
2784 pthread_mutex_unlock(&pComponentPrivate->codecStop_mutex);
2785 OMX_PRDSP2(pComponentPrivate->dbg, "setting state to idle after EMMCodecProcessingStoped event\n\n");
2786 pComponentPrivate->curState = OMX_StateIdle;
2789 rm_error = RMProxy_NewSendCommand(pComponentPrivate->pHandle, RMProxy_StateSet, OMX_AAC_Decoder_COMPONENT, OMX_StateIdle, 3456, NULL);
2792 if((pComponentPrivate->nEmptyThisBufferCount != pComponentPrivate->nEmptyBufferDoneCount) ||
2793 (pComponentPrivate->nFillThisBufferCount != pComponentPrivate->nFillBufferDoneCount)) {
2796 OMX_ERROR4(pComponentPrivate->dbg, "%d :: UTIL: bufferReturned_mutex mutex lock error\n",__LINE__);
2798 OMX_PRINT2(pComponentPrivate->dbg, ":: pthread_cond_waiting for OMX to return all input and outbut buffers\n");
2800 OMX_PRINT2(pComponentPrivate->dbg, ":: OMX has returned all input and output buffers\n");
2803 OMX_ERROR4(pComponentPrivate->dbg, "%d :: UTIL: bufferReturned_mutex mutex unlock error\n",__LINE__);
2808 OMX_PRINT1(pComponentPrivate->dbg, "OMX has returned all input and output buffers");
2811 if (pComponentPrivate->bPreempted == 0) {
2812 pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
2813 pComponentPrivate->pHandle->pApplicationPrivate,
2816 pComponentPrivate->curState,
2820 pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
2821 pComponentPrivate->pHandle->pApplicationPrivate,
2826 OMX_ERROR4(pComponentPrivate->dbg, "Error: pre-empted\n");
2828 pComponentPrivate->bNoIdleOnStop = OMX_FALSE;
2830 OMX_PRDSP2(pComponentPrivate->dbg, "GOT MESSAGE USN_DSPACK_ALGCTRL \n");
2832 OMX_PRSTATE2(pComponentPrivate->dbg, "%d :: commandedState = %d\n",__LINE__,(int)args[0]);
2833 OMX_PRDSP2(pComponentPrivate->dbg, "%d :: arg4 = %d\n",__LINE__,(int)args[4]);
2834 OMX_PRDSP2(pComponentPrivate->dbg, "%d :: arg5 = %d\n",__LINE__,(int)args[5]);
2835 OMX_PRDSP2(pComponentPrivate->dbg, "%d ::UTIL: EMMCodecDspError Here\n",__LINE__);
2854 pComponentPrivate->bIsInvalidState=OMX_TRUE;
2855 pComponentPrivate->curState = OMX_StateInvalid;
2856 pHandle = pComponentPrivate->pHandle;
2857 pComponentPrivate->cbInfo.EventHandler(pHandle,
2869 AACDEC_HandleUSNError (pComponentPrivate, (OMX_U32)args[5]);
2875 OMX_PRDSP2(pComponentPrivate->dbg, "%d :: GOT MESSAGE USN_DSPACK_STRMCTRL ----\n",__LINE__);
2877 pHandle = pComponentPrivate->pHandle;
2880 OMX_PRCOMM2(pComponentPrivate->dbg, "Flushing input port in lcml_callback %d\n",__LINE__);
2882 for (i=0; i < pComponentPrivate->nNumInputBufPending; i++) {
2884 PERF_SendingFrame(pComponentPrivate->pPERFcomp,
2885 PREF(pComponentPrivate->pInputBufHdrPending[i],pBuffer),
2889 pComponentPrivate->cbInfo.EmptyBufferDone (
2890 pComponentPrivate->pHandle,
2891 pComponentPrivate->pHandle->pApplicationPrivate,
2892 pComponentPrivate->pInputBufHdrPending[i]);
2894 pComponentPrivate->nEmptyBufferDoneCount++;
2895 pComponentPrivate->pInputBufHdrPending[i] = NULL;
2896 SignalIfAllBuffersAreReturned(pComponentPrivate);
2899 pComponentPrivate->nNumInputBufPending=0;
2901 pthread_mutex_lock(&pComponentPrivate->codecFlush_mutex);
2902 if(pComponentPrivate->codecFlush_waitingsignal == 0){
2903 pComponentPrivate->codecFlush_waitingsignal = 1;
2904 pthread_cond_signal(&pComponentPrivate->codecFlush_threshold);
2905 OMX_PRCOMM2(pComponentPrivate->dbg, "flush ack. received. for input port\n");
2907 pthread_mutex_unlock(&pComponentPrivate->codecFlush_mutex);
2909 pComponentPrivate->cbInfo.EventHandler(pHandle,
2916 OMX_ERROR4(pComponentPrivate->dbg, "LCML reported error while flushing input port\n");
2922 OMX_PRCOMM2(pComponentPrivate->dbg, "Flushing output port in lcml_callback %d\n",__LINE__);
2923 for (i=0; i < pComponentPrivate->nNumOutputBufPending; i++) {
2925 PERF_SendingFrame(pComponentPrivate->pPERFcomp,
2926 PREF(pComponentPrivate->pOutputBufHdrPending[i],pBuffer),
2927 PREF(pComponentPrivate->pOutputBufHdrPending[i],nFilledLen),
2931 pComponentPrivate->cbInfo.FillBufferDone (pComponentPrivate->pHandle,
2932 pComponentPrivate->pHandle->pApplicationPrivate,
2933 pComponentPrivate->pOutputBufHdrPending[i]
2935 pComponentPrivate->nOutStandingFillDones--;
2936 pComponentPrivate->nFillBufferDoneCount++;
2937 SignalIfAllBuffersAreReturned(pComponentPrivate);
2938 pComponentPrivate->pOutputBufHdrPending[i] = NULL;
2940 pComponentPrivate->nNumOutputBufPending=0;
2942 pthread_mutex_lock(&pComponentPrivate->codecFlush_mutex);
2943 if(pComponentPrivate->codecFlush_waitingsignal == 0){
2944 pComponentPrivate->codecFlush_waitingsignal = 1;
2945 pthread_cond_signal(&pComponentPrivate->codecFlush_threshold);
2946 OMX_PRCOMM2(pComponentPrivate->dbg, "flush ack. received. for output port\n");
2948 pthread_mutex_unlock(&pComponentPrivate->codecFlush_mutex);
2949 pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
2950 pComponentPrivate->pHandle->pApplicationPrivate,
2957 OMX_ERROR4(pComponentPrivate->dbg, "LCML reported error while flushing output port\n");
2963 pComponentPrivate->curState = OMX_StatePause;
2964 pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle, pComponentPrivate->pHandle->pApplicationPrivate,
2966 pComponentPrivate->curState, NULL);
2972 OMX_ERROR4(pComponentPrivate->dbg, "%d :: UTIL: MMU_Fault \n",__LINE__);
2973 pComponentPrivate->bIsInvalidState=OMX_TRUE;
2974 pComponentPrivate->curState = OMX_StateInvalid;
2975 pHandle = pComponentPrivate->pHandle;
2976 pComponentPrivate->cbInfo.EventHandler(pHandle,
2987 OMX_ERROR4(pComponentPrivate->dbg, "%d :: UTIL: MMU_Fault \n",__LINE__);
2988 pComponentPrivate->bIsInvalidState=OMX_TRUE;
2989 pComponentPrivate->curState = OMX_StateInvalid;
2990 pHandle = pComponentPrivate->pHandle;
2991 pComponentPrivate->cbInfo.EventHandler(pHandle,
3026 OMX_ERRORTYPE AACDEC_GetCorresponding_LCMLHeader(AACDEC_COMPONENT_PRIVATE* pComponentPrivate,
3035 while (!pComponentPrivate->bInitParamsInitialized) {
3045 OMX_PRDSP2(pComponentPrivate->dbg, "%d :: In GetCorresponding_LCMLHeader()\n",__LINE__);
3046 nIpBuf = pComponentPrivate->pInputBufferList->numBuffers;
3047 pLcmlBufHeader = pComponentPrivate->pLcmlBufHeader[INPUT_PORT_AACDEC];
3050 OMX_PRBUFFER2(pComponentPrivate->dbg, "pBuffer = %p\n",pBuffer);
3051 OMX_PRBUFFER2(pComponentPrivate->dbg, "pLcmlBufHeader->pBufHdr->pBuffer = %p\n",pLcmlBufHeader->pBufHdr->pBuffer);
3054 OMX_PRINT1(pComponentPrivate->dbg, "%d::Corresponding LCML Header Found\n",__LINE__);
3061 nOpBuf = pComponentPrivate->pOutputBufferList->numBuffers;
3062 pLcmlBufHeader = pComponentPrivate->pLcmlBufHeader[OUTPUT_PORT_AACDEC];
3063 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d :: nOpBuf = %d\n",__LINE__,nOpBuf);
3066 OMX_PRBUFFER2(pComponentPrivate->dbg, "pBuffer = %p\n",pBuffer);
3067 OMX_PRBUFFER2(pComponentPrivate->dbg, "pLcmlBufHeader->pBufHdr->pBuffer = %p\n",pLcmlBufHeader->pBufHdr->pBuffer);
3070 OMX_PRINT1(pComponentPrivate->dbg, "%d::Corresponding LCML Header Found\n",__LINE__);
3076 OMX_ERROR2(pComponentPrivate->dbg, "%d:: Invalid Buffer Type :: exiting...\n",__LINE__);
3090 * @param *pComponentPrivate This is component's private date structure.
3103 OMX_HANDLETYPE AACDEC_GetLCMLHandle(AACDEC_COMPONENT_PRIVATE* pComponentPrivate)
3126 OMX_ERROR4(pComponentPrivate->dbg, "eError != OMX_ErrorNone...\n");
3130 ((LCML_DSP_INTERFACE*)pHandle)->pComponentPrivate = pComponentPrivate;
3136 OMX_HANDLETYPE AACDEC_GetLCMLHandle(AACDEC_COMPONENT_PRIVATE* pComponentPrivate)
3150 OMX_ERROR4(pComponentPrivate->dbg, "BML Load Failed!!!\n");
3166 OMX_ERROR4(pComponentPrivate->dbg, "eError != OMX_ErrorNone...\n");
3170 ((LCML_DSP_INTERFACE*)pHandle)->pComponentPrivate = pComponentPrivate;
3195 AACDEC_COMPONENT_PRIVATE *pComponentPrivate = (AACDEC_COMPONENT_PRIVATE *)pHandle->pComponentPrivate;
3201 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d :: Freeing: pComponentPrivate->strmAttr = %p\n",
3202 __LINE__, pComponentPrivate->strmAttr);
3203 OMX_MEMFREE_STRUCT(pComponentPrivate->strmAttr);
3205 nIpBuf = pComponentPrivate->nRuntimeInputBuffers;
3206 pTemp_lcml = pComponentPrivate->pLcmlBufHeader[INPUT_PORT_AACDEC];
3208 OMX_PRBUFFER2(pComponentPrivate->dbg, ":: Freeing: pTemp_lcml->pIpParam = %p\n",pTemp_lcml->pIpParam);
3213 OMX_PRBUFFER2(pComponentPrivate->dbg, ":: Freeing pComponentPrivate->pLcmlBufHeader[INPUT_PORT_AACDEC] = %p\n",
3214 pComponentPrivate->pLcmlBufHeader[INPUT_PORT_AACDEC]);
3215 OMX_MEMFREE_STRUCT(pComponentPrivate->pLcmlBufHeader[INPUT_PORT_AACDEC]);
3217 nOpBuf = pComponentPrivate->nRuntimeOutputBuffers;
3218 pComponentPrivate->pLcmlBufHeader[INPUT_PORT_AACDEC] = NULL;
3219 pTemp_lcml = pComponentPrivate->pLcmlBufHeader[OUTPUT_PORT_AACDEC];
3221 OMX_PRBUFFER2(pComponentPrivate->dbg, ":: Freeing: pTemp_lcml->pOpParam = %p\n",pTemp_lcml->pOpParam);
3226 OMX_PRBUFFER2(pComponentPrivate->dbg, ":: Freeing: pComponentPrivate->pLcmlBufHeader[OUTPUT_PORT_AACDEC] = %p\n",
3227 pComponentPrivate->pLcmlBufHeader[OUTPUT_PORT_AACDEC]);
3228 OMX_MEMFREE_STRUCT(pComponentPrivate->pLcmlBufHeader[OUTPUT_PORT_AACDEC]);
3230 OMX_MEMFREE_STRUCT_DSPALIGN(pComponentPrivate->pParams, USN_AudioCodecParams);
3232 OMX_MEMFREE_STRUCT_DSPALIGN(pComponentPrivate->AACDEC_UALGParam, MPEG4AACDEC_UALGParams);
3252 AACDEC_COMPONENT_PRIVATE *pComponentPrivate =
3253 (AACDEC_COMPONENT_PRIVATE *)pHandle->pComponentPrivate;
3260 nIpBuf = pComponentPrivate->nRuntimeInputBuffers;
3261 pTemp_lcml = pComponentPrivate->pLcmlBufHeader[INPUT_PORT_AACDEC];
3263 OMX_PRBUFFER2(pComponentPrivate->dbg, "Freeing: pIpParam = %p\n",
3269 OMX_PRBUFFER2(pComponentPrivate->dbg, "Freeing pLcmlBufHeader[INPUT_PORT_AACDEC] = %p\n",
3270 pComponentPrivate->pLcmlBufHeader[INPUT_PORT_AACDEC]);
3271 OMX_MEMFREE_STRUCT(pComponentPrivate->pLcmlBufHeader[INPUT_PORT_AACDEC]);
3274 nOpBuf = pComponentPrivate->nRuntimeOutputBuffers;
3275 pTemp_lcml = pComponentPrivate->pLcmlBufHeader[OUTPUT_PORT_AACDEC];
3277 OMX_PRBUFFER2(pComponentPrivate->dbg, "Freeing: pOpParam = %p\n",
3283 OMX_PRBUFFER2(pComponentPrivate->dbg, "Freeing: pLcmlBufHeader[OUTPUT_PORT_AACDEC] = %p\n",
3284 pComponentPrivate->pLcmlBufHeader[OUTPUT_PORT_AACDEC]);
3285 OMX_MEMFREE_STRUCT(pComponentPrivate->pLcmlBufHeader[OUTPUT_PORT_AACDEC]);
3288 OMX_ERROR4(pComponentPrivate->dbg, "Bad indexport!\n");
3409 * @param pComponentPrivate This is component's private date area.
3422 void AACDEC_SetPending(AACDEC_COMPONENT_PRIVATE *pComponentPrivate, OMX_BUFFERHEADERTYPE *pBufHdr, OMX_DIRTYPE eDir, OMX_U32 lineNumber)
3427 for (i=0; i < pComponentPrivate->pInputBufferList->numBuffers; i++) {
3428 if (pBufHdr == pComponentPrivate->pInputBufferList->pBufHdr[i]) {
3429 pComponentPrivate->pInputBufferList->bBufferPending[i] = 1;
3430 OMX_PRBUFFER2(pComponentPrivate->dbg, "*******************INPUT BUFFER %d IS PENDING Line %lu, :%p******************************\n",i,lineNumber,pBufHdr);
3435 for (i=0; i < pComponentPrivate->pOutputBufferList->numBuffers; i++) {
3436 if (pBufHdr == pComponentPrivate->pOutputBufferList->pBufHdr[i]) {
3437 pComponentPrivate->pOutputBufferList->bBufferPending[i] = 1;
3438 OMX_PRBUFFER2(pComponentPrivate->dbg, "*******************OUTPUT BUFFER %d IS PENDING Line, %lu :%p******************************\n",i,lineNumber,pBufHdr);
3449 * @param pComponentPrivate This is component's private date area.
3463 void AACDEC_ClearPending(AACDEC_COMPONENT_PRIVATE *pComponentPrivate,
3469 for (i=0; i < pComponentPrivate->pInputBufferList->numBuffers; i++) {
3470 if (pBufHdr == pComponentPrivate->pInputBufferList->pBufHdr[i]) {
3471 pComponentPrivate->pInputBufferList->bBufferPending[i] = 0;
3472 OMX_PRBUFFER2(pComponentPrivate->dbg, "*******************INPUT BUFFER %d IS RECLAIMED Line %lu, :%p******************************\n",i,lineNumber,pBufHdr);
3477 for (i=0; i < pComponentPrivate->pOutputBufferList->numBuffers; i++) {
3478 if (pBufHdr == pComponentPrivate->pOutputBufferList->pBufHdr[i]) {
3479 pComponentPrivate->pOutputBufferList->bBufferPending[i] = 0;
3480 OMX_PRBUFFER2(pComponentPrivate->dbg, "*******************OUTPUT BUFFER %d IS RECLAIMED Line %lu, :%p******************************\n",i,lineNumber,pBufHdr);
3490 * @param pComponentPrivate This is component's private date area.
3503 OMX_U32 AACDEC_IsPending(AACDEC_COMPONENT_PRIVATE *pComponentPrivate, OMX_BUFFERHEADERTYPE *pBufHdr, OMX_DIRTYPE eDir)
3508 for (i=0; i < pComponentPrivate->pInputBufferList->numBuffers; i++) {
3509 if (pBufHdr == pComponentPrivate->pInputBufferList->pBufHdr[i]) {
3510 return pComponentPrivate->pInputBufferList->bBufferPending[i];
3515 for (i=0; i < pComponentPrivate->pOutputBufferList->numBuffers; i++) {
3516 if (pBufHdr == pComponentPrivate->pOutputBufferList->pBufHdr[i]) {
3517 return pComponentPrivate->pOutputBufferList->bBufferPending[i];
3530 * @param pComponentPrivate This is component's private date area.
3543 OMX_U32 AACDEC_IsValid(AACDEC_COMPONENT_PRIVATE *pComponentPrivate, OMX_U8 *pBuffer, OMX_DIRTYPE eDir)
3549 for (i=0; i < pComponentPrivate->pInputBufferList->numBuffers; i++) {
3550 if (pBuffer == pComponentPrivate->pInputBufferList->pBufHdr[i]->pBuffer) {
3556 for (i=0; i < pComponentPrivate->pOutputBufferList->numBuffers; i++) {
3557 if (pBuffer == pComponentPrivate->pOutputBufferList->pBufHdr[i]->pBuffer) {
3587 AACDEC_COMPONENT_PRIVATE *pComponentPrivate =
3588 (AACDEC_COMPONENT_PRIVATE *)pHandle->pComponentPrivate;
3593 nIpBuf = pComponentPrivate->pInputBufferList->numBuffers;
3594 nOpBuf = pComponentPrivate->pOutputBufferList->numBuffers;
3595 nIpBufSize = pComponentPrivate->pPortDef[INPUT_PORT_AACDEC]->nBufferSize;
3596 nOpBufSize = pComponentPrivate->pPortDef[OUTPUT_PORT_AACDEC]->nBufferSize;
3599 OMX_PRBUFFER2(pComponentPrivate->dbg, "Input Buffer Count = %ld\n",nIpBuf);
3600 OMX_PRBUFFER2(pComponentPrivate->dbg, "Input Buffer Size = %ld\n",nIpBufSize);
3601 OMX_PRBUFFER2(pComponentPrivate->dbg, "Output Buffer Count = %ld\n",nOpBuf);
3602 OMX_PRBUFFER2(pComponentPrivate->dbg, "Output Buffer Size = %ld\n",nOpBufSize);
3603 OMX_PRBUFFER2(pComponentPrivate->dbg, "Input Buffer Count = %ld\n",nIpBuf);
3604 OMX_PRBUFFER2(pComponentPrivate->dbg, "Input Buffer Size = %ld\n",nIpBufSize);
3605 OMX_PRBUFFER2(pComponentPrivate->dbg, "Output Buffer Count = %ld\n",nOpBuf);
3606 OMX_PRBUFFER2(pComponentPrivate->dbg, "Output Buffer Size = %ld\n",nOpBufSize);
3611 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d :: bufAlloced = %lu\n",__LINE__,pComponentPrivate->bufAlloced);
3617 pComponentPrivate->pLcmlBufHeader[INPUT_PORT_AACDEC] = pTemp_lcml;
3620 pTemp = pComponentPrivate->pInputBufferList->pBufHdr[i];
3628 pComponentPrivate->nVersion = pTemp->nVersion.nVersion;
3630 pTemp->pPlatformPrivate = pHandle->pComponentPrivate;
3646 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d ::Comp: InBuffHeader[%d] = %p\n", __LINE__, i, pTemp);
3647 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d ::Comp: >>>> InputBuffHeader[%d]->pBuffer = %p\n",
3649 OMX_PRDSP2(pComponentPrivate->dbg, "%d ::Comp: Ip : pTemp_lcml[%d] = %p\n", __LINE__, i, pTemp_lcml);
3658 pComponentPrivate->pLcmlBufHeader[OUTPUT_PORT_AACDEC] = pTemp_lcml;
3661 pTemp = pComponentPrivate->pOutputBufferList->pBufHdr[i];
3669 pComponentPrivate->nVersion = pTemp->nVersion.nVersion;
3671 pTemp->pPlatformPrivate = pHandle->pComponentPrivate;
3687 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d ::Comp: >>>>>>>>>>>>> OutBuffHeader[%d] = %p\n",
3689 OMX_PRBUFFER2(pComponentPrivate->dbg, "%d ::Comp: >>>> OutBuffHeader[%d]->pBuffer = %p\n",
3691 OMX_PRDSP2(pComponentPrivate->dbg, "%d ::Comp: Op : pTemp_lcml[%d] = %p\n", __LINE__, i, pTemp_lcml);
3695 pComponentPrivate->bPortDefsAllocated = 1;
3698 pComponentPrivate->nLcml_nCntIp = 0;
3699 pComponentPrivate->nLcml_nCntOpReceived = 0;
3701 pComponentPrivate->bInitParamsInitialized = 1;
3748 * @param AACDEC_COMPONENT_PRIVATE *pComponentPrivate
3757 void SignalIfAllBuffersAreReturned(AACDEC_COMPONENT_PRIVATE *pComponentPrivate)
3759 if((pComponentPrivate->nEmptyThisBufferCount == pComponentPrivate->nEmptyBufferDoneCount) &&
3760 (pComponentPrivate->nFillThisBufferCount == pComponentPrivate->nFillBufferDoneCount))
3764 OMX_ERROR4(pComponentPrivate->dbg, "%d :: bufferReturned_mutex mutex lock error\n",__LINE__);
3767 OMX_PRINT1(pComponentPrivate->dbg, "Sending pthread signal that OMX has returned all buffers to app");
3770 OMX_ERROR4(pComponentPrivate->dbg, "%d :: bufferReturned_mutex mutex unlock error\n",__LINE__);
3776 void AACDEC_HandleUSNError (AACDEC_COMPONENT_PRIVATE *pComponentPrivate, OMX_U32 arg)
3785 OMX_PRDSP2(pComponentPrivate->dbg, "%d :: LCML_Callback: SBR content detected \n" ,__LINE__);
3786 if(pComponentPrivate->aacParams->eAACProfile != OMX_AUDIO_AACObjectHE &&
3787 pComponentPrivate->aacParams->eAACProfile != OMX_AUDIO_AACObjectHE_PS){
3788 pComponentPrivate->aacParams->eAACProfile = OMX_AUDIO_AACObjectHE;
3789 pComponentPrivate->AACDEC_UALGParam->iEnablePS = 0;
3790 pComponentPrivate->AACDEC_UALGParam->DownSampleSbr = 1;
3793 pValues[1] = (OMX_U32)pComponentPrivate->AACDEC_UALGParam;
3796 eError = LCML_ControlCodec(((LCML_DSP_INTERFACE*)pComponentPrivate->pLcmlHandle)->pCodecinterfacehandle,
3799 OMX_ERROR4(pComponentPrivate->dbg, "%d: Error Occurred in Codec StreamControl..\n",__LINE__);
3800 pComponentPrivate->curState = OMX_StateInvalid;
3801 pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
3802 pComponentPrivate->pHandle->pApplicationPrivate,
3812 OMX_PRDSP2(pComponentPrivate->dbg, "%d :: LCML_Callback: PS content detected \n" ,__LINE__);
3813 if(pComponentPrivate->aacParams->eAACProfile != OMX_AUDIO_AACObjectHE_PS){
3814 pComponentPrivate->AACDEC_UALGParam->lOutputFormat = EAUDIO_INTERLEAVED;
3815 pComponentPrivate->AACDEC_UALGParam->DownSampleSbr = 1;
3816 pComponentPrivate->AACDEC_UALGParam->iEnablePS = 1;
3819 pValues[1] = (OMX_U32)pComponentPrivate->AACDEC_UALGParam;
3822 eError = LCML_ControlCodec(((LCML_DSP_INTERFACE*)pComponentPrivate->pLcmlHandle)->pCodecinterfacehandle,
3825 OMX_ERROR4(pComponentPrivate->dbg, "%d: Error Occurred in Codec StreamControl..\n",__LINE__);
3826 pComponentPrivate->curState = OMX_StateInvalid;
3827 pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
3828 pComponentPrivate->pHandle->pApplicationPrivate,
3838 OMX_ERROR4(pComponentPrivate->dbg, "LCML_Callback: Algorithm error, stream corrupt\n");
3844 OMX_ERROR4(pComponentPrivate->dbg, "Algorithm Error" );
3851 OMX_PRINT2(pComponentPrivate->dbg, "%d :: UTIL: IUALG_WARN_PLAYCOMPLETED/USN_ERR_WARNING event received\n", __LINE__);
3853 pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
3854 pComponentPrivate->pHandle->pApplicationPrivate,
3859 pComponentPrivate->pLcmlBufHeader[0]->pIpParam->bLastBuffer = 0;
3862 pComponentPrivate->cbInfo.EventHandler(pComponentPrivate->pHandle,
3863 pComponentPrivate->pHandle->pApplicationPrivate,
3883 OMX_ERROR4(pComponentPrivate->dbg, "Algorithm Error, cannot recover" );
3884 pComponentPrivate->bIsInvalidState=OMX_TRUE;
3885 pComponentPrivate->curState = OMX_StateInvalid;
3886 pHandle = pComponentPrivate->pHandle;
3887 pComponentPrivate->cbInfo.EventHandler(pHandle,
3909 pCompPrivate = (AACDEC_COMPONENT_PRIVATE *)pHandle->pComponentPrivate;