-Subproject commit 92ff5101d55c0f853620bf13f8dd528992824137
+Subproject commit 773e3a64961084c37477faa464f12add3dfcd6dc
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 ====================================
#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
* @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.
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;
}
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;
}
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;
}
*
* Gets the current time of the given clock. The time is always
* monotonically increasing.
- *
+ *
* Returns: the time of the clock.
*/
GstClockTime
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);
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 */
/* [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", /* !! */
"",
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);
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);
}
_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
*
* 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
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);
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
#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);
}
/**
/***** 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; */
return g_strdup_printf("%p",ptr);
}
return NULL;
+#endif
}
#endif
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
*
- * 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
#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
extern const gchar *_gst_category_colors[32];
-extern GStaticPrivate _gst_debug_cothread_index;
/**********************************************************************
#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
#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
#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
#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
#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
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)
+_gst_debug_register_funcptr (void *ptr, gchar *ptrname)
{
if (!__gst_function_pointers) __gst_function_pointers = g_hash_table_new(g_direct_hash,g_direct_equal);
if (!g_hash_table_lookup(__gst_function_pointers,ptr))
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
+gchar *_gst_debug_nameof_funcptr (void *ptr);
void gst_debug_print_stack_trace (void);
+
+
#endif /* __GSTINFO_H__ */
return 1 * GST_USECOND;
}
-static GstClockEntryStatus
+static GstClockEntryStatus
gst_system_clock_wait (GstClock *clock, GstClockEntry *entry)
{
GstClockEntryStatus res = GST_CLOCK_ENTRY_OK;
GstClockTime current, target;
-
+
current = gst_clock_get_time (clock);
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",
- target, GST_CLOCK_ENTRY_TIME (entry), current);
-
+
+ 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) {
GTimeVal tv;