From 80ca485dad89138e77a733e8fa139972bba6709c Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Sat, 8 Oct 2005 06:49:09 +0000 Subject: [PATCH] gst/: log distributing clocks and base time Original commit message from CVS: * gst/gst.c: (init_pre): * gst/gstbin.c: (gst_bin_add_func): log distributing clocks and base time * gst/gstregistry.c: (gst_registry_add_plugin), (gst_registry_scan_path_level), (gst_registry_scan_path): clean up the debugging output a little * gst/gstutils.c: (gst_element_state_get_name): warn about a memleak (I've actually seen this be used, though it was probably a bug) --- ChangeLog | 12 ++++++++++++ gst/gst.c | 2 +- gst/gstbin.c | 3 +++ gst/gstregistry.c | 30 ++++++++++++++++++------------ gst/gstutils.c | 1 + 5 files changed, 35 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 793d0b7e32..10d31385e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2005-10-08 Thomas Vander Stichele + + * gst/gst.c: (init_pre): + * gst/gstbin.c: (gst_bin_add_func): + log distributing clocks and base time + * gst/gstregistry.c: (gst_registry_add_plugin), + (gst_registry_scan_path_level), (gst_registry_scan_path): + clean up the debugging output a little + * gst/gstutils.c: (gst_element_state_get_name): + warn about a memleak (I've actually seen this be used, though + it was probably a bug) + 2005-10-07 Wim Taymans * gst/base/gstbasesrc.c: (gst_base_src_class_init), diff --git a/gst/gst.c b/gst/gst.c index 5f42cd4483..606cfb878b 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -591,7 +591,7 @@ init_pre (void) /* This is the earliest we can make stuff show up in the logs. * So give some useful info about GStreamer here */ GST_INFO ("Initializing GStreamer Core Library version %s", VERSION); - GST_INFO ("Using library from %s", LIBDIR); + GST_INFO ("Using library installed in %s", LIBDIR); return TRUE; } diff --git a/gst/gstbin.c b/gst/gstbin.c index 2368b075e7..7cdc38067b 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -477,7 +477,10 @@ gst_bin_add_func (GstBin * bin, GstElement * element) gst_element_set_bus (element, bin->child_bus); /* propagate the current base time and clock */ + GST_DEBUG_OBJECT (element, "setting base time %" GST_TIME_FORMAT, + GST_TIME_ARGS (GST_ELEMENT (bin)->base_time)); gst_element_set_base_time (element, GST_ELEMENT (bin)->base_time); + GST_DEBUG_OBJECT (element, "setting clock %p", GST_ELEMENT_CLOCK (bin)); gst_element_set_clock (element, GST_ELEMENT_CLOCK (bin)); GST_UNLOCK (bin); diff --git a/gst/gstregistry.c b/gst/gstregistry.c index 4d002bf16a..dce4f84137 100644 --- a/gst/gstregistry.c +++ b/gst/gstregistry.c @@ -291,14 +291,15 @@ gst_registry_add_plugin (GstRegistry * registry, GstPlugin * plugin) GST_LOCK (registry); existing_plugin = gst_registry_lookup_locked (registry, plugin->filename); if (existing_plugin) { - GST_DEBUG - ("Replacing existing plugin %p with new plugin %p for filename \"%s\"", + GST_DEBUG_OBJECT (registry, + "Replacing existing plugin %p with new plugin %p for filename \"%s\"", existing_plugin, plugin, plugin->filename); registry->plugins = g_list_remove (registry->plugins, existing_plugin); gst_object_unref (existing_plugin); } - GST_DEBUG ("adding plugin %p for filename \"%s\"", plugin, plugin->filename); + GST_DEBUG_OBJECT (registry, "adding plugin %p for filename \"%s\"", + plugin, plugin->filename); registry->plugins = g_list_prepend (registry->plugins, plugin); @@ -306,7 +307,8 @@ gst_registry_add_plugin (GstRegistry * registry, GstPlugin * plugin) gst_object_sink (plugin); GST_UNLOCK (registry); - GST_DEBUG ("emitting plugin-added for filename %s", plugin->filename); + GST_DEBUG_OBJECT (registry, "emitting plugin-added for filename %s", + plugin->filename); g_signal_emit (G_OBJECT (registry), gst_registry_signals[PLUGIN_ADDED], 0, plugin); @@ -656,27 +658,29 @@ gst_registry_scan_path_level (GstRegistry * registry, const gchar * path, while ((dirent = g_dir_read_name (dir))) { filename = g_strjoin ("/", path, dirent, NULL); - GST_DEBUG ("examining file: %s", filename); + GST_LOG_OBJECT (registry, "examining file: %s", filename); if (g_file_test (filename, G_FILE_TEST_IS_DIR)) { if (level > 0) { - GST_DEBUG ("found directory, recursing"); + GST_LOG_OBJECT (registry, "found directory, recursing"); gst_registry_scan_path_level (registry, filename, level - 1); } else { - GST_DEBUG ("found directory, but recursion level is too deep"); + GST_LOG_OBJECT (registry, + "found directory, but recursion level is too deep"); } g_free (filename); continue; } if (!g_file_test (filename, G_FILE_TEST_IS_REGULAR)) { - GST_DEBUG ("not a regular file, ignoring"); + GST_LOG_OBJECT (registry, "not a regular file, ignoring"); g_free (filename); continue; } if (!g_str_has_suffix (filename, ".so") && !g_str_has_suffix (filename, ".dll") && !g_str_has_suffix (filename, ".dynlib")) { - GST_DEBUG ("extension is not recognized as module file, ignoring"); + GST_LOG_OBJECT (registry, + "extension is not recognized as module file, ignoring"); g_free (filename); continue; } @@ -693,11 +697,12 @@ gst_registry_scan_path_level (GstRegistry * registry, const gchar * path, if (plugin->file_mtime == file_status.st_mtime && plugin->file_size == file_status.st_size) { - GST_DEBUG ("file %s cached", filename); + GST_DEBUG_OBJECT (registry, "file %s cached", filename); plugin->flags &= ~GST_PLUGIN_FLAG_CACHED; } else { - GST_DEBUG ("cached info for %s is stale", filename); - GST_DEBUG ("mtime %ld != %ld or size %" G_GSIZE_FORMAT " != %" + GST_INFO_OBJECT (registry, "cached info for %s is stale", filename); + GST_DEBUG_OBJECT (registry, "mtime %ld != %ld or size %" + G_GSIZE_FORMAT " != %" G_GSIZE_FORMAT, plugin->file_mtime, file_status.st_mtime, plugin->file_size, file_status.st_size); gst_registry_remove_plugin (gst_registry_get_default (), plugin); @@ -731,6 +736,7 @@ gst_registry_scan_path_level (GstRegistry * registry, const gchar * path, void gst_registry_scan_path (GstRegistry * registry, const gchar * path) { + GST_DEBUG_OBJECT (registry, "scanning path %s", path); gst_registry_scan_path_level (registry, path, 10); } diff --git a/gst/gstutils.c b/gst/gstutils.c index 9920454000..b8723d0a40 100644 --- a/gst/gstutils.c +++ b/gst/gstutils.c @@ -769,6 +769,7 @@ gst_element_state_get_name (GstState state) return "PAUSED"; break; default: + /* This is a memory leak */ return g_strdup_printf ("UNKNOWN!(%d)", state); #endif }