gst-launch-&GST_API_VERSION; is one such application.
</para>
<para>
+When gst-launch-&GST_API_VERSION; changes state through NULL to PLAYING
+and back to NULL, a dot file is generated on each state change. To have
+gst-launch-&GST_API_VERSION; write a snapshot of the pipeline state, send
+a SIGHUP to the gst-launch-&GST_API_VERSION; process.
+ </para>
+ <para>
These .dot files can then be turned into images using the 'dot' utility
from the graphviz set of tools, like this:
<command>dot foo.dot -Tsvg -o foo.svg</command> or
the graphviz set of tools, like this: dot foo.dot \-Tsvg \-o foo.svg (png or jpg
are also possible as output format). There is also a utility called 'xdot'
which allows you to view the .dot file directly without converting it first.
+.br
+When the pipeline changes state through NULL to PLAYING and back to NULL, a
+dot file is generated on each state change. To write a snapshot of the
+pipeline state, send a SIGHUP to the process.
.TP
\fBGST_REGISTRY\fR
Path of the plugin registry file. Default is
}
#if defined(G_OS_UNIX) || defined(G_OS_WIN32)
-static guint signal_watch_id;
+static guint signal_watch_intr_id;
+static guint signal_watch_hup_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;
+}
+
+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;
}
#if defined(G_OS_WIN32) /* G_OS_UNIX */
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))
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);