forked from mirrors/gstreamer-rs
Add the to-dot-file functions to the gst::Bin trait
This allows directly calling them on bins instead of using a global function.
This commit is contained in:
parent
06d654760d
commit
d7157a4279
1 changed files with 26 additions and 0 deletions
|
@ -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)]
|
||||
|
|
Loading…
Reference in a new issue