hi all<br><br>&nbsp;&nbsp;&nbsp;&nbsp; I use the following commend as a server to forward udp packet loaded with rtp packet.<br>&nbsp;&nbsp;&nbsp; &nbsp;<br>&nbsp;&nbsp;&nbsp; gst-launch -v gstrtpbin name=rtpbin latency=200 \<br>&nbsp;&nbsp; &nbsp;udpsrc caps="application/x-rtp,media=(string)video,<br>clock-rate=(int)90000,encoding-name=(string)H264" &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;port=5000 ! rtpbin.recv_rtp_sink_0 \<br>&nbsp;&nbsp; &nbsp;rtpbin. ! udpsink port=5000 host=224.0.0.1 sync=false ts-offset=0 \<br>&nbsp;&nbsp; &nbsp;udpsrc caps="application/x-rtp,media=(string)audio,<br>clock-rate=(int)8000,encoding-name=(string)PCMA" &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;port=5002 ! rtpbin.recv_rtp_sink_1 \<br>&nbsp;&nbsp; &nbsp;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>&nbsp;&nbsp; &nbsp;caps=gst_pad_get_caps(pad);<br>&nbsp;&nbsp; &nbsp;g_assert(caps!=NULL);<br>&nbsp;&nbsp; &nbsp;str=gst_caps_get_structure(caps,0);<br>&nbsp;&nbsp; &nbsp;g_assert(str!=NULL);&nbsp;&nbsp; &nbsp;<br>&nbsp;&nbsp; &nbsp;media_type_name=gst_structure_get_name(str);<br>&nbsp;&nbsp; &nbsp;g_assert(media_type_name!=NULL);<br>&nbsp;&nbsp; &nbsp;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>