[gst-devel] The Xine Plugin and GstBuffers
rbultje at ronald.bitfreak.net
Sat May 24 00:39:07 CEST 2003
On Sat, 2003-05-24 at 08:20, Taylor Christopher P wrote:
> now for my question. How does GstBuffer work in gstreamer? I noticed that
> there's a GST_BUFFER_MAXSIZE and GST_BUFFER_SIZE macro in gstbuffer.h. Is a
> "maxsize" equivalent to the streams' total size while a "size" is the size
> of the current buffer?
Size is the part of the buffer that is in use. Maxsize is the total
allocated size in this buffer. Size is what you're most lilely
interested in. Maxsize is interesting for in-place conversions (like
what audioconvert and colorspace do) - it allows one to see whether the
current buffer is big enough to store the new data.
> And I'm going to venture a guess that a GstBufferPool is just a way of
> reusing GstBuffers to read an entire media stream?
Yes. Though it's primary purpose - seen from how we currently use it -
isn't to just reuse allocated data, but it's rather to take care of
cases where you have to reuse data because you didn't allocate it. Think
of a mmap()'ed or Shm'ed (DMA'able) memory area where you're reading a
file from (filesrc), where you're reading video from (v4lsrc) or to
(xvideosink), etc. You don't want to free the buffers, you rather want
to tell the kernel that you're done using this part and that the kernel
can move new data into it.
Ronald Bultje <rbultje at ronald.bitfreak.net>
More information about the gstreamer-devel