forked from mirrors/gstreamer-rs
Add functions to get the FFI pointer behind a VideoFrame/VideoFrameRef
This commit is contained in:
parent
e37be09eeb
commit
513914c735
1 changed files with 16 additions and 0 deletions
|
@ -223,6 +223,10 @@ impl VideoFrame<Readable> {
|
|||
let info = self.2.clone();
|
||||
VideoFrameRef(vframe, Some(self.buffer()), info, true)
|
||||
}
|
||||
|
||||
pub fn as_ptr(&self) -> *const ffi::GstVideoFrame {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl VideoFrame<Writable> {
|
||||
|
@ -319,11 +323,19 @@ impl VideoFrame<Writable> {
|
|||
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<T>(ffi::GstVideoFrame, Option<T>, ::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> {
|
||||
|
|
Loading…
Reference in a new issue