gst/gstbuffer.c: Some debugging.
authorWim Taymans <wim.taymans@gmail.com>
Wed, 24 Aug 2005 11:22:32 +0000 (11:22 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Wed, 24 Aug 2005 11:22:32 +0000 (11:22 +0000)
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.

ChangeLog
gst/gstbuffer.c
gst/gstclock.h
gst/gstutils.h

index bc4a2c9fa22bbdc671ae982362fc984920011d22..f36a1ad19eaf8d24f96b353ef7e119031c9cfd02 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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),
index 616628694142ebb5c5b999b82e08c104cc09a15b..34887df49a587b5400df35a2747af1a6d82d0c94 100644 (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;
 }
 
index 5438938154140f0fdc63807fa00f3d6d06fe3b65..6aa6b310b3add0be95f7c13350badb2b546aafb3 100644 (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"
 
index 79e86358ad642a4aff7af8c741274ec7a023f28c..179c741efbc395a8dbf736a854d602afe29d6ea3 100644 (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 */