[vlc-commits] d3d11_fmt: reduce the size of processor support logs

Steve Lhomme git at videolan.org
Thu Nov 23 09:58:47 CET 2017


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Wed Nov 22 11:03:35 2017 +0100| [20aa304bbfd8c8cb4f981509e33544f38391c46b] | committer: Jean-Baptiste Kempf

d3d11_fmt: reduce the size of processor support logs

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=20aa304bbfd8c8cb4f981509e33544f38391c46b
---

 modules/video_chroma/d3d11_fmt.c | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/modules/video_chroma/d3d11_fmt.c b/modules/video_chroma/d3d11_fmt.c
index ff9f5a5a7e..b947bd64c4 100644
--- a/modules/video_chroma/d3d11_fmt.c
+++ b/modules/video_chroma/d3d11_fmt.c
@@ -476,10 +476,24 @@ void D3D11_LogProcessorSupport(vlc_object_t *o,
     HRESULT hr;
     for (int format = 0; format < 188; format++) {
         hr = ID3D11VideoProcessorEnumerator_CheckVideoProcessorFormat(processorEnumerator, format, &flags);
-        if (SUCCEEDED(hr) && (flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT))
-            msg_Dbg(o, "processor format %s (%d) is supported for input", DxgiFormatToStr(format),format);
-        if (SUCCEEDED(hr) && (flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT))
-            msg_Dbg(o, "processor format %s (%d) is supported for output", DxgiFormatToStr(format),format);
+        if (FAILED(hr))
+            continue;
+        const char *name = DxgiFormatToStr(format);
+        const char *support = NULL;
+        if ((flags & (D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT|D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT))
+                 == (D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT|D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT))
+            support = "input/output";
+        else if (flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_INPUT)
+            support = "input";
+        else if (flags & D3D11_VIDEO_PROCESSOR_FORMAT_SUPPORT_OUTPUT)
+            support = "output";
+        if (support)
+        {
+            if (name)
+                msg_Dbg(o, "processor format %s is supported for %s", name, support);
+            else
+                msg_Dbg(o, "processor format (%d) is supported for %s", format, support);
+        }
     }
 }
 



More information about the vlc-commits mailing list