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:
Nicolas Dufresne 2017-12-04 11:52:16 -05:00
parent d33aff0fa0
commit 44dabe21d9

View file

@ -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));