mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-05-29 05:38:16 +00:00
inspect: Print element pads
Example: $ gst-inspect-rs codecalphademux
This commit is contained in:
parent
1543405460
commit
51f4044a55
|
@ -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(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue