mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-27 11:32:51 +00:00
d3d11window: Remove hack related to color space selection
Use input GstVideoColorPrimaries without any special case handling otherwise rendered image color would be very wrong. The hack was added to work around an issue that some Intel driver couldn't handle wide color gamut image without HDR10 metadata, specifically PQ image. But device capability can be checked via a method added in https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1723 so there's no issue now. Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1175 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1430>
This commit is contained in:
parent
1a12883993
commit
e8c923ebde
3 changed files with 3 additions and 23 deletions
|
@ -514,7 +514,7 @@ gst_d3d11_video_info_to_dxgi_color_space (GstVideoInfo * info)
|
|||
|
||||
const GstDxgiColorSpace *
|
||||
gst_d3d11_find_swap_chain_color_space (GstVideoInfo * info,
|
||||
IDXGISwapChain3 * swapchain, gboolean use_hdr10)
|
||||
IDXGISwapChain3 * swapchain)
|
||||
{
|
||||
const GstDxgiColorSpace *colorspace = NULL;
|
||||
gint best_score = G_MAXINT;
|
||||
|
@ -535,14 +535,6 @@ gst_d3d11_find_swap_chain_color_space (GstVideoInfo * info,
|
|||
DXGI_COLOR_SPACE_TYPE cur_type =
|
||||
(DXGI_COLOR_SPACE_TYPE) rgb_colorspace_map[i].dxgi_color_space_type;
|
||||
|
||||
/* FIXME: Non-HDR colorspace with BT2020 primaries will break rendering.
|
||||
* https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1175
|
||||
* To workaround it, BT709 colorspace will be chosen for non-HDR case.
|
||||
*/
|
||||
if (!use_hdr10 &&
|
||||
rgb_colorspace_map[i].primaries == GST_VIDEO_COLOR_PRIMARIES_BT2020)
|
||||
continue;
|
||||
|
||||
hr = swapchain->CheckColorSpaceSupport (cur_type, &can_support);
|
||||
|
||||
if (FAILED (hr))
|
||||
|
|
|
@ -73,8 +73,7 @@ gboolean gst_d3d11_hdr_meta_data_to_dxgi (GstVideoMasteringDisplayInf
|
|||
const GstDxgiColorSpace * gst_d3d11_video_info_to_dxgi_color_space (GstVideoInfo * info);
|
||||
|
||||
const GstDxgiColorSpace * gst_d3d11_find_swap_chain_color_space (GstVideoInfo * info,
|
||||
IDXGISwapChain3 * swapchain,
|
||||
gboolean use_hdr10);
|
||||
IDXGISwapChain3 * swapchain);
|
||||
#endif
|
||||
|
||||
GstBuffer * gst_d3d11_allocate_staging_buffer_for (GstBuffer * buffer,
|
||||
|
|
|
@ -583,17 +583,6 @@ gst_d3d11_window_prepare_default (GstD3D11Window * window, guint display_width,
|
|||
window->input_rect.bottom = GST_VIDEO_INFO_HEIGHT (&window->info);
|
||||
|
||||
/* Step 4: Decide render color space and set it on converter/processor */
|
||||
|
||||
/* check HDR10 metadata. If HDR APIs are available, BT2020 primaries colorspcae
|
||||
* will be used.
|
||||
*
|
||||
* FIXME: need to query h/w level support. If that's not the case, tone-mapping
|
||||
* should be placed somewhere.
|
||||
*
|
||||
* FIXME: Non-HDR colorspace with BT2020 primaries will break rendering.
|
||||
* https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1175
|
||||
* To workaround it, BT709 colorspace will be chosen for non-HDR case.
|
||||
*/
|
||||
#if (GST_D3D11_DXGI_HEADER_VERSION >= 5)
|
||||
{
|
||||
GstVideoMasteringDisplayInfo minfo;
|
||||
|
@ -646,7 +635,7 @@ gst_d3d11_window_prepare_default (GstD3D11Window * window, guint display_width,
|
|||
if (gst_d3d11_result (hr, window->device)) {
|
||||
chosen_colorspace =
|
||||
gst_d3d11_find_swap_chain_color_space (&window->render_info,
|
||||
swapchain3.Get (), have_hdr10);
|
||||
swapchain3.Get ());
|
||||
if (chosen_colorspace) {
|
||||
native_colorspace_type =
|
||||
(DXGI_COLOR_SPACE_TYPE) chosen_colorspace->dxgi_color_space_type;
|
||||
|
|
Loading…
Reference in a new issue