[gst-devel] Re: [gst-cvs] thomasvs gst-plugins: gst-plugins/ gst-plugins/sys/v4l/
Ronald Bultje
rbultje at ronald.bitfreak.net
Tue Apr 27 08:03:06 CEST 2004
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.
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.
Thanks,
Ronald
More information about the gstreamer-devel
mailing list