From 3f6424d2ac5fbec2fd917bd7f2fd78a1c74bd6ac Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 28 Jan 2019 15:38:42 +0100 Subject: [PATCH] examples: playbin: show how to use debug_to_dot_file() --- examples/src/bin/playbin.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/examples/src/bin/playbin.rs b/examples/src/bin/playbin.rs index a27598ca8..8d52fd6f1 100644 --- a/examples/src/bin/playbin.rs +++ b/examples/src/bin/playbin.rs @@ -121,6 +121,21 @@ fn example_main() { ); break; } + MessageView::StateChanged(state_changed) => + // We are only interested in state-changed messages from playbin + { + if state_changed + .get_src() + .map(|s| s == playbin) + .unwrap_or(false) + && state_changed.get_current() == gst::State::Playing + { + // Generate a dot graph of the pipeline to GST_DEBUG_DUMP_DOT_DIR if defined + let bin_ref = playbin.downcast_ref::().unwrap(); + bin_ref.debug_to_dot_file(gst::DebugGraphDetails::all(), "PLAYING"); + } + } + _ => (), } }