<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:54 PM, Anton Olegovich
wrote:<br>
</div>
<blockquote cite="mid:540C3974.5020803@gmail.com" type="cite">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div class="post-text" itemprop="text">
<p>I'm writing an app for android using gstreamer 1.0. 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: </p>
<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");
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);</code></pre>
</div>
</blockquote>
<code>You just want to do </code><code>gst_element_request_pad()
here.</code>
<blockquote cite="mid:540C3974.5020803@gmail.com" type="cite">
<div class="post-text" itemprop="text">
<pre><code>
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){
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>
</div>
<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>
</body>
</html>