Commit d7157a42 authored by Sebastian Dröge's avatar Sebastian Dröge

Add the to-dot-file functions to the gst::Bin trait

This allows directly calling them on bins instead of using a global
function.
parent 06d65476
......@@ -15,6 +15,8 @@ use glib::IsA;
use ffi;
use std::path;
pub trait GstBinExtManual {
fn add_many<E: IsA<Element>>(&self, elements: &[&E]) -> Result<(), glib::BoolError>;
fn remove_many<E: IsA<Element>>(&self, elements: &[&E]) -> Result<(), glib::BoolError>;
......@@ -26,6 +28,14 @@ pub trait GstBinExtManual {
fn iterate_sorted(&self) -> ::Iterator<Element>;
fn iterate_sources(&self) -> ::Iterator<Element>;
fn get_children(&self) -> Vec<Element>;
fn debug_to_dot_data(&self, details: ::DebugGraphDetails) -> String;
fn debug_to_dot_file<Q: AsRef<path::Path>>(&self, details: ::DebugGraphDetails, file_name: Q);
fn debug_to_dot_file_with_ts<Q: AsRef<path::Path>>(
&self,
details: ::DebugGraphDetails,
file_name: Q,
);
}
impl<O: IsA<Bin>> GstBinExtManual for O {
......@@ -96,6 +106,22 @@ impl<O: IsA<Bin>> 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<Q: AsRef<path::Path>>(&self, details: ::DebugGraphDetails, file_name: Q) {
::debug_bin_to_dot_file(self, details, file_name)
}
fn debug_to_dot_file_with_ts<Q: AsRef<path::Path>>(
&self,
details: ::DebugGraphDetails,
file_name: Q,
) {
::debug_bin_to_dot_file_with_ts(self, details, file_name)
}
}
#[cfg(test)]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment