mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-29 18:48:44 +00:00
kmssink: Fix CropMeta support
We copy the meta's from the original buffer to the wrapper or copied buffer. https://bugzilla.gnome.org/show_bug.cgi?id=790473
This commit is contained in:
parent
d33aff0fa0
commit
44dabe21d9
1 changed files with 12 additions and 2 deletions
|
@ -1369,11 +1369,18 @@ gst_kms_sink_get_input_buffer (GstKMSSink * self, GstBuffer * inbuf)
|
|||
return gst_buffer_ref (inbuf);
|
||||
|
||||
if (gst_kms_sink_import_dmabuf (self, inbuf, &buf))
|
||||
return buf;
|
||||
goto done;
|
||||
|
||||
GST_CAT_INFO_OBJECT (CAT_PERFORMANCE, self, "frame copy");
|
||||
buf = gst_kms_sink_copy_to_dumb_buffer (self, inbuf);
|
||||
|
||||
return gst_kms_sink_copy_to_dumb_buffer (self, inbuf);
|
||||
done:
|
||||
/* Copy all the non-memory related metas, this way CropMeta will be
|
||||
* available upon GstVideoOverlay::expose calls. */
|
||||
if (buf)
|
||||
gst_buffer_copy_into (buf, inbuf, GST_BUFFER_COPY_METADATA, 0, -1);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
static GstFlowReturn
|
||||
|
@ -1398,6 +1405,9 @@ gst_kms_sink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
|
|||
else if (self->last_buffer)
|
||||
buffer = gst_buffer_ref (self->last_buffer);
|
||||
|
||||
/* Make sure buf is not used accidentally */
|
||||
buf = NULL;
|
||||
|
||||
if (!buffer)
|
||||
return GST_FLOW_ERROR;
|
||||
fb_id = gst_kms_memory_get_fb_id (gst_buffer_peek_memory (buffer, 0));
|
||||
|
|
Loading…
Reference in a new issue