diff --git a/gstreamer-video/src/video_frame.rs b/gstreamer-video/src/video_frame.rs index 7729d3410..754b341bd 100644 --- a/gstreamer-video/src/video_frame.rs +++ b/gstreamer-video/src/video_frame.rs @@ -223,6 +223,10 @@ impl VideoFrame { let info = self.2.clone(); VideoFrameRef(vframe, Some(self.buffer()), info, true) } + + pub fn as_ptr(&self) -> *const ffi::GstVideoFrame { + &self.0 + } } impl VideoFrame { @@ -319,11 +323,19 @@ impl VideoFrame { let info = self.2.clone(); VideoFrameRef(vframe, Some(self.buffer_mut()), info, true) } + + pub fn as_mut_ptr(&mut self) -> *mut ffi::GstVideoFrame { + &mut self.0 + } } pub struct VideoFrameRef(ffi::GstVideoFrame, Option, ::VideoInfo, bool); impl<'a> VideoFrameRef<&'a gst::BufferRef> { + pub fn as_ptr(&self) -> *const ffi::GstVideoFrame { + &self.0 + } + pub fn from_buffer_ref_readable<'b>( buffer: &'a gst::BufferRef, info: &'b ::VideoInfo, @@ -589,6 +601,10 @@ impl<'a> VideoFrameRef<&'a mut gst::BufferRef> { )) } } + + pub fn as_mut_ptr(&mut self) -> *mut ffi::GstVideoFrame { + &mut self.0 + } } impl<'a> ops::Deref for VideoFrameRef<&'a mut gst::BufferRef> {