}
}
+static gboolean
+remove_meta_unpooled (GstBuffer * buffer, GstMeta ** meta, gpointer user_data)
+{
+ if (!GST_META_FLAG_IS_SET (*meta, GST_META_FLAG_POOLED))
+ *meta = NULL;
+ return TRUE;
+}
+
static void
default_reset_buffer (GstBufferPool * pool, GstBuffer * buffer,
GstBufferPoolParams * params)
GST_BUFFER_DURATION (buffer) = GST_CLOCK_TIME_NONE;
GST_BUFFER_OFFSET (buffer) = GST_BUFFER_OFFSET_NONE;
GST_BUFFER_OFFSET_END (buffer) = GST_BUFFER_OFFSET_NONE;
+
+ /* remove all metadata without the POOLED flag */
+ gst_buffer_foreach_meta (buffer, remove_meta_unpooled, pool);
}
/**
gst_poll_write_control (pool->poll);
}
-static gboolean
-remove_meta_unpooled (GstBuffer * buffer, GstMeta ** meta, gpointer user_data)
-{
- if (!GST_META_FLAG_IS_SET (*meta, GST_META_FLAG_POOLED))
- *meta = NULL;
- return TRUE;
-}
-
/**
* gst_buffer_pool_release_buffer:
* @pool: a #GstBufferPool
if (!G_ATOMIC_POINTER_COMPARE_AND_EXCHANGE (&buffer->pool, pool, NULL))
return;
- /* remove all metadata without the POOLED flag */
- gst_buffer_foreach_meta (buffer, remove_meta_unpooled, pool);
-
pclass = GST_BUFFER_POOL_GET_CLASS (pool);
if (G_LIKELY (pclass->release_buffer))
* buffers from the default memory allocator and with the configured
* size, prefix and alignment.
* @reset_buffer: reset the buffer to its state when it was freshly allocated.
- * The default implementation will clear the flags and timestamps.
+ * The default implementation will clear the flags, timestamps and
+ * will remove the metadata added after alloc_buffer.
* @release_buffer: release a buffer back in the pool. The default
* implementation will put the buffer back in the queue and notify any
* blocking acquire_buffer calls.