merge from release branch

Original commit message from CVS:
merge from release branch
This commit is contained in:
Thomas Vander Stichele 2002-12-11 21:33:07 +00:00
parent fb17dbbe32
commit 65d35489ac
8 changed files with 110 additions and 74 deletions

2
common

@ -1 +1 @@
Subproject commit 92ff5101d55c0f853620bf13f8dd528992824137
Subproject commit 773e3a64961084c37477faa464f12add3dfcd6dc

View file

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

View file

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

View file

@ -530,7 +530,9 @@ 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,7 +556,8 @@ 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);

View file

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

View file

@ -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", /* !! */
"",
@ -195,7 +193,7 @@ gst_default_debug_handler (gint category, gboolean incore,
gchar *empty = "";
gchar *elementname = empty,* location = empty;
int pid = getpid ();
int cothread_id = (int) g_static_private_get(&_gst_debug_cothread_index);
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,10 +201,12 @@ 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
@ -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
@ -307,7 +305,7 @@ gst_default_info_handler (gint category, gboolean incore,
gchar *empty = "";
gchar *elementname = empty, *location = empty;
int pid = getpid ();
int cothread_id = (int) g_static_private_get(&_gst_debug_cothread_index);
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,9 +313,11 @@ 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
@ -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

View file

@ -26,11 +26,28 @@
#include <stdio.h>
#include <gmodule.h>
#include <unistd.h>
#include <glib/gmacros.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#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<<cat) & _gst_debug_categories) \
_gst_debug_handler(cat,_GST_DEBUG_INCORE,__FILE__,G_GNUC_PRETTY_FUNCTION,__LINE__,_debug_string, \
_gst_debug_handler(cat,_GST_DEBUG_INCORE,__FILE__,FUNCTION,__LINE__,_debug_string, \
NULL,g_strdup_printf( __VA_ARGS__ )); \
}G_STMT_END
#define GST_DEBUG_ELEMENT(cat, element, ...) G_STMT_START{ \
if ((1<<cat) & _gst_debug_categories) \
_gst_debug_handler(cat,_GST_DEBUG_INCORE,__FILE__,G_GNUC_PRETTY_FUNCTION,__LINE__,_debug_string, \
_gst_debug_handler(cat,_GST_DEBUG_INCORE,__FILE__,FUNCTION,__LINE__,_debug_string, \
element,g_strdup_printf( __VA_ARGS__ )); \
}G_STMT_END
@ -161,13 +177,13 @@ G_GNUC_UNUSED static gchar *_debug_string = NULL;
#ifdef GST_DEBUG_ENABLED
#define GST_DEBUG(cat,format,args...) G_STMT_START{ \
if ((1<<cat) & _gst_debug_categories) \
_gst_debug_handler(cat,_GST_DEBUG_INCORE,__FILE__,G_GNUC_PRETTY_FUNCTION,__LINE__,_debug_string, \
_gst_debug_handler(cat,_GST_DEBUG_INCORE,__FILE__,FUNCTION,__LINE__,_debug_string, \
NULL,g_strdup_printf( format , ## args )); \
}G_STMT_END
#define GST_DEBUG_ELEMENT(cat,element,format,args...) G_STMT_START{ \
if ((1<<cat) & _gst_debug_categories) \
_gst_debug_handler(cat,_GST_DEBUG_INCORE,__FILE__,G_GNUC_PRETTY_FUNCTION,__LINE__,_debug_string, \
_gst_debug_handler(cat,_GST_DEBUG_INCORE,__FILE__,FUNCTION,__LINE__,_debug_string, \
element,g_strdup_printf( format , ## args )); \
}G_STMT_END
@ -352,13 +368,13 @@ extern guint32 _gst_info_categories;
#ifdef GST_INFO_ENABLED
#define GST_INFO(cat,...) G_STMT_START{ \
if ((1<<cat) & _gst_info_categories) \
_gst_info_handler(cat,_GST_DEBUG_INCORE,__FILE__,G_GNUC_PRETTY_FUNCTION,__LINE__,_debug_string, \
_gst_info_handler(cat,_GST_DEBUG_INCORE,__FILE__,FUNCTION,__LINE__,_debug_string, \
NULL,g_strdup_printf( __VA_ARGS__ )); \
}G_STMT_END
#define GST_INFO_ELEMENT(cat,element,...) G_STMT_START{ \
if ((1<<cat) & _gst_info_categories) \
_gst_info_handler(cat,_GST_DEBUG_INCORE,__FILE__,G_GNUC_PRETTY_FUNCTION,__LINE__,_debug_string, \
_gst_info_handler(cat,_GST_DEBUG_INCORE,__FILE__,FUNCTION,__LINE__,_debug_string, \
element,g_strdup_printf( __VA_ARGS__ )); \
}G_STMT_END
@ -372,13 +388,13 @@ extern guint32 _gst_info_categories;
#ifdef GST_INFO_ENABLED
#define GST_INFO(cat,format,args...) G_STMT_START{ \
if ((1<<cat) & _gst_info_categories) \
_gst_info_handler(cat,_GST_DEBUG_INCORE,__FILE__,G_GNUC_PRETTY_FUNCTION,__LINE__,_debug_string, \
_gst_info_handler(cat,_GST_DEBUG_INCORE,__FILE__,FUNCTION,__LINE__,_debug_string, \
NULL,g_strdup_printf( format , ## args )); \
}G_STMT_END
#define GST_INFO_ELEMENT(cat,element,format,args...) G_STMT_START{ \
if ((1<<cat) & _gst_info_categories) \
_gst_info_handler(cat,_GST_DEBUG_INCORE,__FILE__,G_GNUC_PRETTY_FUNCTION,__LINE__,_debug_string, \
_gst_info_handler(cat,_GST_DEBUG_INCORE,__FILE__,FUNCTION,__LINE__,_debug_string, \
element,g_strdup_printf( format , ## args )); \
}G_STMT_END
@ -420,21 +436,21 @@ extern GstErrorHandler _gst_error_handler;
#ifdef G_HAVE_ISO_VARARGS
#define GST_ERROR(element,...) \
_gst_error_handler(__FILE__,G_GNUC_PRETTY_FUNCTION,__LINE__,_debug_string, \
_gst_error_handler(__FILE__,FUNCTION,__LINE__,_debug_string, \
element,NULL,g_strdup_printf( __VA_ARGS__ ))
#define GST_ERROR_OBJECT(element,object,...) \
_gst_error_handler(__FILE__,G_GNUC_PRETTY_FUNCTION,__LINE__,_debug_string, \
_gst_error_handler(__FILE__,FUNCTION,__LINE__,_debug_string, \
element,object,g_strdup_printf( __VA_ARGS__ ))
#elif defined(G_HAVE_GNUC_VARARGS)
#define GST_ERROR(element,format,args...) \
_gst_error_handler(__FILE__,G_GNUC_PRETTY_FUNCTION,__LINE__,_debug_string, \
_gst_error_handler(__FILE__,FUNCTION,__LINE__,_debug_string, \
element,NULL,g_strdup_printf( format , ## args ))
#define GST_ERROR_OBJECT(element,object,format,args...) \
_gst_error_handler(__FILE__,G_GNUC_PRETTY_FUNCTION,__LINE__,_debug_string, \
_gst_error_handler(__FILE__,FUNCTION,__LINE__,_debug_string, \
element,object,g_strdup_printf( format , ## args ))
#endif
@ -446,7 +462,14 @@ extern GstErrorHandler _gst_error_handler;
extern GHashTable *__gst_function_pointers;
#ifdef GST_DEBUG_ENABLED
#if GST_DEBUG_ENABLED
#define GST_DEBUG_FUNCPTR(ptr) _gst_debug_register_funcptr((void *)(ptr), #ptr)
#define GST_DEBUG_FUNCPTR_NAME(ptr) _gst_debug_nameof_funcptr((void *)ptr)
#else
#define GST_DEBUG_FUNCPTR(ptr) (ptr)
#define GST_DEBUG_FUNCPTR_NAME(ptr) ""
#endif
static inline void *
_gst_debug_register_funcptr (void *ptr, gchar *ptrname)
{
@ -455,15 +478,11 @@ _gst_debug_register_funcptr (void *ptr, gchar *ptrname)
g_hash_table_insert(__gst_function_pointers,ptr,ptrname);
return ptr;
}
#define GST_DEBUG_FUNCPTR(ptr) _gst_debug_register_funcptr((void *)(ptr), #ptr)
#define GST_DEBUG_FUNCPTR_NAME(ptr) _gst_debug_nameof_funcptr((void *)ptr)
gchar *_gst_debug_nameof_funcptr (void *ptr);
#else
#define GST_DEBUG_FUNCPTR(ptr) (ptr)
#define GST_DEBUG_FUNCPTR_NAME(ptr) ""
#endif
void gst_debug_print_stack_trace (void);
#endif /* __GSTINFO_H__ */

View file

@ -138,7 +138,9 @@ gst_system_clock_wait (GstClock *clock, GstClockEntry *entry)
target = gst_system_clock_get_internal_time (clock) +
GST_CLOCK_ENTRY_TIME (entry) - current;
GST_DEBUG (GST_CAT_CLOCK, "real_target %llu, target %llu, now %llu",
GST_DEBUG (GST_CAT_CLOCK, "real_target %" G_GUINT64_FORMAT
" target %" G_GUINT64_FORMAT
" now %" G_GUINT64_FORMAT,
target, GST_CLOCK_ENTRY_TIME (entry), current);
if (((gint64)target) > 0) {