Commit graph

98 commits

Author SHA1 Message Date
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
Olivier Crête
ff2603a727 Port to Gst 0.11 2012-04-13 12:16:34 -04:00
Sebastian Dröge
9e6665e8f8 omx: Add hack for encoder components that don't allow empty EOS buffers 2011-12-09 12:24:01 +01:00
Sebastian Dröge
0cb32a4ebd omx: Improve debugging of buffer handling 2011-12-05 13:18:09 +01:00
Sebastian Dröge
47d66cadfa omx: Only disabling of a port is like flushing, enabling is like unflushing 2011-11-17 14:38:54 -08:00
Sebastian Dröge
c144ebd054 omx: Enabling/disabling a port is also like flushing
The component returns all buffers to us and shouldn't get any
new buffers passed anymore.
2011-11-17 14:11:51 -08:00
Sebastian Dröge
70b735da82 omx: Fix debug level for flushing in wrong state from ERROR to DEBUG
It's not really an error and doesn't matter at all if flush is called
when the component is not running.
2011-11-15 09:47:55 -08:00
Sebastian Dröge
6736a39671 omx: Add XXX to the nOffset reset hack comment for QCOM 2011-11-14 09:13:06 -08:00
Sebastian Dröge
b66fd610d6 omx: Always reset buffer flags for output ports, even in flushing/error state 2011-11-09 15:41:02 +01:00
Sebastian Dröge
1d071c05dc omx: Also properly release buffers when in error state 2011-11-08 08:24:49 +01:00
Jonas Larsson
0682012181 omx: Properly release buffers during flushing
We can't pass them back to OMX_FillThisBuffer() or OMX_EmptyThisBuffer()
but instead of doing nothing we have to put them back into our queue.
Otherwise the buffer is leaked and we will have too few buffers in
the future.
2011-11-08 08:24:49 +01:00
Sebastian Dröge
fa6881c1cc omx: Reset buffer flags to 0 after it was consumed by the component or the element
Some implementations don't reset the flags and the standard is not
really clear on the expected behaviour. Let's just always reset the
flags as they're not valid at this point anymore.
2011-11-04 09:04:16 +01:00
Sebastian Dröge
72fa93956b omx: Remove QCOM hack to reset nOffset in EmptyBufferDone
This is now done in a generic way that does not require any
hacks because it will work without any side effects on any
OMX implementation.
2011-10-14 10:27:47 +02:00
Sebastian Dröge
2750a8869b omx: Reset nOffset to 0 in EmptyBufferDone if nFilledLen is 0
Some OMX implementations don't reset nOffset when the complete
buffer is emptied but instead only reset nFilledLen. We reset
nOffset to 0 if nFilledLen == 0, which is safe to do because
the offset *must* be 0 if the buffer is not filled at all.

Seen in QCOM's OMX implementation.
2011-10-14 10:26:21 +02:00
Sebastian Dröge
792cdb7d1f omxvideodec: New hack for QCOM to recreate the component instead of reconfiguring it on caps changes 2011-09-28 10:35:31 +02:00
Sebastian Dröge
a7f77e22a4 omx: Change a g_assert() into a GST_WARNING_OBJECT() 2011-09-27 12:28:22 +02:00
Sebastian Dröge
837fc4ca66 omx: Add hack for Qualcomm's OMX implementation to manually reset nOffset in EmptyBufferDone 2011-09-26 13:05:23 +02:00
Sebastian Dröge
f0fe1148b7 omx: Wait until the Executing state is reached before calling OMX_FillThisBuffer()
This correctly works around the QCOM race condition that happens when calling
FTB after setting the new state and before reaching it.
2011-09-14 10:16:41 +02:00