mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-10-31 22:59:14 +00:00
inspect: Print element interfaces
This commit is contained in:
parent
dadf35f6aa
commit
0d23096ebf
1 changed files with 15 additions and 0 deletions
|
@ -120,6 +120,19 @@ fn print_hierarchy(type_: gst::glib::Type) {
|
|||
println!();
|
||||
}
|
||||
|
||||
fn print_interfaces(type_: gst::glib::Type) {
|
||||
let interfaces = type_.interfaces();
|
||||
if interfaces.is_empty() {
|
||||
return;
|
||||
}
|
||||
|
||||
println!("{}:", HEADING_COLOR.paint("Implemented Interfaces"));
|
||||
for iface in interfaces.as_slice() {
|
||||
println!(" {}", DATA_TYPE_COLOR.paint(iface.name()));
|
||||
}
|
||||
println!();
|
||||
}
|
||||
|
||||
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()));
|
||||
|
@ -138,7 +151,9 @@ fn print_element_info(feature: &gst::PluginFeature) -> Result<(), String> {
|
|||
if let Some(plugin) = feature.plugin() {
|
||||
print_plugin_info(&plugin);
|
||||
}
|
||||
|
||||
print_hierarchy(element.type_());
|
||||
print_interfaces(element.type_());
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue