g_list_foreach (subentries, print_toc_entry, GUINT_TO_POINTER (indent));
}
+#ifdef G_OS_UNIX
+static guint signal_watch_hup_id;
+#endif
#if defined(G_OS_UNIX) || defined(G_OS_WIN32)
-static guint signal_watch_id;
+static guint signal_watch_intr_id;
#if defined(G_OS_WIN32)
static GstElement *intr_pipeline;
#endif
"message", G_TYPE_STRING, "Pipeline interrupted", NULL)));
/* remove signal handler */
- signal_watch_id = 0;
- return FALSE;
+ signal_watch_intr_id = 0;
+ return G_SOURCE_REMOVE;
+}
+
+#ifdef G_OS_UNIX
+static gboolean
+hup_handler (gpointer user_data)
+{
+ GstElement *pipeline = (GstElement *) user_data;
+
+ if (g_getenv ("GST_DEBUG_DUMP_DOT_DIR") != NULL) {
+ PRINT ("SIGHUP: dumping dot file snapshot ...\n");
+ } else {
+ PRINT ("SIGHUP: not dumping dot file snapshot, GST_DEBUG_DUMP_DOT_DIR "
+ "environment variable not set.\n");
+ }
+
+ /* dump graph on hup */
+ GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (pipeline),
+ GST_DEBUG_GRAPH_SHOW_ALL, "gst-launch.snapshot");
+
+ return G_SOURCE_CONTINUE;
}
+#endif
#if defined(G_OS_WIN32) /* G_OS_UNIX */
static BOOL WINAPI
bus = gst_element_get_bus (GST_ELEMENT (pipeline));
#ifdef G_OS_UNIX
- signal_watch_id =
+ signal_watch_intr_id =
g_unix_signal_add (SIGINT, (GSourceFunc) intr_handler, pipeline);
+ signal_watch_hup_id =
+ g_unix_signal_add (SIGHUP, (GSourceFunc) hup_handler, pipeline);
#elif defined(G_OS_WIN32)
intr_pipeline = NULL;
if (SetConsoleCtrlHandler (w32_intr_handler, TRUE))
val_str = g_value_dup_string (val);
else if (G_VALUE_TYPE (val) == GST_TYPE_CAPS)
val_str = gst_caps_to_string (g_value_get_boxed (val));
- val_str = gst_value_serialize (val);
+ else if (G_VALUE_TYPE (val) == GST_TYPE_TAG_LIST)
+ val_str = gst_tag_list_to_string (g_value_get_boxed (val));
+ else if (G_VALUE_TYPE (val) == GST_TYPE_STRUCTURE)
+ val_str = gst_structure_to_string (g_value_get_boxed (val));
+ else
+ val_str = gst_value_serialize (val);
} else {
val_str = g_strdup ("(no value)");
}
gst_message_unref (message);
gst_object_unref (bus);
#ifdef G_OS_UNIX
- if (signal_watch_id > 0)
- g_source_remove (signal_watch_id);
+ if (signal_watch_intr_id > 0)
+ g_source_remove (signal_watch_intr_id);
+ if (signal_watch_hup_id > 0)
+ g_source_remove (signal_watch_hup_id);
#elif defined(G_OS_WIN32)
intr_pipeline = NULL;
SetConsoleCtrlHandler (w32_intr_handler, FALSE);
#endif
g_set_prgname ("gst-launch-" GST_API_VERSION);
+ /* Ensure XInitThreads() is called if/when needed */
+ g_setenv ("GST_GL_XINITTHREADS", "1", TRUE);
#ifndef GST_DISABLE_OPTION_PARSING
ctx = g_option_context_new ("PIPELINE-DESCRIPTION");
g_printerr ("Error initializing: %s\n", GST_STR_NULL (err->message));
else
g_printerr ("Error initializing: Unknown error!\n");
- g_clear_error (&error);
+ g_clear_error (&err);
g_option_context_free (ctx);
exit (1);
}