inspect: Print element pads

Example:

 $ gst-inspect-rs codecalphademux
This commit is contained in:
Fabian Orccon 2023-06-11 14:01:49 +02:00
parent 1543405460
commit 51f4044a55

View file

@ -279,7 +279,41 @@ fn print_uri_handler_info(element: &gst::Element) {
} else {
println!("Element has no URI handling capabilities.");
}
}
fn print_pad_info(element: &gst::Element) {
let indent = 2;
println!();
println!("{}", HEADING_COLOR.paint("Pads:"));
if element.num_pads() == 0 {
println!("{}{}", &" ".repeat(indent), "none");
}
for pad in &element.pads() {
print_property(
match pad.direction() {
gst::PadDirection::Src => "SRC",
gst::PadDirection::Sink => "SINK",
gst::PadDirection::Unknown => "UNKNOWN",
},
&format!("'{}'", pad.name().as_str()),
0,
indent,
true,
);
if let Some(pad_tmpl) = pad.pad_template() {
print_property(
"Pad Template",
&format!("'{}'", pad_tmpl.name_template()),
0,
indent * 2,
true,
);
}
}
}
fn print_element_info(feature: &gst::PluginFeature) -> Result<(), String> {
@ -306,6 +340,7 @@ fn print_element_info(feature: &gst::PluginFeature) -> Result<(), String> {
print_pad_templates_info(element_factory);
print_clocking_info(&element);
print_uri_handler_info(&element);
print_pad_info(&element);
Ok(())
}