mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 05:59:10 +00:00
gst/gst.c: Make _gst_disable_segtrap static, it's only used in gstplugin.c and we can use gst_segtrap_is_enabled() t...
Original commit message from CVS: * gst/gst.c: (_gst_disable_segtrap): Make _gst_disable_segtrap static, it's only used in gstplugin.c and we can use gst_segtrap_is_enabled() there now that we have that API. Move _gst_debug_dump_dot_dir into gstdebugutils.c, there's no reason to do the getenv here (and export the variable). * gst/gstdebugutils.c: (debug_dump_element), (_gst_debug_bin_to_dot_file), (_gst_debug_bin_to_dot_file_with_ts): Don't use VLAs which is a C99ism and throws off MSVC (#493983). * gst/gstinfo.c: (_priv_gst_info_start_time), (_gst_debug_init), (gst_debug_log_default): Rename _gst_info_start_time to priv_gst_info_start_time so it doesn't get exported (was never in any header). * gst/gstplugin.c: (_gst_plugin_fault_handler_setup), (gst_plugin_loading_mutex): Make static mutex gst_plugin_loading_mutex really static (was never in any header), and use gst_segtrap_is_enabled() instead of _gst_disable_segtrap. * gst/gsttrace.c: (_gst_trace_default): Make local _gst_trace_default static (was never in any header).
This commit is contained in:
parent
d8158bf121
commit
efaea50c48
6 changed files with 46 additions and 28 deletions
26
ChangeLog
26
ChangeLog
|
@ -1,3 +1,29 @@
|
||||||
|
2007-11-06 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
|
* gst/gst.c: (_gst_disable_segtrap):
|
||||||
|
Make _gst_disable_segtrap static, it's only used in gstplugin.c and
|
||||||
|
we can use gst_segtrap_is_enabled() there now that we have that API.
|
||||||
|
Move _gst_debug_dump_dot_dir into gstdebugutils.c, there's no reason
|
||||||
|
to do the getenv here (and export the variable).
|
||||||
|
|
||||||
|
* gst/gstdebugutils.c: (debug_dump_element),
|
||||||
|
(_gst_debug_bin_to_dot_file), (_gst_debug_bin_to_dot_file_with_ts):
|
||||||
|
Don't use VLAs which is a C99ism and throws off MSVC (#493983).
|
||||||
|
|
||||||
|
* gst/gstinfo.c: (_priv_gst_info_start_time), (_gst_debug_init),
|
||||||
|
(gst_debug_log_default):
|
||||||
|
Rename _gst_info_start_time to priv_gst_info_start_time so it
|
||||||
|
doesn't get exported (was never in any header).
|
||||||
|
|
||||||
|
* gst/gstplugin.c: (_gst_plugin_fault_handler_setup),
|
||||||
|
(gst_plugin_loading_mutex):
|
||||||
|
Make static mutex gst_plugin_loading_mutex really static (was never
|
||||||
|
in any header), and use gst_segtrap_is_enabled() instead of
|
||||||
|
_gst_disable_segtrap.
|
||||||
|
|
||||||
|
* gst/gsttrace.c: (_gst_trace_default):
|
||||||
|
Make local _gst_trace_default static (was never in any header).
|
||||||
|
|
||||||
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: Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com>
|
Patch by: Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com>
|
||||||
|
|
|
@ -134,7 +134,6 @@ static GList *plugin_paths = NULL; /* for delayed processing in post_init *
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern gint _gst_trace_on;
|
extern gint _gst_trace_on;
|
||||||
extern const gchar *_gst_debug_dump_dot_dir;
|
|
||||||
|
|
||||||
/* defaults */
|
/* defaults */
|
||||||
#ifdef HAVE_FORK
|
#ifdef HAVE_FORK
|
||||||
|
@ -143,9 +142,8 @@ extern const gchar *_gst_debug_dump_dot_dir;
|
||||||
#define DEFAULT_FORK FALSE
|
#define DEFAULT_FORK FALSE
|
||||||
#endif /* HAVE_FORK */
|
#endif /* HAVE_FORK */
|
||||||
|
|
||||||
/* set to TRUE when segfaults need to be left as is, FIXME, this variable is
|
/* set to TRUE when segfaults need to be left as is */
|
||||||
* global. */
|
static gboolean _gst_disable_segtrap = FALSE;
|
||||||
gboolean _gst_disable_segtrap = FALSE;
|
|
||||||
|
|
||||||
/* control the behaviour of registry rebuild */
|
/* control the behaviour of registry rebuild */
|
||||||
static gboolean _gst_enable_registry_fork = DEFAULT_FORK;
|
static gboolean _gst_enable_registry_fork = DEFAULT_FORK;
|
||||||
|
@ -586,8 +584,6 @@ init_pre (GOptionContext * context, GOptionGroup * group, gpointer data,
|
||||||
if (debug_list) {
|
if (debug_list) {
|
||||||
parse_debug_list (debug_list);
|
parse_debug_list (debug_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
_gst_debug_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.
|
||||||
|
|
|
@ -37,8 +37,7 @@
|
||||||
|
|
||||||
/*** PIPELINE GRAPHS **********************************************************/
|
/*** PIPELINE GRAPHS **********************************************************/
|
||||||
|
|
||||||
const gchar *_gst_debug_dump_dot_dir = NULL;
|
extern GstClockTime _priv_gst_info_start_time;
|
||||||
extern GstClockTime _gst_info_start_time;
|
|
||||||
|
|
||||||
static gchar *
|
static gchar *
|
||||||
debug_dump_make_object_name (GstObject * element)
|
debug_dump_make_object_name (GstObject * element)
|
||||||
|
@ -138,8 +137,9 @@ debug_dump_element (GstBin * bin, GstDebugGraphDetails details, FILE * out,
|
||||||
gchar *color_name;
|
gchar *color_name;
|
||||||
gchar *state_name = NULL;
|
gchar *state_name = NULL;
|
||||||
gchar *param_name = NULL;
|
gchar *param_name = NULL;
|
||||||
gchar spc[1 + indent * 2];
|
gchar *spc = NULL;
|
||||||
|
|
||||||
|
spc = g_malloc (1 + indent * 2);
|
||||||
memset (spc, 32, indent * 2);
|
memset (spc, 32, indent * 2);
|
||||||
spc[indent * 2] = '\0';
|
spc[indent * 2] = '\0';
|
||||||
|
|
||||||
|
@ -251,8 +251,7 @@ debug_dump_element (GstBin * bin, GstDebugGraphDetails details, FILE * out,
|
||||||
free_caps = TRUE;
|
free_caps = TRUE;
|
||||||
} else {
|
} else {
|
||||||
free_caps = FALSE;
|
free_caps = FALSE;
|
||||||
if (!(caps =
|
if (!(caps = (GstCaps *)
|
||||||
(GstCaps *)
|
|
||||||
gst_pad_get_pad_template_caps (pad))) {
|
gst_pad_get_pad_template_caps (pad))) {
|
||||||
/* this should not happen */
|
/* this should not happen */
|
||||||
media = "?";
|
media = "?";
|
||||||
|
@ -263,6 +262,7 @@ debug_dump_element (GstBin * bin, GstDebugGraphDetails details, FILE * out,
|
||||||
gchar *tmp =
|
gchar *tmp =
|
||||||
g_strdelimit (gst_caps_to_string (caps), ",",
|
g_strdelimit (gst_caps_to_string (caps), ",",
|
||||||
'\n');
|
'\n');
|
||||||
|
|
||||||
media = g_strescape (tmp, NULL);
|
media = g_strescape (tmp, NULL);
|
||||||
free_media = TRUE;
|
free_media = TRUE;
|
||||||
g_free (tmp);
|
g_free (tmp);
|
||||||
|
@ -397,6 +397,7 @@ debug_dump_element (GstBin * bin, GstDebugGraphDetails details, FILE * out,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gst_iterator_free (element_iter);
|
gst_iterator_free (element_iter);
|
||||||
|
g_free (spc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -415,12 +416,14 @@ 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));
|
||||||
|
|
||||||
if (!_gst_debug_dump_dot_dir)
|
dump_dot_dir = g_getenv ("GST_DEBUG_DUMP_DOT_DIR");
|
||||||
|
if (!dump_dot_dir)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!file_name) {
|
if (!file_name) {
|
||||||
|
@ -430,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",
|
||||||
_gst_debug_dump_dot_dir, file_name);
|
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;
|
||||||
|
@ -498,7 +501,7 @@ _gst_debug_bin_to_dot_file_with_ts (GstBin * bin, GstDebugGraphDetails details,
|
||||||
|
|
||||||
/* add timestamp */
|
/* add timestamp */
|
||||||
g_get_current_time (&now);
|
g_get_current_time (&now);
|
||||||
elapsed = GST_TIMEVAL_TO_TIME (now) - _gst_info_start_time;
|
elapsed = GST_TIMEVAL_TO_TIME (now) - _priv_gst_info_start_time;
|
||||||
ts_file_name =
|
ts_file_name =
|
||||||
g_strdup_printf ("%" GST_TIME_FORMAT "-%s", GST_TIME_ARGS (elapsed),
|
g_strdup_printf ("%" GST_TIME_FORMAT "-%s", GST_TIME_ARGS (elapsed),
|
||||||
file_name);
|
file_name);
|
||||||
|
|
|
@ -120,7 +120,7 @@ GST_DEBUG_CATEGORY_STATIC (_GST_CAT_DEBUG);
|
||||||
* FIXME: we use this in gstdebugutils.c, what about a function + macro to
|
* FIXME: we use this in gstdebugutils.c, what about a function + macro to
|
||||||
* get the running time: GST_DEBUG_RUNNING_TIME
|
* get the running time: GST_DEBUG_RUNNING_TIME
|
||||||
*/
|
*/
|
||||||
GstClockTime _gst_info_start_time;
|
GstClockTime _priv_gst_info_start_time;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
#if defined __sgi__
|
#if defined __sgi__
|
||||||
|
@ -284,7 +284,7 @@ _gst_debug_init (void)
|
||||||
|
|
||||||
/* get time we started for debugging messages */
|
/* get time we started for debugging messages */
|
||||||
g_get_current_time (¤t);
|
g_get_current_time (¤t);
|
||||||
_gst_info_start_time = GST_TIMEVAL_TO_TIME (current);
|
_priv_gst_info_start_time = GST_TIMEVAL_TO_TIME (current);
|
||||||
|
|
||||||
#ifdef HAVE_PRINTF_EXTENSION
|
#ifdef HAVE_PRINTF_EXTENSION
|
||||||
register_printf_function (GST_PTR_FORMAT[0], _gst_info_printf_extension_ptr,
|
register_printf_function (GST_PTR_FORMAT[0], _gst_info_printf_extension_ptr,
|
||||||
|
@ -670,7 +670,7 @@ gst_debug_log_default (GstDebugCategory * category, GstDebugLevel level,
|
||||||
}
|
}
|
||||||
|
|
||||||
g_get_current_time (&now);
|
g_get_current_time (&now);
|
||||||
elapsed = GST_TIMEVAL_TO_TIME (now) - _gst_info_start_time;
|
elapsed = GST_TIMEVAL_TO_TIME (now) - _priv_gst_info_start_time;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
g_printerr ("%s (%p - %" GST_TIME_FORMAT ") %s%20s%s(%s%5d%s) %s%s(%d):%s:%s%s %s\n",
|
g_printerr ("%s (%p - %" GST_TIME_FORMAT ") %s%20s%s(%s%5d%s) %s%s(%d):%s:%s%s %s\n",
|
||||||
|
|
|
@ -65,13 +65,7 @@
|
||||||
|
|
||||||
#include "gst_private.h"
|
#include "gst_private.h"
|
||||||
|
|
||||||
#include "gstplugin.h"
|
#include <gst/gst.h>
|
||||||
#include "gstversion.h"
|
|
||||||
#include "gstinfo.h"
|
|
||||||
#include "gstfilter.h"
|
|
||||||
#include "gstregistry.h"
|
|
||||||
#include "gstmacros.h"
|
|
||||||
|
|
||||||
|
|
||||||
#define GST_CAT_DEFAULT GST_CAT_PLUGIN_LOADING
|
#define GST_CAT_DEFAULT GST_CAT_PLUGIN_LOADING
|
||||||
|
|
||||||
|
@ -80,7 +74,6 @@ static gboolean _gst_plugin_inited;
|
||||||
|
|
||||||
/* static variables for segfault handling of plugin loading */
|
/* static variables for segfault handling of plugin loading */
|
||||||
static char *_gst_plugin_fault_handler_filename = NULL;
|
static char *_gst_plugin_fault_handler_filename = NULL;
|
||||||
extern gboolean _gst_disable_segtrap; /* see gst.c */
|
|
||||||
|
|
||||||
#ifndef HAVE_WIN32
|
#ifndef HAVE_WIN32
|
||||||
static gboolean _gst_plugin_fault_handler_is_setup = FALSE;
|
static gboolean _gst_plugin_fault_handler_is_setup = FALSE;
|
||||||
|
@ -327,7 +320,7 @@ _gst_plugin_fault_handler_setup (void)
|
||||||
struct sigaction action;
|
struct sigaction action;
|
||||||
|
|
||||||
/* if asked to leave segfaults alone, just return */
|
/* if asked to leave segfaults alone, just return */
|
||||||
if (_gst_disable_segtrap)
|
if (!gst_segtrap_is_enabled ())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_gst_plugin_fault_handler_is_setup)
|
if (_gst_plugin_fault_handler_is_setup)
|
||||||
|
@ -354,7 +347,7 @@ _gst_plugin_fault_handler_setup (void)
|
||||||
|
|
||||||
static void _gst_plugin_fault_handler_setup ();
|
static void _gst_plugin_fault_handler_setup ();
|
||||||
|
|
||||||
GStaticMutex gst_plugin_loading_mutex = G_STATIC_MUTEX_INIT;
|
static GStaticMutex gst_plugin_loading_mutex = G_STATIC_MUTEX_INIT;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_plugin_load_file:
|
* gst_plugin_load_file:
|
||||||
|
|
|
@ -95,7 +95,7 @@ gst_trace_read_tsc (gint64 * dst)
|
||||||
read_tsc (dst);
|
read_tsc (dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
GstTrace *_gst_trace_default = NULL;
|
static GstTrace *_gst_trace_default = NULL;
|
||||||
gint _gst_trace_on = 1;
|
gint _gst_trace_on = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue