[gst-devel] Problems with video, tee and queues

4ernov 4ernov at gmail.com
Mon Nov 1 16:34:31 CET 2010


Hello,

I suffer strange problem trying to modify the pipeline connecting
different elements to it through the queue.

I have a playbin playing video files and I need to show the video on
two separate screens (or windows at least). But second sink should
turn on request (by D-Bus but that's not so important). So the first
moment I have the following pipeline:
                      queue -- xvimagesink
                   /
playbin -- tee
                   \
                     queue -- fakesink

but when request is received it is transformed to the following:

                      queue -- xvimagesink
                   /
playbin -- tee
                   \
                      queue -- xvimagesink

Also, tee and next elements are contained to separate bin. Here's the
code of pipeline construction:

// some static elements
GstElement *_pipeline, *_videobin, *_mpoint, *_fakesink;

// pipeline construction
GstElement *, *tee, *xvimagesink;

_pipeline      = gst_element_factory_make("playbin",  NULL);

tee			= gst_element_factory_make("tee",  NULL);
xvimagesink   = gst_element_factory_make("xvimagesink", NULL);

_videobin = gst_bin_new("videobin"); // static videobin
GstElement* queue1	= gst_element_factory_make("queue", NULL);
GstElement* queue2	= gst_element_factory_make("queue", NULL);
fakesink			= gst_element_factory_make("fakesink", NULL);

_mpoint = queue2; // static mount point
gst_bin_add_many(GST_BIN(_videobin), tee, queue1, queue2, xvimagesink,
_fakesink, NULL);

gst_element_link_many(tee, queue1, xvimagesink, NULL);
gst_element_link_many(tee, queue2, _fakesink, NULL);
GstPad* pad = gst_element_get_static_pad (tee, "sink");
gst_element_add_pad (_videobin, gst_ghost_pad_new ("sink", pad));
gst_object_unref (GST_OBJECT (pad));

g_object_set(G_OBJECT (_pipeline), "uri", "video.avi", NULL);
g_object_set(G_OBJECT (_pipeline), "video-sink", _videobin, NULL);

/* Set the pipeline to "playing" state*/
gst_element_set_state (_pipeline, GST_STATE_PLAYING);

and when the request is received the following code change the sink element:

gst_element_unlink(_mpoint, _fakesink);
gst_bin_remove(GST_BIN(_videobin), _fakesink);
gst_element_set_state (_fakesink, GST_STATE_NULL);

GstElement* xv = gst_element_factory_make("xvimagesink",  NULL);
gst_bin_add(GST_BIN(_videobin), xv);
gst_element_link(_mpoint, xv);
gst_element_sync_state_with_parent(xv);
gst_element_set_state (_pipeline, GST_STATE_PLAYING);

So, everything is ok till the request is actually being received.
Suddenly the pipeline is getting stalled (while still staying in
PLAYING state), time messages on bus are coming in very pulsing manner
and another window for another xvimagesink isn't even appear. What can
be the cause of such a problem behavior? I guess it's because queue
elements but without queues videos aren't synchronized. Also, if both
xvimagesink's are connected to tee through queue right from start it
works quite flawlessly and without any problems.

Thanks in advance!




More information about the gstreamer-devel mailing list