mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
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
This commit is contained in:
parent
7be54ad091
commit
f108eeafde
1 changed files with 16 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue