0

I was trying a video player pipeline using openmax, which accepts raw h264 streams decodes it and pass it to render. While configuring the ports, I want to set the frame width and frame height to 1280 * 720. But I was getting bad parameter error while setting the parameters. How to set the frame width and frame height for a port in an openmax component, As i m a newbie to these framework, my knowledge is limited. Is there any other feilds I should set before setting the width and height ?

This is how i tried to set the parameter

    memset(&portdef,0,sizeof(OMX_PARAM_PORTDEFINITIONTYPE));
    portdef.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
    portdef.nVersion.nVersion = OMX_VERSION;
    portdef.nPortIndex = 131; 


    portdef.format.video.nFrameWidth = 1280;
    portdef.format.video.nFrameHeight = 720; 

    portdef.nBufferSize = portdef.format.video.nFrameWidth * portdef.format.video.nFrameHeight * 3 / 2;

    /* set the video decode properties */
    if((error = OMX_SetParameter(video_decode,OMX_IndexParamPortDefinition,&portdef)) != OMX_ErrorNone)
        printf("set parameter error for decoder %x\n",error); 

And I was getting the error as

set parameter error for decoder 80001005

and that is the bad parameter error. Why is it comming ?

jithin
  • 637
  • 2
  • 14
  • 26

1 Answers1

0

Your error is OMX_ErrorBadParameter, it might be caused by setting nCountActuals to zero.

If your board is something old it is worthy to check media_profiles.xml if 1280x720 is supported by the component.

Check if hard coded nPortIndex is set to correct value (it should return 0x8000101B OMX_ErrorBadIndex in case of an error, but I saw implementation which returned OMX_ErrorBadParameter instead).

Is 131 output port? If so, you should set also colour format, now it would be set to OMX_COLOR_FormatUnused.