Getting remote endpoint from UDP traffic in a udpsrc element

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting remote endpoint from UDP traffic in a udpsrc element

Antoni Silvestre Padrós
Hello,

I'm trying to get the remote endpoint info from the last received UDP packet in a udpsrc GStreamer element. 
The only way I can think of doing this is obtaining the socket of the udpsrc and then use the use the recvfrom call, however this I guess would force me to somehow reinject the traffic I captured with that call back to the udpsrc element so it doesn't get lost. Is there any other way of doing this?

I don't have very much experience programming with sockets so I might be missing something.

Any help would be greatly appreciated.

Toni Silvestre



------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages,
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev 
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Getting remote endpoint from UDP traffic in a udpsrc element

Wim Taymans
On Mon, 2010-12-13 at 11:59 +0100, Antoni Silvestre Padrós wrote:

> Hello,
>
>
> I'm trying to get the remote endpoint info from the last received UDP
> packet in a udpsrc GStreamer element.
> The only way I can think of doing this is obtaining the socket of the
> udpsrc and then use the use the recvfrom call, however this I guess
> would force me to somehow reinject the traffic I captured with that
> call back to the udpsrc element so it doesn't get lost. Is there any
> other way of doing this?
>
>
> I don't have very much experience programming with sockets so I might
> be missing something.

Udpsrc generates GstNetBuffers (see
-base/gst-libs/get/netbuffer/gstnetbuffer.h) that contains the sender
address. look in gstrtpbin for how you can use this address in your
plugin then.

Wim

>
>
> Any help would be greatly appreciated.
>
>
> Toni Silvestre
>
>
>
>
> ------------------------------------------------------------------------------
> Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
> new data types, scalar functions, improved concurrency, built-in packages,
> OCI, SQL*Plus, data movement tools, best practices and more.
> http://p.sf.net/sfu/oracle-sfdev2dev 
> _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages,
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev 
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Getting remote endpoint from UDP traffic in a udpsrc element

Antoni Silvestre Padrós
Thanks a lot for your answer.

I found the code you were referring to in the gstrtpsession source, and it would be perfect when writing a plug-in, however I'm not writing a plugin but a standalone application so I don't have direct access to buffers generated by plugins (and in my case inserting a tee and an appsink to the pipeline would not be very convenient).

In my project I'm using the gstrtpbin element for a videoconferencing application, when I receive RTCP reports I'd like to know it's remote endpoint to be able to answer them, as I don't know the address and port of the stream sender beforehand I should get it from the socket. So it would be great if the udpsrc would have a property with the remote endpoint info of the last packet or could emit a signal whenever the remote endpoint location changes.

I could add these features myself, nonetheless it would be great for me if my application would be directly compatible with any new udpsrc versions and gstreamer releases so if you think this feature would be interesting for the udpsrc plugin I could submit a patch with my changes so it may eventually be merged with the main code. If so, please tell me which would be the most convenient way doing it (creating a new property, a signal, ...) and I'll try to do it.

Anyways, maybe I did not understand well your answer and there's no need for these changes or there is another solution.

Thanks,
Toni Silvestre

On Mon, Dec 13, 2010 at 12:40, Wim Taymans <[hidden email]> wrote:
GstNetBuffer


------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel