mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
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:
parent
4471788e4a
commit
73b39407a6
1 changed files with 14 additions and 0 deletions
|
@ -740,6 +740,8 @@ gst_d3d11_video_sink_upload_frame (GstD3D11VideoSink * self, GstBuffer * inbuf,
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
|
GST_LOG_OBJECT (self, "Copy to fallback buffer");
|
||||||
|
|
||||||
if (!gst_video_frame_map (&in_frame, &self->info, inbuf,
|
if (!gst_video_frame_map (&in_frame, &self->info, inbuf,
|
||||||
GST_MAP_READ | GST_VIDEO_FRAME_MAP_FLAG_NO_REF))
|
GST_MAP_READ | GST_VIDEO_FRAME_MAP_FLAG_NO_REF))
|
||||||
goto invalid_buffer;
|
goto invalid_buffer;
|
||||||
|
@ -846,6 +848,18 @@ gst_d3d11_video_sink_show_frame (GstVideoSink * sink, GstBuffer * buf)
|
||||||
return GST_FLOW_ERROR;
|
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)) {
|
if (!gst_d3d11_video_sink_upload_frame (self, buf, render_buf)) {
|
||||||
GST_ERROR_OBJECT (self, "cannot upload frame");
|
GST_ERROR_OBJECT (self, "cannot upload frame");
|
||||||
gst_buffer_unref (render_buf);
|
gst_buffer_unref (render_buf);
|
||||||
|
|
Loading…
Reference in a new issue