diff --git a/ChangeLog b/ChangeLog index bc4a2c9fa2..f36a1ad19e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2005-08-24 Wim Taymans + + * gst/gstbuffer.c: (gst_buffer_new_and_alloc): + Some debugging. + + * gst/gstclock.h: + Cast to ClockTime before formatting to time. + + * gst/gstutils.h: + Cleanups. + 2005-08-24 Stefan Kost * check/gst-libs/controller.c: (GST_START_TEST), diff --git a/gst/gstbuffer.c b/gst/gstbuffer.c index 6166286941..34887df49a 100644 --- a/gst/gstbuffer.c +++ b/gst/gstbuffer.c @@ -261,6 +261,8 @@ gst_buffer_new_and_alloc (guint size) GST_BUFFER_DATA (newbuf) = newbuf->malloc_data; GST_BUFFER_SIZE (newbuf) = size; + GST_CAT_LOG (GST_CAT_BUFFER, "new %p of size %d", newbuf, size); + return newbuf; } diff --git a/gst/gstclock.h b/gst/gstclock.h index 5438938154..6aa6b310b3 100644 --- a/gst/gstclock.h +++ b/gst/gstclock.h @@ -66,10 +66,10 @@ G_STMT_START { \ /* timestamp debugging macros */ #define GST_TIME_FORMAT "u:%02u:%02u.%09u" #define GST_TIME_ARGS(t) \ - (guint) ((t) / (GST_SECOND * 60 * 60)), \ - (guint) (((t) / (GST_SECOND * 60)) % 60), \ - (guint) (((t) / GST_SECOND) % 60), \ - (guint) ((t) % GST_SECOND) + (guint) (((GstClockTime)(t)) / (GST_SECOND * 60 * 60)), \ + (guint) ((((GstClockTime)(t)) / (GST_SECOND * 60)) % 60), \ + (guint) ((((GstClockTime)(t)) / GST_SECOND) % 60), \ + (guint) (((GstClockTime)(t)) % GST_SECOND) #define GST_CLOCK_ENTRY_TRACE_NAME "GstClockEntry" diff --git a/gst/gstutils.h b/gst/gstutils.h index 79e86358ad..179c741efb 100644 --- a/gst/gstutils.h +++ b/gst/gstutils.h @@ -38,7 +38,7 @@ void gst_print_pad_caps (GString *buf, gint indent, GstPad *pad); void gst_print_element_args (GString *buf, gint indent, GstElement *element); -/* Macros for defining classes. Ideas taken from Bonobo, which took theirs +/* Macros for defining classes. Ideas taken from Bonobo, which took theirs from Nautilus and GOB. */ /* Define the boilerplate type stuff to reduce typos and code size. Defines @@ -46,41 +46,42 @@ void gst_print_element_args (GString *buf, gint indent, GstElement *element) void additional_initializations (GType type) is for initializing interfaces and stuff like that */ -#define GST_BOILERPLATE_FULL(type, type_as_function, parent_type, parent_type_macro, additional_initializations) \ - \ -static void type_as_function ## _base_init (gpointer g_class); \ -static void type_as_function ## _class_init (type ## Class *g_class); \ -static void type_as_function ## _init (type *object); \ -static parent_type ## Class *parent_class = NULL; \ -static void \ -type_as_function ## _class_init_trampoline (gpointer g_class, \ - gpointer data) \ -{ \ - parent_class = (parent_type ## Class *) g_type_class_peek_parent (g_class); \ - type_as_function ## _class_init ((type ## Class *)g_class); \ -} \ - \ -GType \ -type_as_function ## _get_type (void) \ -{ \ - static GType object_type = 0; \ - if (object_type == 0) { \ - static const GTypeInfo object_info = { \ - sizeof (type ## Class), \ - type_as_function ## _base_init, \ - NULL, /* base_finalize */ \ - type_as_function ## _class_init_trampoline, \ - NULL, /* class_finalize */ \ - NULL, /* class_data */ \ - sizeof (type), \ - 0, /* n_preallocs */ \ - (GInstanceInitFunc) type_as_function ## _init \ - }; \ - object_type = g_type_register_static (parent_type_macro, #type, \ - &object_info, (GTypeFlags) 0); \ - additional_initializations (object_type); \ - } \ - return object_type; \ +#define GST_BOILERPLATE_FULL(type, type_as_function, parent_type, parent_type_macro, additional_initializations) \ + \ +static void type_as_function ## _base_init (gpointer g_class); \ +static void type_as_function ## _class_init (type ## Class *g_class);\ +static void type_as_function ## _init (type *object); \ +static parent_type ## Class *parent_class = NULL; \ +static void \ +type_as_function ## _class_init_trampoline (gpointer g_class, \ + gpointer data) \ +{ \ + parent_class = (parent_type ## Class *) \ + g_type_class_peek_parent (g_class); \ + type_as_function ## _class_init ((type ## Class *)g_class); \ +} \ + \ +GType \ +type_as_function ## _get_type (void) \ +{ \ + static GType object_type = 0; \ + if (object_type == 0) { \ + static const GTypeInfo object_info = { \ + sizeof (type ## Class), \ + type_as_function ## _base_init, \ + NULL, /* base_finalize */ \ + type_as_function ## _class_init_trampoline, \ + NULL, /* class_finalize */ \ + NULL, /* class_data */ \ + sizeof (type), \ + 0, /* n_preallocs */ \ + (GInstanceInitFunc) type_as_function ## _init \ + }; \ + object_type = g_type_register_static (parent_type_macro, #type, \ + &object_info, (GTypeFlags) 0); \ + additional_initializations (object_type); \ + } \ + return object_type; \ } #define __GST_DO_NOTHING(type) /* NOP */