I am using LibVLC and want to render the video pixels in memory so I will be able to take a snapshot of a frame without getting the video drawn in a window (as is the default).
If I understand correctly, this can be achieved by calling libvlc_video_set_callbacks and libvlc_video_set_format_callbacks. In the first function I have to specify a callback of type libvlc_video_lock_cb, in which I will have to initialize one of three planes, which I understand are buffers in which pixels will be drawn.
My problem is that the number of bytes that is being used per pixel, as well as the number of planes that have to be initialized, depend on the video chroma. While I know how to obtain a four-letter identifier of this chroma, I have no idea how to obtain these particular properties of it; and without that information, I do not know what size the buffers I have to allocate need to be, and how many planes there are.
Does anyone know how to do this? Or am I understanding something incorrectly?