OMX_ERRORTYPE VideoFilter::DoLoaded2Idle() { hTsHandle = tsmCreate(); if(hTsHandle == NULL) { LOG_ERROR("Create Ts manager failed.\n"); return OMX_ErrorUndefined; } return OMX_ErrorNone; }
OMX_ERRORTYPE VideoFilter::InitComponent() { OMX_ERRORTYPE ret = OMX_ErrorNone; OMX_PARAM_PORTDEFINITIONTYPE sPortDef; //OMX_BUFFERSUPPLIERTYPE SupplierType; OMX_INIT_STRUCT(&sPortDef, OMX_PARAM_PORTDEFINITIONTYPE); sPortDef.nPortIndex = IN_PORT; sPortDef.eDir = OMX_DirInput; sPortDef.eDomain = OMX_PortDomainVideo; fsl_osal_memcpy(&sPortDef.format.video, &sInFmt, sizeof(OMX_VIDEO_PORTDEFINITIONTYPE)); sPortDef.bPopulated = OMX_FALSE; sPortDef.bEnabled = OMX_TRUE; sPortDef.nBufferCountMin = nInBufferCnt; sPortDef.nBufferCountActual = nInBufferCnt; sPortDef.nBufferSize = nInBufferSize; ret = ports[IN_PORT]->SetPortDefinition(&sPortDef); if(ret != OMX_ErrorNone) { LOG_ERROR("Set port definition for in port failed.\n"); return ret; } sPortDef.nPortIndex = OUT_PORT; sPortDef.eDir = OMX_DirOutput; sPortDef.nBufferCountMin = nOutBufferCnt; sPortDef.nBufferCountActual = nOutBufferCnt; fsl_osal_memcpy(&sPortDef.format.video, &sOutFmt, sizeof(OMX_VIDEO_PORTDEFINITIONTYPE)); sPortDef.nBufferSize=nOutBufferSize; ret = ports[OUT_PORT]->SetPortDefinition(&sPortDef); if(ret != OMX_ErrorNone) { LOG_ERROR("Set port definition for out port failed.\n"); return ret; } bInit = OMX_FALSE; bGetNewSegment = OMX_TRUE; bNewSegment = OMX_FALSE; bFilterSupportPartilInput = OMX_FALSE; bLastInput = OMX_FALSE; bLastOutput = OMX_FALSE; pCodecData = NULL; nCodecDataLen = 0; bFilterSupportFrmSizeRpt=OMX_FALSE; fsl_osal_memset(&PartialInputHdr, 0, sizeof(OMX_BUFFERHEADERTYPE)); bInReturnBufferState = OMX_FALSE; nDecodeOnly = 0; pInBufferHdr = NULL; bNeedOutBuffer = OMX_TRUE; bNeedInputBuffer = OMX_TRUE; OMX_INIT_STRUCT(&Rotation, OMX_CONFIG_ROTATIONTYPE); Rotation.nPortIndex = OMX_ALL; Rotation.nRotation = 0; hTsHandle = NULL; hTsHandle = tsmCreate(); if(hTsHandle == NULL) { LOG_ERROR("Create Ts manager failed.\n"); return OMX_ErrorUndefined; } ret = InitFilterComponent(); if(ret != OMX_ErrorNone) return ret; return ret; }