[vlc-devel] [PATCH 2/8] d3d11va: workaround for Xbox decoder limitations

Steve Lhomme robux4 at videolabs.io
Fri Jan 6 18:32:38 CET 2017


From: Steve Lhomme <slhomme at matroska.org>

---
 modules/codec/avcodec/d3d11va.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index b139b8a..c3f5e9e 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -963,6 +963,17 @@ static int DxCreateDecoderSurfaces(vlc_va_t *va, int codec_id, const video_forma
         ID3D10Multithread_Release(pMultithread);
     }
 
+#if VLC_WINSTORE_APP
+    if (codec_id == AV_CODEC_ID_H264 && 
+        (dx_sys->surface_width > 2304 || dx_sys->surface_height > 2304) &&
+        isXboxHardware((ID3D11Device*) dx_sys->d3ddev))
+    {
+        msg_Warn(va, "%dx%d resolution not supported by your hardware", dx_sys->surface_width, dx_sys->surface_height);
+        dx_sys->surface_count = 0;
+        return VLC_EGENERIC;
+    }
+#endif
+
     D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC viewDesc;
     ZeroMemory(&viewDesc, sizeof(viewDesc));
     viewDesc.DecodeProfile = dx_sys->input;
-- 
2.10.2



More information about the vlc-devel mailing list