gstreamer: Sync param spec API with glib

This commit is contained in:
Sebastian Dröge 2022-09-04 10:34:05 +03:00
parent 6c594b4c38
commit 201eed8400

View file

@ -44,10 +44,10 @@ impl ParamSpecFraction {
#[allow(clippy::new_ret_no_self)] #[allow(clippy::new_ret_no_self)]
#[doc(alias = "gst_param_spec_fraction")] #[doc(alias = "gst_param_spec_fraction")]
pub fn new( pub fn new<'a>(
name: &str, name: &str,
nick: &str, nick: impl Into<Option<&'a str>>,
blurb: &str, blurb: impl Into<Option<&'a str>>,
min: crate::Fraction, min: crate::Fraction,
max: crate::Fraction, max: crate::Fraction,
default: crate::Fraction, default: crate::Fraction,
@ -57,8 +57,8 @@ impl ParamSpecFraction {
unsafe { unsafe {
from_glib_none(ffi::gst_param_spec_fraction( from_glib_none(ffi::gst_param_spec_fraction(
name.to_glib_none().0, name.to_glib_none().0,
nick.to_glib_none().0, nick.into().to_glib_none().0,
blurb.to_glib_none().0, blurb.into().to_glib_none().0,
min.numer(), min.numer(),
min.denom(), min.denom(),
max.numer(), max.numer(),
@ -217,10 +217,10 @@ impl ParamSpecArray {
#[allow(clippy::new_ret_no_self)] #[allow(clippy::new_ret_no_self)]
#[doc(alias = "gst_param_spec_array")] #[doc(alias = "gst_param_spec_array")]
pub fn new( pub fn new<'a>(
name: &str, name: &str,
nick: &str, nick: impl Into<Option<&'a str>>,
blurb: &str, blurb: impl Into<Option<&'a str>>,
element_spec: Option<&glib::ParamSpec>, element_spec: Option<&glib::ParamSpec>,
flags: glib::ParamFlags, flags: glib::ParamFlags,
) -> glib::ParamSpec { ) -> glib::ParamSpec {
@ -228,8 +228,8 @@ impl ParamSpecArray {
unsafe { unsafe {
from_glib_none(ffi::gst_param_spec_array( from_glib_none(ffi::gst_param_spec_array(
name.to_glib_none().0, name.to_glib_none().0,
nick.to_glib_none().0, nick.into().to_glib_none().0,
blurb.to_glib_none().0, blurb.into().to_glib_none().0,
element_spec.to_glib_none().0, element_spec.to_glib_none().0,
flags.into_glib(), flags.into_glib(),
)) ))
@ -274,8 +274,8 @@ impl<'a> ParamSpecArrayBuilder<'a> {
// rustdoc-stripper-ignore-next // rustdoc-stripper-ignore-next
/// Default: `None` /// Default: `None`
pub fn element_spec(mut self, element_spec: &'a glib::ParamSpec) -> Self { pub fn element_spec(mut self, element_spec: impl Into<Option<&'a glib::ParamSpec>>) -> Self {
self.element_spec = Some(element_spec); self.element_spec = element_spec.into();
self self
} }