Commit graph

174 commits

Author SHA1 Message Date
Guillaume Desmottes 318ef5b357 omx: display states as string if changing failed
Improve the error message by displaying the states in their string
representation rather than their numerical value.

https://bugzilla.gnome.org/show_bug.cgi?id=787235
2017-09-04 08:46:07 +01:00
Guillaume Desmottes 7a0949b750 omx: also reset nFilledLen before calling OMX_FillThisBuffer()
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
2017-08-01 11:26:11 -04:00
Satya Prakash Gupta 5e6c3f170f omx: Possible Memory leak in gst_caps_from_string
https://bugzilla.gnome.org/show_bug.cgi?id=784978
2017-07-17 16:46:29 +03:00
Julien Isorce e60ac7e1c0 omx: do not always print an error if OMX_{UseBuffer,EGLImage} fails
Let the caller decide to print an error. Because it can be part of
a normal trial path.

https://bugzilla.gnome.org/show_bug.cgi?id=784069
2017-07-12 16:26:36 +01:00
Julien Isorce 02d493e859 omx: add gstomxmp3enc
Initial support and only tested with the software based
encoder OMX.Aratelia.audio_encoder.mp3 from Tizonia which
internally uses libmp3lame.

https://bugzilla.gnome.org/show_bug.cgi?id=782988
2017-07-12 14:29:44 +01:00
Guillaume Desmottes 0aa4c9db4e h264dec: add hack to pass profile and level to OMX
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
2017-07-11 11:57:50 -04:00
Gurkirpal Singh 065878a5d4 omx: always ignore OMX_ErrorPortUnpopulated
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
2017-07-05 17:27:27 -04:00
Gurkirpal Singh fc1a8229b0 omx: guard some omx enums with IL version
Some enums that existed in 1.1.2 just do not exit in 1.2.0
See https://www.khronos.org/registry/OpenMAX-IL/specs/OpenMAX_IL_1_2_0_Specification_redline.pdf

https://bugzilla.gnome.org/show_bug.cgi?id=782800
2017-07-05 17:27:27 -04:00
Julien Isorce 1c8f069e42 omx: allow 0 feature
Previously the omx plugin was blacklisted if GST_OMX_CONFIG_DIR
points to an invalid path or if the gstomx.conf contains 0 valid
component.
Problem is that once the plugin is blacklisted, a rescan is not
triggered upon changes of the env var or the gstomx.conf file
despite being setup with gst_plugin_add_dependency.

This also makes it more consistent with other plugins that auto
generate features. For example gst-{ffmeg,libav}, gstreamer-vaapi,
v4l2 video dec.

To clarify the diff, the plugin_init func will return TRUE even if
g_key_file_get_groups returns 0 element and even if
g_key_file_load_from_dirs fails.

https://bugzilla.gnome.org/show_bug.cgi?id=782867
2017-05-21 15:40:11 +01:00
Jan Schmidt 413f05269c omxvideoenc: Add GST_OMX_HACK_HEIGHT_MULTIPLE_16 for Rpi
The Raspberry Pi encoder produces corrupt output unless
the input height is a multiple of 16. Add a hack that adds
zero padding when needed.
2017-03-14 03:00:49 +11:00
Reynaldo H. Verdejo Pinochet 7925355d72 Fix broken build due to syntax error
Problem was introduced by 8716c23e2b
2016-12-14 13:32:16 -08:00
Graham Leggett 8716c23e2b Prevent early EOS by resetting eos flag once GST_OMX_ACQUIRE_BUFFER_EOS is triggered
https://bugzilla.gnome.org/show_bug.cgi?id=774600
2016-12-13 11:38:38 +02:00
Graham Leggett 5d5fbcd8f6 Add clear debug logging on all the paths out of gst_omx_port_acquire_buffer()
https://bugzilla.gnome.org/show_bug.cgi?id=774600
2016-12-13 11:38:36 +02:00
George Kiagiadakis 05b137a256 Add a signals-premature-eos hack for egl_render
egl_render seems to have a bug and signals EOS before it has finished
pushing out all data; this hack simply makes acquire_buffer() wait
a bit more before signalling EOS, in case egl_render decides to spit
out some more data.

https://bugzilla.gnome.org/show_bug.cgi?id=741856
2016-12-13 11:38:26 +02:00
Sebastian Dröge 53d8d353f0 omx: Fix compiler warning with latest clang
gstomx.c:1376:42: error: implicit conversion from enumeration type 'GstOMXAcquireBufferReturn' to different enumeration type 'OMX_ERRORTYPE'
      (aka 'enum OMX_ERRORTYPE') [-Werror,-Wenum-conversion]
  g_return_val_if_fail (!port->tunneled, GST_OMX_ACQUIRE_BUFFER_ERROR);
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

https://bugzilla.gnome.org/show_bug.cgi?id=775112
2016-11-26 00:07:13 +02:00
Sebastian Dröge cb9078627c omx: Also search for gstomx.conf in the autoconf --sysconfdir
https://bugzilla.gnome.org/show_bug.cgi?id=770743
2016-09-14 11:28:36 +02:00
Enrique Ocaña González 271093d633 Remember the last_error after a failed set state call to avoid blocking the next get state call
gst_omx_video_dec_flush() blocks forever in
http://cgit.freedesktop.org/gstreamer/gst-omx/tree/omx/gstomxvideodec.c?id=9adf0ff82903cad5331e40975ae91ed5d11bc102#n2110
when the previous call to gst_omx_component_set_state() fails in
http://cgit.freedesktop.org/gstreamer/gst-omx/tree/omx/gstomx.c?id=9adf0ff82903cad5331e40975ae91ed5d11bc102#n827.
To mitigate that, I set "last_error" to true, so the code in
http://cgit.freedesktop.org/gstreamer/gst-omx/tree/omx/gstomx.c?id=9adf0ff82903cad5331e40975ae91ed5d11bc102#n862
exits early and doesn't block.

https://bugzilla.gnome.org/show_bug.cgi?id=758274
2015-11-18 15:18:02 +02:00
Nicolas Huet 9adf0ff829 omx: fix hacks leak on class init 2015-11-18 12:02:44 +00:00
Luis de Bethencourt 70c48cf85f omx: handle both errors in the two steps of update_port_definition
Also consider potential errors in the _get_parameter() in the return of the
update_port_definition function.

CID #1287052
2015-03-06 12:06:22 +00:00
George Kiagiadakis 0ef1e90b34 omx: call handle_messages() only once in acquire_buffer() to avoid potential deadlock
There is one rare case where calling handle_messages() more than once can cause a deadlock
in the video decoder element:

- sink pad thread starts the src pad task (gst_omx_video_dec_loop())
- _video_dec_loop() calls gst_omx_port_acquire_buffer() on dec_out_port
- blocks in gst_omx_component_wait_message() releasing comp->lock and comp->messages_lock
  (initially, there are no buffers configured on that port, so it waits for OMX_EventPortSettingsChanged)
- the sink pad thread pushes a buffer to the decoder with gst_omx_port_release_buffer()
- _release_buffer() grabs comp->lock and sends the buffer to OMX, which consumes it immediately
- EmptyBufferDone gets called at this point, which signals _wait_message() to unblock
- the message from EmptyBufferDone is processed in gst_omx_component_handle_messages()
  called from gst_omx_port_release_buffer()
- gst_omx_port_release_buffer releases comp->lock
- the src pad thread now gets to run, grabbing comp->lock while it exits from _wait_message()
- _acquire_buffer() calls the _handle_messages() on the next line after _wait_message(),
  which does nothing (no pending messages)
- then it goes to "retry:" and calls _handle_messages() again, which also does nothing
  (still no pending messages)
- scheduler switches to a videocore thread that calls EventHandler, informing us about the
  OMX_EventPortSettingsChanged event that just arrived
- EventHandler graps comp->messages_lock, but not comp->lock, so it can run in parallel at
  this point just fine.
- scheduler switches back to the src pad thread (which is in the middle of _acquire_buffer())
- the next _handle_messages() which is right before if (g_queue_is_empty (&port->pending_buffers))
  processes the OMX_EventPortSettingsChanged
- the buffer queue is still empty, so that thread blocks again in _wait_message()
- the sink pad thread tries to acquire the next input port buffer
- _acquire_buffer() also blocks this thread in:
   if (comp->pending_reconfigure_outports) { ... _wait_message() ... }
- DEADLOCK. gstreamer is waiting for omx to do something, omx waits for gstreamer to do something.

By removing those extra _handle_messages() calls, we can ensure that all the checks of
_acquire_buffer() will re-run. In the above case, after the scheduler switches back to
the middle of _acquire_buffer(), the code will enter _wait_message(), which will see that
there are pending messages and will return immediately, going back to "retry:" and
re-doing all the checks properly.

https://bugzilla.gnome.org/show_bug.cgi?id=741854
2015-03-04 09:51:03 +01:00
Wonchul Lee df58d8baac omx: cleanup code a bit to remove else statement
https://bugzilla.gnome.org/show_bug.cgi?id=745191
2015-02-26 11:15:37 +02:00
Jun Ji 8936f6634c omx: Add omxamrdec
https://bugzilla.gnome.org/show_bug.cgi?id=739333
2014-11-13 13:32:16 +01:00
Sebastian Dröge 03cf0bc9a4 omx: Add AAC audio decoder 2014-07-13 18:22:39 +02:00
Sebastian Dröge 0c3b3ef3d0 omx: Add audio decoder base class and a subclass for MP3 2014-07-02 09:21:00 +02:00
Kazunori Kobayashi 4c488d425d omx: Fix a missing g_free() in error path
This fixes a memory leak with g_strdup() when an error occurs.

https://bugzilla.gnome.org/show_bug.cgi?id=731141
2014-06-03 09:23:41 +02:00
Sebastian Dröge 190adce125 omx: Don't handle disabling/enabling ports exactly like flushing
Otherwise we might abort a flush operation in another thread when
enabling/disabling ports, leading to deadlocks sometimes.

https://bugzilla.gnome.org/show_bug.cgi?id=730989
2014-05-31 15:12:05 +02:00
Sebastian Dröge 59ac1dd03b omx: Remove dead code, buf can never be NULL here as we just check for that the line above
CID 1214596
2014-05-19 08:48:50 +02:00
Sebastian Dröge 800ef8ab14 omx: Fix comparisons in gst_omx_state_to_string() case to actually make sense
CID 1214593
2014-05-19 08:47:36 +02:00
Sebastian Dröge 7b558e37bc omx: Make sure to compare the error codes as unsigned integers so that comparisons >2**31 actually work
CID 1214592
2014-05-19 08:47:33 +02:00
Sebastian Dröge 93528dc43b omx: Fix comparisons in gst_omx_command_to_string() default cause to actually work
CID 1214591
2014-05-19 08:44:55 +02:00
Sebastian Dröge 4e20116bc6 omx: Add a hack for not disabling the output port after set_format until the output format is known
Needed on some OMX implementations, e.g. the one from Atmel. It does
not send the settings-changed event on the output port if it is
disabled.
2014-05-15 10:59:35 +02:00
Josep Torra b3eb4d897d omxaudiosink: Implements OpenMAX based audio sinks
Provides omxanalogaudiosink and omxhdmiaudiosink elements on
the Raspberry PI.

- omxanalogaudiosink is capable to render raw mono or stereo audio
through the jack output.
- omxhdmiaudiosink is capable to render raw audio up to 8 channels
and transmit ac3/dts(IEC 61937) through the HDMI output.
- sinks provide a clock derived from rendered samples
- sinks support the GstStreamVolume interface by implementing
the volume and mute properties.

https://bugzilla.gnome.org/show_bug.cgi?id=728962
2014-05-09 13:15:18 +02:00
Christian König 8a860bd024 omxvideo: fix debug category initialisation
https://bugzilla.gnome.org/show_bug.cgi?id=726024
2014-03-15 12:42:03 +01:00
Christian König 0700d6875f omx: consolidate message waiting code
Add a wait_message helper function and remove all those duplicated code.

https://bugzilla.gnome.org/show_bug.cgi?id=725493
2014-03-12 14:04:57 +01:00
Christian König de5f940186 omx: simplify tunnel functions
Specifying the component is error prone and unnecessary.

https://bugzilla.gnome.org/show_bug.cgi?id=726021
2014-03-12 08:48:46 +01:00
Christian König 8b06b07f6f omx: fix two serious message handling bugs
Waiting for the next message if we already got one
is nonsense and can lead to lockups.

https://bugzilla.gnome.org/show_bug.cgi?id=725468
2014-03-02 12:09:59 +01:00
Tim-Philipp Müller 498b74ab6a omx: don't use the 'z' modifier to print size_t
gcc will warn in some cases even if the size of the type
is exactly that of size_t on the platform.

https://bugzilla.gnome.org/show_bug.cgi?id=699008
2013-08-20 16:00:07 +01:00
jitendra 715b44ea66 omx: Add pads based on element type
This allows to later add sources and sink that only have a srcpad
or sinkpad.

https://bugzilla.gnome.org/show_bug.cgi?id=699754
2013-05-06 16:20:20 +02:00
Carlos Rafael Giani 2d1138f45c omx: fixed type error in printf call
%zu expects size_t

https://bugzilla.gnome.org/show_bug.cgi?id=699008
2013-04-27 09:17:28 +01:00
Tim-Philipp Müller 2cbbab3128 omx: more printf format fixes
Fix printf formats again, so that gst-omx compiles warning-
free on the Raspberry Pi as well. Unfortunately OMX_UINT32
maybe be typedefed to uint32_t or unsigned long, which
doesn't work well with our debugging printf format strings,
so just use %u for those and cast to guint.
2013-04-18 23:10:13 +01:00
Josep Torra 82807bd9dd omx: fixes unused variable 'comp' when GStreamer is built without debug 2013-04-18 16:40:06 +02:00
Tim-Philipp Müller 0c08d375f4 omx: fix printf formats in debug messages
OMX_U32 is typedefed to an unsigned long,
OMX_TICKS to a 64-bit integer.
2013-04-08 17:02:32 +01:00
Sebastian Dröge 8a1bb1b4a3 omxvideodec: Add support for egl_render on RPi 2013-03-26 14:00:03 +01:00
Sebastian Dröge 8460cabd13 omx: Add Theora decoder 2013-03-19 12:25:27 +01:00
Sebastian Dröge 29a348efac omx: Remove additional comma 2013-03-18 16:43:24 +01:00
Sebastian Dröge 36e76faa05 omx: Rename MPEG2 decoder for consistency everywhere 2013-03-18 16:34:51 +01:00
Sebastian Dröge d9d46263c6 omx: Add MJPEG decoder support 2013-03-18 16:34:51 +01:00
Sebastian Dröge 0f5e6e967b omx: Add VP8 decoder support 2013-03-18 16:34:51 +01:00
Josep Torra 8231c9068e omx: minor stylistic change for consistency with other similar code 2013-03-16 10:13:06 +01:00
Tim-Philipp Müller c51afe9093 omx: improve debug logging some more 2013-03-15 13:17:18 +00:00