mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-12-23 00:26:31 +00:00
video: Don't return glib::Borrowed from VideoFrameRef::from_glib_borrow_mut()
For it to be usable we need a mutable reference, which Borrowed does not provide. This should be handled via Pin at a later time, see https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/324
This commit is contained in:
parent
65fd79f973
commit
255c0ff95e
1 changed files with 3 additions and 3 deletions
|
@ -643,18 +643,18 @@ impl<'a> VideoFrameRef<&'a gst::BufferRef> {
|
|||
}
|
||||
|
||||
impl<'a> VideoFrameRef<&'a mut gst::BufferRef> {
|
||||
pub unsafe fn from_glib_borrow_mut(frame: *mut ffi::GstVideoFrame) -> Borrowed<Self> {
|
||||
pub unsafe fn from_glib_borrow_mut(frame: *mut ffi::GstVideoFrame) -> Self {
|
||||
assert!(!frame.is_null());
|
||||
|
||||
let frame = ptr::read(frame);
|
||||
let info = crate::VideoInfo(ptr::read(&frame.info));
|
||||
let buffer = gst::BufferRef::from_mut_ptr(frame.buffer);
|
||||
Borrowed::new(Self {
|
||||
Self {
|
||||
frame,
|
||||
buffer: Some(buffer),
|
||||
info,
|
||||
unmap: false,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
pub unsafe fn from_glib_full_mut(frame: ffi::GstVideoFrame) -> Self {
|
||||
|
|
Loading…
Reference in a new issue