Commit graph

8 commits

Author SHA1 Message Date
Thibault Saunier b7d9115a05 Move files from gst-omx into the "subprojects/gst-omx/" subdir 2021-09-24 16:15:01 -03:00
George Kiagiadakis 783e58fc48 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.
2019-04-25 09:09:40 +05:30
Guillaume Desmottes 3828d9769c omxbufferpool: fix early input buffer release
We used to track the 'allocating' status on the pool. It is used while
allocating so output buffers aren't passed right away to OMX and input
ones are not re-added to the pending queue.

This was causing a bug when exporting buffers to v4l2src. On start
v4l2src acquires a buffer, read its stride and release it right away.
As no buffer was received by the encoder element at this point, 'allocating'
was still on TRUE and so the the buffer wasn't put back to the pending
queue and, as result, no longer available to the pool.

Fix this by checking the active status of the pool instead of manually
tracking it down. The pool is considered as active at the very end of
the activation process so we're good when buffers are released during
the activation.
2018-12-21 17:16:31 +01:00
Guillaume Desmottes 136714c6ed omxvideodec: add dmabuf support for output
The zynqultrascaleplus OMX implementation has a custom extension
allowing decoders to output dmabuf and so avoid buffers copy between OMX
and GStreamer.

Make use of this extension when built on the zynqultrascaleplus. The
buffer pool code should be re-usable for other platforms as well.

https://bugzilla.gnome.org/show_bug.cgi?id=784847
2017-07-18 23:46:46 +01:00
Sebastian Dröge 4593f434a0 omxbufferpool: Copy buffers if the stride does not match and we can't use video meta
https://bugzilla.gnome.org/show_bug.cgi?id=731672
2014-06-24 15:11:53 +02:00
Christian König 0ea0eb1579 omxbufferpool: add proper type definitions
https://bugzilla.gnome.org/show_bug.cgi?id=726325
2014-03-15 11:26:36 +01:00
Sebastian Dröge e9b7dc230b omxbufferpool: Fix header include guard 2014-03-12 12:42:23 +01:00
Christian König 325c90f99d omxvideodec: separate the buffer pool from the decoder
https://bugzilla.gnome.org/show_bug.cgi?id=726025
2014-03-12 12:42:03 +01:00