platform/upstream/gst-omx.git
4 years agoUse tizen allocator for decoder output port 12/224712/2 tizen_gst_1.16.2
Jeongmo Yang [Wed, 12 Feb 2020 10:56:31 +0000 (19:56 +0900)]
Use tizen allocator for decoder output port

[Version] 1.16.2-1
[Profile] Common
[Issue Type] Update

Change-Id: Ia909b9ce23bc5fb1d8910c34cd91b0d932a36e4b
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
4 years agoChange gst-omx spec version 83/224683/1
Gilbok Lee [Wed, 12 Feb 2020 08:28:12 +0000 (17:28 +0900)]
Change gst-omx spec version

Change-Id: Ic0731416d70f7738f325cac26ba035e0350b73a0

4 years agoMerge branch 'upstream/1.16' into tizen_gst_1.16.2 83/223683/2
Gilbok Lee [Fri, 31 Jan 2020 06:47:22 +0000 (15:47 +0900)]
Merge branch 'upstream/1.16' into tizen_gst_1.16.2

Change-Id: I18e3d446d8bb0aa940194357e3c5c895c01b1200

4 years agoomxbufferpool: Fixed fd leak 23/221423/7 accepted/tizen/unified/20200113.130644 submit/tizen/20200110.030320
Gilbok Lee [Thu, 2 Jan 2020 08:03:55 +0000 (17:03 +0900)]
omxbufferpool: Fixed fd leak

- Replace gst_buffer_get_memory() by gst_buffer_peek_memory()

Change-Id: I9bb7725f189bdb7e10cd4bd6e63ddbb4264d3777

4 years agoRelease 1.16.2 upstream/1.16 1.16.2
Tim-Philipp Müller [Tue, 3 Dec 2019 11:19:54 +0000 (11:19 +0000)]
Release 1.16.2

5 years agoRelease 1.16.1
Tim-Philipp Müller [Mon, 23 Sep 2019 10:21:15 +0000 (11:21 +0100)]
Release 1.16.1

5 years agoci: use template from 1.16 branch
Tim-Philipp Müller [Thu, 2 May 2019 11:37:20 +0000 (12:37 +0100)]
ci: use template from 1.16 branch

5 years agoRelease 1.16.0
Tim-Philipp Müller [Thu, 18 Apr 2019 23:38:44 +0000 (00:38 +0100)]
Release 1.16.0

5 years agoFixes build with omx >= 1.2.0
Julien Isorce [Tue, 16 Apr 2019 19:23:10 +0000 (12:23 -0700)]
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

5 years agoFixed an error where lock is called twice when the surface have multiple bos 97/203497/1 accepted/tizen_5.5_unified_mobile_hotfix tizen_5.5_mobile_hotfix accepted/tizen/5.5/unified/20191031.004436 accepted/tizen/5.5/unified/mobile/hotfix/20201027.063615 accepted/tizen/unified/20190418.145716 submit/tizen/20190418.022114 submit/tizen_5.5/20191031.000010 submit/tizen_5.5_mobile_hotfix/20201026.185106 tizen_5.5.m2_release
Sejun Park [Mon, 15 Apr 2019 08:46:13 +0000 (17:46 +0900)]
Fixed an error where lock is called twice when the surface have multiple bos

Change-Id: I563afc5e28374d1242ac1164b17e57a41f03e803

5 years agotestegl: properly detect and use rpi specific libs
Guillaume Desmottes [Fri, 18 May 2018 08:55:21 +0000 (10:55 +0200)]
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.

5 years agotestelg: include eglext.h
Guillaume Desmottes [Fri, 18 May 2018 08:53:34 +0000 (10:53 +0200)]
testelg: include eglext.h

Neded for the declaration of eglSaneChooseConfigBRCM().

5 years agotestegl: move up pi specific macros
Guillaume Desmottes [Fri, 18 May 2018 08:38:33 +0000 (10:38 +0200)]
testegl: move up pi specific macros

We need to define __VCCOREVER__ and disable redundant-decls before
including the egl.h from the pi.

5 years agoRelease 1.15.90
Tim-Philipp Müller [Wed, 10 Apr 2019 23:40:52 +0000 (00:40 +0100)]
Release 1.15.90

5 years agomeson: add -Wundef as additional warning flag
Tim-Philipp Müller [Tue, 9 Apr 2019 23:19:55 +0000 (00:19 +0100)]
meson: add -Wundef as additional warning flag

5 years agoomx: fix autotools build for generic target
Tim-Philipp Müller [Tue, 9 Apr 2019 23:16:27 +0000 (00:16 +0100)]
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

5 years agoAdd Gitlab CI configuration
Jordan Petridis [Mon, 12 Nov 2018 10:51:28 +0000 (12:51 +0200)]
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

5 years agoomx: disable OMX_API_TRACE code if gst debug is disabled
Guillaume Desmottes [Mon, 25 Mar 2019 15:30:11 +0000 (16:30 +0100)]
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.

5 years agoomx: log Get/SetParameter/Config calls
Guillaume Desmottes [Thu, 11 Oct 2018 08:55:04 +0000 (10:55 +0200)]
omx: log Get/SetParameter/Config calls

Extend OMX_API_TRACE by logging component configuration calls.

5 years agoomxbufferpool: don't use CAT_PERFORMANCE if pool will copy
Guillaume Desmottes [Wed, 6 Feb 2019 13:57:05 +0000 (14:57 +0100)]
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.

5 years agoomxvideodec: add debug if proposed pool can't provide enough buffers
Guillaume Desmottes [Wed, 6 Feb 2019 13:50:44 +0000 (14:50 +0100)]
omxvideodec: add debug if proposed pool can't provide enough buffers

We were silently ignoring the pool which was pretty confusing when
debugging.

5 years agoomx: Add hardware classifiers to encoders/decoders
Charlie Turner [Tue, 26 Mar 2019 12:17:26 +0000 (12:17 +0000)]
omx: Add hardware classifiers to encoders/decoders

5 years agomeson: sync warnings flags with -good
Guillaume Desmottes [Mon, 25 Mar 2019 15:01:48 +0000 (16:01 +0100)]
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

5 years agoBack to development
Tim-Philipp Müller [Mon, 4 Mar 2019 09:16:40 +0000 (09:16 +0000)]
Back to development

5 years agoRelease 1.15.2
Tim-Philipp Müller [Tue, 26 Feb 2019 12:02:23 +0000 (12:02 +0000)]
Release 1.15.2

5 years agomeson: add options to disable examples, tests and tools and bump meson requirement
Tim-Philipp Müller [Thu, 14 Feb 2019 23:57:09 +0000 (23:57 +0000)]
meson: add options to disable examples, tests and tools and bump meson requirement

5 years agoomxvideo: use GST_VIDEO_CAPS_MAKE() for template caps
Guillaume Desmottes [Fri, 4 Jan 2019 09:11:38 +0000 (10:11 +0100)]
omxvideo: use GST_VIDEO_CAPS_MAKE() for template caps

Simplify the code and so we advertise the formats actually supported by
gst-omx.

5 years agoomxvideoenc: validate cpb-size and initial-delay
Guillaume Desmottes [Mon, 4 Jun 2018 10:20:03 +0000 (12:20 +0200)]
omxvideoenc: validate cpb-size and initial-delay

cpb-size cannot be smaller than initial-delay.

5 years agoomxvideodec: Remove duplicated QoS code
Nicolas Dufresne [Tue, 2 Oct 2018 14:47:06 +0000 (10:47 -0400)]
omxvideodec: Remove duplicated QoS code

The 'finish' function do the exact same check / drop, there is no
need to duplicate this here.

5 years agoomxvideodec: Remove dead code
Nicolas Dufresne [Thu, 20 Sep 2018 18:44:09 +0000 (14:44 -0400)]
omxvideodec: Remove dead code

The omxvideodec base class have a totally unused prepare_frame() vritual
function, remove it.

5 years agoomxvideoenc: add adaptive gop-mode option
Varunkumar Allagadapa [Thu, 12 Jul 2018 00:38:22 +0000 (17:38 -0700)]
omxvideoenc: add adaptive gop-mode option

Added adaptive gop-mode option to ZYNQ_USCALE_PLUS encoder properties

5 years agoomxvideoenc: Add dynamic framerate support
Nicolas Dufresne [Tue, 13 Feb 2018 18:25:51 +0000 (18:25 +0000)]
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.

5 years agoRelease 1.15.1
Tim-Philipp Müller [Thu, 17 Jan 2019 02:38:28 +0000 (02:38 +0000)]
Release 1.15.1

5 years agoomxvideoenc: Add dynamic IDR insertion support on zynq
Varunkumar Allagadapa [Tue, 20 Feb 2018 18:57:42 +0000 (10:57 -0800)]
omxvideoenc: Add dynamic IDR insertion support on zynq

As the pi, the zynq has its own API to request keyframe.

5 years agoomxbufferpool: fix race when releasing input buffers
Guillaume Desmottes [Mon, 7 Jan 2019 12:29:37 +0000 (13:29 +0100)]
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.

5 years agoomxbufferpool: fix early input buffer release
Guillaume Desmottes [Thu, 15 Nov 2018 10:17:59 +0000 (11:17 +0100)]
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.

5 years agoAutomatic update of common submodule
Thibault Saunier [Wed, 5 Dec 2018 20:24:48 +0000 (17:24 -0300)]
Automatic update of common submodule

From ed78bee to 59cb678

5 years agoomx: fix OMX_EventBufferFlag OMX_API_TRACE struct
Guillaume Desmottes [Fri, 23 Nov 2018 11:57:15 +0000 (12:57 +0100)]
omx: fix OMX_EventBufferFlag OMX_API_TRACE struct

The GType was missing from the second field of the struct.

6 years agoUpdate git locations to gitlab
Matthew Waters [Mon, 5 Nov 2018 05:43:43 +0000 (05:43 +0000)]
Update git locations to gitlab

6 years agoomx: rename OMX_PERFORMANCE debug cat to OMX_API_TRACE
Guillaume Desmottes [Tue, 18 Sep 2018 14:50:11 +0000 (16:50 +0200)]
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

6 years ago1. minimize the component's memory allocation in the encoder 45/189645/5 accepted/tizen_5.0_unified tizen_5.0 accepted/tizen/5.0/unified/20181102.024315 accepted/tizen/unified/20180921.143058 submit/tizen/20180920.072713 submit/tizen_5.0/20181101.000006
Sejun Park [Wed, 19 Sep 2018 10:47:34 +0000 (19:47 +0900)]
1. minimize the component's memory allocation in the encoder

2. remove build warning

Change-Id: Ib6cc75c5067fa312cb029b2cb9b12577f3dba148

6 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

6 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

6 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

6 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

6 years agoomxvideodec : No need to copy out frame after adding tizen allocator 18/189518/2
Sejun Park [Tue, 18 Sep 2018 08:49:55 +0000 (17:49 +0900)]
omxvideodec : No need to copy out frame after adding tizen allocator

Change-Id: I42fb09aa63dbe40cd848abea124def2b52a6396d

6 years agoomxvideodec : Initialization of acquired omx buffer 66/189066/1 accepted/tizen/unified/20180914.073152 submit/tizen/20180913.065409
Sejun Park [Thu, 13 Sep 2018 06:40:15 +0000 (15:40 +0900)]
omxvideodec : Initialization of acquired omx buffer

- omx buffer is not initialized, causing FillThisBuffer to be called successively

Change-Id: I55818ac9ebdbd5fb4bd7a0c8d88b69c2aeaadcf8

6 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

6 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

6 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

6 years agoAfter having been compared to NULL value : pointer 'meta' is dereferenced 13/188413/1 accepted/tizen/unified/20180905.140146 submit/tizen/20180905.024830
Sejun Park [Wed, 5 Sep 2018 01:32:18 +0000 (10:32 +0900)]
After having been compared to NULL value : pointer 'meta' is dereferenced

Change-Id: Iad6f9d6d34020ca1f48bdf3d2603d8114a7ac254

6 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

6 years agoFix bugs after applying tizen allocator 51/184051/10 accepted/tizen/unified/20180903.062523 submit/tizen/20180831.043334 submit/tizen/20180831.080817
Sejun Park [Fri, 13 Jul 2018 08:15:14 +0000 (17:15 +0900)]
Fix bugs after applying tizen allocator

Change-Id: Ie7bee8f11f6a84893181097c7d61d221263730bb

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 years agoApply tizenbufferpool to decoder 17/182717/14
Sejun Park [Wed, 27 Jun 2018 09:30:36 +0000 (18:30 +0900)]
Apply tizenbufferpool to decoder

Change-Id: I4b6669dcd6a64a5405b1c66a235c120f1ea0b464

6 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.