examples: playbin: show how to use debug_to_dot_file()

This commit is contained in:
Guillaume Desmottes 2019-01-28 15:38:42 +01:00
parent 7cb1dc9cb4
commit 3f6424d2ac

View file

@ -121,6 +121,21 @@ fn example_main() {
); );
break; 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::<gst::Bin>().unwrap();
bin_ref.debug_to_dot_file(gst::DebugGraphDetails::all(), "PLAYING");
}
}
_ => (), _ => (),
} }
} }