Commit d6b9ae8b authored by Christian Schaller's avatar Christian Schaller

aye ladie, no more ugly // comments here, even if Taaz gets upset about it

Original commit message from CVS:
aye ladie, no more ugly // comments here, even if Taaz gets upset about it
parent 479d33e3
......@@ -29,7 +29,7 @@
#include <sys/mman.h>
/* we make too much noise for normal debugging... */
//#define GST_DEBUG_FORCE_DISABLE
/* #define GST_DEBUG_FORCE_DISABLE */
#include "gst_private.h"
#include "cothreads.h"
......@@ -67,7 +67,7 @@ cothread_init (void)
{
cothread_context *ctx = (cothread_context *)malloc(sizeof(cothread_context));
// we consider the initiating process to be cothread 0
/* we consider the initiating process to be cothread 0 */
ctx->nthreads = 1;
ctx->current = 0;
ctx->data = g_hash_table_new(g_str_hash, g_str_equal);
......@@ -94,7 +94,7 @@ cothread_init (void)
ctx->threads[0]->sp = (void *)CURRENT_STACK_FRAME;
ctx->threads[0]->pc = 0;
// initialize the lock
/* initialize the lock */
#ifdef COTHREAD_ATOMIC
atomic_set (&ctx->threads[0]->lock, 0);
#else
......@@ -124,15 +124,16 @@ cothread_create (cothread_context *ctx)
return NULL;
}
GST_DEBUG (0,"pthread_self() %ld\n",pthread_self());
//if (0) {
if (pthread_self() == 0) { // FIXME uh, what does this test really do?
/* if (0) { */
if (pthread_self() == 0) { /* FIXME uh, what does this test really do? */
s = (cothread_state *)malloc(COTHREAD_STACKSIZE);
GST_DEBUG (0,"new stack (case 1) at %p\n",s);
} else {
void *sp = CURRENT_STACK_FRAME;
// FIXME this may not be 64bit clean
// could use casts to uintptr_t from inttypes.h
// if only all platforms had inttypes.h
/* FIXME this may not be 64bit clean
* could use casts to uintptr_t from inttypes.h
* if only all platforms had inttypes.h
*/
guchar *stack_end = (guchar *)((unsigned long)sp & ~(STACK_SIZE - 1));
s = (cothread_state *)(stack_end + ((ctx->nthreads - 1) *
COTHREAD_STACKSIZE));
......@@ -149,10 +150,10 @@ cothread_create (cothread_context *ctx)
s->threadnum = ctx->nthreads;
s->flags = 0;
s->sp = ((guchar *)s + COTHREAD_STACKSIZE);
// is this needed anymore?
/* is this needed anymore? */
s->top_sp = s->sp;
// initialize the lock
/* initialize the lock */
#ifdef COTHREAD_ATOMIC
atomic_set (s->lock, 0);
#else
......@@ -226,14 +227,15 @@ cothread_stub (void)
GST_DEBUG_ENTER("");
thread->flags |= COTHREAD_STARTED;
//#ifdef COTHREAD_ATOMIC
// // do something here to lock
//#else
// g_mutex_lock(thread->lock);
//#endif
/* #ifdef COTHREAD_ATOMIC
* do something here to lock
* #else
* g_mutex_lock(thread->lock);
* #endif
*/
while (1) {
thread->func(thread->argc,thread->argv);
// we do this to avoid ever returning, we just switch to 0th thread
/* we do this to avoid ever returning, we just switch to 0th thread */
cothread_switch(cothread_main(ctx));
}
thread->flags &= ~COTHREAD_STARTED;
......@@ -322,21 +324,21 @@ cothread_switch (cothread_state *thread)
#endif
if (current == thread) goto selfswitch;
// unlock the current thread, we're out of that context now
/* unlock the current thread, we're out of that context now */
#ifdef COTHREAD_ATOMIC
// do something to unlock the cothread
/* do something to unlock the cothread */
#else
g_mutex_unlock(current->lock);
#endif
// lock the next cothread before we even switch to it
/* lock the next cothread before we even switch to it */
#ifdef COTHREAD_ATOMIC
// do something to lock the cothread
/* do something to lock the cothread */
#else
g_mutex_lock(thread->lock);
#endif
// find the number of the thread to switch to
/* find the number of the thread to switch to */
GST_INFO (GST_CAT_COTHREAD_SWITCH,"switching from cothread #%d to cothread #%d",
ctx->current,thread->threadnum);
ctx->current = thread->threadnum;
......@@ -359,12 +361,12 @@ cothread_switch (cothread_state *thread)
/* restore stack pointer and other stuff of new cothread */
if (thread->flags & COTHREAD_STARTED) {
GST_DEBUG (0,"in thread \n");
// switch to it
/* switch to it */
siglongjmp(thread->jmp,1);
} else {
GST_ARCH_SETUP_STACK(thread->sp);
GST_ARCH_SET_SP(thread->sp);
// start it
/* start it */
GST_ARCH_CALL(cothread_stub);
GST_DEBUG (0,"exit thread \n");
ctx->current = 0;
......@@ -398,7 +400,7 @@ void
cothread_lock (cothread_state *thread)
{
#ifdef COTHREAD_ATOMIC
// do something to lock the cothread
/* do something to lock the cothread */
#else
if (thread->lock)
g_mutex_lock(thread->lock);
......@@ -417,7 +419,7 @@ gboolean
cothread_trylock (cothread_state *thread)
{
#ifdef COTHREAD_ATOMIC
// do something to try to lock the cothread
/* do something to try to lock the cothread */
#else
if (thread->lock)
return g_mutex_trylock(thread->lock);
......@@ -436,7 +438,7 @@ void
cothread_unlock (cothread_state *thread)
{
#ifdef COTHREAD_ATOMIC
// do something to unlock the cothread
/* do something to unlock the cothread */
#else
if (thread->lock)
g_mutex_unlock(thread->lock);
......
......@@ -6,7 +6,7 @@
#include "gobject2gtk.h"
// list functions not in glib 1.2
/* list functions not in glib 1.2 */
GList *
g_list_delete_link (GList *list, GList *llink)
{
......@@ -23,7 +23,7 @@ g_slist_delete_link (GSList *list, GSList *llink)
return temp;
}
// string helper functions not in glib 1.2
/* string helper functions not in glib 1.2 */
gchar*
g_strcanon (gchar *string,
......@@ -44,7 +44,7 @@ g_strcanon (gchar *string,
return string;
}
// GObject dummy implementation
/* GObject dummy implementation */
static void
g_object_set_arg(GtkObject *object, GtkArg *arg, guint id)
{
......@@ -133,7 +133,7 @@ g2g_object_class_install_property(GObjectClass *oclass,guint property_id,GParamS
gchar *arg_fullname;
arg_fullname = g_strdup_printf("%s::%s",gtk_type_name(oclass->type),pspec->name);
//fprintf(stderr,"installing arg \"%s\" into class \"%s\"\n",arg_fullname,"");
/* fprintf(stderr,"installing arg \"%s\" into class \"%s\"\n",arg_fullname,""); */
gtk_object_add_arg_type(arg_fullname,pspec->value_type,pspec->flags,property_id);
g_free(pspec);
}
......@@ -144,9 +144,9 @@ g2g_object_class_find_property(GObjectClass *class, const gchar *name)
GtkArgInfo *info;
GParamSpec *spec;
//fprintf(stderr,"class name is %s\n",gtk_type_name(class->type));
/* fprintf(stderr,"class name is %s\n",gtk_type_name(class->type)); */
// the return value NULL if no error
/* the return value NULL if no error */
if (gtk_object_arg_get_info(class->type,name,&info) != NULL) {
return NULL;
}
......@@ -170,7 +170,7 @@ g2g_object_class_list_properties(GObjectClass *oclass,guint *n_properties) {
int i;
args = gtk_object_query_args (type, &flags, &num_args);
// FIXME: args and flags need to be freed.
/* FIXME: args and flags need to be freed. */
params = g_new0(GParamSpec *,num_args);
for (i=0;i<num_args;i++) {
......@@ -302,7 +302,7 @@ g2g_signal_new (const gchar *name,
GtkType object_type,
GtkSignalRunType signal_flags,
guint function_offset,
gpointer accumulator, // GSignalAccumulator
gpointer accumulator, /* GSignalAccumulator */
gpointer accu_data,
GtkSignalMarshaller marshaller,
GType return_val,
......@@ -317,7 +317,7 @@ g2g_signal_new (const gchar *name,
if (strcmp (name, "destroy") == 0)
name = "g2gdestroy";
#define MAX_SIGNAL_PARAMS (31) // from gtksignal.c
#define MAX_SIGNAL_PARAMS (31) /* from gtksignal.c */
g_return_val_if_fail (nparams < MAX_SIGNAL_PARAMS, 0);
if (nparams > 0)
......@@ -345,7 +345,7 @@ g2g_signal_new (const gchar *name,
g_free (params);
// now register it.
/* now register it. */
gtk_object_class_add_signals(gtk_type_class(object_type), &signal_id, 1);
return signal_id;
......
......@@ -95,7 +95,7 @@ gst_init (int *argc, char **argv[])
#endif
if (!gst_init_check (argc,argv)) {
exit (0); // FIXME!
exit (0); /* FIXME! */
}
llf = G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL;
......@@ -146,7 +146,7 @@ gst_init (int *argc, char **argv[])
gst_trace = gst_trace_new ("gst.trace",1024);
gst_trace_set_default (gst_trace);
}
#endif // GST_DISABLE_TRACE
#endif /* GST_DISABLE_TRACE */
}
static void
......@@ -219,7 +219,7 @@ gst_init_check (int *argc,
if (!strncmp ("--gst-info-mask=", (*argv)[i], 16)) {
guint32 val;
// handle either 0xHEX or dec
/* handle either 0xHEX or dec */
if (*((*argv)[i]+17) == 'x') {
sscanf ((*argv)[i]+18, "%08x", &val);
} else {
......@@ -233,7 +233,7 @@ gst_init_check (int *argc,
else if (!strncmp ("--gst-debug-mask=", (*argv)[i], 17)) {
guint32 val;
// handle either 0xHEX or dec
/* handle either 0xHEX or dec */
if (*((*argv)[i]+18) == 'x') {
sscanf ((*argv)[i]+19, "%08x", &val);
} else {
......@@ -247,7 +247,7 @@ gst_init_check (int *argc,
else if (!strncmp ("--gst-mask=", (*argv)[i], 11)) {
guint32 val;
// handle either 0xHEX or dec
/* handle either 0xHEX or dec */
if (*((*argv)[i]+12) == 'x') {
sscanf ((*argv)[i]+13, "%08x", &val);
} else {
......
......@@ -20,7 +20,7 @@
* Boston, MA 02111-1307, USA.
*/
//#define GST_DEBUG_ENABLED
/* #define GST_DEBUG_ENABLED */
#include <gst/gstconfig.h>
......@@ -177,7 +177,7 @@ static void gst_autoplugfactory_restore_thyself (GstObject *object, xmlNodePt
#endif
static GstPluginFeatureClass *factory_parent_class = NULL;
//static guint gst_autoplugfactory_signals[LAST_SIGNAL] = { 0 };
/* static guint gst_autoplugfactory_signals[LAST_SIGNAL] = { 0 }; */
GType
gst_autoplugfactory_get_type (void)
......@@ -274,7 +274,7 @@ gst_autoplugfactory_destroy (GstAutoplugFactory *factory)
_gst_autoplugfactories = g_list_remove (_gst_autoplugfactories, factory);
// we don't free the struct bacause someone might have a handle to it..
/* we don't free the struct bacause someone might have a handle to it.. */
}
/**
......
......@@ -20,7 +20,7 @@
* Boston, MA 02111-1307, USA.
*/
//#define GST_DEBUG_ENABLED
/* #define GST_DEBUG_ENABLED */
#include "gst_private.h"
#include "gstbin.h"
......@@ -130,7 +130,7 @@ gst_bin_class_init (GstBinClass *klass)
static void
gst_bin_init (GstBin *bin)
{
// in general, we prefer to use cothreads for most things
/* in general, we prefer to use cothreads for most things */
GST_FLAG_SET (bin, GST_BIN_FLAG_PREFER_COTHREADS);
bin->numchildren = 0;
......@@ -174,7 +174,7 @@ gst_bin_set_element_sched (GstElement *element,GstScheduler *sched)
GST_INFO (GST_CAT_SCHEDULING, "setting element \"%s\" sched to %p",GST_ELEMENT_NAME(element),
sched);
// if it's actually a Bin
/* if it's actually a Bin */
if (GST_IS_BIN(element)) {
if (GST_FLAG_IS_SET (element, GST_BIN_FLAG_MANAGER)) {
GST_INFO_ELEMENT (GST_CAT_PARENTAGE, element, "child is already a manager, not resetting");
......@@ -184,7 +184,7 @@ gst_bin_set_element_sched (GstElement *element,GstScheduler *sched)
GST_INFO_ELEMENT (GST_CAT_PARENTAGE, element, "setting children's schedule to parent's");
gst_scheduler_add_element (sched, element);
// set the children's schedule
/* set the children's schedule */
children = GST_BIN(element)->children;
while (children) {
child = GST_ELEMENT (children->data);
......@@ -193,7 +193,7 @@ gst_bin_set_element_sched (GstElement *element,GstScheduler *sched)
gst_bin_set_element_sched (child, sched);
}
// otherwise, if it's just a regular old element
/* otherwise, if it's just a regular old element */
} else {
gst_scheduler_add_element (sched, element);
}
......@@ -212,7 +212,7 @@ gst_bin_unset_element_sched (GstElement *element)
GST_INFO (GST_CAT_SCHEDULING, "removing element \"%s\" from it sched %p",
GST_ELEMENT_NAME(element),GST_ELEMENT_SCHED(element));
// if it's actually a Bin
/* if it's actually a Bin */
if (GST_IS_BIN(element)) {
if (GST_FLAG_IS_SET(element,GST_BIN_FLAG_MANAGER)) {
......@@ -220,11 +220,11 @@ gst_bin_unset_element_sched (GstElement *element)
return;
}
// FIXME this check should be irrelevant
/* FIXME this check should be irrelevant */
if (GST_ELEMENT_SCHED (element))
gst_scheduler_remove_element (GST_ELEMENT_SCHED(element), element);
// for each child, remove them from their schedule
/* for each child, remove them from their schedule */
children = GST_BIN(element)->children;
while (children) {
child = GST_ELEMENT (children->data);
......@@ -233,9 +233,9 @@ gst_bin_unset_element_sched (GstElement *element)
gst_bin_unset_element_sched (child);
}
// otherwise, if it's just a regular old element
/* otherwise, if it's just a regular old element */
} else {
// FIXME this check should be irrelevant
/* FIXME this check should be irrelevant */
if (GST_ELEMENT_SCHED (element))
gst_scheduler_remove_element (GST_ELEMENT_SCHED(element), element);
}
......@@ -265,30 +265,30 @@ gst_bin_add (GstBin *bin,
GST_DEBUG (GST_CAT_PARENTAGE, "adding element \"%s\" to bin \"%s\"\n",
GST_ELEMENT_NAME (element), GST_ELEMENT_NAME (bin));
// must be not be in PLAYING state in order to modify bin
/* must be not be in PLAYING state in order to modify bin */
g_return_if_fail (GST_STATE (bin) != GST_STATE_PLAYING);
// the element must not already have a parent
/* the element must not already have a parent */
g_return_if_fail (GST_ELEMENT_PARENT (element) == NULL);
// then check to see if the element's name is already taken in the bin
/* then check to see if the element's name is already taken in the bin */
g_return_if_fail (gst_object_check_uniqueness (bin->children, GST_ELEMENT_NAME (element)) == TRUE);
// set the element's parent and add the element to the bin's list of children
/* set the element's parent and add the element to the bin's list of children */
gst_object_set_parent (GST_OBJECT (element), GST_OBJECT (bin));
g_signal_connect_swapped (G_OBJECT (element), "state_change", gst_bin_child_state_change, G_OBJECT (bin));
bin->children = g_list_append (bin->children, element);
bin->numchildren++;
// bump our internal state counter
/* bump our internal state counter */
state = GST_STATE (element);
while (state>>=1) state_idx++;
bin->child_states[state_idx]++;
///// now we have to deal with manager stuff
// we can only do this if there's a scheduler:
// if we're not a manager, and aren't attached to anything, we have no sched (yet)
/* now we have to deal with manager stuff */
/* we can only do this if there's a scheduler: */
/* if we're not a manager, and aren't attached to anything, we have no sched (yet) */
if (GST_IS_BIN(element) && GST_FLAG_IS_SET (element, GST_BIN_FLAG_MANAGER)) {
GST_INFO_ELEMENT (GST_CAT_PARENTAGE, element, "child is a manager");
}
......@@ -321,27 +321,27 @@ gst_bin_remove (GstBin *bin,
g_return_if_fail (GST_IS_ELEMENT (element));
g_return_if_fail (bin->children != NULL);
// must not be in PLAYING state in order to modify bin
/* must not be in PLAYING state in order to modify bin */
g_return_if_fail (GST_STATE (bin) != GST_STATE_PLAYING);
// the element must have its parent set to the current bin
/* the element must have its parent set to the current bin */
g_return_if_fail (GST_ELEMENT_PARENT(element) == (GstObject *)bin);
// the element must be in the bin's list of children
/* the element must be in the bin's list of children */
if (g_list_find(bin->children, element) == NULL) {
// FIXME this should be a warning!!!
/* FIXME this should be a warning!!! */
GST_ERROR_OBJECT(bin,element,"no such element in bin");
return;
}
// remove this element from the list of managed elements
/* remove this element from the list of managed elements */
gst_bin_unset_element_sched (element);
// now remove the element from the list of elements
/* now remove the element from the list of elements */
bin->children = g_list_remove (bin->children, element);
bin->numchildren--;
// bump our internal state counter
/* bump our internal state counter */
state = GST_STATE (element);
while (state>>=1) state_idx++;
bin->child_states[state_idx]--;
......@@ -525,8 +525,8 @@ gst_bin_dispose (GObject *object)
orig = children = g_list_copy (bin->children);
while (children) {
child = GST_ELEMENT (children->data);
//gst_object_unref (GST_OBJECT (child));
//gst_object_unparent (GST_OBJECT (child));
/* gst_object_unref (GST_OBJECT (child)); */
/* gst_object_unparent (GST_OBJECT (child)); */
gst_bin_remove (bin, child);
children = g_list_next (children);
}
......@@ -688,7 +688,7 @@ gst_bin_restore_thyself (GstObject *object,
static gboolean
gst_bin_iterate_func (GstBin *bin)
{
// only iterate if this is the manager bin
/* only iterate if this is the manager bin */
if (GST_ELEMENT_SCHED(bin)->parent == GST_ELEMENT (bin)) {
return gst_scheduler_iterate (GST_ELEMENT_SCHED(bin));
} else {
......@@ -725,7 +725,7 @@ gst_bin_iterate (GstBin *bin)
if (!running) {
if (GST_STATE (bin) == GST_STATE_PLAYING && GST_STATE_PENDING (bin) == GST_STATE_VOID_PENDING) {
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, bin, "waiting for child shutdown after useless iteration\n");
//gst_element_set_state (GST_ELEMENT (bin), GST_STATE_PAUSED);
/* gst_element_set_state (GST_ELEMENT (bin), GST_STATE_PAUSED); */
gst_element_wait_state_change (GST_ELEMENT (bin));
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, bin, "child shutdown\n");
}
......
......@@ -37,19 +37,19 @@ _gst_buffer_initialize (void)
{
int buffersize = sizeof(GstBuffer);
static const GTypeInfo buffer_info = {
0, // sizeof(class),
0, /* sizeof(class), */
NULL,
NULL,
NULL,
NULL,
NULL,
0, // sizeof(object),
0, /* sizeof(object), */
0,
NULL,
NULL,
};
// round up to the nearest 32 bytes for cache-line and other efficiencies
/* round up to the nearest 32 bytes for cache-line and other efficiencies */
buffersize = (((buffersize-1) / 32) + 1) * 32;
_gst_buffer_chunk = g_mem_chunk_new ("GstBuffer", buffersize,
......@@ -165,29 +165,29 @@ gst_buffer_create_sub (GstBuffer *parent,
buffer->refcount = 1;
#endif
// copy flags and type from parent, for lack of better
/* copy flags and type from parent, for lack of better */
buffer->flags = parent->flags;
// set the data pointer, size, offset, and maxsize
/* set the data pointer, size, offset, and maxsize */
buffer->data = parent->data + offset;
buffer->size = size;
buffer->maxsize = parent->size - offset;
// deal with bogus/unknown offsets
/* deal with bogus/unknown offsets */
if (parent->offset != (guint32)-1)
buffer->offset = parent->offset + offset;
else
buffer->offset = (guint32)-1;
// again, for lack of better, copy parent's timestamp
/* again, for lack of better, copy parent's timestamp */
buffer->timestamp = parent->timestamp;
buffer->maxage = parent->maxage;
// if the parent buffer is a subbuffer itself, use its parent, a real buffer
/* if the parent buffer is a subbuffer itself, use its parent, a real buffer */
if (parent->parent != NULL)
parent = parent->parent;
// set parentage and reference the parent
/* set parentage and reference the parent */
buffer->parent = parent;
gst_buffer_ref (parent);
......@@ -197,7 +197,7 @@ gst_buffer_create_sub (GstBuffer *parent,
}
// FIXME FIXME: how does this overlap with the newly-added gst_buffer_span() ???
/* FIXME FIXME: how does this overlap with the newly-added gst_buffer_span() ??? */
/**
* gst_buffer_append:
* @buffer: a buffer
......@@ -224,17 +224,17 @@ gst_buffer_append (GstBuffer *buffer,
GST_INFO (GST_CAT_BUFFER,"appending buffers %p and %p",buffer,append);
GST_BUFFER_LOCK (buffer);
// the buffer is not used by anyone else
/* the buffer is not used by anyone else */
if (GST_BUFFER_REFCOUNT (buffer) == 1 && buffer->parent == NULL
&& !GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_DONTFREE)) {
// save the old size
/* save the old size */
size = buffer->size;
buffer->size += append->size;
buffer->data = g_realloc (buffer->data, buffer->size);
memcpy(buffer->data + size, append->data, append->size);
GST_BUFFER_UNLOCK (buffer);
}
// the buffer is used, create a new one
/* the buffer is used, create a new one */
else {
newbuf = gst_buffer_new ();
newbuf->size = buffer->size+append->size;
......@@ -265,11 +265,11 @@ gst_buffer_destroy (GstBuffer *buffer)
(buffer->parent?"sub":""),
buffer);
// free the data only if there is some, DONTFREE isn't set, and not sub
/* free the data only if there is some, DONTFREE isn't set, and not sub */
if (GST_BUFFER_DATA (buffer) &&
!GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_DONTFREE) &&
(buffer->parent == NULL)) {
// if there's a free function, use it
/* if there's a free function, use it */
if (buffer->free != NULL) {
(buffer->free)(buffer);
} else {
......@@ -277,19 +277,19 @@ gst_buffer_destroy (GstBuffer *buffer)
}
}
// unreference the parent if there is one
/* unreference the parent if there is one */
if (buffer->parent != NULL)
gst_buffer_unref (buffer->parent);
g_mutex_free (buffer->lock);
//g_print("freed mutex\n");
/* g_print("freed mutex\n"); */
#ifdef GST_DEBUG_ENABLED
// make it hard to reuse by mistake
/* make it hard to reuse by mistake */
memset (buffer, 0, sizeof (GstBuffer));
#endif
// remove it entirely from memory
/* remove it entirely from memory */
g_mutex_lock (_gst_buffer_chunk_lock);
g_mem_chunk_free (_gst_buffer_chunk,buffer);
g_mutex_unlock (_gst_buffer_chunk_lock);
......@@ -389,27 +389,27 @@ gst_buffer_copy (GstBuffer *buffer)
g_return_val_if_fail (GST_BUFFER_REFCOUNT(buffer) > 0, NULL);
// if a copy function exists, use it, else copy the bytes
/* if a copy function exists, use it, else copy the bytes */
if (buffer->copy != NULL) {
newbuf = (buffer->copy)(buffer);
} else {
// allocate a new buffer
/* allocate a new buffer */
newbuf = gst_buffer_new();
// copy the absolute size
/* copy the absolute size */
newbuf->size = buffer->size;
// allocate space for the copy
/* allocate space for the copy */
newbuf->data = (guchar *)g_malloc (buffer->size);
// copy the data straight across
/* copy the data straight across */
memcpy(newbuf->data,buffer->data,buffer->size);
// the new maxsize is the same as the size, since we just malloc'd it
/* the new maxsize is the same as the size, since we just malloc'd it */
newbuf->maxsize = newbuf->size;
}
newbuf->offset = buffer->offset;
newbuf->timestamp = buffer->timestamp;
newbuf->maxage = buffer->maxage;
// since we just created a new buffer, so we have no ties to old stuff
/* since we just created a new buffer, so we have no ties to old stuff */
newbuf->parent = NULL;
newbuf->pool = NULL;
......@@ -455,7 +455,7 @@ gst_buffer_is_span_fast (GstBuffer *buf1, GstBuffer *buf2)
*
* Returns: new buffer that spans the two source buffers
*/
// FIXME need to think about CoW and such...
/* FIXME need to think about CoW and such... */
GstBuffer *
gst_buffer_span (GstBuffer *buf1, guint32 offset, GstBuffer *buf2, guint32 len)
{
......@@ -464,31 +464,31 @@ gst_buffer_span (GstBuffer *buf1, guint32 offset, GstBuffer *buf2, guint32 len)
g_return_val_if_fail (GST_BUFFER_REFCOUNT(buf1) > 0, NULL);
g_return_val_if_fail (GST_BUFFER_REFCOUNT(buf2) > 0, NULL);
// make sure buf1 has a lower address than buf2
/* make sure buf1 has a lower address than buf2 */
if (buf1->data > buf2->data) {
GstBuffer *tmp = buf1;
//g_print ("swapping buffers\n");
/* g_print ("swapping buffers\n"); */
buf1 = buf2;
buf2 = tmp;
}
// if the two buffers have the same parent and are adjacent
/* if the two buffers have the same parent and are adjacent */
if (gst_buffer_is_span_fast(buf1,buf2)) {
// we simply create a subbuffer of the common parent
/