diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.com> | 2019-08-21 12:48:25 +0530 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.com> | 2019-09-02 09:47:51 +0530 |
commit | 7cd929bc87b478b18f546c0b37b7315ea5e51ff4 (patch) | |
tree | c841ef702251a8fd24dd89cb1ce40e0ecab17aa1 | |
parent | 8d4d697a583eed52918b6ca70ba6b33672f94be0 (diff) | |
download | gst-omx-7cd929bc87b478b18f546c0b37b7315ea5e51ff4.tar.gz |
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.
-rw-r--r-- | omx/gstomxbufferpool.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/omx/gstomxbufferpool.c b/omx/gstomxbufferpool.c index 094f4c5..7b95d7c 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)) |