gst/gstbuffer.c: Some debugging.

Original commit message from CVS:
* gst/gstbuffer.c: (gst_buffer_new_and_alloc):
Some debugging.

* gst/gstclock.h:
Cast to ClockTime before formatting to time.

* gst/gstutils.h:
Cleanups.
This commit is contained in:
Wim Taymans 2005-08-24 11:22:32 +00:00
parent da9c04e2f0
commit 4101d268d0
4 changed files with 54 additions and 40 deletions

View file

@ -1,3 +1,14 @@
2005-08-24 Wim Taymans <wim@fluendo.com>
* 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 <ensonic@users.sf.net>
* check/gst-libs/controller.c: (GST_START_TEST),

View file

@ -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;
}

View file

@ -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"

View file

@ -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 */