Commit e82e8e0c authored by Luis de Bethencourt's avatar Luis de Bethencourt Committed by Sebastian Dröge

Needless pass by value

Avoid an unnecessary allocation by passing the Caps by reference instead of
by value.

Fixes https://github.com/sdroege/gstreamer-rs/pull/46
Fixes https://github.com/sdroege/gstreamer-rs/issues/45
parent 95dc336b
......@@ -3,7 +3,7 @@ use gst::prelude::*;
use gst::MessageView;
fn print_caps(caps: gst::Caps, prefix: &str) {
fn print_caps(caps: &gst::Caps, prefix: &str) {
if caps.is_any() {
println!("{}ANY", prefix);
return;
......@@ -55,7 +55,7 @@ fn print_pad_template_information(factory: &gst::ElementFactory) {
let caps = pad_template.get_caps();
println!(" Capabilities:");
print_caps(caps, " ");
print_caps(&caps, " ");
}
}
......@@ -67,11 +67,11 @@ fn print_pad_capabilities(element: &gst::Element, pad_name: &str) {
println!("Caps for the {} pad:", pad_name);
match pad.get_current_caps() {
Some(caps) => {
print_caps(caps, " ");
print_caps(&caps, " ");
}
None => {
let caps = pad.query_caps(None).expect("Failed to query caps on pad");
print_caps(caps, " ");
print_caps(&caps, " ");
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment