In my experience, the bin/elements/branch you're trying to attach to one of the src%d pads should be in the PLAYING state before you link it. This is because as the tee tries to push a buffer to its src pads, if any of the pads is linked to a non-PLAYING element, the buffer push method returrn a wrong-state value which propagates all the way to the source and pauses everything, GST_DEBUG=4 will show you this.<div>
<br></div><div>Also, like you mentioned, gst_pad_link is how you would link a tee's src%d to the branch.</div><div><br></div><div>While unlinking, I first unlink the pad and then take care of the disposing the branch. Ideally, however, we should block data on the pad and then unlink it, but that hasn't work for me so far.</div>
<div><br></div><div>HTH<br><br><div class="gmail_quote">On Fri, Nov 6, 2009 at 8:37 AM, Peter Cai <span dir="ltr"><<a href="mailto:newptcai@gmail.com">newptcai@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
After a lot of search, I found this is not quite simple as I used to<br>
think. The coding following only work when 2 sink is linked to the<br>
tee.<br>
When the 3rd comes, all 3 sink doesn't work.<br>
<br>
What is the correct way to add and remove branch to a "tee"?<br>
On IRC, I was told to try these<br>
<br>
1. setting sink "asycn = FALSE"<br>
2. add a queue between tee and sink<br>
3. use pad instead of gst_element_link<br>
<br>
None of them works.<br>
<br>
GstElement* dd = gst_element_factory_make("directdrawsink", NULL);<br>
g_object_set(dd, "async", FALSE, NULL);<br>
gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(dd), (gulong)handle);<br>
<br>
gst_element_set_state (dd, GST_STATE_PAUSED);<br>
gst_bin_add(GST_BIN (self->priv->pipeline), dd);<br>
<br>
if(!gst_element_link (self->priv->tee, dd))<br>
{<br>
vivs_warning("Can not link tee to directdrawsink");<br>
}<br>
<br>
if(self->priv->sink_num == 1)<br>
gst_element_set_state (self->priv->pipeline, GST_STATE_PLAYING);<br>
else<br>
gst_element_set_state (dd, GST_STATE_PLAYING);<br>
self->priv->sink_num += 1<br>
<br>
<br>
--<br>
look to the things around you,the immediate world around you, if you<br>
are alive,it will mean something to you ——Paul Strand<br>
<br>
------------------------------------------------------------------------------<br>
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day<br>
trial. Simplify your report design, integration and deployment - and focus on<br>
what you do best, core application coding. Discover what's new with<br>
Crystal Reports now. <a href="http://p.sf.net/sfu/bobj-july" target="_blank">http://p.sf.net/sfu/bobj-july</a><br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
</blockquote></div><br></div>