Commit graph

914 commits

Author SHA1 Message Date
Guillaume Desmottes
c8969b0dbe 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
2018-06-08 09:53:01 +02:00
Guillaume Desmottes
431eac07bf 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
2018-06-08 09:53:01 +02:00
Guillaume Desmottes
84483f3d7a 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
2018-06-08 09:47:32 +02:00
Guillaume Desmottes
fd108f4278 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
2018-06-08 09:47:32 +02:00
Guillaume Desmottes
798bbc9acf 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
2018-06-08 09:47:32 +02:00
Guillaume Desmottes
2b48338d68 zynqultrascaleplus: enable 'ensure-buffer-count-actual' hack
https://bugzilla.gnome.org/show_bug.cgi?id=791211
2018-06-08 09:44:49 +02:00
Guillaume Desmottes
9a8e863862 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
2018-06-08 09:44:49 +02:00
Guillaume Desmottes
338ff34e5e 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
2018-06-08 09:38:57 +02:00
Guillaume Desmottes
3498f81d1f 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
2018-06-08 09:36:56 +02:00
Matthew Waters
ebcadd9984 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...
2018-05-25 01:35:58 +10:00
Guillaume Desmottes
f706f3b73b omxvideodec: pass a GstOMXBufferMode to gst_omx_buffer_pool_new()
The output_mode is supposed to be a GstOMXBufferMode, not a boolean.
2018-05-04 13:20:55 +02:00
Guillaume Desmottes
787a2c3203 zynq: remove 'no-disable-outport' hack
No longer needed with newer version of the OMX stack.
2018-05-03 09:27:15 +02:00
Guillaume Desmottes
b644699c8d 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
2018-04-26 10:07:54 +02:00
Guillaume Desmottes
83e580bd6b 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
2018-04-25 09:20:02 +02:00
Guillaume Desmottes
7242d0a2e2 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
2018-04-25 09:20:02 +02:00
Guillaume Desmottes
4e75bab796 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
2018-04-25 09:20:02 +02:00
Guillaume Desmottes
f9922a1a56 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
2018-04-25 09:20:02 +02:00
Guillaume Desmottes
dc0ed29a62 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
2018-04-25 09:15:38 +02:00
Guillaume Desmottes
d40c6c0449 omxvideo: display port number when listing supported formats
More convenient when debugging.

https://bugzilla.gnome.org/show_bug.cgi?id=794175
2018-04-25 09:15:38 +02:00
Guillaume Desmottes
72cb1943da 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
2018-04-23 10:41:10 +02:00
Guillaume Desmottes
542faf0f36 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
2018-04-23 10:35:48 +02:00
Guillaume Desmottes
256f77b621 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
2018-04-23 10:35:48 +02:00
Tim-Philipp Müller
cbb28c5702 meson: fix miscellaneous meson warnings
cc.has_header*() doesn't have a 'required:' kwarg.
2018-04-20 11:54:14 +01:00
Guillaume Desmottes
e1a149f3d5 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
2018-04-18 14:01:39 +02:00
Tim-Philipp Müller
dfd270042f Automatic update of common submodule
From 3fa2c9e to ed78bee
2018-04-16 10:53:41 +01:00
Guillaume Desmottes
021b66878a log_omx_performance: convert pointers to strings
G_TYPE_POINTER are not serialized in logs.

https://bugzilla.gnome.org/show_bug.cgi?id=794331
2018-04-06 13:39:42 +02:00
Guillaume Desmottes
dec9c8c385 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
2018-04-02 15:16:33 +02:00
Guillaume Desmottes
530a7537cf omxvideoenc: add 'roi' qp-mode on zynqultrascaleplus
New QP mode used to handle ROI metadata.

https://bugzilla.gnome.org/show_bug.cgi?id=793696
2018-03-28 10:09:20 +02:00
Tim-Philipp Müller
6b6ea6fdf7 Back to development 2018-03-20 10:31:10 +00:00
Tim-Philipp Müller
f5d58a3c58 Release 1.14.0 2018-03-19 20:31:03 +00:00
Tim-Philipp Müller
7626b73e19 Release 1.13.91 2018-03-13 19:32:39 +00:00
Tim-Philipp Müller
75ac839391 meson: fix typo in package name define 2018-03-09 12:02:46 +00:00
Guillaume Desmottes
5b55041bb4 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
2018-03-05 13:59:22 -05:00
Nicolas Dufresne
4e9dca0761 omxvideoenc: Don't drop the frame on empty payload
This otherwise may lead to "No reference frame found" warning.
2018-03-05 13:50:08 -05:00
Nicolas Dufresne
fb455242e9 omxvideodec: Don't drop the frame on empty payload
This otherwise may lead to "No reference frame found" warning.
2018-03-05 13:50:08 -05:00
Nicolas Dufresne
32660fd294 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.
2018-03-05 13:50:08 -05:00
Nicolas Dufresne
4bc3b6e567 omxvideodec: Fix CodecState leak 2018-03-05 13:46:56 -05:00
Tim-Philipp Müller
054cea0617 Release 1.13.90 2018-03-03 23:01:00 +00:00
Tim-Philipp Müller
7ff035e2fe config: dist tizonia config files 2018-03-03 20:21:06 +00:00
Nicolas Dufresne
5eed1a7eb2 Revert "omx: wait for flush complete and buffers being released when flushing"
This reverts commit 4211e4c29a.
2018-03-02 11:06:08 -05:00
Guillaume Desmottes
f861ad2bc5 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
2018-02-28 08:32:26 -05:00
Guillaume Desmottes
ea2df994f3 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
2018-02-28 08:32:26 -05:00
Guillaume Desmottes
d1ffc97ddd 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
2018-02-28 08:32:26 -05:00
Guillaume Desmottes
f2570512cf omxvideoenc: display the computed buffer size when configuring input
https://bugzilla.gnome.org/show_bug.cgi?id=793694
2018-02-28 08:32:15 -05:00
Guillaume Desmottes
6921568161 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
2018-02-21 12:31:39 -05:00
Guillaume Desmottes
a8c3996317 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
2018-02-21 11:31:13 +00:00
Guillaume Desmottes
2d3816fabc 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
2018-02-21 11:24:52 +00:00
Guillaume Desmottes
412df8c74f 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
2018-02-21 11:22:05 +00:00
Tim-Philipp Müller
c6a112ec93 Back to development 2018-02-15 19:44:37 +00:00
Tim-Philipp Müller
dae2cf4dfd Release 1.13.1 2018-02-15 17:50:14 +00:00