Hello!
I am trying to build an application using the OpenMAX IL API. It should decode H.264 video streams using the OMX.TI.DUCATI1.VIDEO.DECODER running on the OMAP4430 processor.
I can get the component to the OMX_Loaded state with zero problems but can not get it into the OMX_Idle state or into the transient state. A call to OMX_SendCommand(omx_decoder, OMX_CommandStateSet, OMX_StateIdle, NULL); fires an OMX_ErrorInsufficientResources error.
I configure the component as follows:
char * _role = "video_decoder.avc"; OMX_PARAM_COMPONENTROLETYPE role_param; role_param.nSize = sizeof (OMX_PARAM_COMPONENTROLETYPE); role_param.nVersion.s.nVersionMajor = 1; role_param.nVersion.s.nVersionMinor = 1; strcpy((char*)role_param.cRole, _role);
omx_err = OMX_SetParameter(omx_decoder, OMX_IndexParamStandardComponentRole, &role_param);
OMX_PARAM_PORTDEFINITIONTYPE port_def, port_def2;
OMX_INIT_STRUCTURE(port_def);
OMX_INIT_STRUCTURE(port_def2);
port_def.nPortIndex = port_param.nStartPortNumber;
port_def2.nPortIndex = port_param.nStartPortNumber + 1;
omx_err = OMX_GetParameter(omx_decoder, OMX_IndexParamPortDefinition, &port_def);
omx_err = OMX_GetParameter(omx_decoder, OMX_IndexParamPortDefinition, &port_def2);
port_def.format.video.nFrameHeight = 720;
port_def.format.video.nFrameWidth = 1280;
port_def2.format.video.nFrameHeight = 720;
port_def2.format.video.nFrameWidth = 1280;
port_def.format.video.eCompressionFormat = OMX_VIDEO_CodingAVC;
port_def.format.video.eColorFormat = OMX_COLOR_FormatUnused;
port_def.nBufferCountActual = 2;
port_def2.format.video.eCompressionFormat = OMX_VIDEO_CodingUnused;
port_def2.format.video.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
port_def2.nBufferCountActual = 2;
omx_err = OMX_SetParameter(omx_decoder, OMX_IndexParamPortDefinition, &port_def);
omx_err = OMX_SetParameter(omx_decoder, OMX_IndexParamPortDefinition, &port_def2);