omxbufferpool: fix dmabuf import

When importing dmabuf from downstream, we want the allocator to be in
OTHER_POOL mode despite output_mode being DMABUF.
So check first if other_pool is set before checking for pool's
output_mode.
This commit is contained in:
Guillaume Desmottes 2019-08-21 12:48:25 +05:30
parent 8d4d697a58
commit 7cd929bc87

View file

@ -157,11 +157,14 @@ gst_omx_buffer_pool_start (GstBufferPool * bpool)
g_assert (pool->port->buffers);
if (pool->output_mode == GST_OMX_BUFFER_MODE_DMABUF)
mode = GST_OMX_ALLOCATOR_FOREIGN_MEM_DMABUF;
else if (pool->other_pool)
if (pool->other_pool)
/* Importing buffers from downstream, either normal or dmabuf ones */
mode = GST_OMX_ALLOCATOR_FOREIGN_MEM_OTHER_POOL;
else if (pool->output_mode == GST_OMX_BUFFER_MODE_DMABUF)
/* Exporting dmabuf */
mode = GST_OMX_ALLOCATOR_FOREIGN_MEM_DMABUF;
else
/* Exporting normal buffers */
mode = GST_OMX_ALLOCATOR_FOREIGN_MEM_NONE;
if (!gst_omx_allocator_configure (pool->allocator, min, mode))