mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
d3d11videosink: Ensure upload staging texture to fallback render texture
gst_video_frame_copy will copy input frame to stating texture of fallback frame. Then, we need to map fallback texture with GST_MAP_D3D11 flag to upload the staging texture to render texture. Otherwise the render texture wouldn't be updated.
This commit is contained in:
parent
9bf4746e2f
commit
36fb790243
1 changed files with 17 additions and 0 deletions
|
@ -735,6 +735,7 @@ gst_d3d11_video_sink_upload_frame (GstD3D11VideoSink * self, GstBuffer * inbuf,
|
|||
{
|
||||
GstVideoFrame in_frame, out_frame;
|
||||
gboolean ret;
|
||||
gint i;
|
||||
|
||||
if (!gst_video_frame_map (&in_frame, &self->info, inbuf,
|
||||
GST_MAP_READ | GST_VIDEO_FRAME_MAP_FLAG_NO_REF))
|
||||
|
@ -751,6 +752,22 @@ gst_d3d11_video_sink_upload_frame (GstD3D11VideoSink * self, GstBuffer * inbuf,
|
|||
gst_video_frame_unmap (&in_frame);
|
||||
gst_video_frame_unmap (&out_frame);
|
||||
|
||||
if (ret) {
|
||||
/* map to upload staging texture to render texture */
|
||||
for (i = 0; i < gst_buffer_n_memory (outbuf); i++) {
|
||||
GstMemory *mem;
|
||||
GstMapInfo map;
|
||||
|
||||
mem = gst_buffer_peek_memory (outbuf, i);
|
||||
if (!gst_memory_map (mem, &map, (GST_MAP_READ | GST_MAP_D3D11))) {
|
||||
GST_ERROR_OBJECT (self, "cannot upload staging texture");
|
||||
ret = FALSE;
|
||||
break;
|
||||
}
|
||||
gst_memory_unmap (mem, &map);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
/* ERRORS */
|
||||
|
|
Loading…
Reference in a new issue