From 26791af39ac9b4dd752695e69ad87e0ac5adbf79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 22 Nov 2024 14:07:51 +0200 Subject: [PATCH] meta: Add bindings for new meta_api_type_aggregate_params() function Part-of: --- gstreamer/src/meta.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/gstreamer/src/meta.rs b/gstreamer/src/meta.rs index 0b3779fd1..3bc8dc282 100644 --- a/gstreamer/src/meta.rs +++ b/gstreamer/src/meta.rs @@ -1135,6 +1135,32 @@ pub fn meta_api_type_get_tags<'b>(type_: glib::Type) -> &'b [glib::GStringPtr] { unsafe { glib::StrV::from_glib_borrow(ffi::gst_meta_api_type_get_tags(type_.into_glib())) } } +#[cfg(feature = "v1_26")] +#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))] +#[doc(alias = "gst_meta_api_type_aggregate_params")] +pub fn meta_api_type_aggregate_params( + type_: glib::Type, + params1: &crate::StructureRef, + params2: &crate::StructureRef, +) -> Result, glib::BoolError> { + skip_assert_initialized!(); + unsafe { + let mut new_params = ptr::null_mut(); + let res = bool::from_glib(ffi::gst_meta_api_type_aggregate_params( + type_.into_glib(), + &mut new_params, + params1.as_ptr(), + params2.as_ptr(), + )); + + if res { + Ok(from_glib_full(new_params)) + } else { + Err(glib::bool_error!("Failed to aggregate meta type params")) + } + } +} + #[cfg(test)] mod tests { use super::*;