The bufferpool api has changed. Check gstbufferpool.h to see the updated interface.
authorAndy Wingo <wingo@pobox.com>
Mon, 27 Aug 2001 06:24:49 +0000 (06:24 +0000)
committerAndy Wingo <wingo@pobox.com>
Mon, 27 Aug 2001 06:24:49 +0000 (06:24 +0000)
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.

gst/gstbuffer.c
gst/gstbufferpool.c
gst/gstbufferpool.h

index dc7a9d7..f2f56eb 100644 (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 = pool;
   buffer->free = pool->buffer_free;
+  buffer->copy = pool->buffer_copy;
   buffer->pool_private = pool->user_data;
   
   return buffer;
index 3111f82..12fb774 100644 (file)
@@ -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 
@@ -189,6 +189,23 @@ gst_buffer_pool_set_buffer_free_function (GstBufferPool *pool,
 }
 
 /**
+ * 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
  * @destroy: the destroy function
@@ -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);
   
index fe327e2..507f77e 100644 (file)
@@ -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,