mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-22 09:31:06 +00:00
video: Don't forget to unmap the VideoFrame
when converting into a gst::Buffer
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1219>
This commit is contained in:
parent
2ac85cd8de
commit
6ffb1db482
1 changed files with 6 additions and 2 deletions
|
@ -46,8 +46,12 @@ impl<T> VideoFrame<T> {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn into_buffer(self) -> gst::Buffer {
|
pub fn into_buffer(self) -> gst::Buffer {
|
||||||
let s = mem::ManuallyDrop::new(self);
|
unsafe {
|
||||||
unsafe { ptr::read(&s.buffer) }
|
let mut s = mem::ManuallyDrop::new(self);
|
||||||
|
let buffer = ptr::read(&s.buffer);
|
||||||
|
ffi::gst_video_frame_unmap(&mut s.frame);
|
||||||
|
buffer
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc(alias = "gst_video_frame_copy")]
|
#[doc(alias = "gst_video_frame_copy")]
|
||||||
|
|
Loading…
Reference in a new issue