Commit graph

587 commits

Author SHA1 Message Date
Vincent Penquerc'h
a02f1e5c9b omxaudioenc: set base class format instead of just source pad caps 2017-01-11 11:38:05 +00:00
Graham Leggett
a1e613dd89 omx*dec: Flush before we stop the srcpad loop
Flushing could otherwise hang if output port queue of pending buffers was empty

https://bugzilla.gnome.org/show_bug.cgi?id=774654
2016-12-19 10:52:16 +02: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
Graham Leggett
8b01b06af6 Add support for OMX_COLOR_FormatYUV420PackedSemiPlanar and OMX_COLOR_Format24bitBGR888
https://bugzilla.gnome.org/show_bug.cgi?id=775959
2016-12-13 11:18:43 +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
Matthew Waters
baaf404f2b videodecoder: remove use of EGLImage orientation
New code should use GstVideoTransformationMeta

(The defaults do the right thing here though).
2016-11-17 19:56:35 +11: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
Kazunori Kobayashi
766cd65fa4 omxvideodec: Use GST_VIDEO_FRAME_PLANE_STRIDE() to get output buffer's stride
GST_VIDEO_FRAME_PLANE_STRIDE() should be used to get the actual buffer stride,
as reported in the buffers's GstVideoMeta, when copying data to that buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=768173
2016-06-29 18:44:20 +10:00
Aurélien Zanelli
d07aa49943 omxaudioenc: implement GstPreset interface
To allow user to use GstPreset to quickly save and load a set of
parameters.

https://bugzilla.gnome.org/show_bug.cgi?id=767907
2016-06-21 15:02:02 +03:00
Aurélien Zanelli
0c265c1e0e omxvideoenc: implement GstPreset interface
To allow user to use GstPreset to quickly save and load a set of
parameters.

https://bugzilla.gnome.org/show_bug.cgi?id=767907
2016-06-21 15:02:02 +03:00
Sebastian Dröge
a78756c63f omx: #define OMX_SKIP64BIT on the RPi as required by their API
Also add generic support for OMX_SKIP64BIT to gst-omx, in case other
implementations also #define that for whatever reason.

https://bugzilla.gnome.org/show_bug.cgi?id=766475
2016-06-17 12:06:48 +03:00
Sebastian Dröge
198e31355f omxvideodec: Implement ::drain() virtual method
https://bugzilla.gnome.org/show_bug.cgi?id=767641
2016-06-17 10:59:45 +03:00
Gwang Yoon Hwang
27d2cdd45d omxvideodec : Use gstglmemoryegl for the RPi
Modified to use gstglmemoryegl to avoid texture creation/copy operations
at the glupload.

[Matthew Waters]: gst-indent the sources and port testegl to GstGLMemoryEGL

https://bugzilla.gnome.org/show_bug.cgi?id=760918
2016-05-04 13:42:23 +10: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
Enrique Ocaña González
d1a79d7c59 Properly handle drain requests while flushing
Without this commit the decoder streaming thread stops without ever attending
the drain request, leaving the decoder input thread waiting forever.

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
Thiago Santos
03fc454457 omxaacdec: Do not accept unknown layouts
It was defaulting to RAW when an unknown layout was received but
the caps template would actually forbid that on the caps query
or accept-caps anyway.
2015-09-01 16:13:00 -03:00
Thiago Santos
1f3bf04fe7 omxaudiodec: use default pad accept-caps handling
Instead of the audiodecoder one. The OMX audioo decoders have their
valid input in the template pad, so just check against that to
avoid doing a query downstream.
2015-09-01 09:01:45 -03:00
Thiago Santos
c038df6671 omxvideodec: use default pad accept-caps handling
Instead of the videodecoder one. The OMX video decoders have their
valid input in the template pad, so just check against that to
avoid doing a query downstream.
2015-08-28 12:57:33 -03:00
Graham Leggett
703bab6885 omxvideoenc: Add keyframe support for the Rpi, using OMX_IndexConfigBrcmVideoRequestIFrame
https://bugzilla.gnome.org/show_bug.cgi?id=753085
2015-08-27 11:15:29 +03:00
Philippe Normand
e0327521f6 omxh264dec: implement is_format_change
The omxvideodecoder class only checks some of the caps parameters but if
other fields change such as h264 profile and/or level it wouldn't trigger a
reconfiguration.

https://bugzilla.gnome.org/show_bug.cgi?id=752376
2015-08-16 15:48:16 +02:00
Aurélien Zanelli
d2df0fb032 omxvideodec: unref allocator after getting it from allocation query
Otherwise a reference will be leaked for each allocator. It only happens
when target platform is Raspberry Pi and when we have GL support.

https://bugzilla.gnome.org/show_bug.cgi?id=751867
2015-07-06 11:54:28 +03:00
Sebastian Dröge
3f46a12aab omxaudiodec: Add an output adapter for chunking the output into codec frames
Otherwise the base class will be confused.
See https://bugzilla.gnome.org/show_bug.cgi?id=685730
2015-05-19 19:14:42 +03:00
Tim-Philipp Müller
afab78e52e Remove obsolete Android build cruft
This is not needed any longer.
2015-04-26 18:24:26 +01:00
Luis de Bethencourt
24c0197e46 omxaudiodec: add comment explaining duplicate code path 2015-03-06 12:12:49 +00:00
Luis de Bethencourt
e8d76fb1ef Revert "omxaudiodec: remove duplicate code path"
This reverts commit a8d26ff27a.
2015-03-06 12:09:06 +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
Luis de Bethencourt
3aa008adb7 omxaudioenc: impossible if statement
ret is set to GST_STATE_CHANGE_SUCCESS and never touched, so it is impossible
for it to be anything else at the if check. Remove the if check.

CID #1287053
2015-03-06 10:57:53 +00:00
Luis de Bethencourt
964cb549bb omxaudiodec: impossible if statement
ret is set to GST_STATE_CHANGE_SUCCESS and never touched, so it is impossible
for it to be anything else at the if check. Remove it.

CID #1287054
2015-03-06 10:54:46 +00:00
Luis de Bethencourt
a8d26ff27a omxaudiodec: remove duplicate code path 2015-03-06 10:50:30 +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
40ab1b0a45 omxaudiodec: Clean up code a bit to get rid of useless NULL checks 2014-09-30 10:47:20 +03:00
junji
eba9e3f29d omxaudiodec: Unmap input buffers after usage
https://bugzilla.gnome.org/show_bug.cgi?id=736314
2014-09-30 10:44:38 +03:00
Michal Lazo
bfeab29a39 omxvideoenc: Setup aspect ratio on RPi
Needs firmware from yesterday or newer to work with all possible
aspect ratios. Before that it only supported a fixed list.

https://bugzilla.gnome.org/show_bug.cgi?id=732533
2014-09-01 12:18:58 +03:00
Sebastian Dröge
cdb918aefb omxaudioenc: Implement the hack flag GST_OMX_HACK_NO_COMPONENT_RECONFIGURE 2014-08-28 10:45:37 +03:00
Sebastian Dröge
2c98a6ab7e omxaudioenc: Use the base class' open/close vfuncs instead of calling them ourselves 2014-08-28 10:45:37 +03:00
Peng Liu
d3d0a82ba4 omxvideoenc: Implement the hack flag GST_OMX_HACK_NO_COMPONENT_RECONFIGURE
Fix a video encoder stall problem on RPi when changing the aspect ratio.

https://bugzilla.gnome.org/show_bug.cgi?id=732533
2014-08-28 10:45:11 +03:00
Sebastian Dröge
d75334456d omx: Let base classes handle EOS
https://bugzilla.gnome.org//show_bug.cgi?id=734774
2014-08-14 17:36:11 +03:00
Sebastian Dröge
19d77004d2 omxaudiodec: Fix flushing logic and make it more similar to the video decoder 2014-08-14 17:33:07 +03:00
Sebastian Dröge
b4c7c726ef Release 1.2.0 2014-07-23 11:28:12 +02:00
Sebastian Dröge
c4deb7c07c omxaudiosink: Set port to not flushing in prepare() and keep it at flushing in unprepare()
https://bugzilla.gnome.org/show_bug.cgi?id=733168
2014-07-20 17:47:50 +02:00
Sebastian Dröge
08385fe944 omxaudiodec: Implement setting of fallback channel positions 2014-07-13 22:15:44 +02:00
Sebastian Dröge
03cf0bc9a4 omx: Add AAC audio decoder 2014-07-13 18:22:39 +02:00
Sebastian Dröge
f4961d0a72 omxaudiodec: Get PCM parameters from the out port, not the in port 2014-07-02 09:22:28 +02:00
Sebastian Dröge
c27053c94e omxaudiodec: Implement 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-07-02 09:21:00 +02:00