[gst-devel] Re: [gst-cvs] thomasvs gst-plugins: gst-plugins/ gst-plugins/sys/v4l/

Thomas Vander Stichele thomas at apestaart.org
Tue Apr 27 10:42:03 CEST 2004

On Tue, 2004-04-27 at 17:06, Ronald Bultje wrote:
> Howdy,
> On Tue, 27 Apr 2004, Thomas Vander Stichele wrote:
> > +/* structure for buffer private data referencing element and frame number */
> > +typedef struct
> > +{
> > +  GstV4lSrc *v4lsrc;
> > +  int num;
> > +}
> > +v4lsrc_private_t;
> [..]
> > +  v4lsrc_private = g_malloc (sizeof (v4lsrc_private_t));
> Given the amount of allocations (low) and their lifespan (low), I guess
> this is a perfect example of a case where we should use g_alloca(). That
> way, v4lsrc is realtime.

It's just a first pass at trying to fix the issue with the hints you
gave me :)

> When I tried out this fix for qc-usb cams some time ago (on a computer
> that's now in storage, so uncommitted... :-( ), I fixed this by simply
> allocating the buffers (using g_malloc()) in the capture-init functions in
> v4lsrc_calls.c. But please don't allocate in-a-row in the _get() function,
> that seems fairly heavy and makes v4lsrc non-realtime.

It's probably even better to use a pre-alloced array, enough for every
frame that the driver can buffer.  Esp. since it's small.  That way you
don't have any overhead anymore.

But I'm willing to submit myself to any fix you propose or commit as
long as it makes the stupid webcams work :)


Dave/Dina : future TV today ! - http://www.davedina.org/
<-*- thomas (dot) apestaart (dot) org -*->
Don't you see that my heart's on fire
wicked wings that you spread round me sometimes
All I know is we've got to aim higher
Babe I wish that we'd go for the great escape
<-*- thomas (at) apestaart (dot) org -*->
URGent, best radio on the net - 24/7 ! - http://urgent.fm/

More information about the gstreamer-devel mailing list