mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-22 17:41:05 +00:00
Add VideoFrame::from_glib_full() constructor
Thus it would be possible to instantiate gst_video::VideoFrame from FFI's VideoFrame created outside of gstreamer_video's crate. Fixes #152
This commit is contained in:
parent
533e4af669
commit
284992d83a
1 changed files with 6 additions and 0 deletions
|
@ -157,6 +157,12 @@ impl<T> VideoFrame<T> {
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub unsafe fn from_glib_full(frame: ffi::GstVideoFrame) -> Self {
|
||||||
|
let info = ::VideoInfo(ptr::read(&frame.info));
|
||||||
|
let buffer = gst::Buffer::from_glib_none(frame.buffer);
|
||||||
|
VideoFrame(frame, Some(buffer), info, PhantomData)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> Drop for VideoFrame<T> {
|
impl<T> Drop for VideoFrame<T> {
|
||||||
|
|
Loading…
Reference in a new issue