X-Git-Url: https://git.ti.com/gitweb?p=glsdk%2Fgstreamer0-10.git;a=blobdiff_plain;f=gst%2Fgstinfo.c;h=226876822adb5d8601a14464eb80d105801fcb00;hp=266feed04a5bb54d80926dbf925565bf4d5e2649;hb=83cb98507f161e0d5610d4aa6a22d283334e131f;hpb=5187a43a25fbb1663fe12cf6f35bb945226d2108 diff --git a/gst/gstinfo.c b/gst/gstinfo.c index 266feed04..226876822 100644 --- a/gst/gstinfo.c +++ b/gst/gstinfo.c @@ -435,6 +435,32 @@ _gst_debug_init (void) /* we can't do this further above, because we initialize the GST_CAT_DEFAULT struct */ #define GST_CAT_DEFAULT _GST_CAT_DEBUG + +/** + * gst_debug_log2: + * @category: category to log + * @level: level of the message is in + * @location: the file, function name, and line number of the location that + * emitted the message + * @object: the object this message relates to or NULL if none + * @format: a printf style format string + * @...: optional arguments for the format + * + * Logs the given message using the currently registered debugging handlers. + */ +void +gst_debug_log2 (GstDebugCategory * category, GstDebugLevel level, + const GstDebugTraceLocation * location, + GObject * object, const gchar * format, ...) +{ + va_list var_args; + + va_start (var_args, format); + gst_debug_log_valist2 (category, level, location, object, format, var_args); + va_end (var_args); +} + + /** * gst_debug_log: * @category: category to log @@ -505,14 +531,41 @@ void gst_debug_log_valist (GstDebugCategory * category, GstDebugLevel level, const gchar * file, const gchar * function, gint line, GObject * object, const gchar * format, va_list args) +{ + GstDebugTraceLocation location = { + .file = file, + .function = function, + .line = line + }; + gst_debug_log_valist2 (category, level, &location, object, format, args); +} + + +/** + * gst_debug_log_valist2: + * @category: category to log + * @level: level of the message is in + * @location: the file, function name, and line number of the location that + * emitted the message + * @object: the object this message relates to or NULL if none + * @format: a printf style format string + * @args: optional arguments for the format + * + * Logs the given message using the currently registered debugging handlers. + */ +void +gst_debug_log_valist2 (GstDebugCategory * category, GstDebugLevel level, + const GstDebugTraceLocation * location, + GObject * object, const gchar * format, va_list args) { GstDebugMessage message; LogFuncEntry *entry; GSList *handler; g_return_if_fail (category != NULL); - g_return_if_fail (file != NULL); - g_return_if_fail (function != NULL); + g_return_if_fail (location != NULL); + g_return_if_fail (location->file != NULL); + g_return_if_fail (location->function != NULL); g_return_if_fail (format != NULL); /* The predefined macro __FILE__ is always the exact path given to the @@ -530,8 +583,9 @@ gst_debug_log_valist (GstDebugCategory * category, GstDebugLevel level, while (handler) { entry = handler->data; handler = g_slist_next (handler); - entry->func (category, level, file, function, line, object, &message, - entry->user_data); + // TODO: change GstLogFunction and pass GstDebugTraceLocation ptr instead.. + entry->func (category, level, location->file, location->function, + location->line, object, &message, entry->user_data); } g_free (message.message); va_end (message.arguments); @@ -604,7 +658,7 @@ gst_info_structure_to_string (GstStructure * s) return gst_structure_to_string (s); } -static gchar * +gchar * gst_debug_print_object (gpointer ptr) { GObject *object = (GObject *) ptr; @@ -719,7 +773,7 @@ gst_debug_print_object (gpointer ptr) #ifdef HAVE_PRINTF_EXTENSION -static gchar * +gchar * gst_debug_print_segment (gpointer ptr) { GstSegment *segment = (GstSegment *) ptr;