GstCollectPads-related freeze in pads mgmt
Sebastian Dröge
sebastian at centricular.com
Sun Jan 5 01:36:10 PST 2014
On Fr, 2014-01-03 at 19:41 +0200, Andrey Utkin wrote:
> 2014/1/3 Sebastian Dröge <sebastian at centricular.com>:
> > There are no plans for simplifying this currently, simply because nobody
> > knows how to simplify it. If you have any suggestions please write them
> > down :)
>
> The only suggestion i can give is to declare strong guarantees on the
> simplest API calls.
> For example, let gst_element_release_pad(), gst_pad_unlink(),
> gst_element_unlink() guarantee that no state corruption or deadlock is
> possible, from whatever thread is it called.
You mean they should just fail cleanly if called in the wrong situation?
I agree, yes. Detecting all wrong situations is not trivial though :)
> I think this is more possible to implement using recursive mutexes, which
> seem to be not used in gstreamer currently.
They are used in quite a few places, e.g. the stream lock is a recursive
mutex. The problem with the idea you seem to have is that it would mean
that the functions mentioned above would just deadlock in situations
where it would be wrong to call them, and the mutex would have no effect
in other situations. Not really an improvement IMHO. You can emulate
that now already if you just take the pad's stream lock before calling
those functions ;)
Also recursive mutexes are quite expensive, they should be used with
care and only in situations where necessary.
> Revising functionality guarantees requires revising all the code, but
> i think it is worthwhile.
I think what you want is some convenience API like insertbin, just for
more/other use cases. I think your tee-queue bin is a good example of
such a convenience API. Not sure where it should be put in the GStreamer
modules and I think there are some improvements necessary first, but
maybe you can provide a patch against gst-plugins-bad for this that just
adds it as a new plugin for now. I'll review it then :)
--
Sebastian Dröge, Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 966 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140105/0e965079/attachment.pgp>
More information about the gstreamer-devel
mailing list