From 65d35489ac22a68199221d52529331266fdedb97 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Wed, 11 Dec 2002 21:33:07 +0000 Subject: [PATCH] merge from release branch Original commit message from CVS: merge from release branch --- common | 2 +- configure.ac | 6 ++++ gst/gstarch.h | 1 + gst/gstclock.c | 23 +++++++++------ gst/gstelement.c | 3 +- gst/gstinfo.c | 70 +++++++++++++++++++++++--------------------- gst/gstinfo.h | 65 +++++++++++++++++++++++++--------------- gst/gstsystemclock.c | 14 +++++---- 8 files changed, 110 insertions(+), 74 deletions(-) diff --git a/common b/common index 92ff5101d5..773e3a6496 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 92ff5101d55c0f853620bf13f8dd528992824137 +Subproject commit 773e3a64961084c37477faa464f12add3dfcd6dc diff --git a/configure.ac b/configure.ac index 89baaf38cb..b48c2491ef 100644 --- a/configure.ac +++ b/configure.ac @@ -106,6 +106,12 @@ AC_MSG_RESULT(no) AC_MSG_RESULT(no) ]) +dnl check for makecontext and define HAVE_MAKECONTEXT if we have it +GST_CHECK_MAKECONTEXT() + +dnl Check for a way to display the function name in debug output +GST_CHECK_FUNCTION() + dnl Check for essential libraries first: dnl ==================================== diff --git a/gst/gstarch.h b/gst/gstarch.h index cd21633863..7f16c8b609 100644 --- a/gst/gstarch.h +++ b/gst/gstarch.h @@ -183,6 +183,7 @@ struct minimal_s390_stackframe { #elif defined(HAVE_MAKECONTEXT) /* If we have makecontext(), we'll be using that. */ +#define USE_MAKECONTEXT 1 #else #error Need to know about this architecture, or have a generic implementation diff --git a/gst/gstclock.c b/gst/gstclock.c index da315a129d..6271e7a2d1 100644 --- a/gst/gstclock.c +++ b/gst/gstclock.c @@ -520,7 +520,7 @@ gst_clock_reset (GstClock *clock) * @time: The new time * * Notifies the clock of a discontinuity in time. - * + * * Returns: TRUE if the clock was updated. It is possible that * the clock was not updated by this call because only the first * discontinuitity in the pipeline is honoured. @@ -529,8 +529,10 @@ gboolean gst_clock_handle_discont (GstClock *clock, guint64 time) { GstClockTime itime = 0LL; - - GST_DEBUG (GST_CAT_CLOCK, "clock discont %llu %llu %d", time, clock->start_time, clock->accept_discont); + + GST_DEBUG (GST_CAT_CLOCK, "clock discont %" G_GUINT64_FORMAT + " %" G_GUINT64_FORMAT " %d", + time, clock->start_time, clock->accept_discont); if (time == GST_CLOCK_TIME_NONE) return TRUE; @@ -543,7 +545,9 @@ gst_clock_handle_discont (GstClock *clock, guint64 time) } else { GST_UNLOCK (clock); - GST_DEBUG (GST_CAT_CLOCK, "clock discont refused %llu %llu", time, clock->start_time); + GST_DEBUG (GST_CAT_CLOCK, "clock discont refused %" G_GUINT64_FORMAT + " %" G_GUINT64_FORMAT, + time, clock->start_time); return FALSE; } @@ -552,11 +556,12 @@ gst_clock_handle_discont (GstClock *clock, guint64 time) clock->accept_discont = FALSE; GST_UNLOCK (clock); - GST_DEBUG (GST_CAT_CLOCK, "new time %llu", gst_clock_get_time (clock)); + GST_DEBUG (GST_CAT_CLOCK, "new time %" G_GUINT64_FORMAT, + gst_clock_get_time (clock)); - g_mutex_lock (clock->active_mutex); - g_cond_broadcast (clock->active_cond); - g_mutex_unlock (clock->active_mutex); + g_mutex_lock (clock->active_mutex); + g_cond_broadcast (clock->active_cond); + g_mutex_unlock (clock->active_mutex); return TRUE; } @@ -567,7 +572,7 @@ gst_clock_handle_discont (GstClock *clock, guint64 time) * * Gets the current time of the given clock. The time is always * monotonically increasing. - * + * * Returns: the time of the clock. */ GstClockTime diff --git a/gst/gstelement.c b/gst/gstelement.c index 8e83b0f7af..818731f705 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -2261,7 +2261,8 @@ gst_element_save_thyself (GstObject *object, else if (G_IS_PARAM_SPEC_ENUM (spec)) contents = g_strdup_printf ("%d", g_value_get_enum (&value)); else if (G_IS_PARAM_SPEC_INT64 (spec)) - contents = g_strdup_printf ("%lld", g_value_get_int64 (&value)); + contents = g_strdup_printf ("%" G_GINT64_FORMAT, + g_value_get_int64 (&value)); else contents = g_strdup_value_contents (&value); diff --git a/gst/gstinfo.c b/gst/gstinfo.c index d79d7535f9..8f32b458a5 100644 --- a/gst/gstinfo.c +++ b/gst/gstinfo.c @@ -50,8 +50,6 @@ int dladdr(void *address, Dl_info *dl) extern gchar *_gst_progname; -GStaticPrivate _gst_debug_cothread_index = G_STATIC_PRIVATE_INIT; - /***** Categories and colorization *****/ /* be careful with these, make them match the enum */ @@ -142,7 +140,7 @@ const gchar *_gst_category_colors[32] = { /* [GST_CAT_TYPES] = */ "01;37;41", /* !! */ /* [GST_CAT_XML] = */ "01;37;41", /* !! */ /* [GST_CAT_NEGOTIATION] = */ "07;34", - /* [GST_CAT_REFCOUNTING] = */ "00;34:42", + /* [GST_CAT_REFCOUNTING] = */ "00;34;42", /* [GST_CAT_EVENT] = */ "01;37;41", /* !! */ /* [GST_CAT_PARAMS] = */ "00;30;43", /* !! */ "", @@ -193,9 +191,9 @@ gst_default_debug_handler (gint category, gboolean incore, void *element, gchar *string) { gchar *empty = ""; - gchar *elementname = empty,*location = empty; - int pid = getpid(); - int cothread_id = (int) g_static_private_get(&_gst_debug_cothread_index); + gchar *elementname = empty,* location = empty; + int pid = getpid (); + int cothread_id = 0; /*FIXME*/ #ifdef GST_DEBUG_COLOR int pid_color = pid%6 + 31; int cothread_color = (cothread_id < 0) ? 37 : (cothread_id%6 + 31); @@ -203,28 +201,30 @@ gst_default_debug_handler (gint category, gboolean incore, if (debug_string == NULL) debug_string = ""; /* if (category != GST_CAT_GST_INIT) */ - location = g_strdup_printf("%s:%d%s:",function,line,debug_string); + location = g_strdup_printf ("%s(%d): %s: %s:", + file, line, function, debug_string); if (element && GST_IS_ELEMENT (element)) #ifdef GST_DEBUG_COLOR - elementname = g_strdup_printf (" \033[04m[%s]\033[00m", GST_OBJECT_NAME (element)); + elementname = g_strdup_printf (" \033[04m[%s]\033[00m", + GST_OBJECT_NAME (element)); #else elementname = g_strdup_printf (" [%s]", GST_OBJECT_NAME (element)); #endif #ifdef GST_DEBUG_COLOR - fprintf(stderr,"DEBUG(\033[00;%dm%5d\033[00m:\033[00;%dm%2d\033[00m)\033[" - "%s;%sm%s%s\033[00m %s\n", - pid_color,pid,cothread_color,cothread_id,incore?"00":"01", - _gst_category_colors[category],location,elementname,string); + fprintf (stderr, "DEBUG(\033[00;%dm%5d\033[00m:\033[00;%dm%2d\033[00m)\033[" + "%s;%sm%s%s\033[00m %s\n", + pid_color, pid, cothread_color, cothread_id, incore ? "00" : "01", + _gst_category_colors[category], location, elementname, string); #else fprintf(stderr,"DEBUG(%5d:%2d)%s%s %s\n", - pid,cothread_id,location,elementname,string); + pid, cothread_id, location, elementname, string); #endif /* GST_DEBUG_COLOR */ - if (location != empty) g_free(location); - if (elementname != empty) g_free(elementname); + if (location != empty) g_free (location); + if (elementname != empty) g_free (elementname); - g_free(string); + g_free (string); } @@ -275,14 +275,11 @@ gst_debug_disable_category (gint category) { _gst_debug_categories &= ~ (1 << category); } - - - /***** INFO system *****/ GstInfoHandler _gst_info_handler = gst_default_info_handler; guint32 _gst_info_categories = 0x00000001; - +/* FIXME:what does debug_string DO ??? */ /** * gst_default_info_handler: * @category: category of the INFO message @@ -296,6 +293,7 @@ guint32 _gst_info_categories = 0x00000001; * * Prints out the INFO mesage in a variant of the following form: * + * FIXME: description should be fixed * INFO:gst_function:542(args): [elementname] something neat happened */ void @@ -305,9 +303,9 @@ gst_default_info_handler (gint category, gboolean incore, void *element, gchar *string) { gchar *empty = ""; - gchar *elementname = empty,*location = empty; - int pid = getpid(); - int cothread_id = (int) g_static_private_get(&_gst_debug_cothread_index); + gchar *elementname = empty, *location = empty; + int pid = getpid (); + int cothread_id = 0; /*FIXME*/ #ifdef GST_DEBUG_COLOR int pid_color = pid%6 + 31; int cothread_color = (cothread_id < 0) ? 37 : (cothread_id%6 + 31); @@ -315,21 +313,23 @@ gst_default_info_handler (gint category, gboolean incore, if (debug_string == NULL) debug_string = ""; if (category != GST_CAT_GST_INIT) - location = g_strdup_printf("%s:%d%s:",function,line,debug_string); + location = g_strdup_printf ("%s(%d): %s: %s:", + file, line, function, debug_string); if (element && GST_IS_ELEMENT (element)) - elementname = g_strdup_printf (" \033[04m[%s]\033[00m", GST_OBJECT_NAME (element)); + elementname = g_strdup_printf (" \033[04m[%s]\033[00m", + GST_OBJECT_NAME (element)); /* #ifdef GST_DEBUG_ENABLED */ #ifdef GST_DEBUG_COLOR - fprintf(stderr,"\033[01mINFO\033[00m (\033[00;%dm%5d\033[00m:\033[00;%dm%2d\033[00m)\033[" - GST_DEBUG_CHAR_MODE ";%sm%s%s\033[00m %s\n", - pid_color,pid,cothread_color,cothread_id, - _gst_category_colors[category],location,elementname,string); + fprintf (stderr, "\033[01mINFO\033[00m (\033[00;%dm%5d\033[00m:\033[00;%dm%2d\033[00m)\033[" + GST_DEBUG_CHAR_MODE ";%sm%s%s\033[00m %s\n", + pid_color, pid, cothread_color, cothread_id, + _gst_category_colors[category], location, elementname, string); #else - fprintf(stderr,"INFO (%5d:%2d)%s%s %s\n", - pid,cothread_id,location,elementname,string); + fprintf (stderr, "INFO (%5d:%2d)%s%s %s\n", + pid, cothread_id, location, elementname, string); #endif /* GST_DEBUG_COLOR */ /* #else @@ -344,10 +344,10 @@ gst_default_info_handler (gint category, gboolean incore, #endif */ - if (location != empty) g_free(location); - if (elementname != empty) g_free(elementname); + if (location != empty) g_free (location); + if (elementname != empty) g_free (elementname); - g_free(string); + g_free (string); } /** @@ -485,6 +485,7 @@ gst_default_error_handler (gchar *file, gchar *function, /***** DEBUG system *****/ #ifdef GST_DEBUG_ENABLED +#ifdef GST_DEBUG_ENABLED GHashTable *__gst_function_pointers = NULL; /* FIXME make this thread specific */ /* static GSList *stack_trace = NULL; */ @@ -504,6 +505,7 @@ _gst_debug_nameof_funcptr (void *ptr) return g_strdup_printf("%p",ptr); } return NULL; +#endif } #endif diff --git a/gst/gstinfo.h b/gst/gstinfo.h index 5ff8f900f1..5b31da716a 100644 --- a/gst/gstinfo.h +++ b/gst/gstinfo.h @@ -2,7 +2,7 @@ * Copyright (C) 1999,2000 Erik Walthinsen * 2000 Wim Taymans * - * gstinfo.h: + * gstinfo.h: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -26,11 +26,28 @@ #include #include #include +#include #ifdef HAVE_CONFIG_H #include #endif +/* FIXME: convert to using G_STRLOC all the way if we can ! */ + +#ifndef FUNCTION +#ifdef G_GNUC_PRETTY_FUNCTION +#define FUNCTION G_GNUC_PRETTY_FUNCTION +#elif HAVE_FUNC +#define FUNCTION __func__ +#elif HAVE_PRETTY_FUNCTION +#define FUNCTION __PRETTY_FUNCTION__ +#elif HAVE_FUNCTION +#define FUNCTION __FUNCTION__ +#else +#define FUNCTION "" +#endif +#endif /* ifndef FUNCTION */ + /***** are we in the core or not? *****/ #ifdef __GST_PRIVATE_H__ #define _GST_DEBUG_INCORE TRUE @@ -95,7 +112,6 @@ enum { extern const gchar *_gst_category_colors[32]; -extern GStaticPrivate _gst_debug_cothread_index; /********************************************************************** @@ -141,13 +157,13 @@ G_GNUC_UNUSED static gchar *_debug_string = NULL; #ifdef GST_DEBUG_ENABLED #define GST_DEBUG(cat, ...) G_STMT_START{ \ if ((1< 0) { GTimeVal tv;