<span style="font-family: courier new,monospace;">Hi Tiago,</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Thank you very much for your reply.</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">I didn't "request" the recv_rtp_src_%d_%d_%d pad. In my codes, I used</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">gst_element_link_many(</span><span style="font-family: courier new,monospace;">gstrtpbin, rtpdec, vdec, vconv, vsink, NULL); and hope that I can get the "dynamically" created pad. But according to the error message, no such pad was created. Any idea? Thanks</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Regards,</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Qin</span><br>
</span><span style="font-family: courier new,monospace;"><br><br></span><br><div class="gmail_quote">On Mon, Mar 1, 2010 at 7:20 AM, Tiago Katcipis <span dir="ltr"><<a href="mailto:katcipis@inf.ufsc.br">katcipis@inf.ufsc.br</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><br><div class="gmail_quote"><div class="im">On Mon, Mar 1, 2010 at 1:24 AM, Qin Chen <span dir="ltr"><<a href="mailto:eric.qin.chen@gmail.com" target="_blank">eric.qin.chen@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<span style="font-family: courier new,monospace;">Hi experts,<br><br>I am trying to write a pipeline for receiving and decoding H.264 RTP packets. Please see the C codes below. It is basically equivalent to following pipeline.<br>
</span><pre>gst<span>-</span>launch <span>-</span>v gstrtpbin name<span>=</span>rtpbin \<br> udpsrc caps<span>=</span><span>"application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264"</span> \<br>
port<span>=</span><span>5000</span> <span>!</span> rtpbin<span>.</span>recv_rtp_sink_0 \<br> rtpbin<span>. !</span> rtph264depay <span>!</span> ffdec_h264 <span>!</span> xvimagesink \<br>
</pre><br><span style="font-family: courier new,monospace;">But I couldn't link gstrtpbin and rtph264depay. The error message is as follows:<br><font size="1">0:00:00.135605335 5934 0x95aa008 INFO GST_ELEMENT_PADS gstutils.c:1587:gst_element_link_pads: trying to link element gst-rtp-bin:(any) to element rtp-decoder:(any)<br>
0:00:00.135657988 5934 0x95aa008 INFO GST_ELEMENT_PADS gstelement.c:970:gst_element_get_static_pad: no such pad 'recv_rtp_src_%d_%d_%d' in element "gst-rtp-bin"<br>0:00:00.135679108 5934 0x95aa008 INFO GST_ELEMENT_PADS gstutils.c:1208:gst_element_get_compatible_pad:<gst-rtp-bin> Could not find a compatible pad to link to rtp-decoder:sink</font><br>
<br>Could someone give me some hints? Why I have no "recv_rtp_src_%d_%d_%d"? </span></blockquote><div><br></div></div><div><font face="arial, helvetica, sans-serif"><a href="http://www.gstreamer.net/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-gstrtpbin.html" target="_blank">http://www.gstreamer.net/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-gstrtpbin.html</a></font></div>
<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">as you can see the "recv_rtp_src_%d_%d_%d" pad is created dinamically, you cant get it.</font></div>
<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">"To use </font><a href="http://gst-plugins-good-plugins-gstrtpbin.html#GstRtpBin" style="text-decoration: none; color: rgb(52, 101, 164);" target="_blank"><span><font face="arial, helvetica, sans-serif">GstRtpBin</font></span></a><font face="arial, helvetica, sans-serif"> as an RTP receiver, request a recv_rtp_sink_%</font><code><font face="arial, helvetica, sans-serif">d</font></code><font face="arial, helvetica, sans-serif"> pad. The session number must be specified in the pad name. Data received on the recv_rtp_sink_%</font><code><font face="arial, helvetica, sans-serif">d</font></code><font face="arial, helvetica, sans-serif"> pad will be processed in the </font><a href="http://gst-plugins-good-plugins-gstrtpsession.html#GstRtpSession" style="text-decoration: none; color: rgb(52, 101, 164);" target="_blank"><span><font face="arial, helvetica, sans-serif">GstRtpSession</font></span></a><font face="arial, helvetica, sans-serif"> manager and after being validated forwarded on </font><a href="http://gst-plugins-good-plugins-gstrtpssrcdemux.html#GstRtpSsrcDemux" style="text-decoration: none; color: rgb(52, 101, 164);" target="_blank"><span><font face="arial, helvetica, sans-serif">GstRtpSsrcDemux</font></span></a><font face="arial, helvetica, sans-serif"> element. Each RTP stream is demuxed based on the SSRC and send to a </font><a href="http://gst-plugins-good-plugins-gstrtpjitterbuffer.html#GstRtpJitterBuffer" style="text-decoration: none; color: rgb(52, 101, 164);" target="_blank"><span><font face="arial, helvetica, sans-serif">GstRtpJitterBuffer</font></span></a><font face="arial, helvetica, sans-serif">. After the packets are released from the jitterbuffer, they will be forwarded to a</font><a href="http://gst-plugins-good-plugins-gstrtpssrcdemux.html#GstRtpSsrcDemux" style="text-decoration: none; color: rgb(52, 101, 164);" target="_blank"><span><font face="arial, helvetica, sans-serif">GstRtpSsrcDemux</font></span></a><font face="arial, helvetica, sans-serif"> element. The </font><a href="http://gst-plugins-good-plugins-gstrtpssrcdemux.html#GstRtpSsrcDemux" style="text-decoration: none; color: rgb(52, 101, 164);" target="_blank"><span><font face="arial, helvetica, sans-serif">GstRtpSsrcDemux</font></span></a><font face="arial, helvetica, sans-serif"> element will demux the packets based on the payload type and will create a unique pad recv_rtp_src_%</font><code><font face="arial, helvetica, sans-serif">d_</font></code><font face="arial, helvetica, sans-serif">%</font><code><font face="arial, helvetica, sans-serif">d_</font></code><font face="arial, helvetica, sans-serif">%</font><code><font face="arial, helvetica, sans-serif">d</font></code><font face="arial, helvetica, sans-serif"> on gstrtpbin with the session number, SSRC and payload type respectively as the pad name."</font></div>
<div> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5"><span style="font-family: courier new,monospace;">Or could someone lead me to similar examples? Thanks in advance!<br>
<br>Regards,<br><br>Qin<br><br><br>static</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">GstElement* construct_receiver_pipeline(void){</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> GstElement *pipeline, *gstrtpbin, *vdec, *rtpdec, *vsink;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> GstElement *jitterbuf, *vconv;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> GstElement *udpsrc_rtp;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> GstCaps *caps;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> GstPad *pad;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> gboolean err;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> GstPadLinkReturn res;</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> //Create gstrtpbin</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> gstrtpbin = gst_element_factory_make("gstrtpbin", "gst-rtp-bin");</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> if ( !gstrtpbin ) {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> g_printerr("Failed to create gstrtpbin\n");</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> return 0;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> g_object_set(G_OBJECT (jitterbuf), "latency", jitter_latency, NULL);</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> //RTP ource initialization</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> udpsrc_rtp = gst_element_factory_make("udpsrc", "udp-udpsrc_rtp");</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> if ( !udpsrc_rtp ) {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> g_printerr("Failed to create udpsrc\n");</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> return 0;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> g_object_set(G_OBJECT (udpsrc_rtp), "port", rtp_port, NULL);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> //gst_caps_new_simple and gst_element_linked_filter don't work</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> g_object_set(G_OBJECT (udpsrc_rtp), "caps",</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> gst_caps_from_string("application/x-rtp, "</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> "clock-rate=(int)90000, "</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> "payload=(int)96, "</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> "media=(string)video, "</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> "encoding-name=(string)H264"), NULL);</span><span style="font-family: courier new,monospace;"></span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> //Create video decoder</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> vdec = gst_element_factory_make(vdecoder, "video-decoder");</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> if ( !vdec ) {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> g_printerr("Failed to create %s\n", vdecoder);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> return 0;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> //Choose RTP decoder according to video codec</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> rtpdecoder = g_strdup(select_rtp_decoder(vdecoder));</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> g_free(vdecoder);</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> //Create rtp decoder</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> rtpdec = gst_element_factory_make(rtpdecoder, "rtp-decoder");</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> if ( !rtpdec ) {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> g_printerr("Failed to create %s\n", rtpdecoder);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> return 0;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> //Create video converter</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> vconv = gst_element_factory_make("ffmpegcolorspace", "video-converter");</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> if ( !vconv ) {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> g_printerr("Failed to create ffmpegcolorspace\n");</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> return 0;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> //Create video sink</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> vsink = gst_element_factory_make("xvimagesink", "video-sink");</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> if ( !vsink ) {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> g_printerr("Failed to create xvimagesink\n");</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> return 0;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> /* Set up the pipeline */</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> gst_bin_add_many(GST_BIN (pipeline), udpsrc_rtp, gstrtpbin/*, jitterbuf*/,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> rtpdec, vdec, vconv, vsink, NULL);</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> //link udpsrc_rtp to gstrtpbin</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> pad = gst_element_get_request_pad(gstrtpbin, "recv_rtp_sink_%d");</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> if ( !pad ) {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> g_printerr("Failed to create pad\n");</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> return 0;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> res = gst_pad_link(gst_element_get_pad(udpsrc_rtp, "src"), pad);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> gst_object_unref(GST_OBJECT (pad));</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> if ( GST_PAD_LINK_FAILED(res) ) {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> g_printerr("Failed to link pads\n");</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> return 0;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> err = gst_element_link_many(gstrtpbin, rtpdec, vdec, vconv, vsink, NULL);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> if ( err==FALSE ) {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> g_printerr("Failed to link elements\n");</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> return 0;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> return pipeline;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">}</span><br>
<br></div></div>------------------------------------------------------------------------------<br>
Download Intel&#174; Parallel Studio Eval<br>
Try the new software tools for yourself. Speed compiling, find bugs<br>
proactively, and fine-tune applications for parallel performance.<br>
See why Intel Parallel Studio got high marks during beta.<br>
<a href="http://p.sf.net/sfu/intel-sw-dev" target="_blank">http://p.sf.net/sfu/intel-sw-dev</a><br>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.sourceforge.net" target="_blank">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>
<br></blockquote></div><br>
<br>------------------------------------------------------------------------------<br>
Download Intel&#174; Parallel Studio Eval<br>
Try the new software tools for yourself. Speed compiling, find bugs<br>
proactively, and fine-tune applications for parallel performance.<br>
See why Intel Parallel Studio got high marks during beta.<br>
<a href="http://p.sf.net/sfu/intel-sw-dev" target="_blank">http://p.sf.net/sfu/intel-sw-dev</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>
<br></blockquote></div><br>