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 5ee2ce9d10
commit c37316fac1

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 {