I am not familiar with YUV and how the data is packed. Given that I have the following code...
int width = 1920;
int height = 1080;
BYTE* yuvData = GetFrame();
...how would I unpack yuvData
into a method that has the following signature...
Display(BYTE* pYplane, BYTE* pVplane, BYTE* pUplane)
The YUV buffer is in planar format.
It depends on the YUV format type which you haven't specified in the question. The following links have a good explanation and illustrations regarding the various YUV types:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd206750%28v=vs.85%29.aspx
For example, one commonly used YUV type is YUV420 planar. In this format the chroma components are down-sampled 2:1 horizontally, and 2:1 vertically. This means that for every 4 luma (Y) values, you have one chroma (1U + 1V) component (see the illustration in the links for a visual). The planar tells you that you first have all the luminance components, followed by all U components, followed by all V components. Therefore
int iSizeY = width * height;
int iSizeUV = (width * height)/4;
BYTE* pY = yuvData;
BYTE* pU = yuvData + iSizeY // there are width * height Y components
BYTE* pV = pU + iSizeUV; // skip the U components