d3d11window: Prefer full color range for display target colorspace
authorSeungha Yang <seungha@centricular.com>
Mon, 16 Nov 2020 11:44:06 +0000 (20:44 +0900)
committerSeungha Yang <seungha@centricular.com>
Mon, 16 Nov 2020 11:48:35 +0000 (20:48 +0900)
We don't need to preserve input color range for transformed target
color space. Also some GPUs doesn't seem to be happy with 16-235
color range for RGB color space.
Also, since our default display target color space is
DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709, choosing full color range
would make more sense.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1814>

sys/d3d11/gstd3d11window.cpp

index 5c00c7cb0cfb51d9b3a5c466d6fe67983b42c938..29180b60fb205c16686ec9db362d3713defdf602 100644 (file)
@@ -613,7 +613,10 @@ gst_d3d11_window_prepare (GstD3D11Window * window, guint display_width,
   window->render_info.colorimetry.primaries =
       window->info.colorimetry.primaries;
   window->render_info.colorimetry.transfer = window->info.colorimetry.transfer;
-  window->render_info.colorimetry.range = window->info.colorimetry.range;
+  /* prefer FULL range RGB. STUDIO range doesn't seem to be well supported
+   * color space by GPUs and we don't need to preserve color range for
+   * target display color space type */
+  window->render_info.colorimetry.range = GST_VIDEO_COLOR_RANGE_0_255;
 
 #if (DXGI_HEADER_VERSION >= 4)
   {