video: Allow converting a VideoFrame into an FFI GstVideoFrame

This commit is contained in:
Sebastian Dröge 2022-03-22 16:14:26 +02:00
parent 2943c310cd
commit 215cdfd548

View file

@ -201,6 +201,12 @@ impl<T> VideoFrame<T> {
pub fn as_ptr(&self) -> *const ffi::GstVideoFrame { pub fn as_ptr(&self) -> *const ffi::GstVideoFrame {
&self.frame &self.frame
} }
pub fn into_raw(self) -> ffi::GstVideoFrame {
let mut s = mem::ManuallyDrop::new(self);
s.buffer = None;
s.frame
}
} }
impl<T> Drop for VideoFrame<T> { impl<T> Drop for VideoFrame<T> {