diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2018-07-31 13:22:31 +0200 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2018-08-30 10:59:30 +0200 |
commit | f108eeafdea68d44497c27de8889685f12a52ac9 (patch) | |
tree | 10b9ea2600f0869435571ce90fced8ce95ebdf8b | |
parent | 7be54ad091fc185c92ebdb60d470e26a17938779 (diff) | |
download | gst-omx-f108eeafdea68d44497c27de8889685f12a52ac9.tar.gz |
omxvideodec: don't import OMX buffers from downstream
We already have code configuring the encoder stride and slice height
when receiving the first buffer from upstream.
We don't have an equivalent when the encoder is exporting its buffers to the
decoder.
There is no point adding it and making the code even more
complex as we wouldn't gain anything by exporting from the encoder to
the decoder. The dynamic buffer mode already ensures 0-copy between OMX
components.
https://bugzilla.gnome.org/show_bug.cgi?id=796918
-rw-r--r-- | omx/gstomxvideodec.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c index 1a943b3..750abc2 100644 --- a/omx/gstomxvideodec.c +++ b/omx/gstomxvideodec.c @@ -3203,6 +3203,7 @@ gst_omx_video_dec_decide_allocation (GstVideoDecoder * bdec, GstQuery * query) GstBufferPool *pool = NULL; GstStructure *config; GstOMXVideoDec *self = GST_OMX_VIDEO_DEC (bdec); + guint i; #if defined (HAVE_GST_GL) { @@ -3249,14 +3250,25 @@ gst_omx_video_dec_decide_allocation (GstVideoDecoder * bdec, GstQuery * query) #endif /* defined (HAVE_GST_GL) */ self->use_buffers = FALSE; - if (gst_query_get_n_allocation_pools (query) > 0) { - gst_query_parse_nth_allocation_pool (query, 0, &pool, NULL, NULL, NULL); - if (pool) { + + /* Importing OMX buffers from downstream isn't supported. + * That wouldn't bring us much as the dynamic buffer mode already + * prevent copies between OMX components. */ + i = 0; + while (i < gst_query_get_n_allocation_pools (query)) { + gst_query_parse_nth_allocation_pool (query, i, &pool, NULL, NULL, NULL); + if (GST_IS_OMX_BUFFER_POOL (pool)) { + GST_DEBUG_OBJECT (self, "Discard OMX pool from downstream"); + gst_query_remove_nth_allocation_pool (query, i); + } else { GST_DEBUG_OBJECT (self, "Try using downstream buffers with OMX_UseBuffer"); self->use_buffers = TRUE; - gst_object_unref (pool); + i++; } + + if (pool) + gst_object_unref (pool); } if (!GST_VIDEO_DECODER_CLASS |