d3d11videosink: Ensure shader resource view of fallback buffer

SRV must be configured for color conversion

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1339>
This commit is contained in:
Seungha Yang 2020-06-12 19:44:01 +09:00 committed by GStreamer Merge Bot
parent 4471788e4a
commit 73b39407a6

View file

@ -740,6 +740,8 @@ gst_d3d11_video_sink_upload_frame (GstD3D11VideoSink * self, GstBuffer * inbuf,
gboolean ret;
gint i;
GST_LOG_OBJECT (self, "Copy to fallback buffer");
if (!gst_video_frame_map (&in_frame, &self->info, inbuf,
GST_MAP_READ | GST_VIDEO_FRAME_MAP_FLAG_NO_REF))
goto invalid_buffer;
@ -846,6 +848,18 @@ gst_d3d11_video_sink_show_frame (GstVideoSink * sink, GstBuffer * buf)
return GST_FLOW_ERROR;
}
for (i = 0; i < gst_buffer_n_memory (render_buf); i++) {
GstD3D11Memory *dmem;
dmem = (GstD3D11Memory *) gst_buffer_peek_memory (render_buf, i);
if (!gst_d3d11_memory_ensure_shader_resource_view (dmem)) {
GST_ERROR_OBJECT (self, "fallback shader resource view is unavailable");
gst_buffer_unref (render_buf);
return GST_FLOW_ERROR;
}
}
if (!gst_d3d11_video_sink_upload_frame (self, buf, render_buf)) {
GST_ERROR_OBJECT (self, "cannot upload frame");
gst_buffer_unref (render_buf);