d3d11decoder: Always use render-target bind flag for downstream pool
authorSeungha Yang <seungha@centricular.com>
Tue, 2 Mar 2021 11:45:22 +0000 (20:45 +0900)
committerSeungha Yang <seungha@centricular.com>
Tue, 2 Mar 2021 14:10:46 +0000 (23:10 +0900)
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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2051>

sys/d3d11/gstd3d11decoder.c

index ac128ff..a89c80a 100644 (file)
@@ -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);