<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 09/07/2014 12:19 PM, Anton Olegovich
wrote:<br>
</div>
<blockquote cite="mid:540C7774.4050306@gmail.com" type="cite">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
I need to display video stream and some times, as required, to
write the same stream to file. Now i'm in practic with manualy
linking pads. I've got this code:
<pre><code> gst_bin_add_many(GST_BIN(data->video_pipeline),udpsrc,rtph264depay,avdec_h264,/*videorate,*/clockoverlay,tee,queue_video_sink,queue_file_sink,NULL);
if (!gst_element_link_filtered (udpsrc,rtph264depay,udpsrc_caps))
GST_ERROR ("Can't link udpsrc and rtph264depay with caps");
}
if (!gst_element_link_many (rtph264depay,avdec_h264,/*videorate,*/clockoverlay,tee,NULL)){
GST_ERROR ("Can't link many to tee");
}
gst_object_unref (G_OBJECT(videorate_src_pad));//Возможно получится ошибка с пямятью
gst_caps_unref(videorate_caps);///Освобождаем caps
#if 1
if(!gst_element_add_pad(tee,pad_surface_src))
GST_ERROR("Cant add pad to tee");</code></pre>
</blockquote>
This seems wrong, you shouldn't be adding pads to tee, but
requesting pads from it and tee will create and add the pad itself.<br>
<br>
<blockquote cite="mid:540C7774.4050306@gmail.com" type="cite">
<pre><code>
tee_src_pad_template = gst_element_class_get_pad_template(GST_ELEMENT_GET_CLASS(tee),"src_%u");
pad_surface_src = gst_element_request_pad(tee,tee_src_pad_template,NULL,NULL);
if(!pad_surface_src){
g_printerr ("Can't obtain request pad src for tee.\n");
}
pad_surface_sink = gst_element_get_static_pad(autovideosink,"sink");
if(!pad_surface_sink){
g_printerr ("Can't obtain request pad sink for autovideosink.\n");
}
if (gst_pad_link (pad_surface_src,pad_surface_sink)!=GST_PAD_LINK_OK){</code></pre>
</blockquote>
<code>Did you check what was the error code? Which was the exact
return here?</code><br>
<blockquote cite="mid:540C7774.4050306@gmail.com" type="cite">
<pre><code>
g_printerr ("Tee could not be linked.\n");
gst_object_unref (data->video_pipeline);
return -1;
}
gst_object_unref(pad_surface_sink);
#endif
</code></pre>
<p>all pads are initialized, but gst_pad_link does not returns
GST_PAD_LINK_OK. Do you know why? May be i can't to link tee and
autovideosink directly, may be i need some queue? but queue do
more latency. </p>
</blockquote>
<br>
You might just be missing a videoconvert element. Does your pipeline
work with gst-launch-1.0?<br>
<br>
<blockquote cite="mid:540C7774.4050306@gmail.com" type="cite"> <br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
gstreamer-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Thiago Sousa Santos
Senior Multimedia Engineer, Open Source Group
Samsung Research America - Silicon Valley</pre>
</body>
</html>