Remove unlinked elements from pipeline

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

Remove unlinked elements from pipeline

Hecate_Eos
Hi All
I use uridecodebin to decode my file. I can play the file with both video and audio, but I have the problem when the file just has video. For example, I play the webcamera.
                               ----------          ---------------------------------------
                        /  -> | tee0 |   ->   |   Video Output to Screen  |
----------------------/        ----------          ---------------------------------------
| uridecodebin |
----------------------
                      \                ---------          ------------------------------------------------
                         \ ---X---> | tee1 |   ->  |     Audio Output to sound device |
                                      ----------         ------------------------------------------------
First, I have added all the elements to the pipeline.
I link uridecodebin with tee0 and tee1 in it's "pad-added" event. When I play a file with both audio & video , it can work well.
But, I want also playback the file without audio and the webcamera using the same pipeline. You know, the webcamera don't have the audio, so in the "pad-added" event , I don't link uridecodebin to tee1.
So, I want to remove tee1 & audio output elements. I do the remove operation in the uridecodebin's "no-more-pads" event.
I have searched on the Internet that I can't really remove elements in the "no-more-pads". So, I just in it post a custom message. I in the bus message process callback to remove the elements. But, I can't get it work.
Please, tell me how to remove the unlinked elements and make the pipeline run.
Or, tell me how I can dynamicly add the tee0, video output, tee1, audio output to the pipeline which just has single element - uridecodebin.

Thanks in advance . Sincerely.
Reply | Threaded
Open this post in threaded view
|

Re: Remove unlinked elements from pipeline

Sudarshan Bisht
Hi ,
 
first add all the elements in your bins or pipeline , but you need to link them according to certain situations  .
 
So first you need to check in the bus call back that your file has audio data of not , that means whether your demuxer or uridecodebin has created an audio src pad or not . If audio src pad is created then only link this pad with the sink pad of tee ( or proxy pad of the respective bin ) . Else just skip it.
 
By doing this you can play a container file which does not have audio elementary stream.
 
 

 
On Mon, Jul 12, 2010 at 3:43 PM, Hecate_Eos <[hidden email]> wrote:

Hi All
I use uridecodebin to decode my file. I can play the file with both video
and audio, but I have the problem when the file just has video. For example,
I play the webcamera.
                              ----------
---------------------------------------
                       /  -> | tee0 |   ->   |   Video Output to Screen  |
----------------------/        ----------
---------------------------------------
| uridecodebin |
----------------------
                     \                ---------
------------------------------------------------
                        \ ---X---> | tee1 |   ->  |     Audio Output to
sound device |
                                     ----------
------------------------------------------------
First, I have added all the elements to the pipeline.
I link uridecodebin with tee0 and tee1 in it's "pad-added" event. When I
play a file with both audio & video , it can work well.
But, I want also playback the file without audio and the webcamera using the
same pipeline. You know, the webcamera don't have the audio, so in the
"pad-added" event , I don't link uridecodebin to tee1.
So, I want to remove tee1 & audio output elements. I do the remove operation
in the uridecodebin's "no-more-pads" event.
I have searched on the Internet that I can't really remove elements in the
"no-more-pads". So, I just in it post a custom message. I in the bus message
process callback to remove the elements. But, I can't get it work.
Please, tell me how to remove the unlinked elements and make the pipeline
run.
Or, tell me how I can dynamicly add the tee0, video output, tee1, audio
output to the pipeline which just has single element - uridecodebin.

Thanks in advance . Sincerely.

--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Remove-unlinked-elements-from-pipeline-tp2285949p2285949.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



--
Regards,

Sudarshan Bisht

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel