platform/upstream/gstreamer.git
5 years agoomx: log OMX commands with OMX_PERFORMANCE debug category
Guillaume Desmottes [Tue, 21 Aug 2018 15:35:04 +0000 (17:35 +0200)]
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

5 years agoomx: factor out gst_omx_component_send_command()
Guillaume Desmottes [Tue, 21 Aug 2018 14:50:38 +0000 (16:50 +0200)]
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

5 years agoomx: log OMX events with OMX_PERFORMANCE debug category
Guillaume Desmottes [Tue, 21 Aug 2018 13:14:09 +0000 (15:14 +0200)]
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

5 years agoomx: rename log_omx_performance() to log_omx_performance_buffer()
Guillaume Desmottes [Wed, 22 Aug 2018 10:51:30 +0000 (12:51 +0200)]
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

5 years agoomxvideoenc: Remove spurious locking
Nicolas Dufresne [Sat, 8 Sep 2018 02:57:30 +0000 (22:57 -0400)]
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

5 years agoomxvideoenc: Remove unneeded size check
Nicolas Dufresne [Sat, 8 Sep 2018 03:09:29 +0000 (23:09 -0400)]
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

5 years agoomxvideodec: Remove spurious unlock in error case
Nicolas Dufresne [Sat, 8 Sep 2018 02:55:41 +0000 (22:55 -0400)]
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

5 years agoomxvideodec: don't hold the stream lock when trying to push a frame
Nicolas Dufresne [Fri, 31 Aug 2018 21:28:03 +0000 (17:28 -0400)]
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

5 years agoomxvideodec: don't import OMX buffers from downstream
Guillaume Desmottes [Tue, 31 Jul 2018 11:22:31 +0000 (13:22 +0200)]
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

5 years agoomxvideoenc: implement dmabuf export on input buffers
Guillaume Desmottes [Tue, 15 May 2018 09:59:26 +0000 (11:59 +0200)]
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

5 years agoomx: allow gst_omx_port_acquire_buffer() to not wait for buffers
Guillaume Desmottes [Mon, 13 Aug 2018 13:10:37 +0000 (15:10 +0200)]
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

5 years agoomxvideodec: don't import non-dmabuf when dec is in dmabuf mode
Guillaume Desmottes [Tue, 31 Jul 2018 13:04:33 +0000 (15:04 +0200)]
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

5 years agoomxvideodec: factor out gst_omx_try_importing_buffer()
Guillaume Desmottes [Thu, 2 Aug 2018 09:29:12 +0000 (11:29 +0200)]
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

5 years agoomxvideodec: fix gst_video_info_from_caps() caps assertion
Guillaume Desmottes [Thu, 26 Jul 2018 14:30:08 +0000 (16:30 +0200)]
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

5 years agoomxvideodec: fix pool caps reference stealing
Guillaume Desmottes [Thu, 26 Jul 2018 14:22:50 +0000 (16:22 +0200)]
omxvideodec: fix pool caps reference stealing

gst_buffer_pool_config_get_params() doesn't ref the returning caps;
so gst_caps_replace() was unreffing the reference owned by the pool.

https://bugzilla.gnome.org/show_bug.cgi?id=796918

5 years agoomxvideodec: prevent timeout when shutting down because of pending out buffers
Guillaume Desmottes [Wed, 25 Jul 2018 07:57:20 +0000 (09:57 +0200)]
omxvideodec: prevent timeout when shutting down because of pending out buffers

The OMX transition state to Loaded won't be complete until all buffers
have been freed. There is no point waiting, and timeout, if we know that
output buffers haven't been freed yet.

The typical scenario is output buffers being still used downstream
and being freed later when released back to the pool.

https://bugzilla.gnome.org/show_bug.cgi?id=796918

5 years agoomxbufferpool: reference the OMX component
Guillaume Desmottes [Tue, 24 Jul 2018 13:14:31 +0000 (15:14 +0200)]
omxbufferpool: reference the OMX component

Now that the pool is responsible of freeing the OMX buffers, we need to
ensure that the OMX component stay alive while the pool is as we rely on
the component to free the buffers.
The GstOMXPort is owned by the component so no need to ref this one.

https://bugzilla.gnome.org/show_bug.cgi?id=796918

5 years agoturn GstOMXComponent to a GstMiniObject
Guillaume Desmottes [Tue, 24 Jul 2018 13:06:01 +0000 (15:06 +0200)]
turn GstOMXComponent to a GstMiniObject

Will use it for refcounting.

https://bugzilla.gnome.org/show_bug.cgi?id=796918

5 years agoomxbufferpool: deallocate OMX buffers when stopping
Guillaume Desmottes [Mon, 28 May 2018 10:20:45 +0000 (12:20 +0200)]
omxbufferpool: deallocate OMX buffers when stopping

The pool is stopped when all the buffers have been released. Deallocate
when stopping so we are sure that the buffers aren't still used by
another element.

https://bugzilla.gnome.org/show_bug.cgi?id=796918

5 years agoomx: call gst_omx_buffer_unmap() when handling BUFFER_DONE
Guillaume Desmottes [Thu, 24 May 2018 14:28:21 +0000 (16:28 +0200)]
omx: call gst_omx_buffer_unmap() when handling BUFFER_DONE

When using a input buffer pool, the buffer may be released to the pool when
gst_omx_buffer_unmap() is called. We need to have buf->used unset at
this point as the pool may use it to check the status of the pool.

{Empty,Fill}BufferDone is called from OMX internal threads while
messages are handled from gst elements' thread. Best to do all this
when handling the message so we don't mess with OMX threads and keep
the original thread/logic split.

https://bugzilla.gnome.org/show_bug.cgi?id=796918

5 years agoomxvideo{enc,dec}: stop calling shutdown() in change_state
Guillaume Desmottes [Fri, 25 May 2018 12:44:16 +0000 (14:44 +0200)]
omxvideo{enc,dec}: stop calling shutdown() in change_state

This is no longer needed since we implemented close() vfuncs as the
encoder/decoder base class already take care of calling close() (which
is calling shutdown()) in its own change_state implementation.

We also move the shut down of the component from PAUSED_TO_READY to READY_TO_NULL.
By doing so upstream will have already deactivated the pool from the
encoder and so won't be preventing the OMX state change as the buffers
will all be released.

https://bugzilla.gnome.org/show_bug.cgi?id=796918

5 years agoomx: factor out gst_omx_buffer_get/set_omx_buf()
Guillaume Desmottes [Tue, 15 May 2018 14:21:26 +0000 (16:21 +0200)]
omx: factor out gst_omx_buffer_get/set_omx_buf()

Move the qdata code to helper functions as I'm going to need them in
omxvideoenc to implement dmabuf export.

https://bugzilla.gnome.org/show_bug.cgi?id=796918

5 years agoomxvideoenc: factor out gst_omx_video_enc_set_to_idle()
Guillaume Desmottes [Tue, 15 May 2018 09:01:13 +0000 (11:01 +0200)]
omxvideoenc: factor out gst_omx_video_enc_set_to_idle()

No semantic change. We'll have to use this when the input pool is
activated so we can allocate buffers.

https://bugzilla.gnome.org/show_bug.cgi?id=796918

5 years agoomxvideoenc: factor out gst_omx_video_enc_deallocate_in_buffers()
Guillaume Desmottes [Tue, 15 May 2018 07:56:10 +0000 (09:56 +0200)]
omxvideoenc: factor out gst_omx_video_enc_deallocate_in_buffers()

Will add extra code when adding input buffer pool.

https://bugzilla.gnome.org/show_bug.cgi?id=796918

5 years agoomx: add pBuffer to OMX_PERFORMANCE logs
Guillaume Desmottes [Mon, 14 May 2018 13:16:38 +0000 (15:16 +0200)]
omx: add pBuffer to OMX_PERFORMANCE logs

Can be useful to check the fd being passed when using dmabuf.

https://bugzilla.gnome.org/show_bug.cgi?id=796918

5 years agoomx: factor out gst_omx_port_set_dmabuf()
Guillaume Desmottes [Wed, 21 Mar 2018 11:43:33 +0000 (12:43 +0100)]
omx: factor out gst_omx_port_set_dmabuf()

No semantic change. I also made the debug message a bit clearer.

https://bugzilla.gnome.org/show_bug.cgi?id=796918

5 years agoomx: wait for flush complete and buffers being released when flushing
Guillaume Desmottes [Wed, 22 Aug 2018 13:56:18 +0000 (15:56 +0200)]
omx: wait for flush complete and buffers being released when flushing

When flusing we should wait for OMX to send the flush command complete event
AND all ports being released.
We were stopping as soon as one of those condition was met.

Fix a race between FillThisBufferDone/EmptyBufferDone and the flush
EventCmdComplete messages. The OMX implementation is supposed to release
its buffers before posting the EventCmdComplete event but the ordering
isn't guaranteed as the FillThisBufferDone/EmptyBufferDone and
EventHandler callbacks can be called from different threads (cf 2.7
'Thread Safety' in the spec).

Only wait for buffers currently used by OMX as some buffers may not be
in the pending queue because they are held downstream.

https://bugzilla.gnome.org/show_bug.cgi?id=789475

5 years agoomx: factor out should_wait_until_flushed()
Guillaume Desmottes [Wed, 22 Aug 2018 13:52:23 +0000 (15:52 +0200)]
omx: factor out should_wait_until_flushed()

No semantic change. Makes the code easier to understand and I'm about to
change the waiting condition.

https://bugzilla.gnome.org/show_bug.cgi?id=789475

5 years agoomxvideoenc: pause component when flushing
Guillaume Desmottes [Tue, 28 Aug 2018 11:10:35 +0000 (13:10 +0200)]
omxvideoenc: pause component when flushing

As stated in the spec ("6.1.3 Seek Event Sequence") we should pause
before flushing.
We were pausing the decoder but not the encoder so I just aligned the
two code paths.

https://bugzilla.gnome.org/show_bug.cgi?id=797038

5 years agoomxvideoenc: fix vertical padding in NV16 formats
Guillaume Desmottes [Thu, 12 Jul 2018 10:41:18 +0000 (12:41 +0200)]
omxvideoenc: fix vertical padding in NV16 formats

My previous patch to calculate the vertical padding was always halfing
the height of the chroma plane which is incorrect for NV16 formats.

https://bugzilla.gnome.org/show_bug.cgi?id=796749

5 years agoomxvideoenc: include vertical padding in nFilledLen when copying
Guillaume Desmottes [Thu, 5 Jul 2018 13:13:47 +0000 (15:13 +0200)]
omxvideoenc: include vertical padding in nFilledLen when copying

According to the OMX spec (3.1.3.7.1) nFilledLen is meant to include any
padding. We use to include the horizontal one (stride) but not the
vertical one if nSliceHeight is bigger than the actual height.

The calculated nFilledLen was wrong as it didn't include the padding
between planes.

https://bugzilla.gnome.org/show_bug.cgi?id=796749

6 years agoomxvideoenc: implement decide_allocation
Guillaume Desmottes [Thu, 26 Apr 2018 10:30:47 +0000 (12:30 +0200)]
omxvideoenc: implement decide_allocation

Increase the number of output buffers by the number of buffers requested
downstream.
Prevent buffers starvation if downstream is going to use dynamic buffer
mode on its input.

https://bugzilla.gnome.org/show_bug.cgi?id=795746

6 years agoomxvideodec: implement propose_allocation
Guillaume Desmottes [Thu, 26 Apr 2018 10:29:16 +0000 (12:29 +0200)]
omxvideodec: implement propose_allocation

Tell upstream about how many buffer we plan to use so they can adjust
their own number of buffers accordingly if needed.

Same logic as the existing gst_omx_video_enc_propose_allocation().

https://bugzilla.gnome.org/show_bug.cgi?id=795746

6 years agoomxvideoenc: always signal drain cond when stopping streaming loop
Guillaume Desmottes [Thu, 17 May 2018 07:54:11 +0000 (09:54 +0200)]
omxvideoenc: always signal drain cond when stopping streaming loop

Similar change as the one I just did in omxvideodec.

https://bugzilla.gnome.org/show_bug.cgi?id=796207

6 years agoomxvideodec: always signal drain cond when stopping streaming loop
Guillaume Desmottes [Wed, 16 May 2018 15:06:29 +0000 (17:06 +0200)]
omxvideodec: always signal drain cond when stopping streaming loop

If for some reason something goes wrong and we stop the streaming loop
we may end up with other threads still waiting on the drain cond.
No more buffers will be produced by the component so they were waiting
forever.

Fix this by always signalling this cond when stopping the streaming
loop.

https://bugzilla.gnome.org/show_bug.cgi?id=796207

6 years agoomxvideoenc: factor out gst_omx_video_enc_pause_loop()
Guillaume Desmottes [Wed, 16 May 2018 15:02:01 +0000 (17:02 +0200)]
omxvideoenc: factor out gst_omx_video_enc_pause_loop()

No semantic change. I'm going to use it in more failure cases.

https://bugzilla.gnome.org/show_bug.cgi?id=796207

6 years agozynqultrascaleplus: enable 'ensure-buffer-count-actual' hack
Guillaume Desmottes [Thu, 17 May 2018 12:24:52 +0000 (14:24 +0200)]
zynqultrascaleplus: enable 'ensure-buffer-count-actual' hack

https://bugzilla.gnome.org/show_bug.cgi?id=791211

6 years agoomxvideodec/enc: add hack updating nBufferCountActual before allocating
Guillaume Desmottes [Fri, 27 Apr 2018 14:26:36 +0000 (16:26 +0200)]
omxvideodec/enc: add hack updating nBufferCountActual before allocating

The OMX specs states that the nBufferCountActual of a port has to default
to its nBufferCountMin. If we don't change nBufferCountActual we purely rely
on this default. But in some cases, OMX may change nBufferCountMin before we
allocate buffers. Like for example when configuring the input ports with the
actual format, it may decrease the number of minimal buffers required.
This method checks this and update nBufferCountActual if needed so we'll use
less buffers than the worst case in such scenarios.

SetParameter() needs to be called when the port is either disabled or
the component in the Loaded state.

Don't do this for the decoder output as
gst_omx_video_dec_allocate_output_buffers() already check
nBufferCountMin when computing the number of output buffers.

On some platform, like rpi, the default nBufferCountActual is much
higher than nBufferCountMin so only enable this using a specific gst-omx
hack.

https://bugzilla.gnome.org/show_bug.cgi?id=791211

6 years agoomxvidee{enc,dec}: refresh input port definition after setting format
Guillaume Desmottes [Mon, 28 May 2018 13:02:13 +0000 (15:02 +0200)]
omxvidee{enc,dec}: refresh input port definition after setting format

Setting the input format and the associated encoder/decoder settings
may also affect the nBufferCountMin of the input port.
Refresh the input port so we'll use up to date values in propose/decide
allocation.

https://bugzilla.gnome.org/show_bug.cgi?id=796445

6 years agoomx: always consider component in 'invalid' state when an error occured
Guillaume Desmottes [Mon, 7 May 2018 09:59:08 +0000 (11:59 +0200)]
omx: always consider component in 'invalid' state when an error occured

gst_omx_component_get_state() used to early return if there was no
pending state change. So if the component raised an error it wasn't
considered in the invalid state until the next requested state change.

Fix this by checking first if we received an error.

https://bugzilla.gnome.org/show_bug.cgi?id=795874

6 years agomeson: Update option names to omit 'with_omx' prefixes
Matthew Waters [Thu, 24 May 2018 15:35:58 +0000 (01:35 +1000)]
meson: Update option names to omit 'with_omx' prefixes

Companion commit to:
https://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=4fb02fc85b70be631f5331b2547e5dc61ef7a43a
https://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=1e1a5d658e4a031535c44823fd398d3052ca2000
etc...

6 years agoomxvideodec: pass a GstOMXBufferMode to gst_omx_buffer_pool_new()
Guillaume Desmottes [Wed, 21 Mar 2018 12:52:23 +0000 (13:52 +0100)]
omxvideodec: pass a GstOMXBufferMode to gst_omx_buffer_pool_new()

The output_mode is supposed to be a GstOMXBufferMode, not a boolean.

6 years agozynq: remove 'no-disable-outport' hack
Guillaume Desmottes [Thu, 3 May 2018 07:27:15 +0000 (09:27 +0200)]
zynq: remove 'no-disable-outport' hack

No longer needed with newer version of the OMX stack.

6 years agoomxh26{4,5}enc: don't pick default 10-bit profile
Guillaume Desmottes [Tue, 13 Mar 2018 15:15:30 +0000 (16:15 +0100)]
omxh26{4,5}enc: don't pick default 10-bit profile

The OMX stack of the zynqultrascaleplus (the only one supporting
NV12_10LE32 and NV16_10LE32) will now pick the proper profile if none
has been requested. Best to rely on its default than hardcoding a
specific one in gst-omx.

https://bugzilla.gnome.org/show_bug.cgi?id=794319

6 years agoomxh264: sync with supported profiles on zynqultrascaleplus
Guillaume Desmottes [Tue, 6 Mar 2018 13:16:56 +0000 (14:16 +0100)]
omxh264: sync with supported profiles on zynqultrascaleplus

Add extra supported AVC profiles and remove extended and 4:4:4 profiles
which are actually not implemented.

https://bugzilla.gnome.org/show_bug.cgi?id=794177

6 years agoomxh264: factor out gst_omx_h264_utils_get_profile_from_enum()
Guillaume Desmottes [Tue, 6 Mar 2018 09:45:14 +0000 (10:45 +0100)]
omxh264: factor out gst_omx_h264_utils_get_profile_from_enum()

Move the profile <-> enum mapping to one place. Make changes easier as
I'm about to add extra profiles.

No semantic change.

https://bugzilla.gnome.org/show_bug.cgi?id=794177

6 years agoomxh265: add format range extension profiles on zynqultrascaleplus
Guillaume Desmottes [Tue, 6 Mar 2018 10:02:44 +0000 (11:02 +0100)]
omxh265: add format range extension profiles on zynqultrascaleplus

The zynqultrascaleplus OMX gained support for more format range
extensions profiles (A.3.5).

https://bugzilla.gnome.org/show_bug.cgi?id=794177

6 years agoomxh265: factor out gst_omx_h265_utils_get_profile_from_enum()
Guillaume Desmottes [Tue, 6 Mar 2018 09:45:14 +0000 (10:45 +0100)]
omxh265: factor out gst_omx_h265_utils_get_profile_from_enum()

Move the profile <-> enum mapping to one place. Make changes easier as
I'm about to add some profiles.

No semantic change.

https://bugzilla.gnome.org/show_bug.cgi?id=794177

6 years agoomxvideoenc: add NV16 support
Guillaume Desmottes [Thu, 8 Mar 2018 11:22:26 +0000 (12:22 +0100)]
omxvideoenc: add NV16 support

NV16 format wasn't supported on encoder input while it was on decoder
output.

https://bugzilla.gnome.org/show_bug.cgi?id=794175

6 years agoomxvideo: display port number when listing supported formats
Guillaume Desmottes [Thu, 8 Mar 2018 11:09:38 +0000 (12:09 +0100)]
omxvideo: display port number when listing supported formats

More convenient when debugging.

https://bugzilla.gnome.org/show_bug.cgi?id=794175

6 years agoomxvideoenc: restore OMX default target-bitrate if requested by user
Guillaume Desmottes [Thu, 29 Mar 2018 14:42:40 +0000 (16:42 +0200)]
omxvideoenc: restore OMX default target-bitrate if requested by user

0xffffffff is the magic number in gst-omx meaning 'the default value
defined in OMX'. This works fine with OMX parameters which are only set
once when starting the component but not with configs which can be
changed while PLAYING.
Save the actual OMX default bitrate so we can restore it later if user
sets back 0xffffffff on the property.

Added GST_OMX_PROP_OMX_DEFAULT so we stop hardcoding magic numbers
everywhere.

https://bugzilla.gnome.org/show_bug.cgi?id=794998

6 years agoomxvideoenc: use gst_omx_video_enc_set_bitrate() when setting bitrate in set_format
Guillaume Desmottes [Thu, 29 Mar 2018 09:36:00 +0000 (11:36 +0200)]
omxvideoenc: use gst_omx_video_enc_set_bitrate() when setting bitrate in set_format

We weren't using the usual pattern when re-setting the bitrate:
- get parameters from OMX
- update only the fields different from 0xffffffff (OMX defaults)
- set parameters

Also added a comment explaining why we re-set this param.

https://bugzilla.gnome.org/show_bug.cgi?id=794998

6 years agoomxvideoenc: factor out gst_omx_video_enc_set_bitrate()
Guillaume Desmottes [Thu, 29 Mar 2018 09:26:04 +0000 (11:26 +0200)]
omxvideoenc: factor out gst_omx_video_enc_set_bitrate()

No semantic change, I'm about to re-use this function in set_format().

https://bugzilla.gnome.org/show_bug.cgi?id=794998

6 years agomeson: fix miscellaneous meson warnings
Tim-Philipp Müller [Fri, 20 Apr 2018 10:54:14 +0000 (11:54 +0100)]
meson: fix miscellaneous meson warnings

cc.has_header*() doesn't have a 'required:' kwarg.

6 years agoomxvideoenc/dec: fix handling of component enabling failing
Guillaume Desmottes [Wed, 18 Apr 2018 10:42:55 +0000 (12:42 +0200)]
omxvideoenc/dec: fix handling of component enabling failing

- Report the error from OMX if any (OMX_EventError)
- If not report the failing to the application (GST_ELEMENT_ERROR)
- return GST_FLOW_ERROR rather than FALSE
- don't leak @frame

https://bugzilla.gnome.org/show_bug.cgi?id=795352

6 years agoAutomatic update of common submodule
Tim-Philipp Müller [Mon, 16 Apr 2018 09:53:41 +0000 (10:53 +0100)]
Automatic update of common submodule

From 3fa2c9e to ed78bee

6 years agolog_omx_performance: convert pointers to strings
Guillaume Desmottes [Wed, 14 Mar 2018 13:53:50 +0000 (14:53 +0100)]
log_omx_performance: convert pointers to strings

G_TYPE_POINTER are not serialized in logs.

https://bugzilla.gnome.org/show_bug.cgi?id=794331

6 years agoomxvideoenc: remove duplicated debug message
Guillaume Desmottes [Mon, 2 Apr 2018 13:14:51 +0000 (15:14 +0200)]
omxvideoenc: remove duplicated debug message

We already have the exact same message at the beginning of
gst_omx_video_enc_handle_frame(). Having it twice is confusing when
reading/grepping logs.

I kept the earlier one to keep the symetry with
gst_omx_video_dec_handle_frame().

https://bugzilla.gnome.org/show_bug.cgi?id=794897

6 years agoomxvideoenc: add 'roi' qp-mode on zynqultrascaleplus
Guillaume Desmottes [Thu, 22 Feb 2018 10:27:03 +0000 (11:27 +0100)]
omxvideoenc: add 'roi' qp-mode on zynqultrascaleplus

New QP mode used to handle ROI metadata.

https://bugzilla.gnome.org/show_bug.cgi?id=793696

6 years agoBack to development
Tim-Philipp Müller [Tue, 20 Mar 2018 10:31:10 +0000 (10:31 +0000)]
Back to development

6 years agoRelease 1.14.0
Tim-Philipp Müller [Mon, 19 Mar 2018 20:31:02 +0000 (20:31 +0000)]
Release 1.14.0

6 years agoRelease 1.13.91
Tim-Philipp Müller [Tue, 13 Mar 2018 19:32:39 +0000 (19:32 +0000)]
Release 1.13.91

6 years agomeson: fix typo in package name define
Tim-Philipp Müller [Fri, 9 Mar 2018 12:02:29 +0000 (12:02 +0000)]
meson: fix typo in package name define

6 years agoomxh265: update 422 profile names
Guillaume Desmottes [Tue, 27 Feb 2018 14:42:53 +0000 (15:42 +0100)]
omxh265: update 422 profile names

h265parse is gaining support for the format range extension profile
(bgo#793876).
Use the profile names defined in h265parse.

https://bugzilla.gnome.org/show_bug.cgi?id=793928

6 years agoomxvideoenc: Don't drop the frame on empty payload
Nicolas Dufresne [Mon, 5 Mar 2018 18:49:18 +0000 (13:49 -0500)]
omxvideoenc: Don't drop the frame on empty payload

This otherwise may lead to "No reference frame found" warning.

6 years agoomxvideodec: Don't drop the frame on empty payload
Nicolas Dufresne [Thu, 1 Mar 2018 20:16:55 +0000 (15:16 -0500)]
omxvideodec: Don't drop the frame on empty payload

This otherwise may lead to "No reference frame found" warning.

6 years agoomx: Free empty buffers list in use_dynamic_buffers
Nicolas Dufresne [Fri, 2 Mar 2018 20:36:06 +0000 (15:36 -0500)]
omx: Free empty buffers list in use_dynamic_buffers

To indicate we are doing dynamic buffers importation, we pass
a list of NULL pointers, but we forgot to free that list.

6 years agoomxvideodec: Fix CodecState leak
Nicolas Dufresne [Thu, 1 Mar 2018 20:16:32 +0000 (15:16 -0500)]
omxvideodec: Fix CodecState leak

6 years agoRelease 1.13.90
Tim-Philipp Müller [Sat, 3 Mar 2018 23:00:59 +0000 (23:00 +0000)]
Release 1.13.90

6 years agoconfig: dist tizonia config files
Tim-Philipp Müller [Sat, 3 Mar 2018 20:21:06 +0000 (20:21 +0000)]
config: dist tizonia config files

6 years agoRevert "omx: wait for flush complete and buffers being released when flushing"
Nicolas Dufresne [Fri, 2 Mar 2018 16:06:08 +0000 (11:06 -0500)]
Revert "omx: wait for flush complete and buffers being released when flushing"

This reverts commit 4211e4c29a262f110cb92ddf9c06b403ced233ef.

6 years agovideoenc: don't set stride padding to 0 when copying frames
Guillaume Desmottes [Wed, 21 Feb 2018 11:50:42 +0000 (12:50 +0100)]
videoenc: don't set stride padding to 0 when copying frames

Padding can be left undefined there is no point filling it with 0.

https://bugzilla.gnome.org/show_bug.cgi?id=793694

6 years agoadd support for NV12_10LE32 and NV16_10LE32 on zynqultrascaleplus
Guillaume Desmottes [Fri, 16 Feb 2018 10:50:35 +0000 (11:50 +0100)]
add support for NV12_10LE32 and NV16_10LE32 on zynqultrascaleplus

The encoder and decoder on zynqultrascaleplus support these new 10 bits
format.

https://bugzilla.gnome.org/show_bug.cgi?id=793694

6 years agoomxvideoenc: factor out gst_omx_video_enc_nv12_manual_copy()
Guillaume Desmottes [Fri, 16 Feb 2018 10:46:47 +0000 (11:46 +0100)]
omxvideoenc: factor out gst_omx_video_enc_nv12_manual_copy()

No semantic change, I'm going to re-use it to copy the NV12_10LE32
format.

https://bugzilla.gnome.org/show_bug.cgi?id=793694

6 years agoomxvideoenc: display the computed buffer size when configuring input
Guillaume Desmottes [Wed, 17 Jan 2018 09:40:49 +0000 (10:40 +0100)]
omxvideoenc: display the computed buffer size when configuring input

https://bugzilla.gnome.org/show_bug.cgi?id=793694

6 years agovideoenc: implement ROI on zynqultrascaleplus
Guillaume Desmottes [Tue, 6 Feb 2018 13:25:57 +0000 (14:25 +0100)]
videoenc: implement ROI on zynqultrascaleplus

Check input buffers for ROI meta and pass them to the encoder by using
zynqultrascaleplus's custom OMX extension. Also add a new
"default-roi-quality" in order to tell the encoder what quality level
should be applied to ROI by default.

https://bugzilla.gnome.org/show_bug.cgi?id=793696

6 years agoomxvideoenc: remove GST_PARAM_MUTABLE_PLAYING from 'max-bitrate' property
Guillaume Desmottes [Wed, 14 Feb 2018 16:23:39 +0000 (17:23 +0100)]
omxvideoenc: remove GST_PARAM_MUTABLE_PLAYING from 'max-bitrate' property

This property isn't actually mutable in the PLAYING state.

https://bugzilla.gnome.org/show_bug.cgi?id=793458

6 years agoomxvideoenc: protect target_bitrate with the object lock
Guillaume Desmottes [Wed, 14 Feb 2018 16:20:02 +0000 (17:20 +0100)]
omxvideoenc: protect target_bitrate with the object lock

The 'target-bitrate' property can be changed while PLAYING
(GST_PARAM_MUTABLE_PLAYING). Make it thread-safe to prevent concurrent
accesses between the application and streaming thread.

https://bugzilla.gnome.org/show_bug.cgi?id=793458

6 years agoomxbufferpool: add PERFORMANCE DEBUG message when copying output frames
Guillaume Desmottes [Tue, 20 Feb 2018 10:46:49 +0000 (11:46 +0100)]
omxbufferpool: add PERFORMANCE DEBUG message when copying output frames

I spent quiet some time figuring out why performance of my pipeline were
terrible. Turned out it was because of output frames being copied
because of stride/offset mismatch.

Add a PERFORMANCE DEBUG message to make it easier to spot and debug from logs.

https://bugzilla.gnome.org/show_bug.cgi?id=793637

6 years agoBack to development
Tim-Philipp Müller [Thu, 15 Feb 2018 19:44:37 +0000 (19:44 +0000)]
Back to development

6 years agoRelease 1.13.1
Tim-Philipp Müller [Thu, 15 Feb 2018 17:50:14 +0000 (17:50 +0000)]
Release 1.13.1

6 years agoomxh265enc: fix typo in "periodicty-idr" property name
Guillaume Desmottes [Fri, 30 Jun 2017 13:15:06 +0000 (15:15 +0200)]
omxh265enc: fix typo in "periodicty-idr" property name

Also fix the 'nick' of the property.

omxh265enc is based on the code from omxh264enc and suffers the same
typo as we fixed in https://bugzilla.gnome.org/show_bug.cgi?id=784370

This element isn't part of a stable release yet so it's not an API
break.

https://bugzilla.gnome.org/show_bug.cgi?id=793390

6 years agomeson: make version numbers ints and fix int/string comparison
Tim-Philipp Müller [Thu, 8 Feb 2018 19:18:59 +0000 (19:18 +0000)]
meson: make version numbers ints and fix int/string comparison

WARNING: Trying to compare values of different types (str, int).
The result of this is undefined and will become a hard error
in a future Meson release.

Also remove unused libversion/soversion.

6 years agoinclude all OMX extension headers if present
Guillaume Desmottes [Tue, 12 Dec 2017 15:50:00 +0000 (16:50 +0100)]
include all OMX extension headers if present

The OMX specs defines 8 headers that implementations can use to define
their custom extensions. We were checking and including 3 and ignoring
the other ones.

https://bugzilla.gnome.org/show_bug.cgi?id=792043

6 years agomeson: simplify OMX extensions detection
Guillaume Desmottes [Tue, 30 Jan 2018 09:31:03 +0000 (10:31 +0100)]
meson: simplify OMX extensions detection

We are now always checking which files are present or not, even when using our
internal copy of OMX, rather than hardcoding the ones present in it.

https://bugzilla.gnome.org/show_bug.cgi?id=792043

6 years agoRevert "meson: use include_directories() with external OMX headers path"
Nicolas Dufresne [Tue, 30 Jan 2018 11:54:24 +0000 (11:54 +0000)]
Revert "meson: use include_directories() with external OMX headers path"

This reverts commit 9d37a92a615e54e8ee12f8c65bcfe386ec9de2d0.

6 years agoomxh265enc: add some encoding properties
Guillaume Desmottes [Mon, 27 Nov 2017 13:52:10 +0000 (14:52 +0100)]
omxh265enc: add some encoding properties

constrained-intra-prediction and loop-filter-mode.
Those map standard OMX settings.

https://bugzilla.gnome.org/show_bug.cgi?id=792528

6 years agoomxh264enc: add some encoding properties
Guillaume Desmottes [Thu, 23 Nov 2017 14:54:15 +0000 (15:54 +0100)]
omxh264enc: add some encoding properties

entropy-mode, constrained-intra-prediction and loop-filter-mode.
Those map standard OMX settings.

https://bugzilla.gnome.org/show_bug.cgi?id=792528

6 years agoomxvideoenc: add zynqultrascaleplus specific properties
Guillaume Desmottes [Thu, 8 Jun 2017 10:31:21 +0000 (12:31 +0200)]
omxvideoenc: add zynqultrascaleplus specific properties

https://bugzilla.gnome.org/show_bug.cgi?id=792528

6 years agoomxvideoenc: document unit of target-bitrate property
Guillaume Desmottes [Tue, 31 Oct 2017 11:24:39 +0000 (12:24 +0100)]
omxvideoenc: document unit of target-bitrate property

nTargetBitrate and nEncodeBitrate are defined in bits per second in the
OMX spec.

https://bugzilla.gnome.org/show_bug.cgi?id=792528

6 years agoomxvideodec: add internal-entropy-buffers property on zynqultrascaleplus
Guillaume Desmottes [Thu, 6 Jul 2017 08:18:48 +0000 (10:18 +0200)]
omxvideodec: add internal-entropy-buffers property on zynqultrascaleplus

Custom property to control the number of internal buffers used in the
decoder to smooth out entropy decoding performance.

https://bugzilla.gnome.org/show_bug.cgi?id=792528

6 years agomeson: use include_directories() with external OMX headers path
Guillaume Desmottes [Tue, 30 Jan 2018 09:31:03 +0000 (10:31 +0100)]
meson: use include_directories() with external OMX headers path

It seems cleaner to use the proper meson tools to include this path
rather than manually tweak the build flags.

This also allows us to simplify the OMX extensions detection code. We
are now always checking which files are present, even when using our
internal copy of OMX, rather than hardcoding the ones present in it.

https://bugzilla.gnome.org/show_bug.cgi?id=792043

6 years agoomxvideoenc: expose chroma format and bit depth in output caps
Guillaume Desmottes [Tue, 7 Nov 2017 14:09:35 +0000 (15:09 +0100)]
omxvideoenc: expose chroma format and bit depth in output caps

As we added in the parser (bgo#792039) expose the chroma and bit
depth information in output caps.

https://bugzilla.gnome.org/show_bug.cgi?id=792040

6 years agoomxvideoenc: factor out get_output_caps()
Guillaume Desmottes [Tue, 7 Nov 2017 13:30:45 +0000 (14:30 +0100)]
omxvideoenc: factor out get_output_caps()

No semantic change so far.

https://bugzilla.gnome.org/show_bug.cgi?id=792040

6 years agoomxvideodec: add hack to pass color format from caps to OMX decoder
Guillaume Desmottes [Fri, 29 Dec 2017 10:59:36 +0000 (11:59 +0100)]
omxvideodec: add hack to pass color format from caps to OMX decoder

This hack tries to pass as much information as possible from caps to the
decoder before it receives any buffer. These information can be used by
the OMX decoder to, for example, pre-allocate its internal buffers
before starting to decode and so reduce its initial latency.

This mechanism is currently supported by the zynqultrascaleplus decoder.

https://bugzilla.gnome.org/show_bug.cgi?id=792040

6 years agolog failing OMX calls as errors
Guillaume Desmottes [Fri, 1 Dec 2017 11:43:19 +0000 (12:43 +0100)]
log failing OMX calls as errors

I find it confusing when debugging that OMX calls returning an error
where not logged as GST_LEVEL_ERROR making them harder to spot.
Fix this by introducing simple log macros checking the return value of
the OMX call and logging failures as errors.

https://bugzilla.gnome.org/show_bug.cgi?id=791069

6 years agoadd OMX_PERFORMANCE debug category
Guillaume Desmottes [Mon, 30 Oct 2017 10:59:19 +0000 (11:59 +0100)]
add OMX_PERFORMANCE debug category

Can be used to log buffers exchange between OMX and gst-omx to profile
performances of the OMX component.
Ideally this should be done using tracer hooks but it's currently not
possible to define custom hooks outside of core.

Use GST_DEBUG="OMX_PERFORMANCE:8" to enable it.
See also
https://github.com/gdesmott/gst-log-parser/blob/master/src/bin/omx-perf.rs
as a simple program consuming those logs to generate gnuplot files and
stats.

https://bugzilla.gnome.org/show_bug.cgi?id=791093

6 years agoomxvideoenc: implement dmabuf import on zynqultrascaleplus
Guillaume Desmottes [Thu, 27 Jul 2017 09:21:59 +0000 (11:21 +0200)]
omxvideoenc: implement dmabuf import on zynqultrascaleplus

The Zynq UltraScale+ encoder implements a custom OMX extension to
directly import dmabuf saving the need of mapping input buffers.

This can be use with either 'v4l2src io-mode=dmabuf' or an OMX video
decoder upstream.

https://bugzilla.gnome.org/show_bug.cgi?id=792361

6 years agoomxvideoenc: drop late input frames if QoS is enabled
Guillaume Desmottes [Fri, 22 Sep 2017 14:02:40 +0000 (16:02 +0200)]
omxvideoenc: drop late input frames if QoS is enabled

Make use of the new GstVideoEncoder QoS API to drop late input frames. This may
help a live pipeline to catch up if it's being late and all frames end up
being dropped at the sink.

https://bugzilla.gnome.org/show_bug.cgi?id=792783

6 years agoTestEgl: Removed redundant/unused code
Ashish Kumar [Fri, 19 Jan 2018 09:48:23 +0000 (15:18 +0530)]
TestEgl: Removed redundant/unused code

https://bugzilla.gnome.org/show_bug.cgi?id=788550