summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-01-07 18:41:25 +0200
committerSebastian Dröge <sebastian@centricular.com>2016-01-07 18:41:25 +0200
commitd787105fd5848560f5bc8c6c09a54c2cf8827dbf (patch)
tree24bb607974a01de530dd25ee344884ea203e540c
parent842b472772158b0e40b201b1a81c45cf8c17ab71 (diff)
gst: Rename _priv_gst_info_start_time to _priv_gst_start_time and initialize it centrally
It's used by the debugging and tracer subsystem and in various files, make it a central thing that is initialized independ of the existence of those subsystems.
-rw-r--r--gst/gst.c5
-rw-r--r--gst/gst_private.h2
-rw-r--r--gst/gstdebugutils.c3
-rw-r--r--gst/gstinfo.c12
-rw-r--r--gst/gsttracerutils.h2
5 files changed, 9 insertions, 15 deletions
diff --git a/gst/gst.c b/gst/gst.c
index 0e809a10a..f42a8795b 100644
--- a/gst/gst.c
+++ b/gst/gst.c
@@ -123,6 +123,8 @@
static gboolean gst_initialized = FALSE;
static gboolean gst_deinitialized = FALSE;
+GstClockTime _priv_gst_start_time;
+
#ifdef G_OS_WIN32
HMODULE _priv_gst_dll_handle = NULL;
#endif
@@ -475,6 +477,9 @@ init_pre (GOptionContext * context, GOptionGroup * group, gpointer data,
GST_DEBUG ("already initialized");
return TRUE;
}
+
+ _priv_gst_start_time = gst_util_get_timestamp ();
+
#ifndef GST_DISABLE_GST_DEBUG
_priv_gst_debug_init ();
priv_gst_dump_dot_dir = g_getenv ("GST_DEBUG_DUMP_DOT_DIR");
diff --git a/gst/gst_private.h b/gst/gst_private.h
index 384dc7b43..c8cdda9c2 100644
--- a/gst/gst_private.h
+++ b/gst/gst_private.h
@@ -263,7 +263,7 @@ extern GstDebugCategory *_priv_GST_CAT_POLL;
#define GST_CAT_PROTECTION _priv_GST_CAT_PROTECTION
extern GstDebugCategory *_priv_GST_CAT_PROTECTION;
-extern GstClockTime _priv_gst_info_start_time;
+extern GstClockTime _priv_gst_start_time;
#else
diff --git a/gst/gstdebugutils.c b/gst/gstdebugutils.c
index 8b4411dbd..446488310 100644
--- a/gst/gstdebugutils.c
+++ b/gst/gstdebugutils.c
@@ -840,8 +840,7 @@ gst_debug_bin_to_dot_file_with_ts (GstBin * bin,
}
/* add timestamp */
- elapsed = GST_CLOCK_DIFF (_priv_gst_info_start_time,
- gst_util_get_timestamp ());
+ elapsed = GST_CLOCK_DIFF (_priv_gst_start_time, gst_util_get_timestamp ());
/* we don't use GST_TIME_FORMAT as such filenames would fail on some
* filesystems like fat */
diff --git a/gst/gstinfo.c b/gst/gstinfo.c
index 643ce88fa..aebd62b42 100644
--- a/gst/gstinfo.c
+++ b/gst/gstinfo.c
@@ -186,12 +186,6 @@ GstDebugCategory *_priv_GST_CAT_PROTECTION = NULL;
/* underscore is to prevent conflict with GST_CAT_DEBUG define */
GST_DEBUG_CATEGORY_STATIC (_GST_CAT_DEBUG);
-/* time of initialization, so we get useful debugging output times
- * FIXME: we use this in gstdebugutils.c, what about a function + macro to
- * get the running time: GST_DEBUG_RUNNING_TIME
- */
-GstClockTime _priv_gst_info_start_time;
-
#if 0
#if defined __sgi__
#include <rld_interface.h>
@@ -318,9 +312,6 @@ _priv_gst_debug_init (void)
log_file = stderr;
}
- /* get time we started for debugging messages */
- _priv_gst_info_start_time = gst_util_get_timestamp ();
-
__gst_printf_pointer_extension_set_func
(gst_info_printf_pointer_extension_func);
@@ -1013,8 +1004,7 @@ gst_debug_log_default (GstDebugCategory * category, GstDebugLevel level,
obj = (gchar *) "";
}
- elapsed = GST_CLOCK_DIFF (_priv_gst_info_start_time,
- gst_util_get_timestamp ());
+ elapsed = GST_CLOCK_DIFF (_priv_gst_start_time, gst_util_get_timestamp ());
if (color_mode != GST_DEBUG_COLOR_MODE_OFF) {
#ifdef G_OS_WIN32
diff --git a/gst/gsttracerutils.h b/gst/gsttracerutils.h
index 079279faa..92f2c9ceb 100644
--- a/gst/gsttracerutils.h
+++ b/gst/gsttracerutils.h
@@ -91,7 +91,7 @@ extern GHashTable *_priv_tracers;
#define GST_TRACER_IS_ENABLED (_priv_tracer_enabled)
#define GST_TRACER_TS \
- GST_CLOCK_DIFF (_priv_gst_info_start_time, gst_util_get_timestamp ())
+ GST_CLOCK_DIFF (_priv_gst_start_time, gst_util_get_timestamp ())
/* tracing hooks */