diff --git a/gst/gstbuffer.c b/gst/gstbuffer.c index dc7a9d7029..f2f56eb7e4 100644 --- a/gst/gstbuffer.c +++ b/gst/gstbuffer.c @@ -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 = pool; buffer->free = pool->buffer_free; + buffer->copy = pool->buffer_copy; buffer->pool_private = pool->user_data; return buffer; diff --git a/gst/gstbufferpool.c b/gst/gstbufferpool.c index 3111f82522..12fb7747a4 100644 --- a/gst/gstbufferpool.c +++ b/gst/gstbufferpool.c @@ -172,11 +172,11 @@ gst_buffer_pool_set_buffer_new_function (GstBufferPool *pool, } /** - * gst_buffer_pool_set_buffer_destroy_function: - * @pool: the pool to set the buffer destroy function for - * @destroy: the destroy function + * gst_buffer_pool_set_buffer_free_function: + * @pool: the pool to set the buffer free function for + * @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. */ void @@ -188,6 +188,23 @@ gst_buffer_pool_set_buffer_free_function (GstBufferPool *pool, 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: * @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. */ void -gst_buffer_pool_set_pool_destroy_hook (GstBufferPool *pool, - GstBufferPoolDestroyHook destroy) +gst_buffer_pool_set_destroy_hook (GstBufferPool *pool, + GstBufferPoolDestroyHook destroy) { g_return_if_fail (pool != NULL); diff --git a/gst/gstbufferpool.h b/gst/gstbufferpool.h index fe327e2ebf..507f77e5e1 100644 --- a/gst/gstbufferpool.h +++ b/gst/gstbufferpool.h @@ -56,6 +56,7 @@ struct _GstBufferPool { GstBufferPoolBufferNewFunction buffer_new; GstBufferFreeFunc buffer_free; + GstBufferCopyFunc buffer_copy; GstBufferPoolDestroyHook destroy_hook; gpointer user_data; @@ -76,6 +77,8 @@ void gst_buffer_pool_set_buffer_new_function (GstBufferPool *pool, GstBufferPoolBufferNewFunction create); void gst_buffer_pool_set_buffer_free_function (GstBufferPool *pool, GstBufferFreeFunc destroy); +void gst_buffer_pool_set_buffer_copy_function (GstBufferPool *pool, + GstBufferCopyFunc copy); void gst_buffer_pool_set_destroy_hook (GstBufferPool *pool, GstBufferPoolDestroyHook destroy); void gst_buffer_pool_set_user_data (GstBufferPool *pool,