From ed6aac91bdee3f18161ef1c3e9a1eb8d1cdf641d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 28 Aug 2024 09:35:06 +0300 Subject: [PATCH] Remove deprecated API Part-of: --- gstreamer-pbutils/src/missing_plugins.rs | 22 -- gstreamer-video/src/video_event.rs | 14 -- gstreamer-video/src/video_message.rs | 22 -- gstreamer/src/event.rs | 24 +-- gstreamer/src/log.rs | 248 ----------------------- gstreamer/src/message.rs | 24 +-- 6 files changed, 2 insertions(+), 352 deletions(-) diff --git a/gstreamer-pbutils/src/missing_plugins.rs b/gstreamer-pbutils/src/missing_plugins.rs index 03e2e960a..9625d8472 100644 --- a/gstreamer-pbutils/src/missing_plugins.rs +++ b/gstreamer-pbutils/src/missing_plugins.rs @@ -139,18 +139,6 @@ macro_rules! message_builder_generic_impl { gst::impl_builder_gvalue_extra_setters!(other_field); - #[deprecated = "use builder.other_field() instead"] - #[allow(clippy::needless_update)] - pub fn other_fields( - self, - other_fields: &[(&'a str, &'a (dyn ToSendValue + Sync))], - ) -> Self { - Self { - builder: self.builder.other_fields(other_fields), - ..self - } - } - #[must_use = "Building the message without using it has no effect"] #[allow(clippy::redundant_closure_call)] pub fn build(mut self) -> Message { @@ -239,16 +227,6 @@ impl<'a> MessageBuilder<'a> { ..self } } - - fn other_fields(self, other_fields: &[(&'a str, &'a (dyn ToSendValue + Sync))]) -> Self { - let mut s = self; - - for (name, value) in other_fields { - s = s.other_field(name, value.to_send_value()); - } - - s - } } enum MessageBuilderDetail<'a> { diff --git a/gstreamer-video/src/video_event.rs b/gstreamer-video/src/video_event.rs index ef5e43fd3..d6cb8fc48 100644 --- a/gstreamer-video/src/video_event.rs +++ b/gstreamer-video/src/video_event.rs @@ -70,20 +70,6 @@ macro_rules! event_builder_generic_impl { gst::impl_builder_gvalue_extra_setters!(other_field); - #[deprecated = "use build.other_field() instead"] - pub fn other_fields( - self, - other_fields: &[(&'a str, &'a (dyn ToSendValue + Sync))], - ) -> Self { - let mut s = self; - - for (name, value) in other_fields { - s = s.other_field(name, value.to_send_value()); - } - - s - } - #[must_use = "Building the event without using it has no effect"] #[allow(clippy::redundant_closure_call)] pub fn build(mut self) -> gst::Event { diff --git a/gstreamer-video/src/video_message.rs b/gstreamer-video/src/video_message.rs index 4d16aa717..2dc7bf2ea 100644 --- a/gstreamer-video/src/video_message.rs +++ b/gstreamer-video/src/video_message.rs @@ -76,18 +76,6 @@ macro_rules! message_builder_generic_impl { gst::impl_builder_gvalue_extra_setters!(other_field); - #[deprecated = "use builder.other_field() instead"] - #[allow(clippy::needless_update)] - pub fn other_fields( - self, - other_fields: &[(&'a str, &'a (dyn ToSendValue + Sync))], - ) -> Self { - Self { - builder: self.builder.other_fields(other_fields), - ..self - } - } - #[must_use = "Building the message without using it has no effect"] #[allow(clippy::redundant_closure_call)] pub fn build(mut self) -> Message { @@ -157,16 +145,6 @@ impl<'a> MessageBuilder<'a> { ..self } } - - fn other_fields(self, other_fields: &[(&'a str, &'a (dyn ToSendValue + Sync))]) -> Self { - let mut s = self; - - for (name, value) in other_fields { - s = s.other_field(name, value.to_send_value()); - } - - s - } } #[must_use = "The builder must be built to be used"] diff --git a/gstreamer/src/event.rs b/gstreamer/src/event.rs index 9a64e0b05..4a4672a62 100644 --- a/gstreamer/src/event.rs +++ b/gstreamer/src/event.rs @@ -2076,16 +2076,6 @@ impl<'a> EventBuilder<'a> { ..self } } - - fn other_fields(self, other_fields: &[(&'a str, &'a (dyn ToSendValue + Sync))]) -> Self { - let mut s = self; - - for (name, value) in other_fields { - s = s.other_field(name, value.to_send_value()); - } - - s - } } macro_rules! event_builder_generic_impl { @@ -2162,18 +2152,6 @@ macro_rules! event_builder_generic_impl { impl_builder_gvalue_extra_setters!(other_field); - #[deprecated = "use build.other_field() instead"] - #[allow(clippy::needless_update)] - pub fn other_fields( - self, - other_fields: &[(&'a str, &'a (dyn ToSendValue + Sync))], - ) -> Self { - Self { - builder: self.builder.other_fields(other_fields), - ..self - } - } - #[must_use = "Building the event without using it has no effect"] #[allow(clippy::redundant_closure_call)] pub fn build(mut self) -> Event { @@ -3142,7 +3120,7 @@ mod tests { } let flush_start_evt = FlushStart::builder() - .other_fields(&[("extra-field", &true)]) + .other_field("extra-field", true) .build(); match flush_start_evt.view() { EventView::FlushStart(flush_start_evt) => { diff --git a/gstreamer/src/log.rs b/gstreamer/src/log.rs index 7ec60a1a9..8f5f51d37 100644 --- a/gstreamer/src/log.rs +++ b/gstreamer/src/log.rs @@ -622,37 +622,6 @@ macro_rules! error( ($cat:expr, id = $id:expr, $($args:tt)*) => { { $crate::log_with_level!($cat, $crate::DebugLevel::Error, id = $id, $($args)*) }}; - - ($cat:expr, obj: $obj:expr, $($args:tt)*) => { { - { - #[deprecated = "Using old-style obj format. Use `obj = ` instead of `obj: ` for better tooling support"] - macro_rules! error( - () => {} - ); - error!(); - } - $crate::log_with_level!($cat, $crate::DebugLevel::Error, obj = $obj, $($args)*) - }}; - ($cat:expr, imp: $imp:expr, $($args:tt)*) => { { - { - #[deprecated = "Using old-style imp format. Use `imp = ` instead of `imp: ` for better tooling support"] - macro_rules! error( - () => {} - ); - error!(); - } - $crate::log_with_level!($cat, $crate::DebugLevel::Error, imp = $imp, $($args)*) - }}; - ($cat:expr, id: $id:expr, $($args:tt)*) => { { - { - #[deprecated = "Using old-style id format. Use `id = ` instead of `id: ` for better tooling support"] - macro_rules! error( - () => {} - ); - error!(); - } - $crate::log_with_level!($cat, $crate::DebugLevel::Error, id = $id, $($args)*) - }}; ($cat:expr, $($args:tt)*) => { { $crate::log_with_level!($cat, $crate::DebugLevel::Error, $($args)*) }}; @@ -669,37 +638,6 @@ macro_rules! warning( ($cat:expr, id = $id:expr, $($args:tt)*) => { { $crate::log_with_level!($cat, $crate::DebugLevel::Warning, id = $id, $($args)*) }}; - - ($cat:expr, obj: $obj:expr, $($args:tt)*) => { { - { - #[deprecated = "Using old-style obj format. Use `obj = ` instead of `obj: ` for better tooling support"] - macro_rules! warning( - () => {} - ); - warning!(); - } - $crate::log_with_level!($cat, $crate::DebugLevel::Warning, obj = $obj, $($args)*) - }}; - ($cat:expr, imp: $imp:expr, $($args:tt)*) => { { - { - #[deprecated = "Using old-style imp format. Use `imp = ` instead of `imp: ` for better tooling support"] - macro_rules! warning( - () => {} - ); - warning!(); - } - $crate::log_with_level!($cat, $crate::DebugLevel::Warning, imp = $imp, $($args)*) - }}; - ($cat:expr, id: $id:expr, $($args:tt)*) => { { - { - #[deprecated = "Using old-style id format. Use `id = ` instead of `id: ` for better tooling support"] - macro_rules! warning( - () => {} - ); - warning!(); - } - $crate::log_with_level!($cat, $crate::DebugLevel::Warning, id = $id, $($args)*) - }}; ($cat:expr, $($args:tt)*) => { { $crate::log_with_level!($cat, $crate::DebugLevel::Warning, $($args)*) }}; @@ -716,37 +654,6 @@ macro_rules! fixme( ($cat:expr, id = $id:expr, $($args:tt)*) => { { $crate::log_with_level!($cat, $crate::DebugLevel::Fixme, id = $id, $($args)*) }}; - - ($cat:expr, obj: $obj:expr, $($args:tt)*) => { { - { - #[deprecated = "Using old-style obj format. Use `obj = ` instead of `obj: ` for better tooling support"] - macro_rules! fixme( - () => {} - ); - fixme!(); - } - $crate::log_with_level!($cat, $crate::DebugLevel::Fixme, obj = $obj, $($args)*) - }}; - ($cat:expr, imp: $imp:expr, $($args:tt)*) => { { - { - #[deprecated = "Using old-style imp format. Use `imp = ` instead of `imp: ` for better tooling support"] - macro_rules! fixme( - () => {} - ); - fixme!(); - } - $crate::log_with_level!($cat, $crate::DebugLevel::Fixme, imp = $imp, $($args)*) - }}; - ($cat:expr, id: $id:expr, $($args:tt)*) => { { - { - #[deprecated = "Using old-style id format. Use `id = ` instead of `id: ` for better tooling support"] - macro_rules! fixme( - () => {} - ); - fixme!(); - } - $crate::log_with_level!($cat, $crate::DebugLevel::Fixme, id = $id, $($args)*) - }}; ($cat:expr, $($args:tt)*) => { { $crate::log_with_level!($cat, $crate::DebugLevel::Fixme, $($args)*) }}; @@ -763,37 +670,6 @@ macro_rules! info( ($cat:expr, id = $id:expr, $($args:tt)*) => { { $crate::log_with_level!($cat, $crate::DebugLevel::Info, id = $id, $($args)*) }}; - - ($cat:expr, obj: $obj:expr, $($args:tt)*) => { { - { - #[deprecated = "Using old-style obj format. Use `obj = ` instead of `obj: ` for better tooling support"] - macro_rules! info( - () => {} - ); - info!(); - } - $crate::log_with_level!($cat, $crate::DebugLevel::Info, obj = $obj, $($args)*) - }}; - ($cat:expr, imp: $imp:expr, $($args:tt)*) => { { - { - #[deprecated = "Using old-style imp format. Use `imp = ` instead of `imp: ` for better tooling support"] - macro_rules! info( - () => {} - ); - info!(); - } - $crate::log_with_level!($cat, $crate::DebugLevel::Info, imp = $imp, $($args)*) - }}; - ($cat:expr, id: $id:expr, $($args:tt)*) => { { - { - #[deprecated = "Using old-style id format. Use `id = ` instead of `id: ` for better tooling support"] - macro_rules! info( - () => {} - ); - info!(); - } - $crate::log_with_level!($cat, $crate::DebugLevel::Info, id = $id, $($args)*) - }}; ($cat:expr, $($args:tt)*) => { { $crate::log_with_level!($cat, $crate::DebugLevel::Info, $($args)*) }}; @@ -810,37 +686,6 @@ macro_rules! debug( ($cat:expr, id = $id:expr, $($args:tt)*) => { { $crate::log_with_level!($cat, $crate::DebugLevel::Debug, id = $id, $($args)*) }}; - - ($cat:expr, obj: $obj:expr, $($args:tt)*) => { { - { - #[deprecated = "Using old-style obj format. Use `obj = ` instead of `obj: ` for better tooling support"] - macro_rules! debug( - () => {} - ); - debug!(); - } - $crate::log_with_level!($cat, $crate::DebugLevel::Debug, obj = $obj, $($args)*) - }}; - ($cat:expr, imp: $imp:expr, $($args:tt)*) => { { - { - #[deprecated = "Using old-style imp format. Use `imp = ` instead of `imp: ` for better tooling support"] - macro_rules! debug( - () => {} - ); - debug!(); - } - $crate::log_with_level!($cat, $crate::DebugLevel::Debug, imp = $imp, $($args)*) - }}; - ($cat:expr, id: $id:expr, $($args:tt)*) => { { - { - #[deprecated = "Using old-style id format. Use `id = ` instead of `id: ` for better tooling support"] - macro_rules! debug( - () => {} - ); - debug!(); - } - $crate::log_with_level!($cat, $crate::DebugLevel::Debug, id = $id, $($args)*) - }}; ($cat:expr, $($args:tt)*) => { { $crate::log_with_level!($cat, $crate::DebugLevel::Debug, $($args)*) }}; @@ -857,37 +702,6 @@ macro_rules! log( ($cat:expr, id = $id:expr, $($args:tt)*) => { { $crate::log_with_level!($cat, $crate::DebugLevel::Log, id = $id, $($args)*) }}; - - ($cat:expr, obj: $obj:expr, $($args:tt)*) => { { - { - #[deprecated = "Using old-style obj format. Use `obj = ` instead of `obj: ` for better tooling support"] - macro_rules! log( - () => {} - ); - log!(); - } - $crate::log_with_level!($cat, $crate::DebugLevel::Log, obj = $obj, $($args)*) - }}; - ($cat:expr, imp: $imp:expr, $($args:tt)*) => { { - { - #[deprecated = "Using old-style imp format. Use `imp = ` instead of `imp: ` for better tooling support"] - macro_rules! log( - () => {} - ); - log!(); - } - $crate::log_with_level!($cat, $crate::DebugLevel::Log, imp = $imp, $($args)*) - }}; - ($cat:expr, id: $id:expr, $($args:tt)*) => { { - { - #[deprecated = "Using old-style id format. Use `id = ` instead of `id: ` for better tooling support"] - macro_rules! log( - () => {} - ); - log!(); - } - $crate::log_with_level!($cat, $crate::DebugLevel::Log, id = $id, $($args)*) - }}; ($cat:expr, $($args:tt)*) => { { $crate::log_with_level!($cat, $crate::DebugLevel::Log, $($args)*) }}; @@ -904,37 +718,6 @@ macro_rules! trace( ($cat:expr, id = $id:expr, $($args:tt)*) => { { $crate::log_with_level!($cat, $crate::DebugLevel::Trace, id = $id, $($args)*) }}; - - ($cat:expr, obj: $obj:expr, $($args:tt)*) => { { - { - #[deprecated = "Using old-style obj format. Use `obj = ` instead of `obj: ` for better tooling support"] - macro_rules! trace( - () => {} - ); - trace!(); - } - $crate::log_with_level!($cat, $crate::DebugLevel::Trace, obj = $obj, $($args)*) - }}; - ($cat:expr, imp: $imp:expr, $($args:tt)*) => { { - { - #[deprecated = "Using old-style imp format. Use `imp = ` instead of `imp: ` for better tooling support"] - macro_rules! trace( - () => {} - ); - trace!(); - } - $crate::log_with_level!($cat, $crate::DebugLevel::Trace, imp = $imp, $($args)*) - }}; - ($cat:expr, id: $id:expr, $($args:tt)*) => { { - { - #[deprecated = "Using old-style id format. Use `id = ` instead of `id: `"] - macro_rules! trace( - () => {} - ); - trace!(); - } - $crate::log_with_level!($cat, $crate::DebugLevel::Trace, id = $id, $($args)*) - }}; ($cat:expr, $($args:tt)*) => { { $crate::log_with_level!($cat, $crate::DebugLevel::Trace, $($args)*) }}; @@ -951,37 +734,6 @@ macro_rules! memdump( ($cat:expr, id = $id:expr, $($args:tt)*) => { { $crate::log_with_level!($cat, $crate::DebugLevel::Memdump, id = $id, $($args)*) }}; - - ($cat:expr, obj: $obj:expr, $($args:tt)*) => { { - { - #[deprecated = "Using old-style obj format. Use `obj = ` instead of `obj: ` for better tooling support"] - macro_rules! memdump( - () => {} - ); - memdump!(); - } - $crate::log_with_level!($cat, $crate::DebugLevel::Memdump, obj = $obj, $($args)*) - }}; - ($cat:expr, imp: $imp:expr, $($args:tt)*) => { { - { - #[deprecated = "Using old-style imp format. Use `imp = ` instead of `imp: ` for better tooling support"] - macro_rules! memdump( - () => {} - ); - memdump!(); - } - $crate::log_with_level!($cat, $crate::DebugLevel::Memdump, imp = $imp, $($args)*) - }}; - ($cat:expr, id: $id:expr, $($args:tt)*) => { { - { - #[deprecated = "Using old-style id format. Use `id = ` instead of `id: ` for better tooling support"] - macro_rules! memdump( - () => {} - ); - memdump!(); - } - $crate::log_with_level!($cat, $crate::DebugLevel::Memdump, id = $id, $($args)*) - }}; ($cat:expr, $($args:tt)*) => { { $crate::log_with_level!($cat, $crate::DebugLevel::Memdump, $($args)*) }}; diff --git a/gstreamer/src/message.rs b/gstreamer/src/message.rs index 82c98ca04..074320227 100644 --- a/gstreamer/src/message.rs +++ b/gstreamer/src/message.rs @@ -2594,16 +2594,6 @@ impl<'a> MessageBuilder<'a> { ..self } } - - fn other_fields(self, other_fields: &[(&'a str, &'a (dyn ToSendValue + Sync))]) -> Self { - let mut s = self; - - for (name, value) in other_fields { - s = s.other_field(name, value.to_send_value()); - } - - s - } } macro_rules! message_builder_generic_impl { @@ -2712,18 +2702,6 @@ macro_rules! message_builder_generic_impl { impl_builder_gvalue_extra_setters!(other_field); - #[deprecated = "use build.other_field() instead"] - #[allow(clippy::needless_update)] - pub fn other_fields( - self, - other_fields: &[(&'a str, &'a (dyn ToSendValue + Sync))], - ) -> Self { - Self { - builder: self.builder.other_fields(other_fields), - ..self - } - } - #[must_use = "Building the message without using it has no effect"] #[allow(clippy::redundant_closure_call)] pub fn build(mut self) -> Message { @@ -4325,7 +4303,7 @@ mod tests { let seqnum = Seqnum::next(); let eos_msg = Eos::builder() - .other_fields(&[("extra-field", &true)]) + .other_field("extra-field", true) .seqnum(seqnum) .build(); match eos_msg.view() {