[vlc-devel] [PATCH 5/5] direct3d11: log which color formats are supported

Steve Lhomme robux4 at videolabs.io
Sat Apr 16 17:47:35 CEST 2016


---
 modules/video_output/msw/direct3d11.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/modules/video_output/msw/direct3d11.c b/modules/video_output/msw/direct3d11.c
index 417f4b8..6ed3629 100644
--- a/modules/video_output/msw/direct3d11.c
+++ b/modules/video_output/msw/direct3d11.c
@@ -34,6 +34,7 @@
 #define COBJMACROS
 #define INITGUID
 #include <d3d11.h>
+#include <dxgi1_4.h>
 
 /* avoided until we can pass ISwapchainPanel without c++/cx mode
 # include <windows.ui.xaml.media.dxinterop.h> */
@@ -1006,6 +1007,23 @@ static int Direct3D11Open(vout_display_t *vd, video_format_t *fmt)
        return VLC_EGENERIC;
     }
 
+    IDXGISwapChain3 *p_swapChain3 = NULL;
+    hr = IDXGISwapChain_QueryInterface( sys->dxgiswapChain, &IID_IDXGISwapChain3, &p_swapChain3);
+    if (FAILED(hr))
+       msg_Err(vd, "Could not create the SwapChain for colorimetry (hr=0x%lX)", hr);
+    else
+    {
+        UINT i_ColorSpaceSupport;
+        for (UINT i=0; i<=DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020; i++)
+        {
+            hr = IDXGISwapChain3_CheckColorSpaceSupport( p_swapChain3, DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P2020, &i_ColorSpaceSupport );
+            if (!FAILED(hr) && (i_ColorSpaceSupport && DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_PRESENT) != 0)
+                msg_Dbg(vd, "color space %s supported%s", (i_ColorSpaceSupport && DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_OVERLAY_PRESENT) ? " with overlay" : "");
+        }
+        //hr = IDXGISwapChain3_SetColorSpace1( p_swapChain3, DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P2020 );
+        IUnknown_Release( p_swapChain3 );
+    }
+
 # endif
 #endif
 
-- 
2.7.0



More information about the vlc-devel mailing list