[gst-devel] Gst Locks and signals

Antoni Silvestre Padrós antoni.silvestre at gmail.com
Wed Dec 22 10:32:27 CET 2010


Hi, I am using GstRtpBin for my application and I have a problem with
signals and locks. I need the program to hold back the emission of certain
gstrtpbin signals while I am executing some functions. Stopping the
execution of the callbacks of those signals when they have already been
called doesn't work because when those callbacks have been called the
gstrtpbin code that has emitted them has already acquired the lock for the
gstrtpbin object and my concurrent part of the code uses functions
like gst_element_get_request_pad
that also need to acquire that same lock.

One solution would be to acquire the lock of the gstrtpbin object myself
every time I run that part of the code that is not compatible with the
signals. That would hold back the emission of gstrtpbin signals, however as
gst object locks are not recursive when I use functions like
gst_element_get_request_pad that also acquire the gst lock, my code gets
deadlocked by locking the same mutex two times by the same thread. One
workaround would be releasing the gst object lock just before any call to
such functions but then obviously I would have the risk of a signal emission
occurring in between the lock release and the call to the gst function that
requires a lock.

Right now I can't think of any elegant solution to this problem, anyone has
any ideas?

Thanks,
Toni Silvestre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20101222/1f40b350/attachment.htm>


More information about the gstreamer-devel mailing list