Commit graph

981 commits

Author SHA1 Message Date
George Kiagiadakis fbe0d07068 gstomx: remove gst_omx_buffer_set_omx_buf/get_omx_buf
They are no longer used anywhere
2019-04-25 09:09:42 +05:30
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 3018ea5843 omxbufferpool: fix memory mapping with offset
gst_memory_map() is already adding the offset to the mapped pointer.
Doing it in the memory implementation was resulting in the offset being
accounted twice.

It doesn't matter yet as we are only creating memory without offset for
now but it will once we'll start sharing OMX memories.
2019-04-23 15:32:05 +05:30
Tim-Philipp Müller e6639588c0 Back to development 2019-04-19 11:00:07 +01:00
Tim-Philipp Müller efb55bfa9f Release 1.16.0 2019-04-19 00:38:44 +01:00
Julien Isorce 18927f33ee Fixes build with omx >= 1.2.0
gstomx.c:1405:10: error: ‘OMX_IndexParamCustomContentPipe’ undeclared (first use in this function)
    case OMX_IndexParamCustomContentPipe

Some enums have been deprecated in 1.2.0

https://gitlab.freedesktop.org/gstreamer/gst-omx/issues/27
2019-04-16 12:26:03 -07:00
Guillaume Desmottes d7c589122b testegl: properly detect and use rpi specific libs
Use pkg-config to detect and configure rpi specific libs used in testegl
rather than hardcoding their flags.
2019-04-12 14:29:19 +05:30
Guillaume Desmottes 9b68aaeeb5 testelg: include eglext.h
Neded for the declaration of eglSaneChooseConfigBRCM().
2019-04-12 14:29:19 +05:30
Guillaume Desmottes 7a964087d0 testegl: move up pi specific macros
We need to define __VCCOREVER__ and disable redundant-decls before
including the egl.h from the pi.
2019-04-12 14:29:19 +05:30
Tim-Philipp Müller 0b9bdbf224 Release 1.15.90 2019-04-11 00:40:53 +01:00
Tim-Philipp Müller 6b29292793 meson: add -Wundef as additional warning flag 2019-04-10 00:21:01 +01:00
Tim-Philipp Müller 6ce69859c5 omx: fix autotools build for generic target
gstomxvideoenc.c:2874:7: error: "USE_OMX_TARGET_ZYNQ_USCALE_PLUS" is not defined, evaluates to 0 [-Werror=undef]
 #elif USE_OMX_TARGET_ZYNQ_USCALE_PLUS

Works on meson because it doesn't use -Wundef
2019-04-10 00:20:37 +01:00
Jordan Petridis 91356c9a7d Add Gitlab CI configuration
This commit adds a .gitlab-ci.yml file, which uses a feature
to fetch the config from a centralized repository. The intent is
to have all the gstreamer modules use the same configuration.

The configuration is currently hosted at the gst-ci repository
under the gitlab/ci_template.yml path.

Part of https://gitlab.freedesktop.org/gstreamer/gstreamer-project/issues/29
2019-04-06 16:23:51 +00:00
Guillaume Desmottes 7d1b77b0c4 omx: disable OMX_API_TRACE code if gst debug is disabled
No need to create debug structs which won't be used as DEBUG macros are
no-op.
2019-03-26 15:15:21 +01:00
Guillaume Desmottes 01bf661d6e omx: log Get/SetParameter/Config calls
Extend OMX_API_TRACE by logging component configuration calls.
2019-03-26 15:15:21 +01:00
Guillaume Desmottes b53c91d9ef omxbufferpool: don't use CAT_PERFORMANCE if pool will copy
This was the single place where this category was used in gst-omx so
most users, including me, are generally not turning it and were missing this
important information from logs.

The copying code uses gst_video_frame_copy() which is already logging
with CAT_PERFORMANCE so we can still have this information when using
only this debug category.
2019-03-26 15:15:21 +01:00
Guillaume Desmottes 6feac3ed26 omxvideodec: add debug if proposed pool can't provide enough buffers
We were silently ignoring the pool which was pretty confusing when
debugging.
2019-03-26 15:15:21 +01:00
Charlie Turner 7412b39765 omx: Add hardware classifiers to encoders/decoders 2019-03-26 12:17:26 +00:00
Guillaume Desmottes e4db5d348a meson: sync warnings flags with -good
Add more warnings flags and disabled unused variable warnings if gst
debug system is disabled.

Copied from gst-plugins-good/meson.build
2019-03-25 16:03:24 +01:00
Tim-Philipp Müller fbd6efcdee Back to development 2019-03-04 09:16:40 +00:00
Tim-Philipp Müller 6c82db2a99 Release 1.15.2 2019-02-26 12:02:24 +00:00
Tim-Philipp Müller b4b00545c7 meson: add options to disable examples, tests and tools and bump meson requirement 2019-02-14 23:57:09 +00:00
Guillaume Desmottes 9ff4dc533f omxvideo: use GST_VIDEO_CAPS_MAKE() for template caps
Simplify the code and so we advertise the formats actually supported by
gst-omx.
2019-01-25 23:48:11 +00:00
Guillaume Desmottes 09bc1d630f omxvideoenc: validate cpb-size and initial-delay
cpb-size cannot be smaller than initial-delay.
2019-01-25 11:48:44 +01:00
Nicolas Dufresne aff131dcee omxvideodec: Remove duplicated QoS code
The 'finish' function do the exact same check / drop, there is no
need to duplicate this here.
2019-01-25 00:50:06 +00:00
Nicolas Dufresne 4159ca2bc5 omxvideodec: Remove dead code
The omxvideodec base class have a totally unused prepare_frame() vritual
function, remove it.
2019-01-25 00:50:06 +00:00
Varunkumar Allagadapa 150e7271ab omxvideoenc: add adaptive gop-mode option
Added adaptive gop-mode option to ZYNQ_USCALE_PLUS encoder properties
2019-01-25 00:49:22 +00:00
Nicolas Dufresne 4f6d788999 omxvideoenc: Add dynamic framerate support
Instead of going through a full reset, try and change the framerate
config on the encoder when only the framerate have change.
2019-01-25 00:47:45 +00:00
Tim-Philipp Müller da512c2fdc Release 1.15.1 2019-01-17 02:38:29 +00:00
Varunkumar Allagadapa 09ad21b26c omxvideoenc: Add dynamic IDR insertion support on zynq
As the pi, the zynq has its own API to request keyframe.
2019-01-09 19:37:36 +00:00
Guillaume Desmottes 9dc359d0c1 omxbufferpool: fix race when releasing input buffers
If buffers were released from the pool while
gst_omx_video_enc_handle_frame() was waiting for new buffers,
gst_omx_port_acquire_buffer() was never awaken as the buffers weren't
released through OMX's messaging system.

GQueue isn't thread safe so also protect it with the lock mutex.
2019-01-08 16:04:31 +01:00
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
Thibault Saunier f17b12c4f9 Automatic update of common submodule
From ed78bee to 59cb678
2018-12-05 17:24:48 -03:00
Guillaume Desmottes 839fbfebab omx: fix OMX_EventBufferFlag OMX_API_TRACE struct
The GType was missing from the second field of the struct.
2018-11-26 10:41:53 +01:00
Matthew Waters cc9df86514 Update git locations to gitlab 2018-11-05 05:43:43 +00:00
Guillaume Desmottes 6207459e0e omx: rename OMX_PERFORMANCE debug cat to OMX_API_TRACE
This debug category can now be used to track more OMX calls and events
so best to rename it to something more generic.

https://bugzilla.gnome.org/show_bug.cgi?id=797171
2018-09-26 09:20:41 +02:00
Guillaume Desmottes 3a16094ab3 omx: log OMX commands with OMX_PERFORMANCE debug category
It has been useful to have a clear raw and structured view of the gst
<-> OMX exchanges when debugging.

https://bugzilla.gnome.org/show_bug.cgi?id=797171
2018-09-19 10:52:25 +02:00
Guillaume Desmottes 68f18341f6 omx: factor out gst_omx_component_send_command()
No semantic change. I'm going to add extra debug in this function.

https://bugzilla.gnome.org/show_bug.cgi?id=797171
2018-09-19 10:52:25 +02:00
Guillaume Desmottes 9b1598e5ec omx: log OMX events with OMX_PERFORMANCE debug category
It has been useful to have a clear raw and structured view of the gst
<-> OMX exchanges when debugging.

https://bugzilla.gnome.org/show_bug.cgi?id=797171
2018-09-19 10:52:25 +02:00
Guillaume Desmottes 313deb4ecf omx: rename log_omx_performance() to log_omx_performance_buffer()
I'm about to log more things under this category

https://bugzilla.gnome.org/show_bug.cgi?id=797171
2018-09-19 10:52:25 +02:00
Nicolas Dufresne a84badc5c4 omxvideoenc: Remove spurious locking
The method we call in the context of pushing a buffer are all thread
safe. Holding a lock would prevent input buffers from being queued while
pushing.

https://bugzilla.gnome.org/show_bug.cgi?id=715192
2018-09-10 17:09:11 -04:00
Nicolas Dufresne d80504afcc omxvideoenc: Remove unneeded size check
We only enter this branch if nFilledLen > 0, there is not need
to check again.

https://bugzilla.gnome.org/show_bug.cgi?id=715192
2018-09-10 17:09:11 -04:00
Nicolas Dufresne 35abdd16d1 omxvideodec: Remove spurious unlock in error case
This was forgotton in previous patch. We no long hold the lock when goto
invalid_buffer is called.

https://bugzilla.gnome.org/show_bug.cgi?id=715192
2018-09-10 17:09:11 -04:00
Nicolas Dufresne 04e1f76b60 omxvideodec: don't hold the stream lock when trying to push a frame
The base class methods will lock this properly when needed, there seems
to be no need to lock it explicitly.

This allows the patch in gstvideodec for unlocking the stream lock
when pushing buffers out to work.

https://bugzilla.gnome.org/show_bug.cgi?id=715192
2018-08-31 17:42:07 -04:00
Guillaume Desmottes f108eeafde omxvideodec: don't import OMX buffers from downstream
We already have code configuring the encoder stride and slice height
when receiving the first buffer from upstream.
We don't have an equivalent when the encoder is exporting its buffers to the
decoder.

There is no point adding it and making the code even more
complex as we wouldn't gain anything by exporting from the encoder to
the decoder. The dynamic buffer mode already ensures 0-copy between OMX
components.

https://bugzilla.gnome.org/show_bug.cgi?id=796918
2018-08-30 10:59:30 +02:00
Guillaume Desmottes 7be54ad091 omxvideoenc: implement dmabuf export on input buffers
Propose pool upstream so input buffers can be allocated by the port and
exported as dmabuf.

The actual OMX buffers are allocated when the pool is activated, so we
don't end up doing useless allocations if the pool isn't used.

https://bugzilla.gnome.org/show_bug.cgi?id=796918
2018-08-30 10:59:30 +02:00
Guillaume Desmottes 34bc02e397 omx: allow gst_omx_port_acquire_buffer() to not wait for buffers
Will be needed to implement GST_BUFFER_POOL_ACQUIRE_FLAG_DONTWAIT.

https://bugzilla.gnome.org/show_bug.cgi?id=796918
2018-08-30 10:59:30 +02:00
Guillaume Desmottes c89b54fe78 omxvideodec: don't import non-dmabuf when dec is in dmabuf mode
Fix 'omxh264dec ! videocrop' pipeline.

https://bugzilla.gnome.org/show_bug.cgi?id=796918
2018-08-30 10:59:30 +02:00
Guillaume Desmottes be5ec66a84 omxvideodec: factor out gst_omx_try_importing_buffer()
No semantic change, just make the code clearer and improve debug output.

https://bugzilla.gnome.org/show_bug.cgi?id=796918
2018-08-30 10:59:30 +02:00
Guillaume Desmottes 7d8a314dff omxvideodec: fix gst_video_info_from_caps() caps assertion
The "use buffers" code path uses gst_video_info_from_caps() which is
asserting if caps is NULL (because pool was rejected).

https://bugzilla.gnome.org/show_bug.cgi?id=796918
2018-08-30 10:59:30 +02:00