2000-09-13 19:04:55 +00:00
|
|
|
<!-- ##### SECTION Title ##### -->
|
2000-10-22 16:30:25 +00:00
|
|
|
GstBufferPool
|
2000-09-13 19:04:55 +00:00
|
|
|
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
2000-10-22 16:30:25 +00:00
|
|
|
Create buffers from a pool
|
2000-09-13 19:04:55 +00:00
|
|
|
|
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
|
|
|
<para>
|
2000-10-22 16:30:25 +00:00
|
|
|
A bufferpool is used to create buffers in an efficient way. En element
|
|
|
|
can maintain a bufferpool with a fixed number of buffers. This will reduce
|
|
|
|
the g_malloc and g_free overhead.
|
2000-09-13 19:04:55 +00:00
|
|
|
</para>
|
|
|
|
<para>
|
2000-10-22 16:30:25 +00:00
|
|
|
A bufferpool can also be used to implement direct access. A bufferpool can be
|
|
|
|
sent from one element to another so that the latter can directly write into
|
|
|
|
the memory of the element that maintains the bufferpool. This can greatly reduce
|
|
|
|
the number of memcpy operations.
|
2000-09-13 19:04:55 +00:00
|
|
|
</para>
|
2001-04-18 20:16:53 +00:00
|
|
|
<para>
|
|
|
|
A bufferpool is created with gst_buffer_pool_new(). You'll have to set the
|
|
|
|
buffer allocation and destroy function afterwards with gst_buffer_pool_set_create_function() and
|
|
|
|
gst_buffer_pool_set_destroy_function().
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
To create a buffer from the bufferpool use gst_buffer_pool_new_buffer(), which is
|
|
|
|
functionally equivalent to gst_buffer_new_from_pool().
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
When the buffer is unreffed and has reached a refcount of 0, the bufferpools destroy
|
|
|
|
function is called with the buffer as an argument.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
A bufferpool can store private data in the buffer it creates with the GST_BUFFER_POOL_PRIVATE()
|
|
|
|
macro. To check it a buffer was made by a specific bufferpool, use the GST_BUFFER_BUFFERPOOL()
|
|
|
|
macro to get it's bufferpool.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Destroy the bufferpool with gst_buffer_pool_destroy().
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
A bufferpool can be requested from a pad with the gst_pad_get_bufferpool() function.
|
|
|
|
</para>
|
2000-09-13 19:04:55 +00:00
|
|
|
|
2000-10-22 16:30:25 +00:00
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
2000-09-13 19:04:55 +00:00
|
|
|
<para>
|
2001-04-18 20:16:53 +00:00
|
|
|
#GstBuffer, #GstPad
|
2000-09-13 19:04:55 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### STRUCT GstBufferPool ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2001-07-07 10:55:58 +00:00
|
|
|
@lock:
|
2001-10-17 10:21:27 +00:00
|
|
|
@buffer_free:
|
|
|
|
@buffer_copy:
|
|
|
|
@destroy_hook:
|
|
|
|
@user_data:
|
2000-09-13 19:04:55 +00:00
|
|
|
|
2001-10-19 22:49:35 +00:00
|
|
|
<!-- ##### USER_FUNCTION GstBufferPoolBufferNewFunction ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@pool:
|
|
|
|
@location:
|
|
|
|
@size:
|
|
|
|
@user_data:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### USER_FUNCTION GstBufferPoolDestroyHook ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@pool:
|
|
|
|
@user_data:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO GST_BUFFER_POOL_UNLOCK ##### -->
|
|
|
|
<para>
|
|
|
|
Lock the given bufferpool.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@pool: The pool to lock.
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO GST_BUFFER_POOL_LOCK ##### -->
|
|
|
|
<para>
|
|
|
|
Unlock the given bufferpool.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@pool: the bufferpool to unlock.
|
|
|
|
|
|
|
|
|
2000-09-13 19:04:55 +00:00
|
|
|
<!-- ##### FUNCTION gst_buffer_pool_new ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2001-07-07 10:55:58 +00:00
|
|
|
<!-- ##### FUNCTION gst_buffer_pool_ref ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@pool:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_buffer_pool_ref_by_count ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@pool:
|
|
|
|
@count:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_buffer_pool_unref ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@buffer:
|
2001-07-20 21:26:34 +00:00
|
|
|
<!-- # Unused Parameters # -->
|
|
|
|
@pool:
|
2001-07-07 10:55:58 +00:00
|
|
|
|
|
|
|
|
2000-09-13 19:04:55 +00:00
|
|
|
<!-- ##### FUNCTION gst_buffer_pool_destroy ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@pool:
|
|
|
|
|
|
|
|
|
2001-07-07 10:55:58 +00:00
|
|
|
<!-- ##### FUNCTION gst_buffer_pool_get_default ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@buffer_size:
|
|
|
|
@pool_size:
|
|
|
|
@Returns:
|
2001-10-17 10:21:27 +00:00
|
|
|
<!-- # Unused Parameters # -->
|
|
|
|
@oldpool:
|
2001-07-07 10:55:58 +00:00
|
|
|
|
|
|
|
|
2001-10-19 22:49:35 +00:00
|
|
|
<!-- ##### FUNCTION gst_buffer_pool_set_user_data ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@pool:
|
|
|
|
@user_data:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_buffer_pool_get_user_data ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@pool:
|
|
|
|
@user_data:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_buffer_pool_set_buffer_copy_function ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@pool:
|
|
|
|
@copy:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_buffer_pool_set_buffer_free_function ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@pool:
|
|
|
|
@destroy:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_buffer_pool_set_buffer_new_function ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@pool:
|
|
|
|
@create:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_buffer_pool_set_destroy_hook ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@pool:
|
|
|
|
@destroy:
|
|
|
|
|
|
|
|
|