Commit ccccda7d authored by Wim Taymans's avatar Wim Taymans
Browse files

Commit my pending changes.

Original commit message from CVS:
Commit my pending changes.
- revert WHERE stuff
- added fast type checking
- add preliminary stack trace functionality
- minor fixes/cleanups.
parent 1058e3cf
......@@ -8,6 +8,8 @@ else
GSTARCH_SRCS =
endif
#GST_INSTRUMENT_FLAGS = -finstrument-functions -DGST_ENABLE_FUNC_INSTRUMENTATION
if USE_GLIB2
GST_OBJECT_MODEL_SRC = gstmarshal.c
GST_OBJECT_MODEL_HDR = gstmarshal.h
......@@ -198,7 +200,7 @@ noinst_HEADERS = \
gstarch.h \
gstpropsprivate.h
CFLAGS = $(LIBGST_CFLAGS) -D_GNU_SOURCE -DGST_CONFIG_DIR=\""$(GST_CONFIG_DIR)"\"
CFLAGS = $(LIBGST_CFLAGS) -D_GNU_SOURCE -DGST_CONFIG_DIR=\""$(GST_CONFIG_DIR)"\" -Wall
LIBS = $(LIBGST_LIBS)
LDFLAGS = ""
libgst_la_LDFLAGS = -version-info $(GST_LIBVERSION)
......
......@@ -41,7 +41,7 @@ noinst_HEADERS = \
gstaggregator.h \
gstsinesrc.h
CFLAGS += -O2 -Wall
CFLAGS += -O2 -Wall -finstrument-functions -DGST_ENABLE_FUNC_INSTRUMENTATION
LDFLAGS += -lm
libgstelements_la_LIBADD = $(GHTTP_LIBS)
......
......@@ -64,8 +64,8 @@ static void gst_disksrc_set_property (GObject *object, guint prop_id,
static void gst_disksrc_get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec);
static GstBuffer * gst_disksrc_get (GstPad *pad);
static GstBuffer * gst_disksrc_get_region (GstPad *pad,GstRegionType type,guint64 offset,guint64 len);
static GstBuffer* gst_disksrc_get (GstPad *pad);
static GstBufferPool* gst_disksrc_get_bufferpool (GstPad *pad);
static GstElementStateReturn
gst_disksrc_change_state (GstElement *element);
......@@ -73,7 +73,7 @@ static GstElementStateReturn
static gboolean gst_disksrc_open_file (GstDiskSrc *src);
static void gst_disksrc_close_file (GstDiskSrc *src);
static GstElementClass *parent_class = NULL;
static GstElementClass* parent_class = NULL;
//static guint gst_disksrc_signals[LAST_SIGNAL] = { 0 };
GType
......@@ -133,8 +133,8 @@ gst_disksrc_init (GstDiskSrc *disksrc)
// GST_FLAG_SET (disksrc, GST_SRC_);
disksrc->srcpad = gst_pad_new ("src", GST_PAD_SRC);
gst_pad_set_get_function (disksrc->srcpad,gst_disksrc_get);
gst_pad_set_getregion_function (disksrc->srcpad,gst_disksrc_get_region);
gst_pad_set_get_function (disksrc->srcpad, gst_disksrc_get);
gst_pad_set_bufferpool_function (disksrc->srcpad, gst_disksrc_get_bufferpool);
gst_element_add_pad (GST_ELEMENT (disksrc), disksrc->srcpad);
disksrc->filename = NULL;
......@@ -220,121 +220,98 @@ gst_disksrc_get_property (GObject *object, guint prop_id, GValue *value, GParamS
}
}
/**
* gst_disksrc_get:
* @pad: #GstPad to push a buffer from
*
* Push a new buffer from the disksrc at the current offset.
*/
static GstBuffer *
gst_disksrc_get (GstPad *pad)
static GstBuffer*
gst_disksrc_buffer_new (GstBufferPool *pool, gint64 location, gint size, gpointer user_data)
{
GstDiskSrc *src;
GstBuffer *buf;
g_return_val_if_fail (pad != NULL, NULL);
src = GST_DISKSRC (gst_pad_get_parent (pad));
g_return_val_if_fail (GST_FLAG_IS_SET (src, GST_DISKSRC_OPEN), NULL);
/* deal with EOF state */
if (src->curoffset >= src->size) {
GST_DEBUG (0,"map offset %ld >= size %ld --> eos\n", src->curoffset, src->size);
gst_pad_event(pad, GST_EVENT_EOS, 0LL, 0);
buf = gst_buffer_new();
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_EOS);
return buf;
}
src = GST_DISKSRC (user_data);
/* create the buffer */
// FIXME: should eventually use a bufferpool for this
buf = gst_buffer_new ();
g_return_val_if_fail (buf != NULL, NULL);
/* simply set the buffer to point to the correct region of the file */
GST_BUFFER_DATA (buf) = src->map + src->curoffset;
GST_BUFFER_OFFSET (buf) = src->curoffset;
GST_BUFFER_DATA (buf) = src->map + location;
GST_BUFFER_OFFSET (buf) = location;
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_DONTFREE);
if ((src->curoffset + src->bytes_per_read) > src->size) {
GST_BUFFER_SIZE (buf) = src->size - src->curoffset;
// FIXME: set the buffer's EOF bit here
} else
GST_BUFFER_SIZE (buf) = src->bytes_per_read;
if ((location + size) > src->size)
GST_BUFFER_SIZE (buf) = src->size - location;
else
GST_BUFFER_SIZE (buf) = size;
GST_DEBUG (0,"map %p, offset %ld (%p), size %d\n", src->map, src->curoffset,
src->map + src->curoffset, GST_BUFFER_SIZE (buf));
//gst_util_dump_mem (GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
return buf;
}
src->curoffset += GST_BUFFER_SIZE (buf);
static void
gst_disksrc_buffer_free (GstBuffer *buf)
{
// FIXME do something here
}
if (src->new_seek) {
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLUSH);
GST_DEBUG (0,"new seek\n");
src->new_seek = FALSE;
static GstBufferPool*
gst_disksrc_get_bufferpool (GstPad *pad)
{
GstDiskSrc *src;
src = GST_DISKSRC (gst_pad_get_parent (pad));
if (!src->bufferpool) {
src->bufferpool = gst_buffer_pool_new ();
gst_buffer_pool_set_buffer_new_function (src->bufferpool, gst_disksrc_buffer_new);
gst_buffer_pool_set_buffer_free_function (src->bufferpool, gst_disksrc_buffer_free);
gst_buffer_pool_set_user_data (src->bufferpool, src);
}
/* we're done, return the buffer */
return buf;
return src->bufferpool;
}
/**
* gst_disksrc_get_region:
* @src: #GstSrc to push a buffer from
* @offset: offset in file
* @size: number of bytes
* gst_disksrc_get:
* @pad: #GstPad to push a buffer from
*
* Push a new buffer from the disksrc of given size at given offset.
* Push a new buffer from the disksrc at the current offset.
*/
static GstBuffer *
gst_disksrc_get_region (GstPad *pad, GstRegionType type,guint64 offset,guint64 len)
gst_disksrc_get (GstPad *pad)
{
GstDiskSrc *src;
GstBuffer *buf;
g_return_val_if_fail (pad != NULL, NULL);
g_return_val_if_fail (type == GST_REGION_OFFSET_LEN, NULL);
src = GST_DISKSRC (gst_pad_get_parent (pad));
g_return_val_if_fail (GST_IS_DISKSRC (src), NULL);
g_return_val_if_fail (GST_FLAG_IS_SET (src, GST_DISKSRC_OPEN), NULL);
/* deal with EOF state */
if (offset >= src->size) {
gst_pad_event (pad, GST_EVENT_EOS, 0LL, 0);
GST_DEBUG (0,"map offset %lld >= size %ld --> eos\n", offset, src->size);
//FIXME
if (src->curoffset >= src->size) {
GST_DEBUG (0,"map offset %ld >= size %ld --> eos\n", src->curoffset, src->size);
gst_pad_event(pad, GST_EVENT_EOS, 0LL, 0);
buf = gst_buffer_new();
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_EOS);
return buf;
}
/* create the buffer */
// FIXME: should eventually use a bufferpool for this
buf = gst_buffer_new ();
g_return_val_if_fail (buf != NULL, NULL);
/* simply set the buffer to point to the correct region of the file */
GST_BUFFER_DATA (buf) = src->map + offset;
GST_BUFFER_OFFSET (buf) = offset;
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_DONTFREE);
// FIXME use a bufferpool
buf = gst_disksrc_buffer_new (NULL, src->curoffset, src->bytes_per_read, src);
if ((offset + len) > src->size) {
GST_BUFFER_SIZE (buf) = src->size - offset;
// FIXME: set the buffer's EOF bit here
} else
GST_BUFFER_SIZE (buf) = len;
//gst_util_dump_mem (GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
src->curoffset += GST_BUFFER_SIZE (buf);
GST_DEBUG (0,"map %p, offset %lld, size %d\n", src->map, offset, GST_BUFFER_SIZE (buf));
if (src->new_seek) {
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLUSH);
GST_DEBUG (0,"new seek\n");
src->new_seek = FALSE;
}
/* we're done, return the buffer off now */
/* we're done, return the buffer */
return buf;
}
/* open the file and mmap it, necessary to go to READY state */
static gboolean
gst_disksrc_open_file (GstDiskSrc *src)
......
......@@ -64,6 +64,7 @@ struct _GstDiskSrc {
gchar *filename;
/* fd */
gint fd;
GstBufferPool *bufferpool;
/* mapping parameters */
gulong size; /* how long is the file? */
......
......@@ -225,6 +225,7 @@ gst_fakesink_chain (GstPad *pad, GstBuffer *buf)
if (GST_IS_EVENT(buf)) {
g_print("fakesink: have event!\n");
gst_element_set_state (GST_ELEMENT (fakesink), GST_STATE_PAUSED);
return;
}
......
......@@ -335,7 +335,8 @@ gst_fakesrc_get(GstPad *pad)
if (src->num_buffers == 0) {
g_print("fakesrc: sending EOS\n");
return GST_BUFFER(gst_event_empty_new (GST_EVENT_EOS));
gst_element_set_state (GST_ELEMENT (src), GST_STATE_PAUSED);
return GST_BUFFER(gst_event_new (GST_EVENT_EOS));
}
else {
if (src->num_buffers > 0)
......@@ -345,7 +346,7 @@ gst_fakesrc_get(GstPad *pad)
if (src->eos) {
GST_INFO (0, "fakesrc is setting eos on pad");
g_print("fakesrc: sending EOS\n");
return GST_BUFFER(gst_event_empty_new (GST_EVENT_EOS));
return GST_BUFFER(gst_event_new (GST_EVENT_EOS));
}
buf = gst_buffer_new();
......@@ -397,7 +398,7 @@ gst_fakesrc_loop(GstElement *element)
if (src->eos) {
GST_INFO (0, "fakesrc is setting eos on pad");
gst_pad_push(pad, GST_BUFFER(gst_event_empty_new (GST_EVENT_EOS)));
gst_pad_push(pad, GST_BUFFER(gst_event_new (GST_EVENT_EOS)));
}
buf = gst_buffer_new();
......
......@@ -596,6 +596,7 @@ gst_filesrc_close_file (GstFileSrc *src)
{
g_return_if_fail (GST_FLAG_IS_SET (src, GST_FILESRC_OPEN));
g_print ("close\n");
/* close the file */
close (src->fd);
......
......@@ -220,7 +220,7 @@ gtk_signal_handler_pending ((GtkObject *)object,name,may_block)
gint* g_signal_list_ids (GType type, guint *n_ids);
// lists
GSList* g_slist_delete_link (GSList *list, GSList *link);
GSList* g_slist_delete_link (GSList *list, GSList *link) __attribute__ ((no_instrument_function));
// arguments/parameters
......
......@@ -90,7 +90,12 @@ gst_init (int *argc, char **argv[])
GST_INFO (GST_CAT_GST_INIT, "Initializing GStreamer Core Library");
gst_object_get_type ();
gst_pad_get_type ();
gst_real_pad_get_type ();
gst_ghost_pad_get_type ();
gst_elementfactory_get_type ();
gst_element_get_type ();
gst_typefactory_get_type ();
#ifndef GST_DISABLE_AUTOPLUG
gst_autoplugfactory_get_type ();
......
......@@ -32,13 +32,6 @@ GType _gst_buffer_type;
static GMemChunk *_gst_buffer_chunk;
static GMutex *_gst_buffer_chunk_lock;
#ifdef GST_BUFFER_WHERE
static GSList *_debug_live = 0;
# define GST_BUFFERS_COUNT (g_slist_length(_debug_live))
#else
# define GST_BUFFERS_COUNT 1
#endif
void
_gst_buffer_initialize (void)
{
......@@ -74,15 +67,12 @@ _gst_buffer_initialize (void)
* Returns: new buffer
*/
GstBuffer*
gst_buffer_new_loc (GST_WHERE_ARGS)
gst_buffer_new (void)
{
GstBuffer *buffer;
g_mutex_lock (_gst_buffer_chunk_lock);
buffer = g_mem_chunk_alloc (_gst_buffer_chunk);
#ifdef GST_BUFFER_WHERE
_debug_live = g_slist_prepend (_debug_live, buffer);
#endif
g_mutex_unlock (_gst_buffer_chunk_lock);
GST_INFO (GST_CAT_BUFFER,"creating new buffer %p",buffer);
......@@ -105,11 +95,6 @@ gst_buffer_new_loc (GST_WHERE_ARGS)
buffer->pool_private = NULL;
buffer->free = NULL;
buffer->copy = NULL;
#ifdef GST_BUFFER_WHERE
buffer->file = where_file;
buffer->line = where_line;
#endif
return buffer;
}
......@@ -152,10 +137,9 @@ gst_buffer_new_from_pool (GstBufferPool *pool, guint32 offset, guint32 size)
* Returns: new buffer
*/
GstBuffer*
gst_buffer_create_sub_loc (GST_WHERE_ARGS_
GstBuffer *parent,
guint32 offset,
guint32 size)
gst_buffer_create_sub (GstBuffer *parent,
guint32 offset,
guint32 size)
{
GstBuffer *buffer;
......@@ -166,9 +150,6 @@ gst_buffer_create_sub_loc (GST_WHERE_ARGS_
g_mutex_lock (_gst_buffer_chunk_lock);
buffer = g_mem_chunk_alloc (_gst_buffer_chunk);
#ifdef GST_BUFFER_WHERE
_debug_live = g_slist_prepend (_debug_live, buffer);
#endif
g_mutex_unlock (_gst_buffer_chunk_lock);
GST_INFO (GST_CAT_BUFFER,"creating new subbuffer %p from parent %p (size %u, offset %u)",
buffer, parent, size, offset);
......@@ -208,11 +189,6 @@ gst_buffer_create_sub_loc (GST_WHERE_ARGS_
buffer->pool = NULL;
#ifdef GST_BUFFER_WHERE
buffer->file = where_file;
buffer->line = where_line;
#endif
return buffer;
}
......@@ -229,9 +205,8 @@ gst_buffer_create_sub_loc (GST_WHERE_ARGS_
* Returns: new buffer
*/
GstBuffer*
gst_buffer_append_loc (GST_WHERE_ARGS_
GstBuffer *buffer,
GstBuffer *append)
gst_buffer_append (GstBuffer *buffer,
GstBuffer *append)
{
guint size;
GstBuffer *newbuf;
......@@ -257,7 +232,7 @@ gst_buffer_append_loc (GST_WHERE_ARGS_
}
// the buffer is used, create a new one
else {
newbuf = gst_buffer_new_loc (GST_WHERE_VARS);
newbuf = gst_buffer_new ();
newbuf->size = buffer->size+append->size;
newbuf->data = g_malloc (newbuf->size);
memcpy (newbuf->data, buffer->data, buffer->size);
......@@ -281,10 +256,9 @@ gst_buffer_destroy (GstBuffer *buffer)
g_return_if_fail (buffer != NULL);
GST_INFO (GST_CAT_BUFFER, "freeing %sbuffer %p (%d buffers remain)",
GST_INFO (GST_CAT_BUFFER, "freeing %sbuffer %p",
(buffer->parent?"sub":""),
buffer,
GST_BUFFERS_COUNT - 1);
buffer);
// free the data only if there is some, DONTFREE isn't set, and not sub
if (GST_BUFFER_DATA (buffer) &&
......@@ -313,61 +287,9 @@ gst_buffer_destroy (GstBuffer *buffer)
// remove it entirely from memory
g_mutex_lock (_gst_buffer_chunk_lock);
g_mem_chunk_free (_gst_buffer_chunk,buffer);
#ifdef GST_BUFFER_WHERE
_debug_live = g_slist_delete_link (_debug_live,
g_slist_find (_debug_live, buffer));
#endif
g_mutex_unlock (_gst_buffer_chunk_lock);
}
#ifdef GST_BUFFER_WHERE
static gint
_compare_buffer (GstBuffer *b1, GstBuffer *b2)
{
if (b1->timestamp == b2->timestamp)
return 0;
else if (b1->timestamp > b2->timestamp)
return 1;
else
return -1;
}
//
// GST_BUFFER_WHERE will be replaced with something better as
// soon as something better is actually implemented. The
// problems with this technique are:
//
// 1. Toggling debugging changes the function prototypes, causing
// a full recompile. Yuk.
//
// 2. The prototypes don't match the documentation. This may cause
// gtk-doc to choak.
//
// 3. Lots of ugly macros make the source code hard to maintain.
//
void gst_buffer_print_live ()
{
GSList *elem;
g_mutex_lock (_gst_buffer_chunk_lock);
_debug_live = g_slist_sort (_debug_live, (GCompareFunc) _compare_buffer);
for (elem = _debug_live; elem; elem = elem->next) {
GstBuffer *buf = elem->data;
g_print ("%sbuffer %p created %s:%d data=%p size=0x%x\n",
buf->parent? "sub":" ",
buf, (!buf->file || buf->file == NULL)? "?" : buf->file,
buf->line, buf->data, buf->size);
}
g_print ("(%d buffers)\n", g_slist_length (_debug_live));
g_mutex_unlock (_gst_buffer_chunk_lock);
}
#endif
/**
* gst_buffer_ref:
* @buffer: the GstBuffer to reference
......@@ -432,7 +354,7 @@ gst_buffer_unref (GstBuffer *buffer)
* Returns: new buffer
*/
GstBuffer *
gst_buffer_copy_loc (GST_WHERE_ARGS_ GstBuffer *buffer)
gst_buffer_copy (GstBuffer *buffer)
{
GstBuffer *newbuf;
......@@ -506,8 +428,7 @@ gst_buffer_is_span_fast (GstBuffer *buf1, GstBuffer *buf2)
*/
// FIXME need to think about CoW and such...
GstBuffer *
gst_buffer_span_loc (GST_WHERE_ARGS_
GstBuffer *buf1, guint32 offset, GstBuffer *buf2, guint32 len)
gst_buffer_span (GstBuffer *buf1, guint32 offset, GstBuffer *buf2, guint32 len)
{
GstBuffer *newbuf;
......@@ -527,13 +448,12 @@ gst_buffer_span_loc (GST_WHERE_ARGS_
// ((buf1->data + buf1->size) == buf2->data)) {
if (gst_buffer_is_span_fast(buf1,buf2)) {
// we simply create a subbuffer of the common parent
newbuf = gst_buffer_create_sub_loc(GST_WHERE_VARS_
buf1->parent, buf1->data - (buf1->parent->data) + offset, len);
newbuf = gst_buffer_create_sub (buf1->parent, buf1->data - (buf1->parent->data) + offset, len);
}
else {
g_print ("slow path taken in buffer_span\n");
// otherwise we simply have to brute-force copy the buffers
newbuf = gst_buffer_new_loc (GST_WHERE_VARS);
newbuf = gst_buffer_new ();
// put in new size
newbuf->size = len;
......@@ -571,10 +491,8 @@ gst_buffer_span_loc (GST_WHERE_ARGS_
* Returns: new buffer that's the concatenation of the source buffers
*/
GstBuffer *
gst_buffer_merge_loc (GST_WHERE_ARGS_
GstBuffer *buf1, GstBuffer *buf2)
gst_buffer_merge (GstBuffer *buf1, GstBuffer *buf2)
{
// we're just a specific case of the more general gst_buffer_span()
return gst_buffer_span_loc (GST_WHERE_VARS_
buf1, 0, buf2, buf1->size + buf2->size);
return gst_buffer_span (buf1, 0, buf2, buf1->size + buf2->size);
}
......@@ -57,14 +57,10 @@ extern GType _gst_buffer_type;
#define GST_BUFFER(buf) ((GstBuffer *)(buf))
#define GST_IS_BUFFER(buf) (GST_DATA_TYPE(buf) == GST_TYPE_BUFFER)
#define GST_BUFFER_FLAGS(buf) \
(GST_BUFFER(buf)->flags)
#define GST_BUFFER_FLAG_IS_SET(buf,flag) \
(GST_BUFFER_FLAGS(buf) & (1<<(flag)))
#define GST_BUFFER_FLAG_SET(buf,flag) \
G_STMT_START{ (GST_BUFFER_FLAGS(buf) |= (1<<(flag))); }G_STMT_END
#define GST_BUFFER_FLAG_UNSET(buf,flag) \
G_STMT_START{ (GST_BUFFER_FLAGS(buf) &= ~(1<<(flag))); }G_STMT_END
#define GST_BUFFER_FLAGS(buf) (GST_BUFFER(buf)->flags)
#define GST_BUFFER_FLAG_IS_SET(buf,flag) (GST_BUFFER_FLAGS(buf) & (1<<(flag)))
#define GST_BUFFER_FLAG_SET(buf,flag) G_STMT_START{ (GST_BUFFER_FLAGS(buf) |= (1<<(flag))); }G_STMT_END
#define GST_BUFFER_FLAG_UNSET(buf,flag) G_STMT_START{ (GST_BUFFER_FLAGS(buf) &= ~(1<<(flag))); }G_STMT_END
#define GST_BUFFER_DATA(buf) (GST_BUFFER(buf)->data)
......@@ -96,7 +92,6 @@ typedef enum {
} GstBufferFlags;
typedef struct _GstBuffer GstBuffer;
......@@ -107,101 +102,53 @@ typedef GstBuffer *(*GstBufferCopyFunc) (GstBuffer *srcbuf);
#include <gst/gstbufferpool.h>
struct _GstBuffer {
GstData data_type;
GstData data_type;
/* locking */
GMutex *lock;
GMutex *lock;
/* refcounting */
#ifdef HAVE_ATOMIC_H
atomic_t refcount;
atomic_t refcount;
#define GST_BUFFER_REFCOUNT(buf) (atomic_read(&(GST_BUFFER((buf))->refcount)))
#else
int refcount;
int refcount;
#define GST_BUFFER_REFCOUNT(buf) (GST_BUFFER(buf)->refcount)
#endif
/* flags */
guint16 flags;
guint16 flags;
/* pointer to data, its size, and offset in original source if known */
guchar *data;
guint32 size;
guint32 maxsize;
guint32 offset;
#ifdef GST_BUFFER_WHERE
const gchar *file;
gint line;
#endif
guchar *data;
guint32 size;
guint32 maxsize;
guint32 offset;
/* timestamp */
gint64 timestamp;
gint64 maxage;
gint64 timestamp;
gint64 maxage;
/* subbuffer support, who's my parent? */
GstBuffer *parent;
GstBuffer *parent;
/* this is a pointer to the buffer pool (if any) */
GstBufferPool *pool;
gpointer pool_private;
GstBufferPool *pool;
gpointer pool_private;
/* utility function pointers */
GstBufferFreeFunc free; // free the data associated with the buffer
GstBufferCopyFunc copy; // copy the data from one buffer to another
GstBufferFreeFunc free; // free the data associated with the buffer
GstBufferCopyFunc copy; // copy the data from one buffer to another
};
#ifdef GST_BUFFER_WHERE
# define GST_WHERE_ARGS const gchar *where_file, gint where_line
# define GST_WHERE_ARGS_ GST_WHERE_ARGS,
# define GST_WHERE_VARS where_file, where_line
# define GST_WHERE_VARS_ where_file, where_line,
# define gst_buffer_new() \
gst_buffer_new_loc(__FILE__, __LINE__)
# define gst_buffer_create_sub(parent, offset, size) \
gst_buffer_create_sub_loc(__FILE__, __LINE__, parent, offset, size)
# define gst_buffer_copy(buffer) \
gst_buffer_copy_loc(__FILE__, __LINE__, buffer)
# define gst_buffer_merge(buf1, buf2) \
gst_buffer_merge_loc(__FILE__, __LINE__, buf1, buf2)
# define gst_buffer_span(buf1, offset, buf2, len) \
gst_buffer_span_loc(__FILE__, __LINE__, buf1, offset, buf2, len)
# define gst_buffer_append(buf, buf2) \
gst_buffer_append_loc(__FILE__, __LINE__, buf, buf2)