properly closing dynamically created rtspsrc ! rtph264depay link

Joona Laine joonarlaine at gmail.com
Tue Jul 12 06:56:53 UTC 2016


Hi,

I'm having a problem with dynamically linked elements. My pipeline is 

gst-launch-1.0 rtspsrc
location=rtsp://root:root@10.128.1.88/axis-media/media.amp?videocodec=h264
latency=0 ! rtph264depay ! h264parse ! queue ! vaapidecode ! glimagesink

When closing the pipeline I get the following debug messages (GST_DEBUG=3):

Execution ended after 0:00:02.282472788
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
0:00:02.913797906  6077      0x1c07320 WARN                 rtspsrc
gstrtspsrc.c:5477:gst_rtspsrc_try_send:<rtspsrc0> receive interrupted
0:00:02.913841639  6077      0x1c07320 WARN                 rtspsrc
gstrtspsrc.c:7500:gst_rtspsrc_pause:<rtspsrc0> PAUSE interrupted
0:00:02.922788913  6077      0x1c07320 WARN                 rtspsrc
gstrtspsrc.c:5477:gst_rtspsrc_try_send:<rtspsrc0> receive interrupted
0:00:02.922838980  6077      0x1c07320 WARN                 rtspsrc
gstrtspsrc.c:6971:gst_rtspsrc_close:<rtspsrc0> TEARDOWN interrupted
Freeing pipeline ...

Otherwise this wouldn't bother me, but I'm making an application that
changes the camera source quite frequently. This behavior causes the
application to crash (actually the whole machine crashes) after a while it
has been changing the rtsp streams. The dynamic pad linking happens in the
following way:

static void onPadAdded(GstElement *element, GstPad *pad, gpointer data)
{
    gchar *name;

    name = gst_pad_get_name(pad);
    g_print("A new pad %s was created\n", name);

    // here, you would setup a new pad link for the newly created pad
    // sooo, now find that rtph264depay is needed and link them?
    GstCaps * p_caps = gst_pad_get_pad_template_caps (pad);

    gchar * description = gst_caps_to_string(p_caps);

    g_print("Caps, %s .\n", description);
//    std::cout << p_caps << ", " << description << std::endl;
    g_free(description);

    GstElement *depay = GST_ELEMENT(data);

    // try to link the pads then ...
    if(gst_element_link_pads(element, name, depay, "sink") == 0)
    {
        g_print("cb_new_rtspsrc_pad : failed to link elements \n");
    }

    g_free(name);
}

Never mind the comments, it's copied and modified from some forum. 

My question is that am I doing the linking correctly? The same debug
messages can be seen using just the gst-launch pipeline.

Thanks,

Joona

PS.
I'll post a runnable example as a reply.



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/properly-closing-dynamically-created-rtspsrc-rtph264depay-link-tp4678624.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list