Hi Tiago,<br><br>I added a callback for pad-added. Now it works. Thanks for the help. <br><br>Regards,<br><br>Qin<br><br><br><div class="gmail_quote">On Mon, Mar 1, 2010 at 5:15 PM, Tiago Katcipis <span dir="ltr"><<a href="mailto:katcipis@inf.ufsc.br" target="_blank">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;">
<font face="arial, helvetica, sans-serif"><br><br></font><div class="gmail_quote"><div><font face="arial, helvetica, sans-serif">On Mon, Mar 1, 2010 at 2:55 PM, Qin Chen </font><span dir="ltr"><font face="arial, helvetica, sans-serif"><<a href="mailto:eric.qin.chen@gmail.com" target="_blank">eric.qin.chen@gmail.com</a>></font></span><font face="arial, helvetica, sans-serif"> wrote:<br>
</font></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><font face="arial, helvetica, sans-serif"><div>Hi Tiago,<br><br>Thank you very much for your reply.<br>
<br>I didn't "request" the recv_rtp_src_%d_%d_%d pad. In my codes, I used<br></div>gst_element_link_many(gstrtpbi</font>
<font face="arial, helvetica, sans-serif">n, 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</font></blockquote>
<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">but according to the error msg it looks like in some moment you are trying to get it with a </font><span style="border-collapse: collapse;"><font face="arial, helvetica, sans-serif">gst_element_get_static_pad</font><span style="border-collapse: separate;"><font face="arial, helvetica, sans-serif">:</font></span></span></div>
<div>
<div><font face="arial, helvetica, sans-serif"><br></font></div><div><span style="border-collapse: collapse;"><font face="arial, helvetica, sans-serif">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"</font></span></div>
<div><span style="border-collapse: collapse;"><font face="arial, helvetica, sans-serif"><br></font></span></div></div><div><span style="border-collapse: collapse;"><font face="arial, helvetica, sans-serif">where is your "pad-added" handler? i think when a pad is added dynamically a "pad-added" signal is emitted by gstrtpbin.</font></span></div>
<div><span style="border-collapse: collapse;"><font face="arial, helvetica, sans-serif"><br></font></span></div><div><span style="border-collapse: collapse;"><font face="arial, helvetica, sans-serif">best regards,</font></span></div>
<div><span style="border-collapse: collapse;"><font face="arial, helvetica, sans-serif">Katcipis</font></span></div><div><div></div><div><div><font face="arial, helvetica, sans-serif"> </font></div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><font face="arial, helvetica, sans-serif"><br><br>Regards,<br></font>
<font color="#888888"><font face="arial, helvetica, sans-serif"><br>Qin<br></font>
</font><div><div></div><div><font face="arial, helvetica, sans-serif"><br><br><br></font><div class="gmail_quote"><font face="arial, helvetica, sans-serif">On Mon, Mar 1, 2010 at 7:20 AM, Tiago Katcipis </font><span dir="ltr"><font face="arial, helvetica, sans-serif"><</font><a href="mailto:katcipis@inf.ufsc.br" target="_blank"><font face="arial, helvetica, sans-serif">katcipis@inf.ufsc.br</font></a><font face="arial, helvetica, sans-serif">></font></span><font face="arial, helvetica, sans-serif"> wrote:<br>
</font>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><font face="arial, helvetica, sans-serif"><br><br></font><div class="gmail_quote">
<div><font face="arial, helvetica, sans-serif">On Mon, Mar 1, 2010 at 1:24 AM, Qin Chen </font><span dir="ltr"><font face="arial, helvetica, sans-serif"><</font><a href="mailto:eric.qin.chen@gmail.com" target="_blank"><font face="arial, helvetica, sans-serif">eric.qin.chen@gmail.com</font></a><font face="arial, helvetica, sans-serif">></font></span><font face="arial, helvetica, sans-serif"> wrote:<br>
</font>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<font face="arial, helvetica, sans-serif">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>
</font>
<pre><font face="arial, helvetica, sans-serif">gst</font><span><font face="arial, helvetica, sans-serif">-</font></span><font face="arial, helvetica, sans-serif">launch </font><span><font face="arial, helvetica, sans-serif">-</font></span><font face="arial, helvetica, sans-serif">v gstrtpbin name</font><span><font face="arial, helvetica, sans-serif">=</font></span><font face="arial, helvetica, sans-serif">rtpbin \<br>
udpsrc caps</font><span><font face="arial, helvetica, sans-serif">=</font></span><span><font face="arial, helvetica, sans-serif">"application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264"</font></span><font face="arial, helvetica, sans-serif"> \<br>
port</font><span><font face="arial, helvetica, sans-serif">=</font></span><span><font face="arial, helvetica, sans-serif">5000</font></span><font face="arial, helvetica, sans-serif"> </font><span><font face="arial, helvetica, sans-serif">!</font></span><font face="arial, helvetica, sans-serif"> rtpbin</font><span><font face="arial, helvetica, sans-serif">.</font></span><font face="arial, helvetica, sans-serif">recv_rtp_sink_0 \<br>
rtpbin</font><span><font face="arial, helvetica, sans-serif">. !</font></span><font face="arial, helvetica, sans-serif"> rtph264depay </font><span><font face="arial, helvetica, sans-serif">!</font></span><font face="arial, helvetica, sans-serif"> ffdec_h264 </font><span><font face="arial, helvetica, sans-serif">!</font></span><font face="arial, helvetica, sans-serif"> xvimagesink \<br>
</font></pre><font face="arial, helvetica, sans-serif"><br>But I couldn't link gstrtpbin and rtph264depay. The error message is as follows:<br>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<br>
<br>Could someone give me some hints? Why I have no "recv_rtp_src_%d_%d_%d"? </font>
</blockquote><div><font face="arial, helvetica, sans-serif"><br></font></div></div><div><a href="http://www.gstreamer.net/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-gstrtpbin.html" target="_blank"><font face="arial, helvetica, sans-serif">http://www.gstreamer.net/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-gstrtpbin.html</font></a></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><font face="arial, helvetica, sans-serif"> </font></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><font face="arial, helvetica, sans-serif">Or could someone lead me to similar examples? Thanks in advance!<br><br>Regards,<br><br>Qin<br><br><br>static<br>GstElement* construct_receiver_pipeline(</font>
<font face="arial, helvetica, sans-serif">void){<br> GstElement *pipeline, *gstrtpbin, *vdec, *rtpdec, *vsink;<br> GstElement *jitterbuf, *vconv;<br> GstElement *udpsrc_rtp;<br> GstCaps *caps;<br>
GstPad *pad;<br> gboolean err;<br> GstPadLinkReturn res;<br><br> //Create gstrtpbin<br> gstrtpbin = gst_element_factory_make("</font>
<font face="arial, helvetica, sans-serif">gstrtpbin", "gst-rtp-bin");<br> if ( !gstrtpbin ) {<br> g_printerr("Failed to create gstrtpbin\n");<br> return 0;<br>
}<br> g_object_set(G_OBJECT (jitterbuf), "latency", jitter_latency, NULL);<br><br> //RTP ource initialization<br> udpsrc_rtp = gst_element_factory_make("</font>
<font face="arial, helvetica, sans-serif">udpsrc", "udp-udpsrc_rtp");<br> if ( !udpsrc_rtp ) {<br> g_printerr("Failed to create udpsrc\n");<br> return 0;<br>
}<br> g_object_set(G_OBJECT (udpsrc_rtp), "port", rtp_port, NULL);<br> //gst_caps_new_simple and gst_element_linked_filter don't work<br> g_object_set(G_OBJECT (udpsrc_rtp), "caps",<br>
gst_caps_from_string("</font>
<font face="arial, helvetica, sans-serif">application/x-rtp, "<br> "clock-rate=(int)90000, "<br> "payload=(int)96, "<br> "media=(string)video, "<br>
"encoding-name=(string)H264"), NULL);<br><br> //Create video decoder<br> vdec = gst_element_factory_make(</font>
<font face="arial, helvetica, sans-serif">vdecoder, "video-decoder");<br> if ( !vdec ) {<br> g_printerr("Failed to create %s\n", vdecoder);<br> return 0;<br> }<br>
<br> //Choose RTP decoder according to video codec<br> rtpdecoder = g_strdup(select_rtp_decoder(</font>
<font face="arial, helvetica, sans-serif">vdecoder));<br> g_free(vdecoder);<br><br> //Create rtp decoder<br> rtpdec = gst_element_factory_make(</font>
<font face="arial, helvetica, sans-serif">rtpdecoder, "rtp-decoder");<br> if ( !rtpdec ) {<br> g_printerr("Failed to create %s\n", rtpdecoder);<br> return 0;<br>
}<br><br> //Create video converter<br> vconv = gst_element_factory_make("</font>
<font face="arial, helvetica, sans-serif">ffmpegcolorspace", "video-converter");<br> if ( !vconv ) {<br> g_printerr("Failed to create ffmpegcolorspace\n");<br> return 0;<br>
}<br><br> //Create video sink<br> vsink = gst_element_factory_make("</font>
<font face="arial, helvetica, sans-serif">xvimagesink", "video-sink");<br> if ( !vsink ) {<br> g_printerr("Failed to create xvimagesink\n");<br> return 0;<br>
}<br><br> /* Set up the pipeline */<br> gst_bin_add_many(GST_BIN (pipeline), udpsrc_rtp, gstrtpbin/*, jitterbuf*/,<br> rtpdec, vdec, vconv, vsink, NULL);<br><br> //link udpsrc_rtp to gstrtpbin<br>
pad = gst_element_get_request_pad(</font>
<font face="arial, helvetica, sans-serif">gstrtpbin, "recv_rtp_sink_%d");<br> if ( !pad ) {<br> g_printerr("Failed to create pad\n");<br> return 0;<br> }<br>
res = gst_pad_link(gst_element_get_</font>
<font face="arial, helvetica, sans-serif">pad(udpsrc_rtp, "src"), pad);<br> gst_object_unref(GST_OBJECT (pad));<br> if ( GST_PAD_LINK_FAILED(res) ) {<br> g_printerr("Failed to link pads\n");<br>
return 0;<br> }<br><br> err = gst_element_link_many(</font>
<font face="arial, helvetica, sans-serif">gstrtpbin, rtpdec, vdec, vconv, vsink, NULL);<br> if ( err==FALSE ) {<br> g_printerr("Failed to link elements\n");<br> return 0;<br>
}<br><br> return pipeline;<br>}<br><br></font>
</div></div><font face="arial, helvetica, sans-serif">------------------------------------------------------------------------------<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></font>
<a href="http://p.sf.net/sfu/intel-sw-dev" target="_blank"><font face="arial, helvetica, sans-serif">http://p.sf.net/sfu/intel-sw-dev</font></a><font face="arial, helvetica, sans-serif"><br>
_______________________________________________<br>
gstreamer-devel mailing list<br></font>
<a href="mailto:gstreamer-devel@lists.sourceforge.net" target="_blank"><font face="arial, helvetica, sans-serif">gstreamer-devel@lists.sourceforge.net</font></a><font face="arial, helvetica, sans-serif"><br>
</font>
<a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank"><font face="arial, helvetica, sans-serif">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</font></a><font face="arial, helvetica, sans-serif"><br>
<br></font>
</blockquote></div><font face="arial, helvetica, sans-serif"><br><br>------------------------------</font>
<font face="arial, helvetica, sans-serif">------------------------------------------------<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></font>
<a href="http://p.sf.net/sfu/intel-sw-dev" target="_blank"><font face="arial, helvetica, sans-serif">http://p.sf.net/sfu/intel-sw-dev</font></a><font face="arial, helvetica, sans-serif"><br>
_______________________________________________<br>
gstreamer-devel mailing list<br></font>
<a href="mailto:gstreamer-devel@lists.sourceforge.net" target="_blank"><font face="arial, helvetica, sans-serif">gstreamer-devel@lists.sourceforge.net</font></a><font face="arial, helvetica, sans-serif"><br>
</font>
<a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank"><font face="arial, helvetica, sans-serif">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</font></a><font face="arial, helvetica, sans-serif"><br>
<br></font>
</blockquote></div><font face="arial, helvetica, sans-serif"><br></font>
</div></div><font face="arial, helvetica, sans-serif"><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></font>
<a href="http://p.sf.net/sfu/intel-sw-dev" target="_blank"><font face="arial, helvetica, sans-serif">http://p.sf.net/sfu/intel-sw-dev</font></a><font face="arial, helvetica, sans-serif"><br>
_______________________________________________<br>
gstreamer-devel mailing list<br></font>
<a href="mailto:gstreamer-devel@lists.sourceforge.net" target="_blank"><font face="arial, helvetica, sans-serif">gstreamer-devel@lists.sourceforge.net</font></a><font face="arial, helvetica, sans-serif"><br>
</font>
<a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank"><font face="arial, helvetica, sans-serif">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</font></a><font face="arial, helvetica, sans-serif"><br>
<br></font>
</blockquote></div></div></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" 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>