From d7157a4279b87b8fe0d7f2f94dd8941fb9340997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 11 Nov 2018 09:33:12 +0200 Subject: [PATCH] Add the to-dot-file functions to the gst::Bin trait This allows directly calling them on bins instead of using a global function. --- gstreamer/src/bin.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/gstreamer/src/bin.rs b/gstreamer/src/bin.rs index 0491ad1b3..5be6b30fc 100644 --- a/gstreamer/src/bin.rs +++ b/gstreamer/src/bin.rs @@ -15,6 +15,8 @@ use glib::IsA; use ffi; +use std::path; + pub trait GstBinExtManual { fn add_many>(&self, elements: &[&E]) -> Result<(), glib::BoolError>; fn remove_many>(&self, elements: &[&E]) -> Result<(), glib::BoolError>; @@ -26,6 +28,14 @@ pub trait GstBinExtManual { fn iterate_sorted(&self) -> ::Iterator; fn iterate_sources(&self) -> ::Iterator; fn get_children(&self) -> Vec; + + fn debug_to_dot_data(&self, details: ::DebugGraphDetails) -> String; + fn debug_to_dot_file>(&self, details: ::DebugGraphDetails, file_name: Q); + fn debug_to_dot_file_with_ts>( + &self, + details: ::DebugGraphDetails, + file_name: Q, + ); } impl> GstBinExtManual for O { @@ -96,6 +106,22 @@ impl> GstBinExtManual for O { FromGlibPtrContainer::from_glib_none(bin.children) } } + + fn debug_to_dot_data(&self, details: ::DebugGraphDetails) -> String { + ::debug_bin_to_dot_data(self, details) + } + + fn debug_to_dot_file>(&self, details: ::DebugGraphDetails, file_name: Q) { + ::debug_bin_to_dot_file(self, details, file_name) + } + + fn debug_to_dot_file_with_ts>( + &self, + details: ::DebugGraphDetails, + file_name: Q, + ) { + ::debug_bin_to_dot_file_with_ts(self, details, file_name) + } } #[cfg(test)]