[gst-devel] Reusing a pipeline

Stefan Kost ensonic at hora-obscura.de
Tue Feb 5 14:36:13 CET 2008


hi,

Quoting Tim Müller <t.i.m at zen.co.uk>:

> On Mon, 2008-02-04 at 19:38 -0700, Jeffrey Barish wrote:
>
>> I created a class for ripping to a file.  It works fine once, but if I try
>> to use the same instance a second time, query_position or query_duration
>> returns a bogus value (I compute a ratio, so I'm not sure which is wrong).
>> I presume that something needs to be reinitialized before I use the
>> instance again, but I don't see my mistake.  Clues?
>
> Do you set the pipeline state back to NULL when you're done and before
> re-using it and setting state back to PLAYING?
>
Set the pipeline to READY after using and then PLAYING again. NULL  
would render it useless.

Stefan
>
> If yes, maybe you could whip up a small self-contained program that
> shows the problem and that people can run?
>
>
>> It works to create a new instance each time. Is it good GStreamer
>> practice to re-create the pipeline each time despite the inefficiency?
>
> It is a prudent thing to do, at least for more complex pipelines. It
> shouldn't be necessary, but unless someone actually goes to write tests
> to make sure that all components are re-usable, chances are they may not
> be. Also, it makes debugging a tad easier if you know you start from a
> guaranteed sane zero state for each track. I very much doubt the
> overhead of constructing your pipeline matters.
>
>  Cheers
>   -Tim
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>






More information about the gstreamer-devel mailing list