[vlc-devel] [PATCH] direct3d9: support the NV12 4:2:0 pixel format

Steve Lhomme robux4 at videolabs.io
Wed Apr 1 13:26:40 CEST 2015


best candidate when using DxVA2 decoding, almost guaranteed to be there if DxVA2 is
---
 modules/video_output/msw/direct3d9.c | 1 +
 src/misc/fourcc.c                    | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/modules/video_output/msw/direct3d9.c b/modules/video_output/msw/direct3d9.c
index 56d053b..d38f3a3 100644
--- a/modules/video_output/msw/direct3d9.c
+++ b/modules/video_output/msw/direct3d9.c
@@ -859,6 +859,7 @@ static const d3d_format_t d3d_formats[] = {
     { "YV12",       MAKEFOURCC('Y','V','1','2'),    VLC_CODEC_YV12,  0,0,0 },
     { "YV12",       MAKEFOURCC('Y','V','1','2'),    VLC_CODEC_I420,  0,0,0 },
     { "YV12",       MAKEFOURCC('Y','V','1','2'),    VLC_CODEC_J420,  0,0,0 },
+    { "NV12",       MAKEFOURCC('N','V','1','2'),    VLC_CODEC_NV12,  0,0,0 },
     { "UYVY",       D3DFMT_UYVY,    VLC_CODEC_UYVY,  0,0,0 },
     { "YUY2",       D3DFMT_YUY2,    VLC_CODEC_YUYV,  0,0,0 },
     { "X8R8G8B8",   D3DFMT_X8R8G8B8,VLC_CODEC_RGB32, 0xff0000, 0x00ff00, 0x0000ff },
diff --git a/src/misc/fourcc.c b/src/misc/fourcc.c
index 014f84b..0a08be4 100644
--- a/src/misc/fourcc.c
+++ b/src/misc/fourcc.c
@@ -1821,6 +1821,9 @@ static const vlc_fourcc_t p_J420_fallback[] = {
 static const vlc_fourcc_t p_YV12_fallback[] = {
     VLC_CODEC_YV12, VLC_CODEC_I420, VLC_CODEC_J420, VLC_CODEC_FALLBACK_420, 0
 };
+static const vlc_fourcc_t p_NV12_fallback[] = {
+    VLC_CODEC_NV12, VLC_CODEC_I420, VLC_CODEC_J420, VLC_CODEC_FALLBACK_420, 0
+};
 
 #define VLC_CODEC_FALLBACK_420_16 \
     VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_J420, VLC_CODEC_FALLBACK_420
@@ -1971,6 +1974,7 @@ static const vlc_fourcc_t *pp_YUV_fallback[] = {
     p_YVYU_fallback,
     p_UYVY_fallback,
     p_VYUY_fallback,
+    p_NV12_fallback,
 
 
     NULL,
-- 
2.3.0




More information about the vlc-devel mailing list