From 3dd2b6f20ba416b6c3b6ea37bb8745c959be0542 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Fri, 19 Jun 2020 21:34:32 +0900 Subject: [PATCH] d3d11device: Print supported DXGI format for debugging Part-of: --- sys/d3d11/gstd3d11device.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/sys/d3d11/gstd3d11device.c b/sys/d3d11/gstd3d11device.c index c8df4a8aa1..0641e5a500 100644 --- a/sys/d3d11/gstd3d11device.c +++ b/sys/d3d11/gstd3d11device.c @@ -371,14 +371,29 @@ can_support_format (GstD3D11Device * self, DXGI_FORMAT format) (D3D11_FORMAT_SUPPORT_TEXTURE2D | D3D11_FORMAT_SUPPORT_RENDER_TARGET | D3D11_FORMAT_SUPPORT_SHADER_SAMPLE); - if (!gst_d3d11_is_windows_8_or_greater ()) + if (!gst_d3d11_is_windows_8_or_greater ()) { + GST_WARNING_OBJECT (self, "DXGI format %d needs Windows 8 or greater", + (guint) format); return FALSE; + } hr = ID3D11Device_CheckFormatSupport (handle, format, &supported); - if (!gst_d3d11_result (hr, NULL)) + if (!gst_d3d11_result (hr, NULL)) { + GST_WARNING_OBJECT (self, "DXGI format %d is not supported by device", + (guint) format); return FALSE; + } + + if ((supported & flags) != flags) { + GST_WARNING_OBJECT (self, + "DXGI format %d doesn't support flag 0x%x (supported flag 0x%x)", + (guint) format, (guint) supported, (guint) flags); + return FALSE; + } + + GST_INFO_OBJECT (self, "Device supports DXGI format %d", (guint) format); - return (supported & flags) == flags; + return TRUE; } static void -- 2.34.1