[gst-devel] simple rtp application

Zoltan Seress gatesofdarkness at gmail.com
Mon Jul 7 15:57:47 CEST 2008


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20080707/20ba7ffc/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: server_prog.tar.gz
Type: application/x-gzip
Size: 121073 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20080707/20ba7ffc/attachment.bin>


More information about the gstreamer-devel mailing list