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

David Schleef ds at schleef.org
Tue Apr 27 10:46:03 CEST 2004

On Tue, Apr 27, 2004 at 05:06:42PM +0200, Ronald Bultje wrote:
> 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.

Are you insane?  Using alloca() at that point creates a chunk of
memory that disappears in 'return GST_DATA (buf);'.

> 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.

Ok, repeat after me:

  GStreamer is not real-time
  GStreamer is not real-time
  GStreamer is not real-time

It's not going to be real-time-capable until a smart developer
spends a significant amount of time setting up infrastructure
and auditing a lot of code.  Given that in the last 2 years,
nobody has stepped up to do this, I don't see it happening any
time soon, and do not wish to constrain current developers to
a model that we may not support any time soon.

Nevertheless, in many cases, I avoid coding in such a way that
I know will cause real-time issues.  This is not one of those

(Also, memory allocation is not inherintly non-real-time.  The
particular implementation of malloc() in this case may occasionally
have a much higher latency than the average case.  But then, so
might alloca().)


More information about the gstreamer-devel mailing list