gstreamer: Implement Default trait for AllocationParams

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1337>
This commit is contained in:
Sebastian Dröge 2023-10-24 18:02:27 +03:00
parent de87e6061e
commit 08ce9f5b2f

View file

@ -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]