From 3bf52158724a5fe2a7e6f2dc63653f9388ff96c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 6 Jul 2020 11:37:01 +0300 Subject: [PATCH] Update configuration for new API --- Gir_Gst.toml | 6 ++++++ Gir_GstBase.toml | 4 ++++ gstreamer/src/functions.rs | 20 ++++++++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/Gir_Gst.toml b/Gir_Gst.toml index 5d8c16ca2..69e4df1d5 100644 --- a/Gir_Gst.toml +++ b/Gir_Gst.toml @@ -53,6 +53,7 @@ generate = [ "Gst.TaskState", "Gst.PromiseResult", "Gst.ClockEntryType", + "Gst.PluginAPIFlags", ] manual = [ @@ -1702,6 +1703,11 @@ status = "generate" # can be called before gst_init() assertion = "skip" + [[object.function]] + name = "type_is_plugin_api" + # confusing return type + ignore = true + [[object]] name = "Gst.StateChangeReturn" status = "generate" diff --git a/Gir_GstBase.toml b/Gir_GstBase.toml index 8e404199d..9f160e1ba 100644 --- a/Gir_GstBase.toml +++ b/Gir_GstBase.toml @@ -195,6 +195,10 @@ manual_traits = ["AggregatorExtManual"] name = "latency" version = "1.14" + [[object.property]] + name = "start-time-selection" + version = "1.18" + [[object.property]] name = "min-upstream-latency" # clock time instead of u64 diff --git a/gstreamer/src/functions.rs b/gstreamer/src/functions.rs index 7650080dd..55b27a3ff 100644 --- a/gstreamer/src/functions.rs +++ b/gstreamer/src/functions.rs @@ -132,6 +132,26 @@ pub fn calculate_linear_regression( } } +#[cfg(any(feature = "v1_18", feature = "dox"))] +pub fn type_is_plugin_api(type_: glib::types::Type) -> Option<::PluginAPIFlags> { + assert_initialized_main_thread!(); + unsafe { + use std::mem; + + let mut flags = mem::MaybeUninit::uninit(); + let ret = from_glib(gst_sys::gst_type_is_plugin_api( + type_.to_glib(), + flags.as_mut_ptr(), + )); + let flags = flags.assume_init(); + if ret { + Some(from_glib(flags)) + } else { + None + } + } +} + #[cfg(test)] mod tests { #[cfg(feature = "v1_12")]