2
votes

I need to convert an RGB texture to the NV12 format which the video codec understands (Y plane immediately followed by UV plane). DXGI_FORMAT_NV12 provides a straightforward view format mapping using R8 for Y and R8G8 for UV, so I use two pixel shaders with an NV12 texture. Unfortunately, this only works on Windows 8. Can I somehow create a texture that has both R8 and R8G8 shader resource views on Windows 7? Or is there another way I can render the YUV data?

1

1 Answers

0
votes

create CreateOffscreenPlainSurface() with following D3DFORMAT

(D3DFORMAT)MAKEFOURCC('N', 'V', '1', '2') //842094158

more detail source code available at my git repo:

https://github.com/sailfish009/sample_direct3d_nv12