Commit graph

115 commits

Author SHA1 Message Date
Sebastian Dröge
303b6c4dc5 omx: Always load the OpenMAX IL cores with G_MODULE_BIND_LOCAL 2013-03-13 09:37:02 +01:00
Sebastian Dröge
f505dad87a omx: Lazy-load symbols of libbcm_host.so
It exports eglIntOpenMAXILDoneMarker(), which is also
exported by libopenmaxil.so... but we need the version
from libopenmaxil.so as the other one is just a stub.
2013-03-13 09:35:20 +01:00
Sebastian Dröge
b9bf849a39 omx: Log unknown events 2013-03-10 11:03:18 +01:00
Sebastian Dröge
716adfa5be Revert "omx: use no-component-reconfigure hack on the Raspberry PI"
This reverts commit e123b2089f.

It's not required anymore after the fix from the last commit.
2013-03-07 17:40:21 +01:00
Sebastian Dröge
20c9ae0823 omx: Also wait for disabled output ports to be reconfigured 2013-03-07 17:27:05 +01:00
Sebastian Dröge
7a1eaec3b9 omx: Add timeout to the flush operation and move buffer populating to a separate function 2013-03-07 13:57:00 +01:00
Sebastian Dröge
001b7f0ed9 omx: Remove min buffer count hack for RPi again
It's not necessary anymore
2013-03-07 13:56:50 +01:00
Sebastian Dröge
60861f3990 omx: Do number of buffers configuration explicitely 2013-03-07 13:56:44 +01:00
Josep Torra
e123b2089f omx: use no-component-reconfigure hack on the Raspberry PI 2013-03-07 11:02:39 +01:00
Sebastian Dröge
0bb816e32c omx: Handle errors more gracefully 2013-03-01 11:18:38 +01:00
Sebastian Dröge
aeec430261 omx: Return the OMX_ERRORTYPE from gst_omx_port_update_port_definition 2013-02-28 15:49:14 +01:00
Sebastian Dröge
dc0385d762 omx: Return port definition update errors 2013-02-28 15:38:28 +01:00
Sebastian Dröge
1dd6214f44 omx: Add hack for RPi for the minimum number of buffers required for a port
The value in the port definition is invalid and the initial actual
buffer count should be used.
2013-02-28 13:57:43 +01:00
Sebastian Dröge
5132a89331 omx: Always tell the component about the right number of buffers that we're going to allocate 2013-02-28 13:26:56 +01:00
Sebastian Dröge
59e92f955d omx: Invert assertion to let it express what was intended 2013-02-28 13:07:58 +01:00
Sebastian Dröge
1a906da409 omx: Add API for allocating a specific number of buffers and using EGLImages or buffers allocated elsewhere 2013-02-28 11:20:52 +01:00
Sebastian Dröge
b12610efd7 omx: Clean up port settings change handling 2013-02-27 15:50:20 +01:00
Sebastian Dröge
8872afff1d omx: Fix deadlock during reconfiguration 2013-02-25 13:11:16 +01:00
Sebastian Dröge
5b45cb0810 omx: Auto-detect the port indizes if possible 2013-02-25 12:42:05 +01:00
Sebastian Dröge
70368c31cd omx: Refactor waiting for buffers to be released by the component to a separate function 2013-02-25 10:41:12 +01:00
Sebastian Dröge
f79bbc302b omx: Add methods to set up and close a tunnel between components 2013-02-25 09:47:37 +01:00
Sebastian Dröge
cba466b61c Retry loading libbcm_host.so without an absolute path if that failed 2013-02-22 10:42:08 +01:00
Sebastian Dröge
05819da94d Set default hacks for the RPI target and always initialize bcm_host 2013-02-21 10:08:07 +01:00
Sebastian Dröge
5d6d6ec2df omx: Add FIXME for the future 2013-02-12 11:55:39 +01:00
Sebastian Dröge
219a93bbaf omx: Some minor refactoring and cleanup 2013-02-12 11:49:21 +01:00
Sebastian Dröge
4399c0b96b omx: Don't access the port's buffers array if it wasn't allocated yet 2013-02-12 11:49:07 +01:00
Sebastian Dröge
dd3ad9e6d5 omx: Mark an array as const 2013-02-12 11:44:40 +01:00
Sebastian Dröge
c3bcc43db7 omx: Split enabling/disabling of port into sending the command and waiting for it
This allows to do anything necessary after sending the command to actually let it finish
2013-02-12 11:41:43 +01:00
Sebastian Dröge
58a093bc0c omx: Flushing is also allowed in Paused state 2013-02-12 11:37:38 +01:00
Julian Scheel
3d7a50944d omx: add mpeg2 video decoder
This adds a decoder class for mpeg2, as well as an extended
configuration for raspberry pi.

https://bugzilla.gnome.org/show_bug.cgi?id=692446

Signed-off-by: Julian Scheel <julian@jusst.de>
2013-01-24 22:46:52 +00:00
Sebastian Dröge
5c4799ccf1 omx: Minimize the time when the messages lock is held
Fixes a deadlock if any OMX functions are called when the
messages are handled.

Thanks to Nicolas Dufresne for noticing.
2013-01-18 16:47:52 +01:00
Tim-Philipp Müller
453d81886d omx: improve debug message when we can't find the config file
Mention where we looked for the config file.
2013-01-18 15:28:20 +00:00
Sebastian Dröge
e5bf204a1d omx: Update port definition when changing some port setting 2013-01-15 14:37:37 +01:00
Sebastian Dröge
449017b50b omx: Rename from libgstopenmax.so to ligstomx.so for consistency 2013-01-15 14:37:37 +01:00
Nicolas Dufresne
8c3bd103ff omx: Add a method to send message 2013-01-14 10:37:13 +01:00
Sebastian Dröge
2d913c6773 omx: Atomic ops are not required anymore for the reconfiguration 2013-01-14 10:37:06 +01:00
Sebastian Dröge
a42f27547d omx: Implement new approach for locking that should solve all deadlocks on RPi
No mutex is locked while calling any OpenMAX functions anymore
and everything from the OpenMAX callbacks is inserted into a message
queue and handled from outside the callbacks.

Also there's only a single mutex and condition variable per component
now for handling anything from OpenMAX callbacks and a single mutex
for keeping our component/port state sane.
2013-01-14 10:36:32 +01:00
Sebastian Dröge
e026926951 omx: Fix another race condition in the recursive mutex
Between lock() and begin_recursion() it was possible for another thread to
try to do a recursive_lock(). This would block because the mutex was already
locked(), but not ready for recursive locking yet. unlock() would never
happen in the original thread because it was waiting for the other thread
to finish first.

Happened on the Raspberry Pi.
2012-12-20 17:46:36 +01:00
Sebastian Dröge
b93d86abbe omx: Use has_suffix() instead of has_prefix() for the Broadcom hack 2012-12-19 12:19:12 +01:00
Sebastian Dröge
5105daba1a omx: Add hack to load and initialize libbcm_host.so
Needed on the Raspberry Pi. Patch based on a patch by
George Kiagiadakis <george.kiagiadakis@collabora.com>
2012-12-19 11:31:51 +01:00
Sebastian Dröge
2481ceb8c4 omx: Update to new GLib thread API 2012-11-12 11:29:48 +01:00
George Kiagiadakis
f93feb2644 omx: fix debug statement 2012-09-03 12:37:02 +03:00
George Kiagiadakis
8a669ee308 omx: use recursive_lock inside set_last_error(), since this function may be called from an event handler 2012-09-03 12:36:53 +03:00
Tim-Philipp Müller
3f963f87fb omx: fix plugin name for new GST_PLUGIN_DEFINE API 2012-08-03 19:32:13 +01:00
George Kiagiadakis
7b3dac67af omx: Fix spelling mistake found by lintian: s/Seperate/Separate/ 2012-05-08 16:16:00 +03:00
George Kiagiadakis
158775f497 Implement a new custom recursive mutex type and fix locking in callbacks so that in-context calls are allowed.
According to the OMX specification, implementations are allowed to call
callbacks in the context of their function calls. However, our callbacks
take locks and this causes deadlocks if the unerlying OMX implementation
uses this kind of in-context calls.

A solution to the problem would be a recursive mutex. However, a normal
recursive mutex does not fix the problem because it is not guaranteed
that the callbacks are called from the same thread. What we see in Broadcom's
implementation for example is:

- OMX_Foo is called
- OMX_Foo waits on a condition
- A callback is executed in a different thread
- When the callback returns, its calling function
  signals the condition that OMX_Foo waits on
- OMX_Foo wakes up and returns

The solution I came up with here is to take a second lock inside the callback,
but only if recursion is expected to happen. Therefore, all calls to OMX
functions are guarded by calls to gst_omx_rec_mutex_begin_recursion() / _end_recursion(),
which effectively tells the mutex that at this point we want to allow calls
to _recursive_lock() to succeed, although we are still holding the master lock.
2012-05-07 17:01:16 +03:00
George Kiagiadakis
5c15caef8e omx: Add hack to disable setting roles to components.
Conflicts:

	omx/gstomx.c
2012-05-03 13:21:18 +02:00
Arun Raghavan
34a83c184e omx: Fix trivial debug print bug 2012-04-26 09:42:54 +05:30
Arun Raghavan
9e4cddee7e omxvideodec: Add hack for Ducati components not returning from drain
This happens on the Galaxy Nexus, and causes the pipeline to hang waiting
endlessly for a drain. The hack replaces the wait with a wait + 500ms timeout.
2012-04-26 09:42:52 +05:30
Arun Raghavan
036cd16756 omx: Fix deadlock between ending a flush and the event handler
gst_omx_port_set_flushing() calls OMX_FillThisBuffer at the end of a flush
without releasing the port lock, and this can cause a deadlock with the
EventHandler. This patches fixes this by dropping the lock for the duration of
the fill buffer call.
2012-04-26 09:42:50 +05:30