[gst-devel] problem for replacing an element in a built pipeline

Matthieu LAURENT matthieu.laurent at purplelabs.com
Mon Feb 26 19:28:44 CET 2007


I have a problem for replacing an element in a built pipeline.

I have coded a program that build the following pipe:
filesrc | ffdemux | queue | fakesink
and once it is done I want to change fakesink by another sink that we
would call fakesink_2

the steps of my process are:

add filesrc to pipeline
add ffdemux to pipeline
link filesrc | ffdemux
set state READY
set state PAUSED

by making this, the callback that I have plugged is called on the
creation of source pad of ffdemux

The process of this callback is:
add queue to pipeline
link ffdemux | queue
add fakesink to pipeline
link queue | fakesink
set state PAUSED (in order that my 2 new elements (queue,fakesink) are
in the right state (PAUSED))

when my 4 elements filesrc | ffdemux | queue | fakesink  (+ the pipe
line) are in the state PAUSED,
I want to change element fakesink by fakesink_2

So I make a
set state READY (this will remove the pad of ffmpeg if I understand well)
set state PAUSED

this time in the callback for pad creation of ffdemux, the process is:
unlink fakesink
remove fakesink from pipe
get queue from pipeline (thanks to gst_bin_get_by_name)
link ffdemux | queue
add fakesink_2 to pipeline
link queue | fakesink_2
set state PAUSED

that is were an error occurs:
WARNING gst_base_sink_chain (gstbasesink.c l. 2012): Push on pad
videosink:sink, but it was not activated in push mode


Even if fakesink_2 is a sink that do something or is a real fakesink, I
have the same problem.


Could you tell me what I do not the good way?
How to replace an element?

Regards

Matthieu






More information about the gstreamer-devel mailing list