forked from mirrors/gstreamer-rs
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
dfe87cf5c9
commit
febb0dfd16
1 changed files with 5 additions and 1 deletions
|
@ -10,7 +10,7 @@ use gst_sys;
|
||||||
use gst_video_sys;
|
use gst_video_sys;
|
||||||
|
|
||||||
use glib;
|
use glib;
|
||||||
use glib::translate::{from_glib, Borrowed, ToGlibPtr};
|
use glib::translate::{from_glib, from_glib_none, Borrowed, ToGlibPtr};
|
||||||
use gst;
|
use gst;
|
||||||
|
|
||||||
use std::fmt;
|
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> {
|
impl VideoFrame<Writable> {
|
||||||
|
|
Loading…
Reference in a new issue