[gst-devel] switching between subpipelines

Arnout Vandecappelle arnout at mind.be
Fri Nov 14 13:29:34 CET 2008


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




More information about the gstreamer-devel mailing list