From d6770a8a00d7c26b8b7a5670c03edf6085c716f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 23 Mar 2025 10:58:57 +0200 Subject: [PATCH] allocator: Add setters to AllocationParams Part-of: --- gstreamer/src/allocation_params.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gstreamer/src/allocation_params.rs b/gstreamer/src/allocation_params.rs index 6aec8d19d..5d126ea93 100644 --- a/gstreamer/src/allocation_params.rs +++ b/gstreamer/src/allocation_params.rs @@ -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 {