GstBuffer Data-passing buffer type, supporting sub-buffers and metadata Buffers are the basic unit of data transfer in GStreamer. The GstBuffer type provides all the state necessary to define a region of memory as part of a stream. Sub-buffers are also supported, allowing a smaller region of a buffer to become its own buffer, with mechanisms in place to ensure that neither memory space goes away. Metadata is supported as a list of pointers to arbitrary metadata. Buffers are usually created with gst_buffer_new(). After a buffer has been created one will typically allocate memory for it and set the size of the buffer data. GstBuffer *buffer; gint size, widht, height, bpp; size = width * height * bpp; buffer = gst_buffer_new (); GST_BUFFER_SIZE (buffer) = size; GST_BUFFER_DATA (buffer) = g_alloc (size); ... GstBuffers can also be created from a GstBufferPool with gst_buffer_new_from_pool(). The bufferpool can be obtained from a peer element with gst_pad_get_bufferpool(). gst_buffer_ref() is used to increase the refcount of a buffer. This must be done when you want to keep a handle to the buffer after pushing it to the next element. To efficiently create a smaller buffer out of an existing one, you can use gst_buffer_create_sub(). Several flags of the buffer can be set and unset with the GST_BUFFER_FLAG_SET() and GST_BUFFER_FLAG_UNSET() macros. Use GST_BUFFER_FLAG_IS_SET() to test it a certain flag is set. Buffers usually are freed by unreffing them with gst_buffer_unref(). gst_buffer_destroy() can also be used to effectively destroy the buffer regardless of the refcount (dangerous). #GstBufferPool, #GstPad, #GstData Checks if the object is a buffer. @buf: object to check Casts an object to a GstBuffer. @buf: object to cast Gets the flags from this buffer. @buf: a #GstBuffer to retrieve the flags from Gives the status of a given #GstBufferFlag. @buf: a #GstBuffer to query @flag: the #GstBufferFlag to check Sets a buffer flag. @buf: a #GstBuffer to modify @flag: the #GstBufferFlag to set Clears a buffer flag. @buf: a #GstBuffer to modify @flag: the #GstBufferFlag to clear Retrieves a pointer to the data element of this buffer. @buf: a #GstBuffer to get data pointer of Gets the size of the data in this buffer. @buf: a #GstBuffer to get data size of Gets the offset in the source file of this buffer. @buf: a #GstBuffer to get offset of Gets the maximum size of this buffer. @buf: a #GstBuffer to get maximum size of Gets the timestamp for this buffer. @buf: a #GstBuffer to get timestamp of Gets the bufferpool for this buffer. @buf: a #GstBuffer to get bufferpool of Gets the bufferpool private data. @buf: a #GstBuffer to get bufferpool's private data of Obtains a lock on the object, making serialization possible. @buf: a #GstBuffer to lock Tries to obtain a lock on the buffer. If it can't get immediately, will return FALSE. @buf: a #GstBuffer to try to lock Releases a lock on the buffer. @buf: a #GstBuffer to unlock Gets the parent of this buffer. The parent is set on sub-buffers. @buf: a #GstBuffer to get parent of Gets the maximum age of a buffer. @buf: a #GstBuffer to get maximum age of Calls the buffer-specific copy function on the given buffer. @buf: a #GstBuffer to copy Calls the buffer-specific free function on the given buffer. @buf: a #GstBuffer to free This supplied function is used to copy the buffer contents. @srcbuf: a #GstBuffer to copy from @Returns: a newly allocated #GstBuffer copy of srcbuf This supplied function is called when the buffer data has to be freed. @buf: a #GstBuffer to clear the buffer data of This enumeration type describes the flags that can be used for a buffer. @GST_BUFFER_READONLY: buffer is read-only @GST_BUFFER_ORIGINAL: buffer is not a copy of another buffer @GST_BUFFER_DONTFREE: do not try to free the data when this buffer is unreferenced @data_type: @lock: @data: @size: @maxsize: @offset: @timestamp: @maxage: @parent: @pool: @pool_private: @free: @copy: @Returns: @pool: @offset: @size: @Returns: @location: @buffer: @Returns: @parent: @offset: @size: @Returns: @buffer: @append: @Returns: @buf: @buf2: @buffer: @buffer: @count: @buffer: @buffer: @buf1: @buf2: @Returns: @buf1: @buf2: @Returns: @buf1: @offset: @buf2: @len: @Returns: