Search code examples
androidstreaminggstreamerrtsprtp

Android Gstreamer SDK 1.4.3 Internal Data Flow Error


I'm trying to run a basic gstreamer rtsp streaming application in Android Kitkat and while doing so getting errors like

basesrc gstbasesrc.c:2933:gst_base_src_loop: error: Internal data flow error. basesrc gstbasesrc.c:2933:gst_base_src_loop: error: streaming task paused, reason not-linked (-1)

From the logs its appears like RTSP communication is happening but RTP streaming is not taking off.

Am using GstreamerSDK 1.4.3. The source code of the application is ...

#include <gst/gst.h>
#include <glib.h>
#include <gio/gio.h>
#include <dlfcn.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>

GST_PLUGIN_STATIC_REGISTER(coreelements);  
GST_PLUGIN_STATIC_REGISTER(adder);
GST_PLUGIN_STATIC_REGISTER(app);
GST_PLUGIN_STATIC_REGISTER(videoconvert);
GST_PLUGIN_STATIC_REGISTER(gdp);
GST_PLUGIN_STATIC_REGISTER(gio);
GST_PLUGIN_STATIC_REGISTER(pango);
GST_PLUGIN_STATIC_REGISTER(typefindfunctions);
GST_PLUGIN_STATIC_REGISTER(videorate);
GST_PLUGIN_STATIC_REGISTER(videoscale);
GST_PLUGIN_STATIC_REGISTER(videotestsrc);
GST_PLUGIN_STATIC_REGISTER(volume);
GST_PLUGIN_STATIC_REGISTER(autodetect);
GST_PLUGIN_STATIC_REGISTER(videofilter);
GST_PLUGIN_STATIC_REGISTER(x264);
GST_PLUGIN_STATIC_REGISTER(libav);
GST_PLUGIN_STATIC_REGISTER(subparse);
GST_PLUGIN_STATIC_REGISTER(auparse);
GST_PLUGIN_STATIC_REGISTER(multipart);
GST_PLUGIN_STATIC_REGISTER(fragmented);
GST_PLUGIN_STATIC_REGISTER(subenc);
GST_PLUGIN_STATIC_REGISTER(videoparsersbad);
GST_PLUGIN_STATIC_REGISTER(androidmedia);
GST_PLUGIN_STATIC_REGISTER(tcp);
GST_PLUGIN_STATIC_REGISTER(rtsp);
GST_PLUGIN_STATIC_REGISTER(rtp);
GST_PLUGIN_STATIC_REGISTER(rtmp);
GST_PLUGIN_STATIC_REGISTER(rtpmanager);
GST_PLUGIN_STATIC_REGISTER(soup);
GST_PLUGIN_STATIC_REGISTER(udp);
GST_PLUGIN_STATIC_REGISTER(dataurisrc);
GST_PLUGIN_STATIC_REGISTER(sdp);

static gboolean
bus_call (GstBus     *bus,
      GstMessage *msg,
      gpointer    data)
{
GMainLoop *loop = (GMainLoop *) data;

switch (GST_MESSAGE_TYPE (msg)) {

case GST_MESSAGE_EOS:
  g_print ("End of stream\n");
  g_main_loop_quit (loop);
  break;

case GST_MESSAGE_ERROR: {
  gchar  *debug;
  GError *error;

  gst_message_parse_error (msg, &error, &debug);
  g_free (debug);

  g_printerr ("Error: %s\n", error->message);
  g_error_free (error);

  g_main_loop_quit (loop);
  break;
}
default:
  break;
}

return TRUE;
}

static void on_pad_added (GstElement *element, GstPad *pad, void *data)
{
GstElement *depay = GST_ELEMENT (data);
GstPad *sinkpad;

g_print ("on_pad_added\n");
sinkpad = gst_element_get_static_pad (depay, "sink");

if(!sinkpad)
  g_print ("error - get static pad on the queue failed\n");

gst_pad_link (pad, sinkpad);
gst_object_unref (sinkpad);
}

/* Listen for element's state change */
static void on_state_changed (GstBus *bus, GstMessage *msg, gpointer user_data)
{
   GstState old_state, new_state, pending_state;
   GstElement* pipeline = (GstElement*)user_data;

   gst_message_parse_state_changed (msg, &old_state, &new_state, &pending_state);

   if(GST_MESSAGE_SRC(msg) == pipeline)
   {
       g_print("Pipeline state changed to %s\n", gst_element_state_get_name(new_state));
   }
}


int main (int   argc,
  char *argv[])
{
   GMainLoop *loop;

   GstElement *pipeline, *source, *parser, *decoder, *conv, *sink, *video_scale,    *decodebin, *depay, *queue, *bin;
   GstBus *bus;
   guint bus_watch_id;
   CustomData *data;
   GSource *bus_source;
   GError *error = NULL;
   pthread_t tid;

   /* Initialisation */
  gst_init (&argc, &argv);

  gst_android_register_static_plugins();

  loop = g_main_loop_new (NULL, FALSE);


  /* Check input arguments */
  if (argc < 2) {
      g_printerr ("Usage: RunPipe <infilepath> \n");
      return -1;
   }

   /* Create gstreamer elements */
   pipeline = gst_pipeline_new ("video-player");
   source   = gst_element_factory_make ("rtspsrc",       "rtspsrc-source");
   depay = gst_element_factory_make ("rtph264depay",       "rtp-depacketizer");
   decoder  = gst_element_factory_make ("avdec_h264",     "h264-decoder");
   sink     = gst_element_factory_make ("filesink", "file-sink");

   if (!pipeline) {
       g_printerr ("pipeline could not be created. Exiting.\n");
       return -1;
   }

   if (!source ) {
       g_printerr ("source could not be created. Exiting.\n");
       return -1;
   }  

   if (!depay ) {
       g_printerr ("depay element could not be created. Exiting.\n");
       return -1;
   }

   if (!decoder) {
       g_printerr ("decoder element could not be created. Exiting.\n");
       return -1;
   }

   if (!sink) {
       g_printerr ("sink element could not be created. Exiting.\n");
       return -1;
   } 


   /* Set up the pipeline */
   /* we set the input filename to the source element */
   g_object_set (G_OBJECT (source), "location", argv[1], NULL);
   g_object_set (G_OBJECT (source), "debug", TRUE, NULL);  
   g_object_set (G_OBJECT (source), "latency", 100, NULL);
   g_object_set (G_OBJECT (source), "protocols", 0x00000005, NULL);  
   g_object_set (G_OBJECT (source), "do-rtcp", TRUE, NULL);  
   g_object_set (G_OBJECT (source), "nat-method", 0, NULL);  

   g_object_set (G_OBJECT (sink), "location", "/data/abc.yuv", NULL);

   g_signal_connect (source , "pad-added", G_CALLBACK (on_pad_added), depay);
   g_signal_connect (depay , "pad-added", G_CALLBACK (on_pad_added), decoder);


   /* we add a message handler */
   bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
   gst_bus_enable_sync_message_emission (bus);
   gst_bus_add_signal_watch (bus);

   g_signal_connect (G_OBJECT (bus), "message::state-changed", (GCallback) on_state_changed, pipeline);

   gst_bin_add_many (GST_BIN (pipeline),
                source, depay, decoder, sink, NULL);

   gst_element_set_state (pipeline, GST_STATE_READY);

   /* we link the elements together */
   gst_element_link_many (decoder, sink, NULL);

   gst_element_set_state (pipeline, GST_STATE_PAUSED);

   /* Set the pipeline to "playing" state*/
   g_print ("Now playing: %s\n", argv[1]);
   gst_element_set_state (pipeline, GST_STATE_PLAYING);

   /* Iterate */
  g_print ("Running...\n");
  g_main_loop_run (loop);


  /* Out of the main loop, clean up nicely */
  g_print ("Returned, stopping playback\n");
  gst_element_set_state (pipeline, GST_STATE_NULL);

  g_print ("Deleting pipeline\n");
  gst_object_unref (bus);
  gst_object_unref (GST_OBJECT (pipeline));

  return 0;
 }

I tried several suggestions but nothing could resolve this issue. Also analysed DOT images but could get any clue. Any help would be highly appreciated. Attaching partial log due to character count constraint.

changed state to 4(PLAYING) successfully
Running...
Pipeline state changed to READY
Pipeline state changed to PAUSED
RTSP request message 0xb2e08be8
 request line:
   method: 'OPTIONS'
   uri:    'rtsp://192.168.0.8:556/can_smallest.mp4'
   version: '1.0'
 headers:
 body:
RTSP response message 0xb2e08c14
 status line:
   code:   '200'
   reason: 'OK'
   version: '1.0'
 headers:
   key: 'CSeq', value: '1'
   key: 'Public', value: 'DESCRIBE'
   key: 'Public', value: 'SETUP'
   key: 'Public', value: 'TEARDOWN'
   key: 'Public', value: 'PLAY'
   key: 'Public', value: 'PAUSE'
   key: 'Public', value: 'OPTIONS'
 body: length 0
RTSP request message 0xb2e08be8
 request line:
   method: 'DESCRIBE'
   uri:    'rtsp://192.168.0.8:556/can_smallest.mp4'
   version: '1.0'
 headers:
   key: 'Accept', value: 'application/sdp'
 body:
RTSP response message 0xb2e08c14
 status line:
   code:   '200'
   reason: 'OK'
   version: '1.0'
 headers:
   key: 'Server', value: 'testserver'
   key: 'CSeq', value: '2'
   key: 'Last-Modified', value: 'Mon, 28 Feb 2005 12:29:26 GMT'
   key: 'Content-Length', value: '464'
   key: 'Date', value: 'Wed, 21 Feb 2007 05:40:13 GMT'
   key: 'Expires', value: 'Wed, 21 Feb 2007 05:40:13 GMT'
   key: 'Content-Type', value: 'application/sdp'
   key: 'Content-Base', value: 'rtsp://192.168.0.8:556/can_smallest.mp4'
 body: length 465
                                        .               
sdp packet 0xb8a475b0:
 version:       '0'
 origin:
  username:     'teststreamingserver'
  sess_id:      '2001'
  sess_version: '2005'
  nettype:      'IN'
  addrtype:     'IP4'
  addr:         ''
 session_name:  '\can_smallest.mp4'
 information:   '(NULL)'
 uri:           'http://example.com'
 emails:
  email 'last.first@example.com'
 phones:
  phone '123-456-789'
 connection:
  nettype:      'IN'
  addrtype:     'IP4'
  address:      ''
  ttl:          '0'
  addr_number:  '0'
 bandwidths:
  type:         'AS'
  bandwidth:    '50'
 key:
  type:         '(NULL)'
  data:         '(NULL)'
 attributes:
  attribute 'control' : '*'
  attribute 'range' : 'npt=0.000000-39.681999'
 medias:
  media 0:
   media:       'video'
   port:        '0'
   num_ports:   '0'
   proto:       'RTP/AVP'
   formats:
    format  '96'
   information: '(NULL)'
   bandwidths:
    type:         'AS'
    bandwidth:    '2097151'
   key:
    type:       '(NULL)'
    data:       '(NULL)'
   attributes:
    attribute 'control' : 'rtsp://192.168.0.8:556/can_smallest.mp4/trackID=1'
    attribute 'rtpmap' : '96 H264/90000'
    attribute 'framesize' : '96 32-24'
    attribute 'fmtp' : '96 packetization-mode=1;profile-level-id=676400;sprop-parameter-sets=Z2QACazZSX5cBEAAAAMAQAAADCPEiWWA,aOvssiw='
0:00:00.391975105   INFO     GST_ELEMENT_FACTORY gstelementfactory.c:364:gst_element_factory_create: creating element "udpsrc"
0:00:00.392144844   INFO        GST_ELEMENT_PADS gstelement.c:643:gst_element_add_pad:<GstBaseSrc@0xb8a48170> adding pad 'src'
0:00:00.392450782   INFO                  udpsrc gstudpsrc.c:898:gst_udpsrc_open:<udpsrc0> setting udp buffer of 524288 bytes
0:00:00.392521563   INFO                  udpsrc gstudpsrc.c:918:gst_udpsrc_open:<udpsrc0> have udp buffer of 1048576 bytes
0:00:00.392647136   INFO              GST_STATES gstelement.c:2328:gst_element_continue_state:<udpsrc0> completed state change to READY
0:00:00.392713907   INFO              GST_STATES gstelement.c:2233:_priv_gst_element_state_changed:<udpsrc0> notifying about state-changed NULL to READY (VOID_PENDING pending)
0:00:00.392899219   INFO     GST_ELEMENT_FACTORY gstelementfactory.c:364:gst_element_factory_create: creating element "udpsrc"
0:00:00.393008073   INFO        GST_ELEMENT_PADS gstelement.c:643:gst_element_add_pad:<GstBaseSrc@0xb8a48428> adding pad 'src'
0:00:00.393262865   INFO                  udpsrc gstudpsrc.c:918:gst_udpsrc_open:<udpsrc1> have udp buffer of 163840 bytes
0:00:00.393381250   INFO              GST_STATES gstelement.c:2328:gst_element_continue_state:<udpsrc1> completed state change to READY
0:00:00.393451042   INFO              GST_STATES gstelement.c:2233:_priv_gst_element_state_changed:<udpsrc1> notifying about state-changed NULL to READY (VOID_PENDING pending)
RTSP request message 0xb2e08bbc
 request line:
   method: 'SETUP'
   uri:    'rtsp://192.168.0.8:556/can_smallest.mp4/trackID=1'
   version: '1.0'
 headers:
   key: 'Transport', value: 'RTP/AVP;unicast;client_port=43198-43199'
 body:
RTSP response message 0xb2e08be8
 status line:
   code:   '200'
   reason: 'OK'
   version: '1.0'
 headers:
   key: 'Server', value: 'testserver'
   key: 'CSeq', value: '3'
   key: 'Last-Modified', value: 'Mon, 28 Feb 2005 12:29:26 GMT'
   key: 'Cache-Control', value: 'must-revalidate'
   key: 'Session', value: '20007ac820007ac8'
   key: 'Date', value: 'Wed, 21 Feb 2007 05:40:13 GMT'
   key: 'Expires', value: 'Wed, 21 Feb 2007 05:40:13 GMT'
   key: 'Transport', value: 'RTP/AVP/UDP;unicast;source=;client_port=-22338--22337;server_port=4000-4001;ssrc=0000181C'
 body: length 0
0:00:00.423977500   INFO     GST_ELEMENT_FACTORY gstelementfactory.c:362:gst_element_factory_create: creating element "rtpbin" named "manager"
0:00:00.424180938   INFO              GST_STATES gstelement.c:2303:gst_element_continue_state:<manager> committing state from NULL to READY, pending PAUSED, next PAUSED
0:00:00.424255782   INFO              GST_STATES gstelement.c:2233:_priv_gst_element_state_changed:<manager> notifying about state-changed NULL to READY (PAUSED pending)
0:00:00.424420418   INFO              GST_STATES gstelement.c:2310:gst_element_continue_state:<manager> continue state change READY to PAUSED, final PAUSED
0:00:00.424506980   INFO              GST_STATES gstelement.c:2328:gst_element_continue_state:<manager> completed state change to PAUSED
0:00:00.424570209   INFO              GST_STATES gstelement.c:2233:_priv_gst_element_state_changed:<manager> notifying about state-changed READY to PAUSED (VOID_PENDING pending)
0:00:00.424837136   INFO        GST_ELEMENT_PADS gstelement.c:892:gst_element_get_static_pad: no such pad 'recv_rtp_sink_0' in element "manager"
0:00:00.424917397   INFO     GST_ELEMENT_FACTORY gstelementfactory.c:364:gst_element_factory_create: creating element "rtpsession"
0:00:00.425484324   INFO     GST_ELEMENT_FACTORY gstelementfactory.c:364:gst_element_factory_create: creating element "rtpssrcdemux"
0:00:00.425606303   INFO        GST_ELEMENT_PADS gstelement.c:643:gst_element_add_pad:<GstRtpSsrcDemux@0xb8a51010> adding pad 'sink'
0:00:00.425712293   INFO        GST_ELEMENT_PADS gstelement.c:643:gst_element_add_pad:<GstRtpSsrcDemux@0xb8a51010> adding pad 'rtcp_sink'
0:00:00.425938855   INFO              GST_STATES gstelement.c:2303:gst_element_continue_state:<rtpssrcdemux0> committing state from NULL to READY, pending PAUSED, next PAUSED
0:00:00.426012136   INFO              GST_STATES gstelement.c:2233:_priv_gst_element_state_changed:<rtpssrcdemux0> notifying about state-changed NULL to READY (PAUSED pending)
0:00:00.426165157   INFO              GST_STATES gstelement.c:2310:gst_element_continue_state:<rtpssrcdemux0> continue state change READY to PAUSED, final PAUSED
0:00:00.426247032   INFO              GST_STATES gstelement.c:2328:gst_element_continue_state:<rtpssrcdemux0> completed state change to PAUSED
0:00:00.426313074   INFO              GST_STATES gstelement.c:2233:_priv_gst_element_state_changed:<rtpssrcdemux0> notifying about state-changed READY to PAUSED (VOID_PENDING pending)
0:00:00.426459376   INFO              GST_STATES gstelement.c:2303:gst_element_continue_state:<rtpsession0> committing state from NULL to READY, pending PAUSED, next PAUSED
0:00:00.426528699   INFO              GST_STATES gstelement.c:2233:_priv_gst_element_state_changed:<rtpsession0> notifying about state-changed NULL to READY (PAUSED pending)
0:00:00.426668126   INFO              GST_STATES gstelement.c:2310:gst_element_continue_state:<rtpsession0> continue state change READY to PAUSED, final PAUSED
0:00:00.426740105   INFO              GST_STATES gstelement.c:2328:gst_element_continue_state:<rtpsession0> completed state change to PAUSED
0:00:00.426802032   INFO              GST_STATES gstelement.c:2233:_priv_gst_element_state_changed:<rtpsession0> notifying about state-changed READY to PAUSED (VOID_PENDING pending)
0:00:00.426944584   INFO        GST_ELEMENT_PADS gstelement.c:892:gst_element_get_static_pad: no such pad 'recv_rtp_sink' in element "rtpsession0"
0:00:00.427094011   INFO        GST_ELEMENT_PADS gstelement.c:643:gst_element_add_pad:<rtpsession0> adding pad 'recv_rtp_sink'
0:00:00.427231824   INFO        GST_ELEMENT_PADS gstelement.c:643:gst_element_add_pad:<rtpsession0> adding pad 'recv_rtp_src'
0:00:00.427505834   INFO                GST_PADS gstpad.c:2186:gst_pad_link_prepare: trying to link recv_rtp_sink_0:proxypad0 and rtpsession0:recv_rtp_sink
0:00:00.427583490   INFO                GST_PADS gstpad.c:2388:gst_pad_link_full: linked recv_rtp_sink_0:proxypad0 and rtpsession0:recv_rtp_sink, successful
0:00:00.427651199   INFO               GST_EVENT gstevent.c:1373:gst_event_new_reconfigure: creating reconfigure event
0:00:00.427740834   INFO        GST_ELEMENT_PADS gstelement.c:643:gst_element_add_pad:<manager> adding pad 'recv_rtp_sink_0'
0:00:00.427815001   INFO        GST_ELEMENT_PADS gstelement.c:895:gst_element_get_static_pad: found pad rtpsession0:recv_rtp_src
0:00:00.427887345   INFO        GST_ELEMENT_PADS gstelement.c:895:gst_element_get_static_pad: found pad rtpssrcdemux0:sink
0:00:00.427966876   INFO                GST_PADS gstpad.c:2186:gst_pad_link_prepare: trying to link rtpsession0:recv_rtp_src and rtpssrcdemux0:sink
0:00:00.428036355   INFO                GST_PADS gstpad.c:2388:gst_pad_link_full: linked rtpsession0:recv_rtp_src and rtpssrcdemux0:sink, successful
0:00:00.428108595   INFO               GST_EVENT gstevent.c:1373:gst_event_new_reconfigure: creating reconfigure event

0:00:40.562537627   INFO               GST_EVENT gstevent.c:759:gst_event_new_segment: creating segment event time segment start=0:00:00.000000000, offset=0:00:00.000000000, stop=99:99:99.999999999, rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:00.000000000, base=0:00:00.000000000, position 0:00:00.000000000, duration     0:00:39.681999000
RTSP request message 0xb2e08bec
 request line:
   method: 'PLAY'
   uri:    'rtsp://192.168.0.8:556/can_smallest.mp4'
   version: '1.0'
 headers:
   key: 'Range', value: 'npt=0-'
 body:
0:00:40.564684015 16036 0xb8a468f0 INFO        GST_ELEMENT_PADS gstelement.c:892:gst_element_get_static_pad: no such pad 'sink' in element "udpsrc1"
0:00:40.565839765 16036 0xb8a468f0 INFO               GST_EVENT gstevent.c:678:gst_event_new_caps: creating caps event application/x-rtcp
RTSP response message 0xb2e08c18
 status line:
   code:   '200'
   reason: 'OK'
   version: '1.0'
 headers:
   key: 'CSeq', value: '4'
   key: 'Server', value: 'testserv'
   key: 'Session', value: '20007ac820007ac8'
   key: 'Scale', value: '-0.000000'
   key: 'Range', value: 'npt=0.000000-1.000000'
   key: 'RTP-Info', value: 'url=rtsp://192.168.0.8:556/can_smallest.mp4/trackID=1;seq=5103;rtptime=1777208127'
 body: length 0
0:00:42.038357285 16036 0xb8a46890 INFO               GST_EVENT gstevent.c:678:gst_event_new_caps: creating caps event application/x-rtcp
0:00:42.039331595 16036 0xb8a46890 INFO               GST_EVENT gstevent.c:759:gst_event_new_segment: creating segment event time segment start=0:00:00.000000000, offset=0:00:00.000000000, stop=99:99:99.999999999, rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:00.000000000, base=0:00:00.000000000, position 0:00:00.000000000, duration 99:99:99.999999999
0:00:45.566325490   INFO              GST_STATES gstbin.c:2230:gst_bin_element_set_state:<rtpssrcdemux0> current PLAYING pending VOID_PENDING, desired next PAUSED
0:00:45.566720775   INFO              GST_STATES gstelement.c:2328:gst_element_continue_state:<rtpssrcdemux0> completed state change to PAUSED
0:00:45.567005614   INFO              GST_STATES gstelement.c:2233:_priv_gst_element_state_changed:<rtpssrcdemux0> notifying about state-changed PLAYING to PAUSED (VOID_PENDING pending)
0:00:45.567820502   INFO              GST_STATES gstbin.c:2673:gst_bin_change_state_func:<manager> child 'rtpssrcdemux0' changed state to 3(PAUSED) successfully
0:00:45.568193813   INFO              GST_STATES gstbin.c:2230:gst_bin_element_set_state:<rtpsession0> current PLAYING pending VOID_PENDING, desired next PAUSED
0:00:45.568813272   INFO              GST_STATES gstelement.c:2328:gst_element_continue_state:<rtpsession0> completed state change to PAUSED
0:00:45.569093215   INFO              GST_STATES gstelement.c:2233:_priv_gst_element_state_changed:<rtpsession0> notifying about state-changed PLAYING to PAUSED (VOID_PENDING pending)
0:00:45.570539383   INFO              GST_STATES gstbin.c:2673:gst_bin_change_state_func:<manager> child 'rtpsession0' changed state to 3(PAUSED) successfully
0:00:45.570889730   INFO              GST_STATES gstelement.c:2303:gst_element_continue_state:<manager> committing state from PLAYING to PAUSED, pending READY, next READY
0:00:45.571186285   INFO              GST_STATES gstelement.c:2233:_priv_gst_element_state_changed:<manager> notifying about state-changed PLAYING to PAUSED (READY pending)
0:00:45.572885735   INFO              GST_STATES gstelement.c:2310:gst_element_continue_state:<manager> continue state change PAUSED to READY, final READY
0:00:45.574231298   INFO              GST_STATES gstbin.c:2230:gst_bin_element_set_state:<rtpssrcdemux0> current PAUSED pending VOID_PENDING, desired next READY
0:00:45.574915390   INFO              GST_STATES gstelement.c:2328:gst_element_continue_state:<rtpssrcdemux0> completed state change to READY
0:00:45.575195860   INFO              GST_STATES gstelement.c:2233:_priv_gst_element_state_changed:<rtpssrcdemux0> notifying about state-changed PAUSED to READY (VOID_PENDING pending)
0:00:45.577369370   INFO              GST_STATES gstbin.c:2673:gst_bin_change_state_func:<manager> child 'rtpssrcdemux0' changed state to 2(READY) successfully
0:00:45.579579801   INFO              GST_STATES gstbin.c:2230:gst_bin_element_set_state:<rtpsession0> current PAUSED pending VOID_PENDING, desired next READY
0:00:45.583540695   INFO              GST_STATES gstelement.c:2328:gst_element_continue_state:<rtpsession0> completed state change to READY
0:00:45.585652339   INFO              GST_STATES gstelement.c:2233:_priv_gst_element_state_changed:<rtpsession0> notifying about state-changed PAUSED to READY (VOID_PENDING pending)
0:00:45.589310404   INFO              GST_STATES gstbin.c:2673:gst_bin_change_state_func:<manager> child 'rtpsession0' changed state to 2(READY) successfully
0:00:45.592431046   INFO              GST_STATES gstelement.c:2328:gst_element_continue_state:<manager> completed state change to READY
0:00:45.595299608   INFO              GST_STATES gstelement.c:2233:_priv_gst_element_state_changed:<manager> notifying about state-changed PAUSED to READY (VOID_PENDING pending)
0:00:45.598642573 16036 0xb8a468c0 INFO                 basesrc gstbasesrc.c:2724:gst_base_src_loop:<udpsrc0> pausing after gst_base_src_get_range() = flushing
0:00:45.598998830 16036 0xb8a468c0 INFO                    task gsttask.c:301:gst_task_func:<udpsrc0:src> Task going to paused
0:00:45.600470312   INFO              GST_STATES gstelement.c:2303:gst_element_continue_state:<udpsrc0> committing state from PLAYING to PAUSED, pending READY, next READY
0:00:45.602734506   INFO              GST_STATES gstelement.c:2233:_priv_gst_element_state_changed:<udpsrc0> notifying about state-changed PLAYING to PAUSED (READY pending)
0:00:45.604942723   INFO              GST_STATES gstelement.c:2310:gst_element_continue_state:<udpsrc0> continue state change PAUSED to READY, final READY
0:00:45.606568784 16036 0xb8a468c0 INFO                    task gsttask.c:303:gst_task_func:<udpsrc0:src> Task resume from paused
0:00:45.607717244   INFO              GST_STATES gstelement.c:2328:gst_element_continue_state:<udpsrc0> completed state change to READY
0:00:45.608986680   INFO              GST_STATES gstelement.c:2233:_priv_gst_element_state_changed:<udpsrc0> notifying about state-changed PAUSED to READY (VOID_PENDING pending)
0:00:45.611940554 16036 0xb8a468f0 INFO                 basesrc gstbasesrc.c:2724:gst_base_src_loop:<udpsrc1> pausing after gst_base_src_get_range() = flushing
0:00:45.612250362 16036 0xb8a468f0 INFO                    task gsttask.c:301:gst_task_func:<udpsrc1:src> Task going to paused
0:00:45.612590479   INFO              GST_STATES gstelement.c:2303:gst_element_continue_state:<udpsrc1> committing state from PLAYING to PAUSED, pending READY, next READY
0:00:45.614020729   INFO              GST_STATES gstelement.c:2233:_priv_gst_element_state_changed:<udpsrc1> notifying about state-changed PLAYING to PAUSED (READY pending)
0:00:45.617100318   INFO              GST_STATES gstelement.c:2310:gst_element_continue_state:<udpsrc1> continue state change PAUSED to READY, final READY
0:00:45.619118298 16036 0xb8a468f0 INFO                    task gsttask.c:303:gst_task_func:<udpsrc1:src> Task resume from paused
0:00:45.619331663   INFO              GST_STATES gstelement.c:2328:gst_element_continue_state:<udpsrc1> completed state change to READY
0:00:45.619586169   INFO              GST_STATES gstelement.c:2233:_priv_gst_element_state_changed:<udpsrc1> notifying about state-changed PAUSED to READY (VOID_PENDING pending)

RTSP request message 0xb2e08c18
 request line:
   method: 'TEARDOWN'
   uri:    'rtsp://192.168.0.8:556/can_smallest.mp4'
   version: '1.0'
 headers:
 body:
RTSP response message 0xb2e08c44
 status line:
   code:   '200'
   reason: 'OK'
   version: '1.0'
 headers:
   key: 'CSeq', value: '5'
   key: 'Server', value: 'testserv'
   key: 'Session', value: '20007ac820007ac8'
   key: 'Connection', value: 'Close'
 body: length 0
0:00:45.633186296   INFO              GST_STATES gstelement.c:2328:gst_element_continue_state:<udpsrc0> completed state change to NULL
0:00:45.633262019   INFO              GST_STATES gstelement.c:2233:_priv_gst_element_state_changed:<udpsrc0> notifying about state-changed READY to NULL (VOID_PENDING pending)

0:00:45.650815163   INFO           GST_PARENTAGE gstbin.c:1554:gst_bin_remove_func:<manager> removed child "rtpsession0"
0:00:45.651069523   INFO         GST_REFCOUNTING gstelement.c:2873:gst_element_dispose:<rtpsession0> dispose
0:00:45.651315133   INFO         GST_REFCOUNTING gstelement.c:2917:gst_element_dispose:
0:00:45.655121646   INFO         GST_REFCOUNTING gstelement.c:2953:gst_element_finalize:<manager> finalize parent
0:00:45.655418127   WARN                 rtspsrc gstrtspsrc.c:4847:gst_rtspsrc_reconnect:<rtspsrc-source> warning: Could not receive any UDP packets for 5.0000 seconds, maybe your firewall is blocking it. Retrying using a TCP connection.
0:00:45.655915943   INFO        GST_ERROR_SYSTEM gstelement.c:1835:gst_element_message_full:<rtspsrc-source> posting message: Could not read from resource.
0:00:45.656420217   INFO        GST_ERROR_SYSTEM gstelement.c:1858:gst_element_message_full:<rtspsrc-source> posted warning message: Could not read from resource.
0:01:05.678280907   ERROR                default gstrtspconnection.c:877:gst_rtsp_connection_connect: failed to connect: Could not connect to 192.168.0.8: Socket I/O timed out
0:01:05.678675900   ERROR                rtspsrc gstrtspsrc.c:4196:gst_rtsp_conninfo_connect:<rtspsrc-source> Could not connect to server. (Generic error)
0:01:05.678974905   WARN                 rtspsrc gstrtspsrc.c:6858:gst_rtspsrc_retrieve_sdp:<rtspsrc-source> error: Failed to connect. (Generic error)
0:01:05.679482655   INFO        GST_ERROR_SYSTEM gstelement.c:1835:gst_element_message_full:<rtspsrc-source> posting message: Could not open resource for reading and writing.
0:01:05.680319462   INFO        GST_ERROR_SYSTEM gstelement.c:1858:gst_element_message_full:<rtspsrc-source> posted error message: Could not open resource for reading and writing.
0:01:05.680756433   WARN                 rtspsrc gstrtspsrc.c:6937:gst_rtspsrc_open:<rtspsrc-source> can't get sdp
0:01:05.681004918   WARN                 rtspsrc gstrtspsrc.c:5040:gst_rtspsrc_loop:<rtspsrc-source> we are not connected
0:01:05.681261319   INFO                    task gsttask.c:301:gst_task_func:<task0> Task going to paused

Solution

  •  g_signal_connect (depay , "pad-added", G_CALLBACK (on_pad_added), decoder);
    

    The depayloader has static pads so you won't get any pads added during playback. Instead you should just link it just like the decoder and sink. You can check the type of pads using gst-inspect-1.0 .

    As you don't link the depayloader you end up with a not-linked error.