From: <co...@fr...> - 2005-05-16 19:15:48
|
CVS Root: /cvs/gstreamer Module: gstreamer Changes by: company Date: Sun May 15 2005 21:49:47 PDT Branch: BRANCH-COMPANY Log message: * gst/Makefile.am: * gst/gstatomic.c: * gst/gstatomic.h: * gst/gstatomic_impl.h: * gst/gstbuffer.c: * gst/gstdata.c: (gst_data_is_writable), (gst_data_copy_on_write), (gst_data_ref), (gst_data_ref_by_count), (gst_data_unref): * gst/gstdata.h: * gst/gstdata_private.h: * gst/gstinfo.c: (_gst_debug_init), (gst_debug_set_colored), (gst_debug_is_colored), (gst_debug_set_default_threshold), (gst_debug_get_default_threshold), (_gst_debug_category_new), (gst_debug_category_free), (gst_debug_category_set_threshold), (gst_debug_category_get_threshold): * gst/gstinfo.h: * testsuite/elements/struct_i386.h: remove GstAtomic. Use plain ints instead for the time being Modified files: . : ChangeLog gst : Makefile.am gstbuffer.c gstdata.c gstdata.h gstdata_private.h gstinfo.c gstinfo.h testsuite/elements: struct_i386.h Removed files: gst : gstatomic.c gstatomic.h gstatomic_impl.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.966.2.71.2.4&r2=1.966.2.71.2.5 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/Makefile.am.diff?r1=1.164.4.4.2.2&r2=1.164.4.4.2.3 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstatomic.c http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstatomic.h http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstatomic_impl.h http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstbuffer.c.diff?r1=1.90.6.1&r2=1.90.6.2 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstdata.c.diff?r1=1.24&r2=1.24.6.1 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstdata.h.diff?r1=1.19&r2=1.19.6.1 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstdata_private.h.diff?r1=1.6&r2=1.6.6.1 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstinfo.c.diff?r1=1.96.2.1.2.1&r2=1.96.2.1.2.2 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstinfo.h.diff?r1=1.81.4.1&r2=1.81.4.1.2.1 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/testsuite/elements/struct_i386.h.diff?r1=1.1.6.2&r2=1.1.6.3 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.966.2.71.2.4 retrieving revision 1.966.2.71.2.5 diff -u -d -r1.966.2.71.2.4 -r1.966.2.71.2.5 --- ChangeLog 16 May 2005 03:23:06 -0000 1.966.2.71.2.4 +++ ChangeLog 16 May 2005 04:49:34 -0000 1.966.2.71.2.5 @@ -1,5 +1,25 @@ 2005-05-16 Benjamin Otte <in...@pu...> + * gst/Makefile.am: + * gst/gstatomic.c: + * gst/gstatomic.h: + * gst/gstatomic_impl.h: + * gst/gstbuffer.c: + * gst/gstdata.c: (gst_data_is_writable), (gst_data_copy_on_write), + (gst_data_ref), (gst_data_ref_by_count), (gst_data_unref): + * gst/gstdata.h: + * gst/gstdata_private.h: + * gst/gstinfo.c: (_gst_debug_init), (gst_debug_set_colored), + (gst_debug_is_colored), (gst_debug_set_default_threshold), + (gst_debug_get_default_threshold), (_gst_debug_category_new), + (gst_debug_category_free), (gst_debug_category_set_threshold), + (gst_debug_category_get_threshold): + * gst/gstinfo.h: + * testsuite/elements/struct_i386.h: + remove GstAtomic. Use plain ints instead for the time being + +2005-05-16 Benjamin Otte <in...@pu...> * configure.ac: * gst/gst_private.h: * gst/gstinfo.c: (_gst_debug_init): Index: Makefile.am RCS file: /cvs/gstreamer/gstreamer/gst/Makefile.am,v retrieving revision 1.164.4.4.2.2 retrieving revision 1.164.4.4.2.3 diff -u -d -r1.164.4.4.2.2 -r1.164.4.4.2.3 --- Makefile.am 16 May 2005 02:30:13 -0000 1.164.4.4.2.2 +++ Makefile.am 16 May 2005 04:49:34 -0000 1.164.4.4.2.3 @@ -82,7 +82,6 @@ libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \ gst.c \ gstobject.c \ - gstatomic.c \ gstbin.c \ gstbuffer.c \ gstcaps.c \ @@ -152,7 +151,6 @@ gst_headers = \ gst.h \ - gstatomic.h \ gstobject.h \ gstbin.h \ gstbuffer.h \ @@ -204,7 +202,6 @@ gst-i18n-lib.h \ gst-i18n-app.h \ gst_private.h \ - gstatomic_impl.h \ gstdata_private.h \ gstarch.h \ cothreads.h --- gstatomic.c DELETED --- --- gstatomic.h DELETED --- --- gstatomic_impl.h DELETED --- Index: gstbuffer.c RCS file: /cvs/gstreamer/gstreamer/gst/gstbuffer.c,v retrieving revision 1.90.6.1 retrieving revision 1.90.6.2 diff -u -d -r1.90.6.1 -r1.90.6.2 --- gstbuffer.c 16 May 2005 01:49:57 -0000 1.90.6.1 +++ gstbuffer.c 16 May 2005 04:49:34 -0000 1.90.6.2 @@ -22,7 +22,6 @@ #include "gst_private.h" -#include "gstatomic_impl.h" #include "gstdata_private.h" #include "gstbuffer.h" #include "gstinfo.h" Index: gstdata.c RCS file: /cvs/gstreamer/gstreamer/gst/gstdata.c,v retrieving revision 1.24 retrieving revision 1.24.6.1 diff -u -d -r1.24 -r1.24.6.1 --- gstdata.c 14 Jul 2004 15:28:51 -0000 1.24 +++ gstdata.c 16 May 2005 04:49:34 -0000 1.24.6.1 #include "gstdata.h" @@ -122,13 +121,9 @@ gboolean gst_data_is_writable (GstData * data) { - gint refcount; - g_return_val_if_fail (data != NULL, FALSE); - refcount = gst_atomic_int_read (&data->refcount); - if (refcount > 1) + if (data->refcount > 1) return FALSE; if (GST_DATA_FLAG_IS_SET (data, GST_DATA_READONLY)) @@ -152,13 +147,9 @@ GstData * gst_data_copy_on_write (GstData * data) g_return_val_if_fail (data != NULL, NULL); - if (refcount == 1 && !GST_DATA_FLAG_IS_SET (data, GST_DATA_READONLY)) + if (data->refcount == 1 && !GST_DATA_FLAG_IS_SET (data, GST_DATA_READONLY)) return GST_DATA (data); if (data->copy) { @@ -188,7 +179,7 @@ GST_CAT_LOG (GST_CAT_BUFFER, "%p %d->%d", data, GST_DATA_REFCOUNT_VALUE (data), GST_DATA_REFCOUNT_VALUE (data) + 1); - gst_atomic_int_inc (&data->refcount); + data->refcount++; return data; } @@ -212,7 +203,7 @@ GST_DATA_REFCOUNT_VALUE (data), GST_DATA_REFCOUNT_VALUE (data) + count); - gst_atomic_int_add (&data->refcount, count); + data->refcount += count; @@ -231,18 +222,16 @@ void gst_data_unref (GstData * data) - gint zero; g_return_if_fail (data != NULL); GST_DATA_REFCOUNT_VALUE (data), GST_DATA_REFCOUNT_VALUE (data) - 1); g_return_if_fail (GST_DATA_REFCOUNT_VALUE (data) > 0); - zero = gst_atomic_int_dec_and_test (&data->refcount); + data->refcount--; /* if we ended up with the refcount at zero, free the data */ - if (zero) { + if (data->refcount == 0) { if (data->free) data->free (data); } Index: gstdata.h RCS file: /cvs/gstreamer/gstreamer/gst/gstdata.h,v retrieving revision 1.19 retrieving revision 1.19.6.1 diff -u -d -r1.19 -r1.19.6.1 --- gstdata.h 15 Mar 2004 14:43:21 -0000 1.19 +++ gstdata.h 16 May 2005 04:49:34 -0000 1.19.6.1 @@ -25,7 +25,6 @@ #define __GST_DATA_H__ #include <glib-object.h> -#include <gst/gstatomic.h> #include <gst/gsttypes.h> G_BEGIN_DECLS @@ -58,8 +57,7 @@ } GstDataFlags; /* refcount */ -#define GST_DATA_REFCOUNT(data) ((GST_DATA(data))->refcount) -#define GST_DATA_REFCOUNT_VALUE(data) (gst_atomic_int_read (&(GST_DATA(data))->refcount)) +#define GST_DATA_REFCOUNT_VALUE(data) ((GST_DATA(data))->refcount) /* copy/free functions */ #define GST_DATA_COPY_FUNC(data) (GST_DATA(data)->copy) @@ -70,7 +68,7 @@ GType type; /* refcounting */ - GstAtomicInt refcount; + guint refcount; guint16 flags; Index: gstdata_private.h RCS file: /cvs/gstreamer/gstreamer/gst/gstdata_private.h,v retrieving revision 1.6 retrieving revision 1.6.6.1 diff -u -d -r1.6 -r1.6.6.1 --- gstdata_private.h 15 Mar 2004 14:43:21 -0000 1.6 +++ gstdata_private.h 16 May 2005 04:49:34 -0000 1.6.6.1 @@ -20,19 +20,14 @@ * Boston, MA 02111-1307, USA. */ #define _GST_DATA_INIT(data, ptype, pflags, pfree, pcopy) \ G_STMT_START { \ - gst_atomic_int_init (&(data)->refcount, 1); \ + (data)->refcount = 1; \ (data)->type = ptype; \ (data)->flags = pflags; \ (data)->free = pfree; \ (data)->copy = pcopy; \ } G_STMT_END; -#define _GST_DATA_DISPOSE(data) \ -G_STMT_START { \ - gst_atomic_int_destroy (&(data)->refcount); \ -} G_STMT_END; +#define _GST_DATA_DISPOSE(data) Index: gstinfo.c RCS file: /cvs/gstreamer/gstreamer/gst/gstinfo.c,v retrieving revision 1.96.2.1.2.1 retrieving revision 1.96.2.1.2.2 diff -u -d -r1.96.2.1.2.1 -r1.96.2.1.2.2 --- gstinfo.c 16 May 2005 03:23:07 -0000 1.96.2.1.2.1 +++ gstinfo.c 16 May 2005 04:49:34 -0000 1.96.2.1.2.2 @@ -118,8 +118,8 @@ static GStaticMutex __log_func_mutex = G_STATIC_MUTEX_INIT; static GSList *__log_functions = NULL; -static GstAtomicInt __default_level; -static GstAtomicInt __use_color; +static GstDebugLevel __default_level; +static gboolean __use_color; gboolean __gst_debug_enabled = TRUE; @@ -168,8 +168,8 @@ _gst_debug_init (void) - gst_atomic_int_init (&__default_level, GST_LEVEL_DEFAULT); - gst_atomic_int_init (&__use_color, 1); + __default_level = GST_LEVEL_DEFAULT; + __use_color = TRUE; #ifdef HAVE_PRINTF_EXTENSION register_printf_function (GST_PTR_FORMAT[0], _gst_info_printf_extension, @@ -650,7 +650,7 @@ gst_debug_set_colored (gboolean colored) - gst_atomic_int_set (&__use_color, colored ? 1 : 0); + __use_color = colored; /** @@ -663,7 +663,7 @@ gst_debug_is_colored (void) - return gst_atomic_int_read (&__use_color) == 0 ? FALSE : TRUE; + return __use_color; @@ -705,7 +705,7 @@ gst_debug_set_default_threshold (GstDebugLevel level) - gst_atomic_int_set (&__default_level, level); + __default_level = level; gst_debug_reset_all_thresholds (); @@ -719,7 +719,7 @@ GstDebugLevel gst_debug_get_default_threshold (void) - return (GstDebugLevel) gst_atomic_int_read (&__default_level); + return __default_level; static void gst_debug_reset_threshold (gpointer category, gpointer unused) @@ -842,8 +842,7 @@ } else { cat->description = g_strdup ("no description"); - cat->threshold = g_new (GstAtomicInt, 1); - gst_atomic_int_init (cat->threshold, 0); + cat->threshold = 0; gst_debug_reset_threshold (cat, NULL); /* add to category list */ @@ -873,8 +872,6 @@ g_free ((gpointer) category->name); g_free ((gpointer) category->description); - gst_atomic_int_destroy (category->threshold); - g_free (category->threshold); g_free (category); @@ -898,7 +895,7 @@ g_return_if_fail (category != NULL); - gst_atomic_int_set (category->threshold, level); + category->threshold = level; @@ -928,7 +925,7 @@ gst_debug_category_get_threshold (GstDebugCategory * category) - return gst_atomic_int_read (category->threshold); + return category->threshold; Index: gstinfo.h RCS file: /cvs/gstreamer/gstreamer/gst/gstinfo.h,v retrieving revision 1.81.4.1 retrieving revision 1.81.4.1.2.1 diff -u -d -r1.81.4.1 -r1.81.4.1.2.1 --- gstinfo.h 25 Feb 2005 10:31:22 -0000 1.81.4.1 +++ gstinfo.h 16 May 2005 04:49:34 -0000 1.81.4.1.2.1 @@ -26,7 +26,6 @@ #include <glib.h> #include <gst/gstconfig.h> @@ -96,7 +95,7 @@ typedef struct _GstDebugCategory GstDebugCategory; struct _GstDebugCategory { /*< private >*/ - GstAtomicInt * threshold; + GstDebugLevel threshold; guint color; /* see defines above */ const gchar * name; Index: struct_i386.h RCS file: /cvs/gstreamer/gstreamer/testsuite/elements/struct_i386.h,v retrieving revision 1.1.6.2 retrieving revision 1.1.6.3 diff -u -d -r1.1.6.2 -r1.1.6.3 --- struct_i386.h 16 May 2005 02:30:13 -0000 1.1.6.2 +++ struct_i386.h 16 May 2005 04:49:34 -0000 1.1.6.3 @@ -2,8 +2,6 @@ Struct list[] = { {"GstPoptOption", sizeof (GstPoptOption), 28} , - {"GstAtomicInt", sizeof (GstAtomicInt), 8} - , {"GstBuffer", sizeof (GstBuffer), 108} {"GstCaps", sizeof (GstCaps), 28} |