How to get the src pad for rtspsrc

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU)
• DeepStream Version
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs)
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

When I am using the uridecodebin in deepstream-test3-app

If I play with a local mp4 files, I can find uridecodebin will use below child element
Decodebin child added: source
Decodebin child added: decodebin0
Decodebin child added: multiqueue0
Decodebin child added: h264parse0
Decodebin child added: capsfilter0
Decodebin child added: nvv4l2decoder0

If I play with rtsp stream, I can find uridecodebin will use below child element
Decodebin child added: source
Decodebin child added: decodebin0
Decodebin child added: rtph264depay0
Decodebin child added: h264parse0
Decodebin child added: capsfilter0
Decodebin child added: nvv4l2decoder0

And I feel that source element is different. And I guess for rtsp, the source element is rtspsrc.

And then I want to add prob for this rtspsrc. But it doesn’t work. I do really need to get the location during runtime.

      GstPad* source_end_pad = gst_element_get_static_pad (GST_ELEMENT(object), "src");
      if(!source_end_pad)
      {
      	g_print("This is rtspsrc\n");
      	source_end_pad = gst_element_get_request_pad (GST_ELEMENT(object), "stream_0");
      	if(!source_end_pad){
      		g_print("Can't get source_end_pad from both rtspsrc and src\n");
      	}else{
      		g_printerr("source_end_pad from rtspsrc\n");
      	}
      	g_object_set(G_OBJECT(object),"drop-on-latency",true,NULL);
      	gst_pad_add_probe (source_end_pad, GST_PAD_PROBE_TYPE_BUFFER,rtspsrc_end_pad_probe, object, NULL);
      }else{
      	gst_pad_add_probe (source_end_pad, GST_PAD_PROBE_TYPE_BUFFER,source_end_pad_probe, object, NULL);
      }

	    gst_object_unref (source_end_pad);

You can refer to the source code in deepstream_test_3.

static void
decodebin_child_added (GstChildProxy * child_proxy, GObject * object,
    gchar * name, gpointer user_data)
{
  g_print ("Decodebin child added: %s\n", name);
  if (g_strrstr (name, "decodebin") == name) {
    g_signal_connect (G_OBJECT (object), "child-added",
        G_CALLBACK (decodebin_child_added), user_data);
  }
  if (g_strrstr (name, "source") == name) {
        //this object is rtspsrc plugin
        g_object_set(G_OBJECT(object),"drop-on-latency",true,NULL);
  }

}

I want to add a prob for this rtsp object, how shall I do this?
Because I can’t get pad from rtsp object.

For example, if this object is filesrc, I can add prob as below

GstPad* source_end_pad = gst_element_get_static_pad (GST_ELEMENT(object), "src");
gst_pad_add_probe (source_end_pad, GST_PAD_PROBE_TYPE_BUFFER,source_end_pad_probe, object, NULL);

But for rtspsrc, I can’t get the static pad.

The pad of rtsp source is like below, not “src”. You can try to change the parameter to stream_0.

Pad Templates:
  SRC template: 'stream_%u'
    Availability: Sometimes
    Capabilities:
      application/x-rtp
      application/x-rdt

I also tried stream_0 and I even try to iterator pad for this rtspsrc. Nothing I can get. It’s so wired.

Rtspsrc plugin is a bin element. You need to find the specific plugin from the pipeline and add the probe to that plugin. Please refer to our FAQ to get the graph of the pipeline.