mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-09-02 01:43:49 +00:00
allocators: Manually bind FdAllocator::alloc_full()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1729>
This commit is contained in:
parent
20152b8579
commit
608edfc4ad
2 changed files with 27 additions and 0 deletions
|
@ -94,6 +94,9 @@ status = "generate"
|
|||
[[object.function]]
|
||||
name = "alloc"
|
||||
manual = true
|
||||
[[object.function]]
|
||||
name = "alloc_full"
|
||||
manual = true
|
||||
|
||||
[[object]]
|
||||
name = "GstAllocators.ShmAllocator"
|
||||
|
|
|
@ -61,4 +61,28 @@ impl FdAllocator {
|
|||
))
|
||||
.ok_or_else(|| glib::bool_error!("Failed to allocate memory"))
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1_28")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
|
||||
#[doc(alias = "gst_fd_allocator_alloc_full")]
|
||||
pub unsafe fn alloc_full(
|
||||
allocator: &impl IsA<gst::Allocator>,
|
||||
fd: RawFd,
|
||||
maxsize: usize,
|
||||
offset: usize,
|
||||
size: usize,
|
||||
flags: FdMemoryFlags,
|
||||
) -> Option<gst::Memory> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_full(ffi::gst_fd_allocator_alloc_full(
|
||||
allocator.as_ref().to_glib_none().0,
|
||||
fd,
|
||||
maxsize,
|
||||
offset,
|
||||
size,
|
||||
flags.into_glib(),
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue