diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2019-11-08 18:00:46 -0500 |
---|---|---|
committer | GStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2019-11-11 22:20:28 +0000 |
commit | 80b599c81b2e85928ece76d300c2a3075e0f842c (patch) | |
tree | 5908f6221bdeba3732649c27081ee2ec6adeac4a /sys/kms/gstkmssink.c | |
parent | 8574154cc84a9c44962cca600bae359151f21168 (diff) | |
download | gstreamer-plugins-bad-80b599c81b2e85928ece76d300c2a3075e0f842c.tar.gz |
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).
Diffstat (limited to 'sys/kms/gstkmssink.c')
-rw-r--r-- | sys/kms/gstkmssink.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/kms/gstkmssink.c b/sys/kms/gstkmssink.c index 4f6ed26eb..cf1e3daf3 100644 --- a/sys/kms/gstkmssink.c +++ b/sys/kms/gstkmssink.c @@ -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; |