The bufferpool api has changed. Check gstbufferpool.h to see the updated interface.

Original commit message from CVS:
The bufferpool api has changed. Check gstbufferpool.h to see the updated
interface.

Also, the default bufferpool implementation has been finished somewhat. Take a
look at speed.c to see an example of its use, when I get the plugins committed.
This commit is contained in:
Andy Wingo 2001-08-27 06:24:49 +00:00
parent b6a69722aa
commit 104844cb86
3 changed files with 27 additions and 6 deletions

View file

@ -100,6 +100,7 @@ gst_buffer_new_from_pool (GstBufferPool *pool, guint64 location, gint size)
buffer = pool->buffer_new (pool, location, size, pool->user_data); buffer = pool->buffer_new (pool, location, size, pool->user_data);
buffer->pool = pool; buffer->pool = pool;
buffer->free = pool->buffer_free; buffer->free = pool->buffer_free;
buffer->copy = pool->buffer_copy;
buffer->pool_private = pool->user_data; buffer->pool_private = pool->user_data;
return buffer; return buffer;

View file

@ -172,11 +172,11 @@ gst_buffer_pool_set_buffer_new_function (GstBufferPool *pool,
} }
/** /**
* gst_buffer_pool_set_buffer_destroy_function: * gst_buffer_pool_set_buffer_free_function:
* @pool: the pool to set the buffer destroy function for * @pool: the pool to set the buffer free function for
* @destroy: the destroy function * @destroy: the free function
* *
* Sets the function that will be called when a buffer is destroyed * Sets the function that will be called when a buffer is freed
* from this pool. * from this pool.
*/ */
void void
@ -188,6 +188,23 @@ gst_buffer_pool_set_buffer_free_function (GstBufferPool *pool,
pool->buffer_free = destroy; pool->buffer_free = destroy;
} }
/**
* gst_buffer_pool_set_buffer_copy_function:
* @pool: the pool to set the buffer copy function for
* @destroy: the copy function
*
* Sets the function that will be called when a buffer is copied.
* If this is not set, the default GstBuffer implementation will be used.
*/
void
gst_buffer_pool_set_buffer_copy_function (GstBufferPool *pool,
GstBufferCopyFunc copy)
{
g_return_if_fail (pool != NULL);
pool->buffer_copy = copy;
}
/** /**
* gst_buffer_pool_set_pool_destroy_hook: * gst_buffer_pool_set_pool_destroy_hook:
* @pool: the pool to set the destroy hook for * @pool: the pool to set the destroy hook for
@ -197,8 +214,8 @@ gst_buffer_pool_set_buffer_free_function (GstBufferPool *pool,
* You can take care of you private_data here. * You can take care of you private_data here.
*/ */
void void
gst_buffer_pool_set_pool_destroy_hook (GstBufferPool *pool, gst_buffer_pool_set_destroy_hook (GstBufferPool *pool,
GstBufferPoolDestroyHook destroy) GstBufferPoolDestroyHook destroy)
{ {
g_return_if_fail (pool != NULL); g_return_if_fail (pool != NULL);

View file

@ -56,6 +56,7 @@ struct _GstBufferPool {
GstBufferPoolBufferNewFunction buffer_new; GstBufferPoolBufferNewFunction buffer_new;
GstBufferFreeFunc buffer_free; GstBufferFreeFunc buffer_free;
GstBufferCopyFunc buffer_copy;
GstBufferPoolDestroyHook destroy_hook; GstBufferPoolDestroyHook destroy_hook;
gpointer user_data; gpointer user_data;
@ -76,6 +77,8 @@ void gst_buffer_pool_set_buffer_new_function (GstBufferPool *pool,
GstBufferPoolBufferNewFunction create); GstBufferPoolBufferNewFunction create);
void gst_buffer_pool_set_buffer_free_function (GstBufferPool *pool, void gst_buffer_pool_set_buffer_free_function (GstBufferPool *pool,
GstBufferFreeFunc destroy); GstBufferFreeFunc destroy);
void gst_buffer_pool_set_buffer_copy_function (GstBufferPool *pool,
GstBufferCopyFunc copy);
void gst_buffer_pool_set_destroy_hook (GstBufferPool *pool, void gst_buffer_pool_set_destroy_hook (GstBufferPool *pool,
GstBufferPoolDestroyHook destroy); GstBufferPoolDestroyHook destroy);
void gst_buffer_pool_set_user_data (GstBufferPool *pool, void gst_buffer_pool_set_user_data (GstBufferPool *pool,