hi all<br><br> I use the following commend as a server to forward udp packet loaded with rtp packet.<br> <br> gst-launch -v gstrtpbin name=rtpbin latency=200 \<br> udpsrc caps="application/x-rtp,media=(string)video,<br>clock-rate=(int)90000,encoding-name=(string)H264" port=5000 ! rtpbin.recv_rtp_sink_0 \<br> rtpbin. ! udpsink port=5000 host=224.0.0.1 sync=false ts-offset=0 \<br> udpsrc caps="application/x-rtp,media=(string)audio,<br>clock-rate=(int)8000,encoding-name=(string)PCMA" port=5002 ! rtpbin.recv_rtp_sink_1 \<br> rtpbin. ! udpsink port=5002 host=224.0.0.1 sync=false ts-offset=0 <br><br>When I implement it in c and use the commends as follows to get the media type ,but the result is "application/x-rtp" . I think the method I used to create the caps maybe wrong ,would you tell me the right way to create the caps? thank you very much.<br><br>the following is my code used to get the name:<br> caps=gst_pad_get_caps(pad);<br> g_assert(caps!=NULL);<br> str=gst_caps_get_structure(caps,0);<br> g_assert(str!=NULL); <br> media_type_name=gst_structure_get_name(str);<br> g_assert(media_type_name!=NULL);<br> g_print("the media type is %s\n",media_type_name);<br><!-- footer --><br><span title="neteasefooter"/><hr/>
<a href="http://qiye.163.com/?ft=2">网易全新推出企业邮箱</a>
</span>