[gst-devel] Checking whether gstreamer has been initialized

Braden McDaniel braden at endoframe.com
Mon Sep 25 00:38:30 CEST 2006


On Sun, 2006-09-24 at 10:36 -0700, David Schleef wrote:
> On Fri, Sep 22, 2006 at 09:33:00PM -0400, Braden McDaniel wrote:
> > On Fri, 2006-09-22 at 16:46 -0700, David Schleef wrote:
> > > I recommend having a yourlibrary_init() that calls gst_init().
> > > gst_init() can be called multiple times with no side-effects.  You
> > > might lose handling of --gst command line options, but that's
> > > probably a good thing.
> > 
> > I thought about that. However, the problem then becomes knowing whether
> > it's appropriate for my library to call gst_deinit. I shouldn't call it
> > if the user may be using gstreamer elsewhere after shutting down my
> > library. (Right?)
> 
> Correct.  Pretty much only test suite programs should call
> gst_deinit().

Or user applications. So if I'm going to force users to care about
shutting down gstreamer, I might as well insist that they bear
responsibility for initializing it as well. Which is a major annoyance:
users of my library shouldn't have to care that I'm using gstreamer.

Couldn't a count be applied to gst_init/deinit? That way deinit would
only *really* happen if the count dropped to 0. I'd be happy to provide
a patch for this.

-- 
Braden McDaniel                           e-mail: <braden at endoframe.com>
<http://endoframe.com>                    Jabber: <braden at jabber.org>






More information about the gstreamer-devel mailing list