d3d11screencapturesrc: Fix wrong color with HDR enabled
authorSeungha Yang <seungha@centricular.com>
Wed, 15 Nov 2023 13:41:47 +0000 (22:41 +0900)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 16 Nov 2023 12:53:31 +0000 (12:53 +0000)
commitd2646e0a1925941533c666d83f79be1325d89ea8
treed34004790fa90494cdb4365f9de919505e1497de
parent1eca0a1049bb2aa25dd1199480b3e1deb9a1b9b0
d3d11screencapturesrc: Fix wrong color with HDR enabled

Even if IDXGIOutput6 says current display colorspace is HDR,
captured texture via IDXGIOutputDuplication::AcquireNextFrame()
is converted frame by OS unless we use IDXGIOutput5::DuplicateOutput1()
with DXGI_FORMAT_R16G16B16A16_FLOAT format, in order for captured
frame to be scRGB color space. Then application should perform
tonemap operation based on reported display white level, color primaries, etc.

Since we don't have any tonemapping implementation, ignores colorimetry
reported by IDXGIOutput6.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3128
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5679>
subprojects/gst-plugins-bad/sys/d3d11/gstd3d11dxgicapture.cpp
subprojects/gst-plugins-bad/sys/d3d11/gstd3d11screencapture.cpp
subprojects/gst-plugins-bad/sys/d3d11/gstd3d11screencapture.h
subprojects/gst-plugins-bad/sys/d3d11/gstd3d11screencapturedevice.cpp
subprojects/gst-plugins-bad/sys/d3d11/gstd3d11screencapturesrc.cpp
subprojects/gst-plugins-bad/sys/d3d11/gstd3d11winrtcapture.cpp