From 414019af21b71db1f905a8a9db5025cba525d697 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 24 Oct 2023 18:02:27 +0300 Subject: [PATCH] gstreamer: Implement `Default` trait for `AllocationParams` Part-of: --- gstreamer/src/allocation_params.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gstreamer/src/allocation_params.rs b/gstreamer/src/allocation_params.rs index 1795335c9..e73161792 100644 --- a/gstreamer/src/allocation_params.rs +++ b/gstreamer/src/allocation_params.rs @@ -14,6 +14,16 @@ pub struct AllocationParams(ffi::GstAllocationParams); unsafe impl Send for AllocationParams {} unsafe impl Sync for AllocationParams {} +impl Default for AllocationParams { + fn default() -> Self { + unsafe { + let mut params = mem::MaybeUninit::uninit(); + ffi::gst_allocation_params_init(params.as_mut_ptr()); + AllocationParams(params.assume_init()) + } + } +} + impl AllocationParams { #[doc(alias = "get_flags")] #[inline]