[Nice] a Farsight 2 nice transmitter, a git repo and various related thougths

Rémi Denis-Courmont remi.denis-courmont at nokia.com
Wed Apr 30 04:52:12 PDT 2008

Le Tuesday 29 April 2008 21:29:43 ext Olivier Crête, vous avez écrit :
> > > I made the default buffer larger (64k), because they are used to
> > > receive data UDP packets and we don't want them to be truncated.
> > > Ideally, we'd just allocate the memory on demand (that's what all the
> > > other gstreamer sources do anyway).
> >
> > Hmm well. I remember doing that a few months back on another
> > RTP-receiving software, and then people complained that I was allocating
> > to much memory.
> >
> > Also, *in theory*, UDP jumbo-datagrams can exceed 64k, yet we cannot
> > allocate a 2 gigabyte buffer. Better read the MTU from an appropriately
> > connect()'d UDP socket, IMHO.
> I guess the solution is to use ioctl(..FIONREAD,..) and allocate the
> right amount of ram (or at least have a way to do that)... Since gst
> does mallocs all the time anyway.

Doing one ioctl() before each recv() is going to add further latency, in 
addition to malloc(). I would rather do a getsockopt(IP_MTU/IPV6_MTU) once 
and for all.

I'd rather avoid malloc() on the fast path, within libince. I don't mind the 
gst plugin doing it. Though given the MTU, one could probably pre-allocate a 
pool of receive buffers.

Rémi Denis-Courmont

More information about the Nice mailing list