i still didnt the teste, but i found this<br><br><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad-plugins/html/gst-plugins-bad-plugins-gstrtpssrcdemux.html#GstRtpSsrcDemux-new-ssrc-pad">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad-plugins/html/gst-plugins-bad-plugins-gstrtpssrcdemux.html#GstRtpSsrcDemux-new-ssrc-pad</a><br>
<br>the GstRtpSsrcDemux sends the signal, i tried to get the signal from the bin with:<br><br>g_signal_connect (rtp_bin, &quot;new-ssrc-pad&quot;, G_CALLBACK (on_new_ssrc_pad), rtp_decoder);<br><br>but i didnt got the signal.<br>
<br>My question is, i can get the signal from an element inside the bin from the bin or i have to retrieve the element from the bin and then connect? and if i have to get the element from the bin (in this case the GstRtpSsrcDemux),  how is the cleanest way of doing this?<br>
<br>thanks for all the help.<br>Best regards,<br>Katcipis<br><br>here goes the src:<br><br>#include &lt;gst/gst.h&gt;<br>#include &lt;glib.h&gt;<br><br>#define PORTA_UDP_ENTRADA 5000<br><br>static gboolean<br>bus_call (GstBus     *bus,<br>
          GstMessage *msg,<br>          gpointer    data)<br>{<br>  GMainLoop *loop = (GMainLoop *) data;<br><br>  switch (GST_MESSAGE_TYPE (msg)) {<br><br>    case GST_MESSAGE_EOS:<br>      g_print (&quot;End of stream\n&quot;);<br>
      g_main_loop_quit (loop);<br>      break;<br><br>    case GST_MESSAGE_ERROR: {<br>      gchar  *debug;<br>      GError *error;<br><br>      gst_message_parse_error (msg, &amp;error, &amp;debug);<br>      g_free (debug);<br>
<br>      g_printerr (&quot;Error: %s\n&quot;, error-&gt;message);<br>      g_error_free (error);<br><br>      g_main_loop_quit (loop);<br>      break;<br>    }<br>    default:<br>      g_print(&quot;Tipo da mensagem [%d], Nome da mensagem [%s]\n&quot;, GST_MESSAGE_TYPE (msg), GST_MESSAGE_TYPE_NAME(msg));<br>
      break;<br>  }<br><br>  return TRUE;<br>}<br><br><br>static void<br>on_new_ssrc (GstElement* gstrtpbin,<br>                   guint session,<br>                   guint ssrc,<br>                   gpointer data)<br>{<br>
  GstPad* sinkpad;<br>  GstPad* srcpad[1];<br>  GstElement* decoder = (GstElement *) data;<br>  GstIterator* iter;<br>  gint done, linked, iter_count;<br><br>  g_print (&quot;New session stabilished, linking gstrtpbin session src pad to the rtp_decoder\n&quot;);<br>
<br>  sinkpad = gst_element_get_static_pad(decoder, &quot;sink&quot;);<br>  // TODO Esta dificil de pegar o pad src do gstrtpbin que eh criado ao iniciar uma sessao nova.<br>  if(!sinkpad){<br>      g_warning(&quot;Error getting rtp_decoder sink pad&quot;);<br>
      return;<br>  }<br>  /* <br>     unique pad recv_rtp_src_%d_%d_%d on gstrtpbin with the session number, SSRC and payload type respectively as the pad name.<br>     <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad-plugins/html/gst-plugins-bad-plugins-gstrtpbin.html">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad-plugins/html/gst-plugins-bad-plugins-gstrtpbin.html</a><br>
  */<br>  <br>  iter = gst_element_iterate_src_pads(gstrtpbin);<br>  if(!iter){<br>      g_warning(&quot;Error getting gstrtpbin pads iterator&quot;);<br>      return;<br>  }<br><br>  done = FALSE;<br>  linked = FALSE;<br>
  iter_count = 0;<br><br>  while (!done) {<br>      switch (gst_iterator_next (iter, (gpointer *) srcpad)) {<br>          case GST_ITERATOR_OK:<br>              if(gst_pad_link (*srcpad, sinkpad) != GST_PAD_LINK_OK){<br>                  g_warning(&quot;Error linking gstrtpbin pad[%s] to rtp_decoder pad[%s]&quot;, gst_pad_get_name(*srcpad), gst_pad_get_name(sinkpad));<br>
              }else{<br>                  g_warning(&quot;Linked gstrtpbin pad[%s] to rtp_decoder pad[%s] with success&quot;, gst_pad_get_name(*srcpad), gst_pad_get_name(sinkpad));<br>                  linked = TRUE;<br>              }<br>
              iter_count++;<br>              gst_object_unref (*srcpad);<br>          break;<br>          case GST_ITERATOR_RESYNC:<br>              gst_iterator_resync (iter);<br>          break;<br>          case GST_ITERATOR_ERROR:<br>
              done = TRUE;<br>          break;<br>          case GST_ITERATOR_DONE:<br>              done = TRUE;<br>          break;<br>      }<br>   }<br>  if(!linked){<br>      g_warning(&quot;failed to found a valid recv_src_pad on gstrtpbin&quot;);<br>
  }<br>  g_debug(&quot;GstRtpBin has [%d] src pads&quot;, iter_count);<br><br>  gst_iterator_free (iter);<br>  gst_object_unref (sinkpad);<br>}<br><br>static void<br>on_new_ssrc_pad (GstElement *element,<br>                 GstPad     *pad,<br>
                 guint      ssrc,<br>                 gpointer   data)<br>{<br>  GstPad *sinkpad;<br>  GstElement *decoder = (GstElement *) data;<br><br>  /* We can now link this pad with the converter sink pad */<br>  g_print (&quot;Dynamic ssrc pad created, linking the pad to the rtp_decoder\n&quot;);<br>
<br>  sinkpad = gst_element_get_static_pad (decoder, &quot;sink&quot;);<br>  if(gst_pad_link (pad, sinkpad) != GST_PAD_LINK_OK){<br>      gchar* name = gst_pad_get_name(pad);<br>      g_warning(&quot;Error linking the pad[%s] to rtp_decoder sinkpad&quot;, name);<br>
      g_free(name);<br>  }<br><br>  gst_object_unref (sinkpad);<br>}<br><br>int<br>main (int   argc,<br>      char *argv[])<br>{<br>  GMainLoop *loop;<br><br>  GstElement *pipeline, *source, *rtp_bin, *rtp_decoder, *sink;<br>
  GstPad *gstrtp_sink_pad;<br>  GstBus *bus;<br><br>  /* Initialisation */<br>  gst_init (&amp;argc, &amp;argv);<br><br>  loop = g_main_loop_new (NULL, FALSE);<br><br>  /* Create gstreamer elements */<br>  pipeline    = gst_pipeline_new (&quot;audio-player&quot;);<br>
  source      = gst_element_factory_make (&quot;udpsrc&quot;,&quot;udp-source&quot;);<br>  rtp_bin     = gst_element_factory_make (&quot;gstrtpbin&quot;, &quot;gst_rtpbin&quot;);<br>  rtp_decoder = gst_element_factory_make (&quot;rtpL16depay&quot;, &quot;rtp_decoder&quot;);<br>
  sink        = gst_element_factory_make (&quot;filesink&quot;, &quot;file-sink&quot;);<br><br>  if (!pipeline || !source || !sink || !rtp_decoder || !rtp_bin) {<br>    g_printerr (&quot;One element could not be created. Exiting.\n&quot;);<br>
    return -1;<br>  }<br><br>  gstrtp_sink_pad = gst_element_get_request_pad(rtp_bin, &quot;recv_rtp_sink_0&quot;);<br>  if (!gstrtp_sink_pad) {<br>    g_printerr (&quot;Sink pad could not be created. Exiting.\n&quot;);<br>
    return -1;<br>  }<br> <br>  /* Set up the pipeline */<br>  g_object_set (G_OBJECT (source), &quot;port&quot;, PORTA_UDP_ENTRADA , NULL);<br>  g_object_set (G_OBJECT (sink), &quot;location&quot;, &quot;dados_recebidos_rtp&quot; , NULL);<br>
<br>  /* we add a message handler */<br>  bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));<br>  gst_bus_add_watch (bus, bus_call, loop);<br>  gst_object_unref (bus);<br><br>  /* we add all elements into the pipeline */<br>
  /* file-source | ogg-demuxer | vorbis-decoder | converter | alsa-output */<br>  gst_bin_add_many (GST_BIN (pipeline),<br>                    source, sink, rtp_bin, rtp_decoder, NULL);<br><br>  /* we link the elements together */<br>
  if(gst_pad_link(gst_element_get_static_pad(source, &quot;src&quot;), gstrtp_sink_pad) != GST_PAD_LINK_OK){<br>      g_warning(&quot;Error linking source to the gstrtp_sink_pad&quot;);<br>      gst_object_unref (GST_OBJECT (pipeline));<br>
      return 0;<br>  }<br>  <br>  /* <br>    After the packets are released from the jitterbuffer, they will be forwarded to a GstRtpsSrcDemux element.<br>    The GstRtpsSrcDemux element will demux the packets based on the payload type and will create a unique pad <br>
    recv_rtp_src_%d_%d_%d on gstrtpbin with the session number, SSRC and payload type respectively as the pad name.<br>    Because of that we have to dinamicaly link the src pads on runtime. <br>  */<br>  g_signal_connect (rtp_bin, &quot;new-ssrc-pad&quot;, G_CALLBACK (on_new_ssrc_pad), rtp_decoder);<br>
  g_signal_connect (rtp_bin, &quot;on-new-ssrc&quot;,  G_CALLBACK (on_new_ssrc), rtp_decoder);<br><br>  if(!gst_element_link (rtp_decoder, sink)){<br>      g_warning(&quot;Error linking the rtp_decoder to the sink&quot;);<br>
      gst_object_unref (GST_OBJECT (pipeline));<br>      return -1;<br>  }<br><br>  /* Set the pipeline to &quot;playing&quot; state*/<br>  g_print (&quot;listening on port: %d\n&quot;, PORTA_UDP_ENTRADA);<br>  gst_element_set_state (pipeline, GST_STATE_PLAYING);<br>
<br>  /* Iterate */<br>  g_print (&quot;Running...\n&quot;);<br>  g_main_loop_run (loop);<br><br>  /* Out of the main loop, clean up nicely */<br>  g_print (&quot;Returned, stopping listening on port\n&quot;);<br>  gst_element_set_state (pipeline, GST_STATE_NULL);<br>
<br>  g_print (&quot;Deleting pipeline\n&quot;);<br>  gst_object_unref (GST_OBJECT (pipeline));<br><br>  return 0;<br>}<br><br><br><div class="gmail_quote">On Sat, May 9, 2009 at 3:40 PM, Aurelien Grimaud <span dir="ltr">&lt;<a href="mailto:gstelzz@yahoo.fr">gstelzz@yahoo.fr</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Sorry, I misread your code.<br>
the pad-added signal is a signal of elements, documented in the element<br>
documentation.<br>
Do you receive RTP ?<br>
Because the pad wont be created if you do not receive RTP.<br>
What does tcpdump tell ?<br>
<div class="im"><br>
Aurelien<br>
Tiago Katcipis a écrit :<br>
</div><div class="im">&gt; i did it, the pad never is created :-(, but i get no message of<br>
&gt; warning or error neither. And on the list of signals of the gstrtpbin<br>
&gt; there is no &quot;pad-added&quot; signal, its normal to the signal dont be there?<br>
&gt; *<br>
&gt; g_signal_connect (rtp_bin, &quot;pad-added&quot;,   G_CALLBACK (on_pad_added),<br>
&gt; rtp_decoder);*<br>
&gt;<br>
&gt; On Sat, May 9, 2009 at 3:55 AM, Aurelien Grimaud &lt;<a href="mailto:gstelzz@yahoo.fr">gstelzz@yahoo.fr</a><br>
</div><div><div></div><div class="h5">&gt; &lt;mailto:<a href="mailto:gstelzz@yahoo.fr">gstelzz@yahoo.fr</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     You should add the pad-added signal on the rtpbin.<br>
&gt;     When it triggers, check the pad name to find out which pad it is.<br>
&gt;     If pad is a recv_rtp_src_%d_%d_%d, link your decoder and sink in the<br>
&gt;     call back.<br>
&gt;<br>
&gt;     Aurelien<br>
&gt;<br>
&gt;     Tiago Katcipis a écrit :<br>
&gt;     &gt; Im trying to do a rtp stream sending data and another side receiving<br>
&gt;     &gt; the data, the part that sends the data is working fine, but the part<br>
&gt;     &gt; that receives is giving me a lot of trouble. At<br>
&gt;     &gt;<br>
&gt;     <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad-plugins/html/gst-plugins-bad-plugins-gstrtpbin.html" target="_blank">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad-plugins/html/gst-plugins-bad-plugins-gstrtpbin.html</a><br>

&gt;     &gt; i have read:<br>
&gt;     &gt;<br>
&gt;     &gt; &quot;To use GstRtpBin<br>
&gt;     &gt;<br>
&gt;     &lt;<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad-plugins/html/gst-plugins-bad-plugins-gstrtpbin.html#GstRtpBin" target="_blank">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad-plugins/html/gst-plugins-bad-plugins-gstrtpbin.html#GstRtpBin</a>&gt;<br>

&gt;     &gt; as an RTP receiver, request a recv_rtp_sink_%|d| pad. The session<br>
&gt;     &gt; number must be specified in the pad name. Data received on the<br>
&gt;     &gt; recv_rtp_sink_%|d| pad will be processed in the gstrtpsession<br>
&gt;     manager<br>
&gt;     &gt; and after being validated forwarded on GstRtpsSrcDemux element. Each<br>
&gt;     &gt; RTP stream is demuxed based on the SSRC and send to a<br>
&gt;     &gt; GstRtpJitterBuffer<br>
&gt;     &gt;<br>
&gt;     &lt;<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad-plugins/html/gst-plugins-bad-plugins-gstrtpjitterbuffer.html#GstRtpJitterBuffer" target="_blank">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad-plugins/html/gst-plugins-bad-plugins-gstrtpjitterbuffer.html#GstRtpJitterBuffer</a>&gt;.<br>

&gt;     &gt; After the packets are released from the jitterbuffer, they will be<br>
&gt;     &gt; forwarded to a GstRtpsSrcDemux element. The GstRtpsSrcDemux element<br>
&gt;     &gt; will demux the packets based on the payload type and will create a<br>
&gt;     &gt; unique pad recv_rtp_src_%|d_|%|d_|%|d| on gstrtpbin with the session<br>
&gt;     &gt; number, SSRC and payload type respectively as the pad name. &quot;<br>
&gt;     &gt;<br>
&gt;     &gt; on my application i cant get the recv_rtp_src_%|d_|%|d_|%|d,  |i<br>
&gt;     &gt; already tried on a lot of ways, my last shot was try to iterate over<br>
&gt;     &gt; all the pads on the bin and try to conect, i discovered that the src<br>
&gt;     &gt; pad never shows up. No error is given. I can get the on-new-ssrc<br>
&gt;     &gt; signal...and other signals as  |on-ssrc-validated... but on all this<br>
&gt;     &gt; signals the | recv_rtp_src_%|d_|%|d_|%|d is not created yet, i also<br>
&gt;     &gt; tried to get the &quot;on-pad-added&quot; signal but this signal never<br>
&gt;     happens|.<br>
&gt;     &gt;<br>
&gt;     &gt; My problem is, when the recv_rtp_src_%|d_|%|d_|%|d is created|.<br>
&gt;     When i<br>
&gt;     &gt; iterate over the pads i always get a<br>
&gt;     &gt; ** (teste_rtp:9516): DEBUG: GstRtpBin has [0] src pads<br>
&gt;     &gt;<br>
&gt;     &gt; here goes the source code, is a little messy because im all day<br>
&gt;     trying<br>
&gt;     &gt; a lot of different ways to do this. And i get no error message.<br>
&gt;     &gt;<br>
&gt;     &gt; #include &lt;gst/gst.h&gt;<br>
&gt;     &gt; #include &lt;glib.h&gt;<br>
&gt;     &gt;<br>
&gt;     &gt; #define PORTA_UDP_ENTRADA 5000<br>
&gt;     &gt;<br>
&gt;     &gt; static gboolean<br>
&gt;     &gt; bus_call (GstBus     *bus,<br>
&gt;     &gt;           GstMessage *msg,<br>
&gt;     &gt;           gpointer    data)<br>
&gt;     &gt; {<br>
&gt;     &gt;   GMainLoop *loop = (GMainLoop *) data;<br>
&gt;     &gt;<br>
&gt;     &gt;   switch (GST_MESSAGE_TYPE (msg)) {<br>
&gt;     &gt;<br>
&gt;     &gt;     case GST_MESSAGE_EOS:<br>
&gt;     &gt;       g_print (&quot;End of stream\n&quot;);<br>
&gt;     &gt;       g_main_loop_quit (loop);<br>
&gt;     &gt;       break;<br>
&gt;     &gt;<br>
&gt;     &gt;     case GST_MESSAGE_ERROR: {<br>
&gt;     &gt;       gchar  *debug;<br>
&gt;     &gt;       GError *error;<br>
&gt;     &gt;<br>
&gt;     &gt;       gst_message_parse_error (msg, &amp;error, &amp;debug);<br>
&gt;     &gt;       g_free (debug);<br>
&gt;     &gt;<br>
&gt;     &gt;       g_printerr (&quot;Error: %s\n&quot;, error-&gt;message);<br>
&gt;     &gt;       g_error_free (error);<br>
&gt;     &gt;<br>
&gt;     &gt;       g_main_loop_quit (loop);<br>
&gt;     &gt;       break;<br>
&gt;     &gt;     }<br>
&gt;     &gt;     default:<br>
&gt;     &gt;       g_print(&quot;Tipo da mensagem [%d], Nome da mensagem [%s]\n&quot;,<br>
&gt;     &gt; GST_MESSAGE_TYPE (msg), GST_MESSAGE_TYPE_NAME(msg));<br>
&gt;     &gt;       break;<br>
&gt;     &gt;   }<br>
&gt;     &gt;<br>
&gt;     &gt;   return TRUE;<br>
&gt;     &gt; }<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt; static void<br>
&gt;     &gt; on_new_ssrc (GstElement* gstrtpbin,<br>
&gt;     &gt;                    guint session,<br>
&gt;     &gt;                    guint ssrc,<br>
&gt;     &gt;                    gpointer data)<br>
&gt;     &gt; {<br>
&gt;     &gt;   GstPad* sinkpad;<br>
&gt;     &gt;   GstPad* srcpad[1];<br>
&gt;     &gt;   GstElement* decoder = (GstElement *) data;<br>
&gt;     &gt;   GstIterator* iter;<br>
&gt;     &gt;   gint done, linked, iter_count;<br>
&gt;     &gt;<br>
&gt;     &gt;   g_print (&quot;New session stabilished, linking gstrtpbin session<br>
&gt;     src pad<br>
&gt;     &gt; to the rtp_decoder\n&quot;);<br>
&gt;     &gt;<br>
&gt;     &gt;   sinkpad = gst_element_get_static_pad(decoder, &quot;sink&quot;);<br>
&gt;     &gt;   // TODO Esta dificil de pegar o pad src do gstrtpbin que eh criado<br>
&gt;     &gt; ao iniciar uma sessao nova.<br>
&gt;     &gt;   if(!sinkpad){<br>
&gt;     &gt;       g_warning(&quot;Error getting rtp_decoder sink pad&quot;);<br>
&gt;     &gt;       return;<br>
&gt;     &gt;   }<br>
&gt;     &gt;   /*<br>
&gt;     &gt;      unique pad recv_rtp_src_%d_%d_%d on gstrtpbin with the session<br>
&gt;     &gt; number, SSRC and payload type respectively as the pad name.<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad-plugins/html/gst-plugins-bad-plugins-gstrtpbin.html" target="_blank">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad-plugins/html/gst-plugins-bad-plugins-gstrtpbin.html</a><br>

&gt;     &gt;   */<br>
&gt;     &gt;<br>
&gt;     &gt;   iter = gst_element_iterate_src_pads(gstrtpbin);<br>
&gt;     &gt;   if(!iter){<br>
&gt;     &gt;       g_warning(&quot;Error getting gstrtpbin pads iterator&quot;);<br>
&gt;     &gt;       return;<br>
&gt;     &gt;   }<br>
&gt;     &gt;<br>
&gt;     &gt;   done = FALSE;<br>
&gt;     &gt;   linked = FALSE;<br>
&gt;     &gt;   iter_count = 0;<br>
&gt;     &gt;<br>
&gt;     &gt;   while (!done) {<br>
&gt;     &gt;       switch (gst_iterator_next (iter, (gpointer *) srcpad)) {<br>
&gt;     &gt;           case GST_ITERATOR_OK:<br>
&gt;     &gt;               if(gst_pad_link (*srcpad, sinkpad) !=<br>
&gt;     GST_PAD_LINK_OK){<br>
&gt;     &gt;                   g_warning(&quot;Error linking gstrtpbin pad[%s] to<br>
&gt;     &gt; rtp_decoder pad[%s]&quot;, gst_pad_get_name(*srcpad),<br>
&gt;     &gt; gst_pad_get_name(sinkpad));<br>
&gt;     &gt;               }else{<br>
&gt;     &gt;                   g_warning(&quot;Linked gstrtpbin pad[%s] to rtp_decoder<br>
&gt;     &gt; pad[%s] with success&quot;, gst_pad_get_name(*srcpad),<br>
&gt;     &gt; gst_pad_get_name(sinkpad));<br>
&gt;     &gt;                   linked = TRUE;<br>
&gt;     &gt;               }<br>
&gt;     &gt;               iter_count++;<br>
&gt;     &gt;               gst_object_unref (*srcpad);<br>
&gt;     &gt;           break;<br>
&gt;     &gt;           case GST_ITERATOR_RESYNC:<br>
&gt;     &gt;               gst_iterator_resync (iter);<br>
&gt;     &gt;           break;<br>
&gt;     &gt;           case GST_ITERATOR_ERROR:<br>
&gt;     &gt;               done = TRUE;<br>
&gt;     &gt;           break;<br>
&gt;     &gt;           case GST_ITERATOR_DONE:<br>
&gt;     &gt;               done = TRUE;<br>
&gt;     &gt;           break;<br>
&gt;     &gt;       }<br>
&gt;     &gt;    }<br>
&gt;     &gt;   if(!linked){<br>
&gt;     &gt;       g_warning(&quot;failed to found a valid recv_src_pad on<br>
&gt;     gstrtpbin&quot;);<br>
&gt;     &gt;   }<br>
&gt;     &gt;   g_debug(&quot;GstRtpBin has [%d] src pads&quot;, iter_count);<br>
&gt;     &gt;<br>
&gt;     &gt;   gst_iterator_free (iter);<br>
&gt;     &gt;   gst_object_unref (sinkpad);<br>
&gt;     &gt; }<br>
&gt;     &gt;<br>
&gt;     &gt; static void<br>
&gt;     &gt; on_pad_added (GstElement *element,<br>
&gt;     &gt;               GstPad     *pad,<br>
&gt;     &gt;               gpointer    data)<br>
&gt;     &gt; {<br>
&gt;     &gt;   GstPad *sinkpad;<br>
&gt;     &gt;   GstElement *decoder = (GstElement *) data;<br>
&gt;     &gt;<br>
&gt;     &gt;   /* We can now link this pad with the converter sink pad */<br>
&gt;     &gt;   g_print (&quot;Dynamic pad created, linking wavparser/converter\n&quot;);<br>
&gt;     &gt;<br>
&gt;     &gt;   sinkpad = gst_element_get_static_pad (decoder, &quot;sink&quot;);<br>
&gt;     &gt;   if(gst_pad_link (pad, sinkpad) != GST_PAD_LINK_OK){<br>
&gt;     &gt;       g_warning(&quot;Error linking recv_rtp_src pad to sinkpad&quot;);<br>
&gt;     &gt;   }<br>
&gt;     &gt;   gst_object_unref (sinkpad);<br>
&gt;     &gt; }<br>
&gt;     &gt;<br>
&gt;     &gt; int<br>
&gt;     &gt; main (int   argc,<br>
&gt;     &gt;       char *argv[])<br>
&gt;     &gt; {<br>
&gt;     &gt;   GMainLoop *loop;<br>
&gt;     &gt;<br>
&gt;     &gt;   GstElement *pipeline, *source, *rtp_bin, *rtp_decoder, *sink;<br>
&gt;     &gt;   GstPad *gstrtp_sink_pad;<br>
&gt;     &gt;   GstBus *bus;<br>
&gt;     &gt;<br>
&gt;     &gt;   /* Initialisation */<br>
&gt;     &gt;   gst_init (&amp;argc, &amp;argv);<br>
&gt;     &gt;<br>
&gt;     &gt;   loop = g_main_loop_new (NULL, FALSE);<br>
&gt;     &gt;<br>
&gt;     &gt;   /* Create gstreamer elements */<br>
&gt;     &gt;   pipeline    = gst_pipeline_new (&quot;audio-player&quot;);<br>
&gt;     &gt;   source      = gst_element_factory_make (&quot;udpsrc&quot;,&quot;udp-source&quot;);<br>
&gt;     &gt;   rtp_bin     = gst_element_factory_make (&quot;gstrtpbin&quot;,<br>
&gt;     &quot;gst_rtpbin&quot;);<br>
&gt;     &gt;   rtp_decoder = gst_element_factory_make (&quot;rtpL16depay&quot;,<br>
&gt;     &quot;rtp_decoder&quot;);<br>
&gt;     &gt;   sink        = gst_element_factory_make (&quot;filesink&quot;, &quot;file-sink&quot;);<br>
&gt;     &gt;<br>
&gt;     &gt;   if (!pipeline || !source || !sink || !rtp_decoder || !rtp_bin) {<br>
&gt;     &gt;     g_printerr (&quot;One element could not be created. Exiting.\n&quot;);<br>
&gt;     &gt;     return -1;<br>
&gt;     &gt;   }<br>
&gt;     &gt;<br>
&gt;     &gt;   gstrtp_sink_pad = gst_element_get_request_pad(rtp_bin,<br>
&gt;     &gt; &quot;recv_rtp_sink_0&quot;);<br>
&gt;     &gt;   if (!gstrtp_sink_pad) {<br>
&gt;     &gt;     g_printerr (&quot;Sink pad could not be created. Exiting.\n&quot;);<br>
&gt;     &gt;     return -1;<br>
&gt;     &gt;   }<br>
&gt;     &gt;<br>
&gt;     &gt;   /* Set up the pipeline */<br>
&gt;     &gt;   g_object_set (G_OBJECT (source), &quot;port&quot;, PORTA_UDP_ENTRADA ,<br>
&gt;     NULL);<br>
&gt;     &gt;   g_object_set (G_OBJECT (sink), &quot;location&quot;, &quot;dados_recebidos_rtp&quot; ,<br>
&gt;     &gt; NULL);<br>
&gt;     &gt;<br>
&gt;     &gt;   /* we add a message handler */<br>
&gt;     &gt;   bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));<br>
&gt;     &gt;   gst_bus_add_watch (bus, bus_call, loop);<br>
&gt;     &gt;   gst_object_unref (bus);<br>
&gt;     &gt;<br>
&gt;     &gt;   /* we add all elements into the pipeline */<br>
&gt;     &gt;   /* file-source | ogg-demuxer | vorbis-decoder | converter |<br>
&gt;     &gt; alsa-output */<br>
&gt;     &gt;   gst_bin_add_many (GST_BIN (pipeline),<br>
&gt;     &gt;                     source, sink, rtp_bin, rtp_decoder, NULL);<br>
&gt;     &gt;<br>
&gt;     &gt;   /* we link the elements together */<br>
&gt;     &gt;   if(gst_pad_link(gst_element_get_static_pad(source, &quot;src&quot;),<br>
&gt;     &gt; gstrtp_sink_pad) != GST_PAD_LINK_OK){<br>
&gt;     &gt;       g_warning(&quot;Error linking source to the gstrtp_sink_pad&quot;);<br>
&gt;     &gt;       gst_object_unref (GST_OBJECT (pipeline));<br>
&gt;     &gt;       return 0;<br>
&gt;     &gt;   }<br>
&gt;     &gt;<br>
&gt;     &gt;   /*<br>
&gt;     &gt;     After the packets are released from the jitterbuffer, they<br>
&gt;     will be<br>
&gt;     &gt; forwarded to a GstRtpsSrcDemux element.<br>
&gt;     &gt;     The GstRtpsSrcDemux element will demux the packets based on the<br>
&gt;     &gt; payload type and will create a unique pad<br>
&gt;     &gt;     recv_rtp_src_%d_%d_%d on gstrtpbin with the session number, SSRC<br>
&gt;     &gt; and payload type respectively as the pad name.<br>
&gt;     &gt;     Because of that we have to dinamicaly link the src pads on<br>
&gt;     runtime.<br>
&gt;     &gt;   */<br>
&gt;     &gt;   g_signal_connect (rtp_bin, &quot;pad-added&quot;,   G_CALLBACK<br>
&gt;     (on_pad_added),<br>
&gt;     &gt; rtp_decoder);<br>
&gt;     &gt;   g_signal_connect (rtp_bin, &quot;on-new-ssrc&quot;, G_CALLBACK<br>
&gt;     (on_new_ssrc),<br>
&gt;     &gt; rtp_decoder);<br>
&gt;     &gt;<br>
&gt;     &gt;   if(!gst_element_link (rtp_decoder, sink)){<br>
&gt;     &gt;       g_warning(&quot;Error linking the rtp_decoder to the sink&quot;);<br>
&gt;     &gt;       gst_object_unref (GST_OBJECT (pipeline));<br>
&gt;     &gt;       return -1;<br>
&gt;     &gt;   }<br>
&gt;     &gt;<br>
&gt;     &gt;   /* Set the pipeline to &quot;playing&quot; state*/<br>
&gt;     &gt;   g_print (&quot;listening on port: %d\n&quot;, PORTA_UDP_ENTRADA);<br>
&gt;     &gt;   gst_element_set_state (pipeline, GST_STATE_PLAYING);<br>
&gt;     &gt;<br>
&gt;     &gt;   /* Iterate */<br>
&gt;     &gt;   g_print (&quot;Running...\n&quot;);<br>
&gt;     &gt;   g_main_loop_run (loop);<br>
&gt;     &gt;<br>
&gt;     &gt;   /* Out of the main loop, clean up nicely */<br>
&gt;     &gt;   g_print (&quot;Returned, stopping listening on port\n&quot;);<br>
&gt;     &gt;   gst_element_set_state (pipeline, GST_STATE_NULL);<br>
&gt;     &gt;<br>
&gt;     &gt;   g_print (&quot;Deleting pipeline\n&quot;);<br>
&gt;     &gt;   gst_object_unref (GST_OBJECT (pipeline));<br>
&gt;     &gt;<br>
&gt;     &gt;   return 0;<br>
&gt;     &gt; }<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     ------------------------------------------------------------------------<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     ------------------------------------------------------------------------------<br>
&gt;     &gt; The NEW KODAK i700 Series Scanners deliver under ANY<br>
&gt;     circumstances! Your<br>
&gt;     &gt; production scanning environment may not be a perfect world - but<br>
&gt;     thanks to<br>
&gt;     &gt; Kodak, there&#39;s a perfect scanner to get the job done! With the<br>
&gt;     NEW KODAK i700<br>
&gt;     &gt; Series Scanner you&#39;ll get full speed at 300 dpi even with all image<br>
&gt;     &gt; processing features enabled. <a href="http://p.sf.net/sfu/kodak-com" target="_blank">http://p.sf.net/sfu/kodak-com</a><br>
&gt;     &gt;<br>
&gt;     ------------------------------------------------------------------------<br>
&gt;     &gt;<br>
&gt;     &gt; _______________________________________________<br>
&gt;     &gt; gstreamer-devel mailing list<br>
&gt;     &gt; <a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
</div></div>&gt;     &lt;mailto:<a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a>&gt;<br>
<div class="im">&gt;     &gt; <a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
&gt;     &gt;<br>
&gt;<br>
&gt;<br>
&gt;     ------------------------------------------------------------------------------<br>
&gt;     The NEW KODAK i700 Series Scanners deliver under ANY<br>
&gt;     circumstances! Your<br>
&gt;     production scanning environment may not be a perfect world - but<br>
&gt;     thanks to<br>
&gt;     Kodak, there&#39;s a perfect scanner to get the job done! With the NEW<br>
&gt;     KODAK i700<br>
&gt;     Series Scanner you&#39;ll get full speed at 300 dpi even with all image<br>
&gt;     processing features enabled. <a href="http://p.sf.net/sfu/kodak-com" target="_blank">http://p.sf.net/sfu/kodak-com</a><br>
&gt;     _______________________________________________<br>
&gt;     gstreamer-devel mailing list<br>
&gt;     <a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
</div>&gt;     &lt;mailto:<a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a>&gt;<br>
<div><div></div><div class="h5">&gt;     <a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; &quot;it might be a profitable thing to learn Java, but it has no<br>
&gt; intellectual value whatsoever&quot; Alexander Stepanov<br>
&gt; ------------------------------------------------------------------------<br>
&gt;<br>
&gt; ------------------------------------------------------------------------------<br>
&gt; The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your<br>
&gt; production scanning environment may not be a perfect world - but thanks to<br>
&gt; Kodak, there&#39;s a perfect scanner to get the job done! With the NEW KODAK i700<br>
&gt; Series Scanner you&#39;ll get full speed at 300 dpi even with all image<br>
&gt; processing features enabled. <a href="http://p.sf.net/sfu/kodak-com" target="_blank">http://p.sf.net/sfu/kodak-com</a><br>
&gt; ------------------------------------------------------------------------<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; gstreamer-devel mailing list<br>
&gt; <a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
&gt; <a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
&gt;<br>
<br>
<br>
------------------------------------------------------------------------------<br>
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your<br>
production scanning environment may not be a perfect world - but thanks to<br>
Kodak, there&#39;s a perfect scanner to get the job done! With the NEW KODAK i700<br>
Series Scanner you&#39;ll get full speed at 300 dpi even with all image<br>
processing features enabled. <a href="http://p.sf.net/sfu/kodak-com" target="_blank">http://p.sf.net/sfu/kodak-com</a><br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>&quot;it might be a profitable thing to learn Java, but it has no intellectual value whatsoever&quot; Alexander Stepanov<br>