inspect: Print children section

Example:

 $ gst-inspect-rs decodebin
This commit is contained in:
Fabian Orccon 2023-12-10 18:49:20 +01:00
parent a36dfd92bc
commit 67a7923063

View file

@ -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(())
}