From 7cd929bc87b478b18f546c0b37b7315ea5e51ff4 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Wed, 21 Aug 2019 12:48:25 +0530 Subject: [PATCH] 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. --- omx/gstomxbufferpool.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/omx/gstomxbufferpool.c b/omx/gstomxbufferpool.c index 094f4c5be5..7b95d7c54c 100644 --- a/omx/gstomxbufferpool.c +++ b/omx/gstomxbufferpool.c @@ -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))