summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sourceforge.net>2007-10-17 12:58:23 +0000
committerStefan Kost <ensonic@users.sourceforge.net>2007-10-17 12:58:23 +0000
commit58a155347b924ec0f1418e986f8e912aac48902a (patch)
tree0c9d913c75101e573947331259b67315969a7620 /tools
parent4945ceea3926921f9fc8996faa4dec56c094a08c (diff)
Allow dumping pipelines as dot graphs. Fixes #456573.
Original commit message from CVS: * docs/gst/gstreamer-sections.txt: * gst/Makefile.am: * gst/gst.c: * gst/gst.h: * gst/gstdebugutils.c: * gst/gstdebugutils.h: * gst/gstinfo.c: * gst/gstinfo.h: * tools/gst-launch.c: Allow dumping pipelines as dot graphs. Fixes #456573.
Diffstat (limited to 'tools')
-rw-r--r--tools/gst-launch.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/gst-launch.c b/tools/gst-launch.c
index 56c9b1350e..b0b5187a25 100644
--- a/tools/gst-launch.c
+++ b/tools/gst-launch.c
@@ -450,6 +450,11 @@ event_loop (GstElement * pipeline, gboolean blocking, GstState target_state)
gchar *debug;
gchar *name = gst_object_get_path_string (GST_MESSAGE_SRC (message));
+ /* dump graph on warning */
+ GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (pipeline),
+ GST_DEBUG_GRAPH_SHOW_ALL,
+ "/tmp/gst-launch.warning.%" GST_TIME_FORMAT ".dot");
+
gst_message_parse_warning (message, &gerror, &debug);
g_print (_("WARNING: from element %s: %s\n"), name, gerror->message);
if (debug) {
@@ -464,6 +469,11 @@ event_loop (GstElement * pipeline, gboolean blocking, GstState target_state)
GError *gerror;
gchar *debug;
+ /* dump graph on error */
+ GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (pipeline),
+ GST_DEBUG_GRAPH_SHOW_ALL,
+ "/tmp/gst-launch.error.%" GST_TIME_FORMAT ".dot");
+
gst_message_parse_error (message, &gerror, &debug);
gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug);
g_error_free (gerror);
@@ -477,10 +487,19 @@ event_loop (GstElement * pipeline, gboolean blocking, GstState target_state)
gst_message_parse_state_changed (message, &old, &new, &pending);
+ /* debug each state change
+ GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(pipeline),GST_DEBUG_GRAPH_SHOW_ALL,"/tmp/gst-launch.%" GST_TIME_FORMAT ".dot");
+ */
+
/* we only care about pipeline state change messages */
if (GST_MESSAGE_SRC (message) != GST_OBJECT_CAST (pipeline))
break;
+ /* debug only overall state changes
+ FIXME: add statename to name template: gst_element_state_get_name(new);
+ GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(pipeline),GST_DEBUG_GRAPH_SHOW_ALL,"/tmp/gst-launch.%" GST_TIME_FORMAT ".dot");
+ */
+
/* ignore when we are buffering since then we mess with the states
* ourselves. */
if (buffering) {