how to restart a pipeline

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

how to restart a pipeline

Pavel Zeldin
I need advice on how to restart a pipeline cleanly. The pipeline
handles recording from several live sources. The recording goes to a
file (may be several files)  and/or network.
>From time to time I want to close the current file(s) and begin a new
one. File should not be closed while there is outstanding data in the
pipeline.
To ensure this the application sends EOS to the pipeline. When EOS is
seen on the bus the application stops the pipeline.
But in order to restart it all dynamic pads must be created and linked
again, and caps negotiation repeated. This takes long time.
Is there a simpler (i.e. faster)  way?

-Pavel.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to restart a pipeline

AJAY GAUTAM
Hi Pavel ,
You can Unlink the elements ,then set state of pipeline as NULL ,then set next file to play using the same pipeline,then Link the elements and set state as PLAY.
I think it is help to you.


On Thu, Oct 9, 2008 at 1:34 AM, Pavel Zeldin <[hidden email]> wrote:
I need advice on how to restart a pipeline cleanly. The pipeline
handles recording from several live sources. The recording goes to a
file (may be several files)  and/or network.
>From time to time I want to close the current file(s) and begin a new
one. File should not be closed while there is outstanding data in the
pipeline.
To ensure this the application sends EOS to the pipeline. When EOS is
seen on the bus the application stops the pipeline.
But in order to restart it all dynamic pads must be created and linked
again, and caps negotiation repeated. This takes long time.
Is there a simpler (i.e. faster)  way?

-Pavel.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



--
Thanx & Regards
Ajay Gautam


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to restart a pipeline

Arnout Vandecappelle
On Thursday 09 October 2008 05:14:07 you wrote:
> Hi Pavel ,
> You can Unlink the elements ,then set state of pipeline as NULL ,then set
> next file to play using the same pipeline,then Link the elements and set
> state as PLAY.

 However, before unlinking the elements, you should send an EOS through them,
otherwise the stream will not close properly.  For most pipelines this
probably doesn't matter, but for instance the matroskamux sets the duration
when it receives EOS.

 Here's an example (prev_elt is the last element you want to keep, sink is the
element you want to remove/replace; if you have several, all of them should
be removed from the pipeline):

gst_pad_push_event(gst_element_get_pad(prev_elt, "src"), gst_event_new_eos());
gst_element_unlink (prev_elt, sink);
gst_element_set_state (sink, GST_STATE_NULL);
gst_bin_remove(pipeline, sink);

gst_bin_add(pipeline, new_sink);
gst_element_link(prev_elt, new_sink);
gst_element_set_state(pipeline, GST_STATE_PLAYING);


 This example assumes you don't need to preroll on your new elements...  You
mileage may vary.

 Regards,
 Arnout

--
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  D206 D44B 5155 DF98 550D  3F2A 2213 88AA A1C7 C933

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel