[gst-devel] problem of creating caps and get the name of cap

xuxin04072129 xuxin04072129 at 126.com
Thu Jun 4 14:29:39 CEST 2009


hi all

     I use the following commend as a server to forward udp packet loaded with rtp packet.
     
    gst-launch -v gstrtpbin name=rtpbin latency=200 \
    udpsrc caps="application/x-rtp,media=(string)video,
clock-rate=(int)90000,encoding-name=(string)H264"         port=5000 ! rtpbin.recv_rtp_sink_0 \
    rtpbin. ! udpsink port=5000 host=224.0.0.1 sync=false ts-offset=0 \
    udpsrc caps="application/x-rtp,media=(string)audio,
clock-rate=(int)8000,encoding-name=(string)PCMA"         port=5002 ! rtpbin.recv_rtp_sink_1 \
    rtpbin. ! udpsink port=5002 host=224.0.0.1 sync=false ts-offset=0 

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.

the following is my code used to get the name:
    caps=gst_pad_get_caps(pad);
    g_assert(caps!=NULL);
    str=gst_caps_get_structure(caps,0);
    g_assert(str!=NULL);    
    media_type_name=gst_structure_get_name(str);
    g_assert(media_type_name!=NULL);
    g_print("the media type is %s\n",media_type_name);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20090604/6bd77ca5/attachment.htm>


More information about the gstreamer-devel mailing list