How to get the frame size and access to Y and UV planes

Hello everyone,

I am currently decoding a video streaming content into H264, and it’s being stored as OMX_COLOR_FormatYVU420SemiPlanar (i.e. NV21), which is the only color format supported by the target platform.

I basically need to render that content onto display screen. In order to do that, I need to know (1) frame width, (2) frame height and (3) frame size. Moreover, I need to have access to Y and UV planes, so I can render each of them onto the corresponding texture (I’m using OpenGL ES).

As far as frame width and height are concerned, I can retrieve them by a call to OMX_GetParameter(), and nFrameWidth and nFrameHeight fields from OMX_VIDEO_PORTDEFINITIONTYPE structure (inside OMX_PARAM_PORTDEFINITIONTYPE struct). However, I don’t know how I can retrieve frame size information AND how can I grab pixel info from Y and UV planes.

Thanks in advance and regards,
Alexandre Bodi