switching between subpipelines

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

switching between subpipelines

Albert Costa
Hello people,
I am writing/testing to build a small application where I have 2 possible source pipelines for a sink. For example, I would have (if I translate to command line):
gst-launch filesrc location=myfile.avi ! decodebin ! ffmpegcolorspace ! directdrawsink and at some time I want to switch to videotestsrc ! ffmpegcolorspace ! directdrawsink (and vice-versa)
That is, I either get my frames from the (filesrc+decodebin) or the (videotestsrc) elements.
Is there a way to keep 2 such 'subpipelines' created, while only one is currently linked to the sink?
- If I create and add all the elements to the main pipeline but only link one branch, I get ofcourse a 'nonlinked' error for the other branch.
- If I create all, but only add the branch I use (with gst_bin_add_many), then remove the branch (with gst_bin_remove_many) and add the new one it works. But if I want to revert again, then the elements that got removed in the first place cannot be added again.
Is there a way to keep a bunch of elements such that I can add/remove them from the pipeline anytime I want (without having to recreate them) ?
 
Best Regards,
Al


-------------------------------------------------------------------------
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: switching between subpipelines

Eric Zhang-6
Hi, gstreamer-devel:

    Seems `input-selector' is a choice -- a N-to-1 stream selectoring element.

Eric Zhang

2008/11/13 Albert Costa <[hidden email]>
Hello people,
I am writing/testing to build a small application where I have 2 possible source pipelines for a sink. For example, I would have (if I translate to command line):
gst-launch filesrc location=myfile.avi ! decodebin ! ffmpegcolorspace ! directdrawsink and at some time I want to switch to videotestsrc ! ffmpegcolorspace ! directdrawsink (and vice-versa)
That is, I either get my frames from the (filesrc+decodebin) or the (videotestsrc) elements.
Is there a way to keep 2 such 'subpipelines' created, while only one is currently linked to the sink?
- If I create and add all the elements to the main pipeline but only link one branch, I get ofcourse a 'nonlinked' error for the other branch.
- If I create all, but only add the branch I use (with gst_bin_add_many), then remove the branch (with gst_bin_remove_many) and add the new one it works. But if I want to revert again, then the elements that got removed in the first place cannot be added again.
Is there a way to keep a bunch of elements such that I can add/remove them from the pipeline anytime I want (without having to recreate them) ?
 
Best Regards,
Al


-------------------------------------------------------------------------
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



-------------------------------------------------------------------------
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: switching between subpipelines

Arnout Vandecappelle
In reply to this post by Albert Costa
On Wednesday 12 November 2008 18:29:35 Albert Costa wrote:
>  If I create all, but only add the branch I use (with gst_bin_add_many),
> then remove the branch (with gst_bin_remove_many) and add the new one it
> works. But if I want to revert again, then the elements that got removed in
> the first place cannot be added again.

 When you remove elements from the pipeline, they are unlinked and unreffed.  
Probably you didn't ref them before adding to the pipeline, so they'll be
destroyed.  So, you'd have to first ref them, then remove from the pipeline;
when adding, first add them, then link them again, then unref them.  Or, of
course, you can ref them once in the beginning and keep them alive all the
way to the end.  Oh, and before you do any of that you'll have to set the
element's state to NULL (or is READY sufficient?).

 That said, removing them from the pipeline isn't really the solution you
want.  You'd better pause the branch that is inactive, then link the tail to
the other branch.  There's no need to remove elements from the pipeline at
all.

 But of course, input-selector is much simpler :-)

 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