summaryrefslogtreecommitdiff
path: root/omx/gstomxbufferpool.h
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2019-03-22 12:11:13 +0200
committerGuillaume Desmottes <guillaume.desmottes@collabora.com>2019-04-25 09:09:40 +0530
commit783e58fc48d9556d6b9a31be1b2009f230640de4 (patch)
treef3b650f923510c4aa8732bf0d8cd10286913bb56 /omx/gstomxbufferpool.h
parent3018ea584361e88b45f6627141a9ac064d6cd4bc (diff)
downloadgst-omx-783e58fc48d9556d6b9a31be1b2009f230640de4.tar.gz
omxbufferpool: refactor to allow memory sharing
One big restriction of the OMX buffer pool has always been that the GstMemory objects were flagged with NO_SHARE. This was because the buffer pool needed to be sure that when a buffer returned to the pool, it would be safe to release the OMX buffer back to OpenMAX. With this change, this is no longer a restriction. What this commit introduces is a new allocator that allows us to track the GstMemory objects independently. Now, when a buffer returns to the pool, it is not necessary for the memory to be released as well. We simply track the memory's ref count in the allocator and we return the OMX buffer back when the memory's ref count drops to 0. The reason for doing this is to allow implementing zero-copy transfers in situations where we may need to copy or map a certain region of the buffer. For instance, omxh264enc ! h264parse should be possible to be zero-copy by using an OMX buffer pool between them.
Diffstat (limited to 'omx/gstomxbufferpool.h')
-rw-r--r--omx/gstomxbufferpool.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/omx/gstomxbufferpool.h b/omx/gstomxbufferpool.h
index a09c825..bc5ac60 100644
--- a/omx/gstomxbufferpool.h
+++ b/omx/gstomxbufferpool.h
@@ -30,6 +30,7 @@
#include <gst/video/gstvideopool.h>
#include "gstomx.h"
+#include "gstomxallocator.h"
G_BEGIN_DECLS
@@ -65,7 +66,7 @@ struct _GstOMXBufferPool
GstOMXPort *port;
/* For handling OpenMAX allocated memory */
- GstAllocator *allocator;
+ GstOMXAllocator *allocator;
/* Set from outside this pool */
/* TRUE if the pool is not used anymore */