gstreamer: Implement Default trait for AllocationParams

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1328>
This commit is contained in:
Sebastian Dröge 2023-10-24 18:02:27 +03:00 committed by GStreamer Marge Bot
parent a41dc25eba
commit 414019af21

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]