kmssink: Do not drain if imported buffer are from KMS

This adds a check to avoid draining when the imported buffers are in
fact own by kmssink. This happens since we export our kms buffer as
DMABuf. They are not really imported back as we pre-fill the cache,
but uses the same format as if they were external. This fixes
performance issues seen with videocrop2-test (found in -good).
This commit is contained in:
Nicolas Dufresne 2019-11-08 18:00:46 -05:00 committed by GStreamer Merge Bot
parent 8574154cc8
commit 80b599c81b

View file

@ -1717,8 +1717,6 @@ gst_kms_sink_drain (GstKMSSink * self)
{
GstParentBufferMeta *parent_meta;
GST_DEBUG_OBJECT (self, "draining");
if (!self->last_buffer)
return;
@ -1728,6 +1726,14 @@ gst_kms_sink_drain (GstKMSSink * self)
if (parent_meta) {
GstBuffer *dumb_buf, *last_buf;
/* If this was imported from our dumb buffer pool we can safely skip the
* drain */
if (parent_meta->buffer->pool &&
GST_IS_KMS_BUFFER_POOL (parent_meta->buffer->pool))
return;
GST_DEBUG_OBJECT (self, "draining");
dumb_buf = gst_kms_sink_copy_to_dumb_buffer (self, &self->last_vinfo,
parent_meta->buffer);
last_buf = self->last_buffer;