mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-17 05:15:14 +00:00
threadshare/jitterbuffer: Avoid buffer copies
Replaces the RTPJitterBufferItem.get_buffer() method with an into_buffer() version, ensuring that when we make it mutable we don't make a copy (unless necessary)
This commit is contained in:
parent
776708bee6
commit
5f9e923a04
1 changed files with 3 additions and 3 deletions
|
@ -198,11 +198,11 @@ impl RTPJitterBufferItem {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn get_buffer(&self) -> gst::Buffer {
|
||||
pub fn into_buffer(mut self) -> gst::Buffer {
|
||||
unsafe {
|
||||
let item = self.0.as_ref().expect("Invalid wrapper");
|
||||
let item = self.0.take().expect("Invalid wrapper");
|
||||
let buf = item.data as *mut gst_ffi::GstBuffer;
|
||||
from_glib_none(buf)
|
||||
from_glib_full(buf)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue