pbutils: encoding_profile: Remove unintentionally backported new API

This commit is contained in:
Sebastian Dröge 2024-05-23 15:44:12 +03:00
parent 5b0ee8a256
commit a6353e70c7

View file

@ -346,37 +346,20 @@ pub trait EncodingProfileBuilder<'a>: Sized {
#[doc(alias = "gst_encoding_profile_set_presence")] #[doc(alias = "gst_encoding_profile_set_presence")]
#[must_use] #[must_use]
fn presence(self, presence: u32) -> Self; fn presence(self, presence: u32) -> Self;
#[doc(alias = "gst_encoding_profile_set_presence")]
#[must_use]
fn presence_if_some(self, presence: Option<u32>) -> Self;
#[doc(alias = "gst_encoding_profile_set_allow_dynamic_output")] #[doc(alias = "gst_encoding_profile_set_allow_dynamic_output")]
#[must_use] #[must_use]
fn allow_dynamic_output(self, allow: bool) -> Self; fn allow_dynamic_output(self, allow: bool) -> Self;
#[doc(alias = "gst_encoding_profile_set_allow_dynamic_output")]
#[must_use]
fn allow_dynamic_output_if_some(self, allow_dynamic_output: Option<bool>) -> Self;
#[doc(alias = "gst_encoding_profile_set_enabled")] #[doc(alias = "gst_encoding_profile_set_enabled")]
#[must_use] #[must_use]
fn enabled(self, enabled: bool) -> Self; fn enabled(self, enabled: bool) -> Self;
#[doc(alias = "gst_encoding_profile_set_enabled")]
#[must_use]
fn enabled_if_some(self, enabled: Option<bool>) -> Self;
#[cfg(feature = "v1_18")] #[cfg(feature = "v1_18")]
#[doc(alias = "gst_encoding_profile_set_single_segment")] #[doc(alias = "gst_encoding_profile_set_single_segment")]
#[must_use] #[must_use]
fn single_segment(self, single_segment: bool) -> Self; fn single_segment(self, single_segment: bool) -> Self;
#[cfg(feature = "v1_18")]
#[doc(alias = "gst_encoding_profile_set_single_segment")]
#[must_use]
fn single_segment_if_some(self, single_segment: Option<bool>) -> Self;
#[cfg(feature = "v1_20")] #[cfg(feature = "v1_20")]
#[doc(alias = "gst_encoding_profile_set_element_properties")] #[doc(alias = "gst_encoding_profile_set_element_properties")]
#[must_use] #[must_use]
fn element_properties(self, element_properties: ElementProperties) -> Self; fn element_properties(self, element_properties: ElementProperties) -> Self;
#[cfg(feature = "v1_20")]
#[doc(alias = "gst_encoding_profile_set_element_properties")]
#[must_use]
fn element_properties_if_some(self, element_properties: Option<ElementProperties>) -> Self;
} }
macro_rules! declare_encoding_profile_builder_common( macro_rules! declare_encoding_profile_builder_common(
@ -407,69 +390,27 @@ macro_rules! declare_encoding_profile_builder_common(
self self
} }
fn presence_if_some(self, presence: Option<u32>) -> $name<'a> {
if let Some(presence) = presence {
self.presence(presence)
} else {
self
}
}
fn allow_dynamic_output(mut self, allow: bool) -> $name<'a> { fn allow_dynamic_output(mut self, allow: bool) -> $name<'a> {
self.base.allow_dynamic_output = allow; self.base.allow_dynamic_output = allow;
self self
} }
fn allow_dynamic_output_if_some(self, allow_dynamic_output: Option<bool>) -> $name<'a> {
if let Some(allow_dynamic_output) = allow_dynamic_output {
self.allow_dynamic_output(allow_dynamic_output)
} else {
self
}
}
fn enabled(mut self, enabled: bool) -> $name<'a> { fn enabled(mut self, enabled: bool) -> $name<'a> {
self.base.enabled = enabled; self.base.enabled = enabled;
self self
} }
fn enabled_if_some(self, enabled: Option<bool>) -> $name<'a> {
if let Some(enabled) = enabled {
self.enabled(enabled)
} else {
self
}
}
#[cfg(feature = "v1_18")] #[cfg(feature = "v1_18")]
fn single_segment(mut self, single_segment: bool) -> $name<'a> { fn single_segment(mut self, single_segment: bool) -> $name<'a> {
self.base.single_segment = single_segment; self.base.single_segment = single_segment;
self self
} }
#[cfg(feature = "v1_18")]
fn single_segment_if_some(self, single_segment: Option<bool>) -> $name<'a> {
if let Some(single_segment) = single_segment {
self.single_segment(single_segment)
} else {
self
}
}
#[cfg(feature = "v1_20")] #[cfg(feature = "v1_20")]
fn element_properties(mut self, element_properties: ElementProperties) -> $name<'a> { fn element_properties(mut self, element_properties: ElementProperties) -> $name<'a> {
self.base.element_properties = Some(element_properties); self.base.element_properties = Some(element_properties);
self self
} }
#[cfg(feature = "v1_20")]
fn element_properties_if_some(self, element_properties: Option<ElementProperties>) -> $name<'a> {
if let Some(element_properties) = element_properties {
self.element_properties(element_properties)
} else {
self
}
}
} }
} }
); );