but the ssrc is being created, why does the pad not? i get all the msgs the pipeline sends and print them all and i get no error, i already made a test with just a udpsrc ! filesink and the data is comming.<br><br><div class="gmail_quote">
On Mon, May 11, 2009 at 2:06 PM, Wim Taymans <span dir="ltr"><<a href="mailto:wim.taymans@gmail.com">wim.taymans@gmail.com</a>></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;">
<div class="im">On Mon, 2009-05-11 at 13:55 -0300, Tiago Katcipis wrote:<br>
> i still didnt the teste, but i found this<br>
><br>
<br>
<br>
</div>Sometimes (dynamic pads) on elements *always* get notified to you with<br>
the "pad-added" callback. This is a signal on GstElement. You will get<br>
the newly created pads from gstrtpbin with this signal. The other<br>
signals you are trying to connect to are for something else.<br>
<font color="#888888"><br>
Wim<br>
</font><div><div></div><div class="h5"><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" target="_blank">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<br>
> the bin with:<br>
><br>
> g_signal_connect (rtp_bin, "new-ssrc-pad", G_CALLBACK<br>
> (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<br>
> from the bin or i have to retrieve the element from the bin and then<br>
> connect? and if i have to get the element from the bin (in this case<br>
> 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 <gst/gst.h><br>
> #include <glib.h><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 ("End of stream\n");<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, &error, &debug);<br>
> g_free (debug);<br>
><br>
> g_printerr ("Error: %s\n", error->message);<br>
> g_error_free (error);<br>
><br>
> g_main_loop_quit (loop);<br>
> break;<br>
> }<br>
> default:<br>
> g_print("Tipo da mensagem [%d], Nome da mensagem [%s]\n",<br>
> 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 ("New session stabilished, linking gstrtpbin session src pad<br>
> to the rtp_decoder\n");<br>
><br>
> sinkpad = gst_element_get_static_pad(decoder, "sink");<br>
> // TODO Esta dificil de pegar o pad src do gstrtpbin que eh criado<br>
> ao iniciar uma sessao nova.<br>
> if(!sinkpad){<br>
> g_warning("Error getting rtp_decoder sink pad");<br>
> return;<br>
> }<br>
> /*<br>
> unique pad recv_rtp_src_%d_%d_%d on gstrtpbin with the session<br>
> number, SSRC and payload type respectively as the pad name.<br>
><br>
> <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>
> */<br>
><br>
> iter = gst_element_iterate_src_pads(gstrtpbin);<br>
> if(!iter){<br>
> g_warning("Error getting gstrtpbin pads iterator");<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("Error linking gstrtpbin pad[%s] to<br>
> rtp_decoder pad[%s]", gst_pad_get_name(*srcpad),<br>
> gst_pad_get_name(sinkpad));<br>
> }else{<br>
> g_warning("Linked gstrtpbin pad[%s] to rtp_decoder<br>
> pad[%s] with success", gst_pad_get_name(*srcpad),<br>
> 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("failed to found a valid recv_src_pad on gstrtpbin");<br>
> }<br>
> g_debug("GstRtpBin has [%d] src pads", 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 ("Dynamic ssrc pad created, linking the pad to the<br>
> rtp_decoder\n");<br>
><br>
> sinkpad = gst_element_get_static_pad (decoder, "sink");<br>
> if(gst_pad_link (pad, sinkpad) != GST_PAD_LINK_OK){<br>
> gchar* name = gst_pad_get_name(pad);<br>
> g_warning("Error linking the pad[%s] to rtp_decoder sinkpad",<br>
> 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 (&argc, &argv);<br>
><br>
> loop = g_main_loop_new (NULL, FALSE);<br>
><br>
> /* Create gstreamer elements */<br>
> pipeline = gst_pipeline_new ("audio-player");<br>
> source = gst_element_factory_make ("udpsrc","udp-source");<br>
> rtp_bin = gst_element_factory_make ("gstrtpbin", "gst_rtpbin");<br>
> rtp_decoder = gst_element_factory_make ("rtpL16depay",<br>
> "rtp_decoder");<br>
> sink = gst_element_factory_make ("filesink", "file-sink");<br>
><br>
> if (!pipeline || !source || !sink || !rtp_decoder || !rtp_bin) {<br>
> g_printerr ("One element could not be created. Exiting.\n");<br>
> return -1;<br>
> }<br>
><br>
> gstrtp_sink_pad = gst_element_get_request_pad(rtp_bin,<br>
> "recv_rtp_sink_0");<br>
> if (!gstrtp_sink_pad) {<br>
> g_printerr ("Sink pad could not be created. Exiting.\n");<br>
> return -1;<br>
> }<br>
><br>
> /* Set up the pipeline */<br>
> g_object_set (G_OBJECT (source), "port", PORTA_UDP_ENTRADA , NULL);<br>
> g_object_set (G_OBJECT (sink), "location", "dados_recebidos_rtp" ,<br>
> 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 |<br>
> 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, "src"),<br>
> gstrtp_sink_pad) != GST_PAD_LINK_OK){<br>
> g_warning("Error linking source to the gstrtp_sink_pad");<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<br>
> forwarded to a GstRtpsSrcDemux element.<br>
> The GstRtpsSrcDemux element will demux the packets based on the<br>
> payload type and will create a unique pad<br>
> recv_rtp_src_%d_%d_%d on gstrtpbin with the session number, SSRC<br>
> and payload type respectively as the pad name.<br>
> Because of that we have to dinamicaly link the src pads on<br>
> runtime.<br>
> */<br>
> g_signal_connect (rtp_bin, "new-ssrc-pad", G_CALLBACK<br>
> (on_new_ssrc_pad), rtp_decoder);<br>
> g_signal_connect (rtp_bin, "on-new-ssrc", G_CALLBACK (on_new_ssrc),<br>
> rtp_decoder);<br>
><br>
> if(!gst_element_link (rtp_decoder, sink)){<br>
> g_warning("Error linking the rtp_decoder to the sink");<br>
> gst_object_unref (GST_OBJECT (pipeline));<br>
> return -1;<br>
> }<br>
><br>
> /* Set the pipeline to "playing" state*/<br>
> g_print ("listening on port: %d\n", PORTA_UDP_ENTRADA);<br>
> gst_element_set_state (pipeline, GST_STATE_PLAYING);<br>
><br>
> /* Iterate */<br>
> g_print ("Running...\n");<br>
> g_main_loop_run (loop);<br>
><br>
> /* Out of the main loop, clean up nicely */<br>
> g_print ("Returned, stopping listening on port\n");<br>
> gst_element_set_state (pipeline, GST_STATE_NULL);<br>
><br>
> g_print ("Deleting pipeline\n");<br>
> gst_object_unref (GST_OBJECT (pipeline));<br>
><br>
> return 0;<br>
> }<br>
><br>
><br>
> On Sat, May 9, 2009 at 3:40 PM, Aurelien Grimaud <<a href="mailto:gstelzz@yahoo.fr">gstelzz@yahoo.fr</a>><br>
> wrote:<br>
> Sorry, I misread your code.<br>
> the pad-added signal is a signal of elements, documented in<br>
> 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>
><br>
> Aurelien<br>
> Tiago Katcipis a écrit :<br>
><br>
> > i did it, the pad never is created :-(, but i get no message<br>
> of<br>
> > warning or error neither. And on the list of signals of the<br>
> gstrtpbin<br>
> > there is no "pad-added" signal, its normal to the signal<br>
> dont be there?<br>
> > *<br>
> > g_signal_connect (rtp_bin, "pad-added", G_CALLBACK<br>
> (on_pad_added),<br>
> > rtp_decoder);*<br>
> ><br>
> > On Sat, May 9, 2009 at 3:55 AM, Aurelien Grimaud<br>
> <<a href="mailto:gstelzz@yahoo.fr">gstelzz@yahoo.fr</a><br>
><br>
><br>
> > <mailto:<a href="mailto:gstelzz@yahoo.fr">gstelzz@yahoo.fr</a>>> wrote:<br>
> ><br>
> > You should add the pad-added signal on the rtpbin.<br>
> > When it triggers, check the pad name to find out which<br>
> pad it is.<br>
> > If pad is a recv_rtp_src_%d_%d_%d, link your decoder and<br>
> sink in the<br>
> > call back.<br>
> ><br>
> > Aurelien<br>
> ><br>
> > Tiago Katcipis a écrit :<br>
> > > Im trying to do a rtp stream sending data and another<br>
> side receiving<br>
> > > the data, the part that sends the data is working<br>
> fine, but the part<br>
> > > that receives is giving me a lot of trouble. At<br>
> > ><br>
> ><br>
> <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>
> > > i have read:<br>
> > ><br>
> > > "To use GstRtpBin<br>
> > ><br>
> ><br>
> <<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>><br>
> > > as an RTP receiver, request a recv_rtp_sink_%|d| pad.<br>
> The session<br>
> > > number must be specified in the pad name. Data<br>
> received on the<br>
> > > recv_rtp_sink_%|d| pad will be processed in the<br>
> gstrtpsession<br>
> > manager<br>
> > > and after being validated forwarded on GstRtpsSrcDemux<br>
> element. Each<br>
> > > RTP stream is demuxed based on the SSRC and send to a<br>
> > > GstRtpJitterBuffer<br>
> > ><br>
> ><br>
> <<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>>.<br>
> > > After the packets are released from the jitterbuffer,<br>
> they will be<br>
> > > forwarded to a GstRtpsSrcDemux element. The<br>
> GstRtpsSrcDemux element<br>
> > > will demux the packets based on the payload type and<br>
> will create a<br>
> > > unique pad recv_rtp_src_%|d_|%|d_|%|d| on gstrtpbin<br>
> with the session<br>
> > > number, SSRC and payload type respectively as the pad<br>
> name. "<br>
> > ><br>
> > > on my application i cant get the recv_rtp_src_%|d_|%|<br>
> d_|%|d, |i<br>
> > > already tried on a lot of ways, my last shot was try<br>
> to iterate over<br>
> > > all the pads on the bin and try to conect, i<br>
> discovered that the src<br>
> > > pad never shows up. No error is given. I can get the<br>
> on-new-ssrc<br>
> > > signal...and other signals as |on-ssrc-validated...<br>
> but on all this<br>
> > > signals the | recv_rtp_src_%|d_|%|d_|%|d is not<br>
> created yet, i also<br>
> > > tried to get the "on-pad-added" signal but this signal<br>
> never<br>
> > happens|.<br>
> > ><br>
> > > My problem is, when the recv_rtp_src_%|d_|%|d_|%|d is<br>
> created|.<br>
> > When i<br>
> > > iterate over the pads i always get a<br>
> > > ** (teste_rtp:9516): DEBUG: GstRtpBin has [0] src pads<br>
> > ><br>
> > > here goes the source code, is a little messy because<br>
> im all day<br>
> > trying<br>
> > > a lot of different ways to do this. And i get no error<br>
> message.<br>
> > ><br>
> > > #include <gst/gst.h><br>
> > > #include <glib.h><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 ("End of stream\n");<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, &error, &debug);<br>
> > > g_free (debug);<br>
> > ><br>
> > > g_printerr ("Error: %s\n", error->message);<br>
> > > g_error_free (error);<br>
> > ><br>
> > > g_main_loop_quit (loop);<br>
> > > break;<br>
> > > }<br>
> > > default:<br>
> > > g_print("Tipo da mensagem [%d], Nome da mensagem<br>
> [%s]\n",<br>
> > > 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 ("New session stabilished, linking gstrtpbin<br>
> session<br>
> > src pad<br>
> > > to the rtp_decoder\n");<br>
> > ><br>
> > > sinkpad = gst_element_get_static_pad(decoder,<br>
> "sink");<br>
> > > // TODO Esta dificil de pegar o pad src do gstrtpbin<br>
> que eh criado<br>
> > > ao iniciar uma sessao nova.<br>
> > > if(!sinkpad){<br>
> > > g_warning("Error getting rtp_decoder sink pad");<br>
> > > return;<br>
> > > }<br>
> > > /*<br>
> > > unique pad recv_rtp_src_%d_%d_%d on gstrtpbin<br>
> with the session<br>
> > > number, SSRC and payload type respectively as the pad<br>
> name.<br>
> > ><br>
> > ><br>
> ><br>
> <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>
> > > */<br>
> > ><br>
> > > iter = gst_element_iterate_src_pads(gstrtpbin);<br>
> > > if(!iter){<br>
> > > g_warning("Error getting gstrtpbin pads<br>
> iterator");<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 *)<br>
> srcpad)) {<br>
> > > case GST_ITERATOR_OK:<br>
> > > if(gst_pad_link (*srcpad, sinkpad) !=<br>
> > GST_PAD_LINK_OK){<br>
> > > g_warning("Error linking gstrtpbin<br>
> pad[%s] to<br>
> > > rtp_decoder pad[%s]", gst_pad_get_name(*srcpad),<br>
> > > gst_pad_get_name(sinkpad));<br>
> > > }else{<br>
> > > g_warning("Linked gstrtpbin pad[%s]<br>
> to rtp_decoder<br>
> > > pad[%s] with success", gst_pad_get_name(*srcpad),<br>
> > > 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("failed to found a valid recv_src_pad<br>
> on<br>
> > gstrtpbin");<br>
> > > }<br>
> > > g_debug("GstRtpBin has [%d] src pads", iter_count);<br>
> > ><br>
> > > gst_iterator_free (iter);<br>
> > > gst_object_unref (sinkpad);<br>
> > > }<br>
> > ><br>
> > > static void<br>
> > > on_pad_added (GstElement *element,<br>
> > > GstPad *pad,<br>
> > > gpointer data)<br>
> > > {<br>
> > > GstPad *sinkpad;<br>
> > > GstElement *decoder = (GstElement *) data;<br>
> > ><br>
> > > /* We can now link this pad with the converter sink<br>
> pad */<br>
> > > g_print ("Dynamic pad created, linking<br>
> wavparser/converter\n");<br>
> > ><br>
> > > sinkpad = gst_element_get_static_pad (decoder,<br>
> "sink");<br>
> > > if(gst_pad_link (pad, sinkpad) != GST_PAD_LINK_OK){<br>
> > > g_warning("Error linking recv_rtp_src pad to<br>
> sinkpad");<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,<br>
> *rtp_decoder, *sink;<br>
> > > GstPad *gstrtp_sink_pad;<br>
> > > GstBus *bus;<br>
> > ><br>
> > > /* Initialisation */<br>
> > > gst_init (&argc, &argv);<br>
> > ><br>
> > > loop = g_main_loop_new (NULL, FALSE);<br>
> > ><br>
> > > /* Create gstreamer elements */<br>
> > > pipeline = gst_pipeline_new ("audio-player");<br>
> > > source = gst_element_factory_make<br>
> ("udpsrc","udp-source");<br>
> > > rtp_bin = gst_element_factory_make ("gstrtpbin",<br>
> > "gst_rtpbin");<br>
> > > rtp_decoder = gst_element_factory_make<br>
> ("rtpL16depay",<br>
> > "rtp_decoder");<br>
> > > sink = gst_element_factory_make ("filesink",<br>
> "file-sink");<br>
> > ><br>
> > > if (!pipeline || !source || !sink || !rtp_decoder<br>
> || !rtp_bin) {<br>
> > > g_printerr ("One element could not be created.<br>
> Exiting.\n");<br>
> > > return -1;<br>
> > > }<br>
> > ><br>
> > > gstrtp_sink_pad =<br>
> gst_element_get_request_pad(rtp_bin,<br>
> > > "recv_rtp_sink_0");<br>
> > > if (!gstrtp_sink_pad) {<br>
> > > g_printerr ("Sink pad could not be created.<br>
> Exiting.\n");<br>
> > > return -1;<br>
> > > }<br>
> > ><br>
> > > /* Set up the pipeline */<br>
> > > g_object_set (G_OBJECT (source), "port",<br>
> PORTA_UDP_ENTRADA ,<br>
> > NULL);<br>
> > > g_object_set (G_OBJECT (sink), "location",<br>
> "dados_recebidos_rtp" ,<br>
> > > NULL);<br>
> > ><br>
> > > /* we add a message handler */<br>
> > > bus = gst_pipeline_get_bus (GST_PIPELINE<br>
> (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 |<br>
> converter |<br>
> > > alsa-output */<br>
> > > gst_bin_add_many (GST_BIN (pipeline),<br>
> > > source, sink, rtp_bin,<br>
> rtp_decoder, NULL);<br>
> > ><br>
> > > /* we link the elements together */<br>
> > > if(gst_pad_link(gst_element_get_static_pad(source,<br>
> "src"),<br>
> > > gstrtp_sink_pad) != GST_PAD_LINK_OK){<br>
> > > g_warning("Error linking source to the<br>
> gstrtp_sink_pad");<br>
> > > gst_object_unref (GST_OBJECT (pipeline));<br>
> > > return 0;<br>
> > > }<br>
> > ><br>
> > > /*<br>
> > > After the packets are released from the<br>
> jitterbuffer, they<br>
> > will be<br>
> > > forwarded to a GstRtpsSrcDemux element.<br>
> > > The GstRtpsSrcDemux element will demux the packets<br>
> based on the<br>
> > > payload type and will create a unique pad<br>
> > > recv_rtp_src_%d_%d_%d on gstrtpbin with the<br>
> session number, SSRC<br>
> > > and payload type respectively as the pad name.<br>
> > > Because of that we have to dinamicaly link the src<br>
> pads on<br>
> > runtime.<br>
> > > */<br>
> > > g_signal_connect (rtp_bin, "pad-added", G_CALLBACK<br>
> > (on_pad_added),<br>
> > > rtp_decoder);<br>
> > > g_signal_connect (rtp_bin, "on-new-ssrc", G_CALLBACK<br>
> > (on_new_ssrc),<br>
> > > rtp_decoder);<br>
> > ><br>
> > > if(!gst_element_link (rtp_decoder, sink)){<br>
> > > g_warning("Error linking the rtp_decoder to the<br>
> sink");<br>
> > > gst_object_unref (GST_OBJECT (pipeline));<br>
> > > return -1;<br>
> > > }<br>
> > ><br>
> > > /* Set the pipeline to "playing" state*/<br>
> > > g_print ("listening on port: %d\n",<br>
> PORTA_UDP_ENTRADA);<br>
> > > gst_element_set_state (pipeline, GST_STATE_PLAYING);<br>
> > ><br>
> > > /* Iterate */<br>
> > > g_print ("Running...\n");<br>
> > > g_main_loop_run (loop);<br>
> > ><br>
> > > /* Out of the main loop, clean up nicely */<br>
> > > g_print ("Returned, stopping listening on port\n");<br>
> > > gst_element_set_state (pipeline, GST_STATE_NULL);<br>
> > ><br>
> > > g_print ("Deleting pipeline\n");<br>
> > > gst_object_unref (GST_OBJECT (pipeline));<br>
> > ><br>
> > > return 0;<br>
> > > }<br>
> > ><br>
> > ><br>
> ><br>
> ------------------------------------------------------------------------<br>
> > ><br>
> > ><br>
> ><br>
> ------------------------------------------------------------------------------<br>
> > > The NEW KODAK i700 Series Scanners deliver under ANY<br>
> > circumstances! Your<br>
> > > production scanning environment may not be a perfect<br>
> world - but<br>
> > thanks to<br>
> > > Kodak, there's a perfect scanner to get the job done!<br>
> With the<br>
> > NEW KODAK i700<br>
> > > Series Scanner you'll get full speed at 300 dpi even<br>
> with all image<br>
> > > processing features enabled.<br>
> <a href="http://p.sf.net/sfu/kodak-com" target="_blank">http://p.sf.net/sfu/kodak-com</a><br>
> > ><br>
> ><br>
> ------------------------------------------------------------------------<br>
> > ><br>
> > > _______________________________________________<br>
> > > gstreamer-devel mailing list<br>
> > > <a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
><br>
> > <mailto:<a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a>><br>
> > ><br>
> <a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
> > ><br>
> ><br>
> ><br>
> ><br>
> ------------------------------------------------------------------------------<br>
> > The NEW KODAK i700 Series Scanners deliver under ANY<br>
> > circumstances! Your<br>
> > production scanning environment may not be a perfect<br>
> world - but<br>
> > thanks to<br>
> > Kodak, there's a perfect scanner to get the job done!<br>
> With the NEW<br>
> > KODAK i700<br>
> > Series Scanner you'll get full speed at 300 dpi even<br>
> with all image<br>
> > processing features enabled.<br>
> <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>
><br>
> > <mailto:<a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a>><br>
><br>
> ><br>
> <a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > --<br>
> > "it might be a profitable thing to learn Java, but it has no<br>
> > intellectual value whatsoever" Alexander Stepanov<br>
> ><br>
> ------------------------------------------------------------------------<br>
> ><br>
> ><br>
> ------------------------------------------------------------------------------<br>
> > The NEW KODAK i700 Series Scanners deliver under ANY<br>
> circumstances! Your<br>
> > production scanning environment may not be a perfect world -<br>
> but thanks to<br>
> > Kodak, there's a perfect scanner to get the job done! With<br>
> the NEW KODAK i700<br>
> > Series Scanner you'll get full speed at 300 dpi even with<br>
> 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>
> ------------------------------------------------------------------------<br>
> ><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>
> ><br>
><br>
><br>
> ------------------------------------------------------------------------------<br>
> The NEW KODAK i700 Series Scanners deliver under ANY<br>
> circumstances! Your<br>
> production scanning environment may not be a perfect world -<br>
> but thanks to<br>
> Kodak, there's a perfect scanner to get the job done! With the<br>
> NEW KODAK i700<br>
> Series Scanner you'll get full speed at 300 dpi even with all<br>
> 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>
><br>
><br>
><br>
><br>
> --<br>
> "it might be a profitable thing to learn Java, but it has no<br>
> intellectual value whatsoever" Alexander Stepanov<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's a perfect scanner to get the job done! With the NEW KODAK i700<br>
> Series Scanner you'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>
> _______________________________________________ gstreamer-devel mailing list <a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a> <a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><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's a perfect scanner to get the job done! With the NEW KODAK i700<br>
Series Scanner you'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>"it might be a profitable thing to learn Java, but it has no intellectual value whatsoever" Alexander Stepanov<br>