video: Allow getting an owned reference to the input buffer from a video codec frame

This commit is contained in:
Sebastian Dröge 2022-02-02 00:54:06 +02:00
parent 74557132e1
commit 4956346b23

View file

@ -140,6 +140,18 @@ impl<'a> VideoCodecFrame<'a> {
}
}
#[doc(alias = "get_input_buffer")]
pub fn input_buffer_owned(&self) -> Option<gst::Buffer> {
unsafe {
let ptr = (*self.to_glib_none().0).input_buffer;
if ptr.is_null() {
None
} else {
Some(from_glib_none(ptr))
}
}
}
#[doc(alias = "get_output_buffer")]
pub fn output_buffer(&self) -> Option<&gst::BufferRef> {
unsafe {