OMX_ERRORTYPE IL_ClientSetCaptureParams (IL_Client *pAppData) { OMX_PARAM_VFCC_HWPORT_PROPERTIES sHwPortParam; OMX_PARAM_VFCC_HWPORT_ID sHwPortId; OMX_CONFIG_VFCC_FRAMESKIP_INFO sCapSkipFrames; OMX_PARAM_CTRL_VIDDECODER_INFO sVidDecParam; OMX_PARAM_BUFFER_MEMORYTYPE memTypeCfg; OMX_PARAM_PORTDEFINITIONTYPE paramPort; OMX_ERRORTYPE eError = OMX_ErrorNone; OMX_INIT_PARAM (¶mPort); /* set input height/width and color format */ paramPort.nPortIndex = OMX_VFCC_OUTPUT_PORT_START_INDEX; OMX_GetParameter (pAppData->pCapHandle, OMX_IndexParamPortDefinition, ¶mPort); paramPort.nPortIndex = OMX_VFCC_OUTPUT_PORT_START_INDEX; paramPort.format.video.nFrameWidth = pAppData->nWidth; paramPort.format.video.nFrameHeight = pAppData->nHeight; paramPort.format.video.nStride = pAppData->nWidth; paramPort.nBufferCountActual = IL_CLIENT_CAPTURE_OUTPUT_BUFFER_COUNT; paramPort.format.video.eCompressionFormat = OMX_VIDEO_CodingUnused; /* Capture output in 420 format */ paramPort.format.video.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar; paramPort.nBufferSize = (paramPort.format.video.nStride * pAppData->nHeight * 3) >> 1; if(pAppData->nScanFormat) { //paramPort.format.video.nStride = pAppData->nWidth << 1; paramPort.format.video.nFrameHeight = pAppData->nHeight >> 1; paramPort.format.video.nStride = pAppData->nWidth ; //paramPort.format.video.eColorFormat = OMX_COLOR_FormatYCbYCr; paramPort.format.video.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar; paramPort.nBufferSize = // (paramPort.format.video.nStride * pAppData->nHeight) >> 1; (paramPort.format.video.nStride * (pAppData->nHeight) * 3) >> 1; } printf ("Buffer Size computed: %d\n", (int) paramPort.nBufferSize); printf ("set input port params (width = %d, height = %d)", (int) pAppData->nWidth, (int) pAppData->nHeight); OMX_SetParameter (pAppData->pCapHandle, OMX_IndexParamPortDefinition, ¶mPort); /* Setting Memory type at output port to Raw Memory */ OMX_INIT_PARAM (&memTypeCfg); memTypeCfg.nPortIndex = OMX_VFCC_OUTPUT_PORT_START_INDEX; memTypeCfg.eBufMemoryType = OMX_BUFFER_MEMORY_DEFAULT; eError = OMX_SetParameter (pAppData->pCapHandle, OMX_TI_IndexParamBuffMemType, &memTypeCfg); if (eError != OMX_ErrorNone) ERROR ("failed to set memory Type at output port\n"); OMX_INIT_PARAM (&sHwPortId); /* capture on C-VIC card: HDMI & SDI on VIP1 port */ if(pAppData->nIsHdmi) { sHwPortId.eHwPortId = OMX_VIDEO_CaptureHWPortVIP1_PORTA ; } else { sHwPortId.eHwPortId = OMX_VIDEO_CaptureHWPortVIP1_PORTA ; } eError = OMX_SetParameter (pAppData->pCapHandle, (OMX_INDEXTYPE) OMX_TI_IndexParamVFCCHwPortID, (OMX_PTR) & sHwPortId); OMX_INIT_PARAM (&sHwPortParam); sHwPortParam.eCaptMode = OMX_VIDEO_CaptureModeSC_NON_MUX; sHwPortParam.eVifMode = OMX_VIDEO_CaptureVifMode_16BIT; sHwPortParam.eInColorFormat = OMX_COLOR_FormatYCbYCr; sHwPortParam.eScanType = OMX_VIDEO_CaptureScanTypeProgressive; sHwPortParam.nMaxHeight = pAppData->nHeight; sHwPortParam.bFieldMerged = OMX_FALSE; if(pAppData->nScanFormat) { sHwPortParam.eScanType = OMX_VIDEO_CaptureScanTypeInterlaced; sHwPortParam.nMaxHeight = pAppData->nHeight >> 1; sHwPortParam.bFieldMerged = OMX_FALSE; } sHwPortParam.nMaxWidth = pAppData->nWidth; sHwPortParam.nMaxChnlsPerHwPort = 1; eError = OMX_SetParameter (pAppData->pCapHandle, (OMX_INDEXTYPE) OMX_TI_IndexParamVFCCHwPortProperties, (OMX_PTR) & sHwPortParam); if(pAppData->nIsHdmi) { /* Set parameters for ADV controller */ OMX_INIT_PARAM (&sHwPortId); /* capture on EIO card is component input at VIP1 port */ sHwPortId.eHwPortId = OMX_VIDEO_CaptureHWPortVIP1_PORTA; eError = OMX_SetParameter (pAppData->pTvpHandle, (OMX_INDEXTYPE) OMX_TI_IndexParamVFCCHwPortID, (OMX_PTR) & sHwPortId); OMX_INIT_PARAM (&sHwPortParam); sHwPortParam.eCaptMode = OMX_VIDEO_CaptureModeSC_NON_MUX; sHwPortParam.eVifMode = OMX_VIDEO_CaptureVifMode_16BIT; sHwPortParam.eInColorFormat = OMX_COLOR_FormatYCbYCr; sHwPortParam.eScanType = OMX_VIDEO_CaptureScanTypeProgressive; sHwPortParam.bFieldMerged = OMX_FALSE; sHwPortParam.nMaxHeight = pAppData->nHeight; if(pAppData->nScanFormat) { sHwPortParam.eScanType = OMX_VIDEO_CaptureScanTypeInterlaced; sHwPortParam.nMaxHeight = pAppData->nHeight >> 1; sHwPortParam.bFieldMerged = OMX_FALSE; } sHwPortParam.nMaxWidth = pAppData->nWidth; sHwPortParam.nMaxChnlsPerHwPort = 1; eError = OMX_SetParameter (pAppData->pTvpHandle, (OMX_INDEXTYPE) OMX_TI_IndexParamVFCCHwPortProperties, (OMX_PTR) & sHwPortParam); OMX_INIT_PARAM (&sVidDecParam); sVidDecParam.videoStandard = OMX_VIDEO_DECODER_STD_720P_60; /* setting ADV7611 component input */ sVidDecParam.videoDecoderId = OMX_VID_DEC_ADV7611_DRV; sVidDecParam.videoSystemId = OMX_VIDEO_DECODER_VIDEO_SYSTEM_AUTO_DETECT; } return (eError); }