gstreamer: Propagate nullability changes into manual code

This commit is contained in:
Marijn Suijten 2020-12-02 22:14:17 +01:00
parent 88321a4d61
commit 5afca49a7b
2 changed files with 6 additions and 10 deletions

View file

@ -80,7 +80,8 @@ impl UniqueAdapter {
} }
pub fn copy_bytes(&self, offset: usize, size: usize) -> Result<glib::Bytes, glib::BoolError> { pub fn copy_bytes(&self, offset: usize, size: usize) -> Result<glib::Bytes, glib::BoolError> {
self.0.copy_bytes(offset, size) // TBD: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/298
Ok(self.0.copy_bytes(offset, size))
} }
#[cfg(any(feature = "v1_10", feature = "dox"))] #[cfg(any(feature = "v1_10", feature = "dox"))]

View file

@ -70,15 +70,10 @@ fn print_pad_capabilities(element: &gst::Element, pad_name: &str) {
.expect("Could not retrieve pad"); .expect("Could not retrieve pad");
println!("Caps for the {} pad:", pad_name); println!("Caps for the {} pad:", pad_name);
match pad.get_current_caps() { let caps = pad
Some(caps) => { .get_current_caps()
.unwrap_or_else(|| pad.query_caps(None));
print_caps(&caps, " "); print_caps(&caps, " ");
}
None => {
let caps = pad.query_caps(None).expect("Failed to query caps on pad");
print_caps(&caps, " ");
}
}
} }
fn tutorial_main() { fn tutorial_main() {