gstreamer/omx
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
..
openmax openmax: Add OpenMAX IL 1.1.2 headers 2011-07-06 08:42:09 +02:00
gstbasevideocodec.c Port to Gst 0.11 2012-04-13 12:16:34 -04:00
gstbasevideocodec.h Port to Gst 0.11 2012-04-13 12:16:34 -04:00
gstbasevideodecoder.c omx: Update video encoder/decoder base classes from gst-plugins-bad 2012-04-24 15:41:38 +02:00
gstbasevideodecoder.h Port to Gst 0.11 2012-04-13 12:16:34 -04:00
gstbasevideoencoder.c omx: Update video encoder/decoder base classes from gst-plugins-bad 2012-04-24 15:41:38 +02:00
gstbasevideoencoder.h Port to Gst 0.11 2012-04-13 12:16:34 -04:00
gstbasevideoutils.c basevideo: Move the utils from the codec header to its own header 2011-07-09 11:41:42 +02:00
gstbasevideoutils.h basevideo: Move the utils from the codec header to its own header 2011-07-09 11:41:42 +02:00
gstomx.c Implement a new custom recursive mutex type and fix locking in callbacks so that in-context calls are allowed. 2012-05-07 17:01:16 +03:00
gstomx.conf omxaacenc: Add initial version of OpenMAX AAC encoder element 2011-08-16 10:49:21 +02:00
gstomx.h Implement a new custom recursive mutex type and fix locking in callbacks so that in-context calls are allowed. 2012-05-07 17:01:16 +03:00
gstomxaacenc.c Port to Gst 0.11 2012-04-13 12:16:34 -04:00
gstomxaacenc.h omxaacenc: Add initial version of OpenMAX AAC encoder element 2011-08-16 10:49:21 +02:00
gstomxaudioenc.c Implement a new custom recursive mutex type and fix locking in callbacks so that in-context calls are allowed. 2012-05-07 17:01:16 +03:00
gstomxaudioenc.h Port to Gst 0.11 2012-04-13 12:16:34 -04:00
gstomxh263dec.c Port to Gst 0.11 2012-04-13 12:16:34 -04:00
gstomxh263dec.h omxh263dec: Add H.263 decoder element 2011-07-25 11:44:56 +02:00
gstomxh263enc.c Port to Gst 0.11 2012-04-13 12:16:34 -04:00
gstomxh263enc.h omxh263enc: Add H.263 encoder element 2011-07-29 12:06:21 +02:00
gstomxh264dec.c Port to Gst 0.11 2012-04-13 12:16:34 -04:00
gstomxh264dec.h omxh264dec: Rename from omxh264videodec to omxh264dec 2011-07-12 08:54:22 +02:00
gstomxh264enc.c Port to Gst 0.11 2012-04-13 12:16:34 -04:00
gstomxh264enc.h omxh264enc: Add H.264 encoder element 2011-07-25 11:32:51 +02:00
gstomxmpeg4videodec.c Port to Gst 0.11 2012-04-13 12:16:34 -04:00
gstomxmpeg4videodec.h omx: Add initial version of OpenMAX framework, video decoder base class and MPEG4 video decoder 2011-07-09 11:06:05 +02:00
gstomxmpeg4videoenc.c Port to Gst 0.11 2012-04-13 12:16:34 -04:00
gstomxmpeg4videoenc.h omxvideoenc: Add video encoder base class and MPEG4 video encoder 2011-07-20 11:08:18 +02:00
gstomxrecmutex.c Implement a new custom recursive mutex type and fix locking in callbacks so that in-context calls are allowed. 2012-05-07 17:01:16 +03:00
gstomxrecmutex.h Implement a new custom recursive mutex type and fix locking in callbacks so that in-context calls are allowed. 2012-05-07 17:01:16 +03:00
gstomxvideodec.c Implement a new custom recursive mutex type and fix locking in callbacks so that in-context calls are allowed. 2012-05-07 17:01:16 +03:00
gstomxvideodec.h Port to Gst 0.11 2012-04-13 12:16:34 -04:00
gstomxvideoenc.c Implement a new custom recursive mutex type and fix locking in callbacks so that in-context calls are allowed. 2012-05-07 17:01:16 +03:00
gstomxvideoenc.h Port to Gst 0.11 2012-04-13 12:16:34 -04:00
gstomxwmvdec.c Port to Gst 0.11 2012-04-13 12:16:34 -04:00
gstomxwmvdec.h omxwmvdec: Add WMV video decoder element 2011-07-25 12:01:05 +02:00
Makefile.am Implement a new custom recursive mutex type and fix locking in callbacks so that in-context calls are allowed. 2012-05-07 17:01:16 +03:00