gst/: Move getenv() back into gst_init, so everyone can live happily ever after. Make sure the symbol isn't exported ...

Original commit message from CVS:
* gst/gst.c: (init_pre):
* gst/gstdebugutils.c: (priv_gst_dump_dot_dir), (debug_dump_element),
(_gst_debug_bin_to_dot_file):
Move getenv() back into gst_init, so everyone can live happily
ever after. Make sure the symbol isn't exported though.
This commit is contained in:
Tim-Philipp Müller 2007-11-07 15:53:52 +00:00
parent a463a40fd8
commit def6b4bb66
3 changed files with 18 additions and 4 deletions

View file

@ -1,3 +1,11 @@
2007-11-07 Tim-Philipp Müller <tim at centricular dot net>
* gst/gst.c: (init_pre):
* gst/gstdebugutils.c: (priv_gst_dump_dot_dir), (debug_dump_element),
(_gst_debug_bin_to_dot_file):
Move getenv() back into gst_init, so everyone can live happily
ever after. Make sure the symbol isn't exported though.
2007-11-06 Tim-Philipp Müller <tim at centricular dot net> 2007-11-06 Tim-Philipp Müller <tim at centricular dot net>
Patch by: Sebastien Moutte <sebastien moutte net> Patch by: Sebastien Moutte <sebastien moutte net>

View file

@ -135,6 +135,10 @@ static GList *plugin_paths = NULL; /* for delayed processing in post_init *
extern gint _gst_trace_on; extern gint _gst_trace_on;
#ifndef GST_DISABLE_GST_DEBUG
extern const gchar *priv_gst_dump_dot_dir;
#endif
/* defaults */ /* defaults */
#ifdef HAVE_FORK #ifdef HAVE_FORK
#define DEFAULT_FORK TRUE #define DEFAULT_FORK TRUE
@ -585,6 +589,8 @@ init_pre (GOptionContext * context, GOptionGroup * group, gpointer data,
parse_debug_list (debug_list); parse_debug_list (debug_list);
} }
} }
priv_gst_dump_dot_dir = g_getenv ("GST_DEBUG_DUMP_DOT_DIR");
#endif #endif
/* This is the earliest we can make stuff show up in the logs. /* This is the earliest we can make stuff show up in the logs.
* So give some useful info about GStreamer here */ * So give some useful info about GStreamer here */

View file

@ -37,6 +37,8 @@
/*** PIPELINE GRAPHS **********************************************************/ /*** PIPELINE GRAPHS **********************************************************/
const gchar *priv_gst_dump_dot_dir; /* NULL *//* set from gst.c */
extern GstClockTime _priv_gst_info_start_time; extern GstClockTime _priv_gst_info_start_time;
static gchar * static gchar *
@ -416,14 +418,12 @@ void
_gst_debug_bin_to_dot_file (GstBin * bin, GstDebugGraphDetails details, _gst_debug_bin_to_dot_file (GstBin * bin, GstDebugGraphDetails details,
const gchar * file_name) const gchar * file_name)
{ {
const gchar *dump_dot_dir;
gchar *full_file_name = NULL; gchar *full_file_name = NULL;
FILE *out; FILE *out;
g_return_if_fail (GST_IS_BIN (bin)); g_return_if_fail (GST_IS_BIN (bin));
dump_dot_dir = g_getenv ("GST_DEBUG_DUMP_DOT_DIR"); if (G_LIKELY (priv_gst_dump_dot_dir == NULL))
if (!dump_dot_dir)
return; return;
if (!file_name) { if (!file_name) {
@ -433,7 +433,7 @@ _gst_debug_bin_to_dot_file (GstBin * bin, GstDebugGraphDetails details,
} }
full_file_name = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s.dot", full_file_name = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s.dot",
dump_dot_dir, file_name); priv_gst_dump_dot_dir, file_name);
if ((out = fopen (full_file_name, "wb"))) { if ((out = fopen (full_file_name, "wb"))) {
gchar *state_name = NULL; gchar *state_name = NULL;