From 98929c8157af65de782f90c91d12c312cfd83e44 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Tue, 2 Mar 2021 20:45:22 +0900 Subject: [PATCH] d3d11decoder: Always use render-target bind flag for downstream pool To convert decoded texture into other format, downstream would use video processor instead of shader. In order for downstream to be able to use video processor even if we copied decoded texture into downstream pool, we should set this bind flag. Otherwise, downstream would keep switching video processor and shader to convert format which would result in inconsistent image quality. Part-of: --- sys/d3d11/gstd3d11decoder.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/d3d11/gstd3d11decoder.c b/sys/d3d11/gstd3d11decoder.c index ac128ff92c..a89c80a4b9 100644 --- a/sys/d3d11/gstd3d11decoder.c +++ b/sys/d3d11/gstd3d11decoder.c @@ -1641,11 +1641,11 @@ gst_d3d11_decoder_decide_allocation (GstVideoDecoder * decoder, return FALSE; } - if (codec == GST_D3D11_CODEC_VP9) { - /* Needs render target bind flag so that it can be used for - * output of shader pipeline if internal resizing is required */ - d3d11_params->desc[0].BindFlags |= D3D11_BIND_RENDER_TARGET; - } + /* Needs render target bind flag so that it can be used for + * output of shader pipeline if internal resizing is required. + * Also, downstream can keep using video processor even if we copy + * some decoded textures into downstream buffer */ + d3d11_params->desc[0].BindFlags |= D3D11_BIND_RENDER_TARGET; gst_buffer_pool_config_set_d3d11_allocation_params (config, d3d11_params); gst_d3d11_allocation_params_free (d3d11_params);