mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-14 13:31:09 +00:00
video/video_frame: Allow getting an owned buffer from readable video frames
In all other variations this is not possible as it would allow to circumvent the mini object writability rules.
This commit is contained in:
parent
fc21a2d9a3
commit
a6253a1f77
1 changed files with 5 additions and 1 deletions
|
@ -10,7 +10,7 @@ use gst_sys;
|
|||
use gst_video_sys;
|
||||
|
||||
use glib;
|
||||
use glib::translate::{from_glib, Borrowed, ToGlibPtr};
|
||||
use glib::translate::{from_glib, from_glib_none, Borrowed, ToGlibPtr};
|
||||
use gst;
|
||||
|
||||
use std::fmt;
|
||||
|
@ -283,6 +283,10 @@ impl VideoFrame<Readable> {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn buffer_owned(&self) -> gst::Buffer {
|
||||
unsafe { from_glib_none(self.frame.buffer) }
|
||||
}
|
||||
}
|
||||
|
||||
impl VideoFrame<Writable> {
|
||||
|
|
Loading…
Reference in a new issue