gstreamer/omx/Makefile.am
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

80 lines
2.1 KiB
Makefile

plugin_LTLIBRARIES = libgstopenmax.la
libgstopenmax_la_SOURCES = \
gstomx.c \
gstomxvideodec.c \
gstomxvideoenc.c \
gstomxaudioenc.c \
gstomxmpeg4videodec.c \
gstomxh264dec.c \
gstomxh263dec.c \
gstomxwmvdec.c \
gstomxmpeg4videoenc.c \
gstomxh264enc.c \
gstomxh263enc.c \
gstomxaacenc.c \
gstbasevideocodec.c \
gstbasevideodecoder.c \
gstbasevideoencoder.c \
gstbasevideoutils.c \
gstomxrecmutex.c
noinst_HEADERS = \
gstomx.h \
gstomxvideodec.h \
gstomxvideoenc.h \
gstomxaudioenc.h \
gstomxmpeg4videodec.h \
gstomxh264dec.h \
gstomxh263dec.h \
gstomxwmvdec.h \
gstomxmpeg4videoenc.h \
gstomxh264enc.h \
gstomxh263enc.h \
gstomxaacenc.h \
gstbasevideocodec.h \
gstbasevideodecoder.h \
gstbasevideoencoder.h \
gstbasevideoutils.h \
gstomxrecmutex.h
fixbaseclasses = \
-DGstBaseVideoCodec=OMXBaseVideoCodec \
-DGstBaseVideoCodecClass=OMXBaseVideoCodecClass \
-DGstBaseVideoEncoder=OMXBaseVideoEncoder \
-DGstBaseVideoEncoderClass=OMXBaseVideoEncoderClass \
-DGstBaseVideoDecoder=OMXBaseVideoDecoder \
-DGstBaseVideoDecoderClass=OMXBaseVideoDecoderClass
libgstopenmax_la_CFLAGS = \
-DGST_USE_UNSTABLE_API=1 \
-I$(abs_srcdir)/openmax \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
$(GST_CFLAGS) \
$(fixbaseclasses)
libgstopenmax_la_LIBADD = \
$(GST_PLUGINS_BASE_LIBS) \
-lgstaudio-@GST_API_VERSION@ \
-lgstpbutils-@GST_API_VERSION@ \
-lgstvideo-@GST_API_VERSION@ \
$(GST_BASE_LIBS) \
$(GST_LIBS)
libgstopenmax_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
EXTRA_DIST = openmax gstomx.conf
Android.mk: Makefile.am $(BUILT_SOURCES)
androgenizer \
-:PROJECT libgstopenmax -:SHARED libgstopenmax \
-:TAGS eng debug \
-:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
-:SOURCES $(libgstopenmax_la_SOURCES) \
$(nodist_libgstopenmax_la_SOURCES) \
-:CFLAGS $(DEFS) $(DEFAULT_INCLUDES) $(libgstopenmax_la_CFLAGS) \
-:LDFLAGS $(libgstopenmax_la_LDFLAGS) \
$(libgstopenmax_la_LIBADD) \
-ldl \
-:PASSTHROUGH LOCAL_ARM_MODE:=arm \
LOCAL_MODULE_PATH:='$$(TARGET_OUT)/lib/gstreamer-0.10' \
> $@