void
gst_buffer_default_free (GstBuffer *buffer)
{
+ g_return_if_fail (buffer != NULL);
+
/* free our data */
if (!GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_DONTFREE) && GST_BUFFER_DATA (buffer))
g_free (GST_BUFFER_DATA (buffer));
{
GstBuffer *copy;
+ g_return_val_if_fail (buffer != NULL, NULL);
+
/* create a fresh new buffer */
copy = gst_buffer_new ();
gst_buffer_merge (GstBuffer *buf1, GstBuffer *buf2)
{
GstBuffer *result;
+
/* we're just a specific case of the more general gst_buffer_span() */
result = gst_buffer_span (buf1, 0, buf2, buf1->size + buf2->size);
gboolean
gst_buffer_is_span_fast (GstBuffer *buf1, GstBuffer *buf2)
{
+ g_return_val_if_fail (buf1 != NULL && buf2 != NULL, FALSE);
g_return_val_if_fail (GST_BUFFER_REFCOUNT_VALUE (buf1) > 0, FALSE);
g_return_val_if_fail (GST_BUFFER_REFCOUNT_VALUE (buf2) > 0, FALSE);
{
GstBuffer *newbuf;
+ g_return_val_if_fail (buf1 != NULL && buf2 != NULL, FALSE);
g_return_val_if_fail (GST_BUFFER_REFCOUNT_VALUE (buf1) > 0, NULL);
g_return_val_if_fail (GST_BUFFER_REFCOUNT_VALUE (buf2) > 0, NULL);
g_return_val_if_fail (len > 0, NULL);
void
gst_buffer_pool_default_free (GstBufferPool *pool)
{
+ g_return_if_fail (pool != NULL);
+
_GST_DATA_DISPOSE (GST_DATA (pool));
g_free (pool);
_gst_buffer_pool_live--;
gboolean
gst_buffer_pool_is_active (GstBufferPool *pool)
{
+ g_return_val_if_fail (pool != NULL, FALSE);
+
return pool->active;
}
void
gst_buffer_pool_set_active (GstBufferPool *pool, gboolean active)
{
+ g_return_if_fail (pool != NULL);
+
pool->active = active;
}
void
gst_buffer_pool_set_user_data (GstBufferPool *pool, gpointer user_data)
{
+ g_return_if_fail (pool != NULL);
+
pool->user_data = user_data;
}
gpointer
gst_buffer_pool_get_user_data (GstBufferPool *pool)
{
+ g_return_val_if_fail (pool != NULL, NULL);
+
return pool->user_data;
}
void
gst_data_init (GstData *data, GType type, guint16 flags, GstDataFreeFunction free, GstDataCopyFunction copy)
{
+ g_return_if_fail (data != NULL);
+
_GST_DATA_INIT (data, type, flags, free, copy);
}
void
gst_data_copy_into (const GstData *data, GstData *target)
{
+ g_return_if_fail (data != NULL);
}
/**
void
gst_data_dispose (GstData *data)
{
+ g_return_if_fail (data != NULL);
+
_GST_DATA_DISPOSE (data);
}
GstData*
gst_data_copy (const GstData *data)
{
+ g_return_val_if_fail (data != NULL, NULL);
+
if (data->copy)
return data->copy (data);
{
gint refcount;
+ g_return_val_if_fail (data != NULL, FALSE);
+
GST_ATOMIC_INT_READ (&data->refcount, &refcount);
if (refcount == 1 && !GST_DATA_FLAG_IS_SET (data, GST_DATA_READONLY))
{
gint refcount;
+ g_return_val_if_fail (data != NULL, NULL);
+
GST_ATOMIC_INT_READ (&data->refcount, &refcount);
if (refcount == 1 && !GST_DATA_FLAG_IS_SET (data, GST_DATA_READONLY))
void
gst_data_free (GstData *data)
{
+ if (!data)
+ return;
+
if (data->free)
data->free (data);
}