simple rtp application

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

simple rtp application

Zoltan Seress
Hello!

I would like to have the following gst pipeline in a c application:

It is only the server side.

gst-launch gstrtpbin name=rtpbin \
           audiotestsrc ! alawenc ! rtppcmapay ! rtpbin.send_rtp_sink_0  \
                 rtpbin.send_rtp_src_0 ! udpsink port=5000      \
                 rtpbin.send_rtcp_src_0 ! udpsink port=5001 sync=false async=false         \
                     udpsrc port=5003 ! rtpbin.recv_rtcp_sink_0

It works well. Then I created an image from the pipeline, which I attached. The image (and the pipeline as well) clearly show that gstrtpbin uses 4 pads: 3 on-request pads ( send_rtp_sink_0, recv_rtcp_sink_0, send_rtcp_src_0 ) and one sometimes pad (send_rtp_src_0).

I wrote the application, but it quits with: "Internal data flow error."

I do not know what the problem is. I already used request pads before, so I guess the the dynamic pad is wrong. The Hello World example uses a signal handler to summon the sometimes pad (but in there application the oggdemux element has only one source pad, which the sometimes pad), but gstrtpbin has 2 sometimes source pads, I need only one of them, namely send_rtp_src_0. I couldn't able to do it with the signal handler, therefore I tried the following way:

static void new_pad_send_rtp_src(  )
{
    GstPad *sinkpad;
    GstPad *srcpad;
    gchar *srcname;
    gchar *sinkname;   
   
    sinkpad = gst_element_get_static_pad(udpsink0, "sink");
    sinkname = gst_pad_get_name(sinkpad);
    srcpad = gst_element_get_pad(rtpbin, "send_rtp_src_0");
    srcname = gst_pad_get_name(srcpad);

    gst_pad_link (srcpad, sinkpad);
    g_print ("A dynamic pad %s created and linked \n", srcname);

    g_free(srcname);
    g_free(sinkname);
    gst_object_unref(sinkpad);
    gst_object_unref(srcpad);

}

 The core reference says one shouldn't use gst_pad_get_name(GstPad *pad), becouse it's not safe, but the pads were succesfully linked, as the request pads too with the proper elements.

Any idea? Thank you in advance.

PS: I attached the pipeline image and my source to have a full view.

Zoli

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

server_prog.tar.gz (161K) Download Attachment