mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-05-29 05:38:16 +00:00
inspect: Print children section
Example: $ gst-inspect-rs decodebin
This commit is contained in:
parent
a36dfd92bc
commit
67a7923063
|
@ -682,6 +682,20 @@ fn print_element_properties(element: &gst::Element) {
|
|||
}
|
||||
}
|
||||
|
||||
fn print_children_info(element: &gst::Element) {
|
||||
if let Some(bin) = element.downcast_ref::<gst::Bin>() {
|
||||
if !bin.children().is_empty() {
|
||||
println!();
|
||||
println!("{}:", HEADING_COLOR.paint("Children"));
|
||||
}
|
||||
|
||||
for child in bin.children() {
|
||||
println!(" {}", DATATYPE_COLOR.paint(&format!("\"{}\"", child.name())));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fn print_element_info(feature: &gst::PluginFeature) -> Result<(), String> {
|
||||
let Ok(factory) = feature.load() else {
|
||||
return Err(format!("element factory '{}' couldn't be loaded", feature.name()));
|
||||
|
@ -708,6 +722,7 @@ fn print_element_info(feature: &gst::PluginFeature) -> Result<(), String> {
|
|||
print_uri_handler_info(&element);
|
||||
print_pad_info(&element);
|
||||
print_element_properties(&element);
|
||||
print_children_info(&element);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue