[vlc-commits] [Git][videolan/vlc][3.0.x] direct3d11: only send the HDR metadata when they change

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Oct 30 07:09:39 UTC 2023



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
d3832e1c by Steve Lhomme at 2023-10-30T06:43:47+00:00
direct3d11: only send the HDR metadata when they change

Newer Windows issue this warning if we send metadata with each picture:

DXGI WARNING: IDXGISwapChain4::SetHDRMetaData: Redundant invocation on unchanged
metadata could result in presentation performance inefficiency. [ MISCELLANEOUS WARNING #295: ]

Similar code as done in 269540817f0fc882076238ddb0ce904d00ac90f2 for VLC 4.0.

- - - - -


1 changed file:

- modules/video_output/win32/direct3d11.c


Changes:

=====================================
modules/video_output/win32/direct3d11.c
=====================================
@@ -122,6 +122,7 @@ struct vout_display_sys_t
     d3d11_handle_t           hd3d;
     IDXGISwapChain1          *dxgiswapChain;   /* DXGI 1.2 swap chain */
     IDXGISwapChain4          *dxgiswapChain4;  /* DXGI 1.5 for HDR */
+    DXGI_HDR_METADATA_HDR10  hdr10;
     d3d11_device_t           d3d_dev;
     d3d_quad_t               picQuad;
     video_format_t           quad_fmt;
@@ -1103,7 +1104,11 @@ static void Prepare(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
             hdr10.MaxMasteringLuminance = picture->format.mastering.max_luminance;
             hdr10.MaxContentLightLevel = picture->format.lighting.MaxCLL;
             hdr10.MaxFrameAverageLightLevel = picture->format.lighting.MaxFALL;
-            IDXGISwapChain4_SetHDRMetaData(sys->dxgiswapChain4, DXGI_HDR_METADATA_TYPE_HDR10, sizeof(hdr10), &hdr10);
+            if (memcmp(&sys->hdr10, &hdr10, sizeof(hdr10)))
+            {
+                memcpy(&sys->hdr10, &hdr10, sizeof(hdr10));
+                IDXGISwapChain4_SetHDRMetaData(sys->dxgiswapChain4, DXGI_HDR_METADATA_TYPE_HDR10, sizeof(hdr10), &hdr10);
+            }
         }
     }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/d3832e1cdcce175a723246ff26a0a820748eb55e

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/d3832e1cdcce175a723246ff26a0a820748eb55e
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list