Partially revert 1b7d0b8:
omxvideodec: handle IL 1.2 behavior for OMX_SetParameter
It turned out it was a problem in the decoder which was
not updating some local variables upon SetParameter.
https://bugzilla.gnome.org/show_bug.cgi?id=783976
For the history, the parallel disable port has been introduced by:
"00be69f omxvideodec: Disable output port when setting a new format"
and then replicated to videoenc, audiodec and audioenc.
This is only required to do 'parallel' if buffers are shared between ports.
But for decoders and encoders the input and output buffer are of different
nature by definition (bitstream vs images). So they cannot be shared.
Also starting from IL 1.2.0 it is written in the spec that the parallel
disable is not allowed and will return an error. Except when buffers are
shared.
Again here we know in advance that they are not shared so let's always
do a sequential disable.
Tested on Desktop, rpi and zynqultrascaleplus.
https://bugzilla.gnome.org/show_bug.cgi?id=786348
The OMX specification doesn't provide any API to expose the latency
introduced by encoders and decoders. We implemented this as a custom
extension as declaring the latency is needed for live pipelines like
video conferencing.
https://bugzilla.gnome.org/show_bug.cgi?id=785125
Use the stride and slice height information from the first buffer meta
data to adjust the settings of the input port.
This will ensure that the OMX input buffers match the GStreamer ones
and so will save us from having to copy line-by-line each one.
This is also the first step to allow the OMX encoder to receive dmabuf.
Tested on rpi and zynqultrascaleplus.
https://bugzilla.gnome.org/show_bug.cgi?id=785967
No significant change for now. Just delay the input port configuration
of the buffer size related fields (stride, slice height, buffer size)
until the component is activated.
This will allow us to use the actual stride/height of the first input
and so avoid the buffer copying code path in most cases.
Tested on rpi and zynqultrascaleplus.
https://bugzilla.gnome.org/show_bug.cgi?id=785967
Allocating OMX components buffers in set_format() is too early.
Doing it when receiving the first buffers will allow the element to use
the information from the allocation query and/or the first incoming
buffer to pick to best allocation mode.
Tested on raspberry pi with dynamic resolution changes on decoder and
encoder input.
https://bugzilla.gnome.org/show_bug.cgi?id=785967
Makes the code simpler as we no longer need to restart the thread in
gst_omx_video_enc_flush() and It's more symetric which the omxvideodec
implementation.
I'm also going to move the enabling of the OMX component in
handle_frame() and the src pad thread needs to be started after it.
https://bugzilla.gnome.org/show_bug.cgi?id=785967
No semantic change, just factor out the code enabling and disabling the
component to their own functions.
Makes the code easier to read as the set_format() method was already
pretty big. Will also allow us to easily change the enabling logic.
https://bugzilla.gnome.org/show_bug.cgi?id=785967
No semantic change, just factor out the code enabling and disabling the
component to their own functions.
Makes the code easier to read as the set_format() method was already
pretty big. Will also allow us to easily change the enabling logic.
https://bugzilla.gnome.org/show_bug.cgi?id=785967
The spec states that the buffer passed to OMX_FillThisBuffer() needs to be
empty. Some implementation may check it actually is by checking its
nFilledLen field, so best to reset it as well.
https://bugzilla.gnome.org/show_bug.cgi?id=785623
Will be easier to maintain and to make enhancements.
Tested with Tizonia on Desktop.
Also tested with Bellagio to make sure it does not crash when
calling OMX_UseEGLImage and indeed it returns NotImplemented.
Then gst-omx fallback to OMX_UseBuffer if it can and so on.
Also tested on rpi to make sure there is no regression.
https://bugzilla.gnome.org/show_bug.cgi?id=784365
On segment seek, unlike EOS, we drain, but we cannot expect a flush
later to reset the decoder state. As a side effect, the decoder would
remain in EOS state and ignore any new incoming buffers.
To fix this, we call _flush() inside the _drain() function, and
_finish() becomes what _drain() was before. This way, for _finish() (the
eos case) we only drain, for _drain() triggered by segment seek or new
caps, we also reset the decoder state so it's ready to accept buffers.
https://bugzilla.gnome.org/show_bug.cgi?id=785237
The zynqultrascaleplus OMX implementation has a custom extension
allowing decoders to output dmabuf and so avoid buffers copy between OMX
and GStreamer.
Make use of this extension when built on the zynqultrascaleplus. The
buffer pool code should be re-usable for other platforms as well.
https://bugzilla.gnome.org/show_bug.cgi?id=784847
It triggers SettingsChanged on the other port and it is up to
the client to decide if it should lead to a port reconfiguration.
Settings are propagated to the other port for fields they have
in common. But this event is only triggered on the other port
if it actually change a setting.
https://bugzilla.gnome.org/show_bug.cgi?id=783976
Can happen if gst_buffer_pool_acquire_buffer succeeds but
gst_buffer_n_memory (buffer) is not exactly 1.
In theory this should not happen because the decoder requests
EGLImage(RGBA) but better to fix any leak on corner cases.
https://bugzilla.gnome.org/show_bug.cgi?id=784365
For example this allows the omx decoder to directly fill the
pixmaps coming from the video sink.
It only avoids a buffer copy when the decoder uses a pool provided
by a downstream element. So let's restrict this usage to situations
where the decoder decides to use a downstream buffer pool.
Tested with Tizonia/OMX.Aratelia.video_decoder.vp8
and with Bellagio/OMX.mesa.video_decoder.avc.
If it fails to setup buffers with OMX_UseBuffer the decoders
fallbacks to usual OMX_AllocateBuffer.
Also it allows to test on desktop the GstOMXBufferPool->other_pool
management which was previously only used in the OMX_UseEGLImage
case, i.e. on Rpi.
https://bugzilla.gnome.org/show_bug.cgi?id=784069
This information can be useful to zynqultrascaleplus decoders. They may
use this information to reduce startup latency by configuring itself
before receiving the first frames.
We also have a custom OMX extension allowing the decoder to report the
latency. The profile/level information helps it reporting a more
accurate latency earlier.
https://bugzilla.gnome.org/show_bug.cgi?id=783114
It is safe to ignore it always. Tizonia notifies this error to pass
some khronos conformance tests. Problem is that gst-omx saves this
error in comp->last_error and then gst_omx_port_set_enabled early
error out which fails the pipeline.
https://bugzilla.gnome.org/show_bug.cgi?id=782800
This will check for tizilheaders.pc which adds path to omx-il
headers its cflags. Can be installed all together with the 1.2 headers
with package tizilheaders if not building from sources:
https://github.com/tizonia/tizonia-openmax-il
It is also adviced to remove libomxil-bellagio-dev package because
it installs headers /usr/include directly, ex: /usr/include/OMX_Video.h.
https://bugzilla.gnome.org/show_bug.cgi?id=782800
gst_omx_audio_enc_open will only update GstOMXAudioEnc->port->port_def.
Note that the component is reopen only if the flag
GST_OMX_HACK_NO_COMPONENT_RECONFIGURE is set.
https://bugzilla.gnome.org/show_bug.cgi?id=782418
gst_omx_video_enc_open will only update GstOMXVideoEnc->port->port_def.
Note that the component is reopen only if the flag
GST_OMX_HACK_NO_COMPONENT_RECONFIGURE is set.
https://bugzilla.gnome.org/show_bug.cgi?id=782418
gst_omx_video_dec_open will only update GstOMXVideoDec->port->port_def.
Note that the component is reopen only if the flag
GST_OMX_HACK_NO_COMPONENT_RECONFIGURE is set.
https://bugzilla.gnome.org/show_bug.cgi?id=782418
Ensure that enough buffers are allocated by adding up component's own
minimal plus the number of buffers requested by downstream.
This should prevent buffers starvation problem if downstream elements
are holding some of the buffers they required.
Also simplify the check on the maximum on buffers. What we actually care
about is to make sure the pool can hold the minimum of required buffers.
https://bugzilla.gnome.org/show_bug.cgi?id=784479
Some platforms may not implement OMX_IndexConfigVideoAVCIntraPeriod and
use OMX_IndexParamVideoAvc instead to configure the GOP pattern.
So raise a warning instead of an error if this API is not implemented.
https://bugzilla.gnome.org/show_bug.cgi?id=784379
Install libomxil-bellagio0 and make sure mesa has been built with
--enable-omx. Check there is /usr/lib/libomxil-bellagio0/libomx_mesa.so
then run omxregister-bellagio to regenerate $XDG_DATA_HOME/.omxregister
Then omxh264dec and omxmpeg2dec should load.
https://bugzilla.gnome.org/show_bug.cgi?id=782926
Does not change anything, except this will be useful for future commits.
Indeed some targets provide a .pc file where to look for the omx headers.
https://bugzilla.gnome.org/show_bug.cgi?id=782800