allocator: Add setters to AllocationParams

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1667>
This commit is contained in:
Sebastian Dröge 2025-03-23 10:58:57 +02:00
parent 035ebe032b
commit d6770a8a00

View file

@ -49,6 +49,26 @@ impl AllocationParams {
self.0.padding
}
#[inline]
pub fn set_flags(&mut self, flags: MemoryFlags) {
self.0.flags = flags.into_glib();
}
#[inline]
pub fn set_align(&mut self, align: usize) {
self.0.align = align;
}
#[inline]
pub fn set_prefix(&mut self, prefix: usize) {
self.0.prefix = prefix;
}
#[inline]
pub fn set_padding(&mut self, padding: usize) {
self.0.padding = padding;
}
pub fn new(flags: MemoryFlags, align: usize, prefix: usize, padding: usize) -> Self {
assert_initialized_main_thread!();
let params = unsafe {