From 5923adf333b2015b747f5eb50859ff8136a13dd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 18 Dec 2019 19:34:00 +0200 Subject: [PATCH 1/2] Update to gstreamer 0.15 bindings release --- Cargo.toml | 10 +++++----- src/ndiaudiosrc.rs | 16 ++++++++-------- src/ndivideosrc.rs | 16 ++++++++-------- src/receiver.rs | 6 +++--- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c0fd4236..835c7c40 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,12 +8,12 @@ description = "NewTek NDI Plugin" edition = "2018" [dependencies] -glib = { version = "0.8.0", features = ["subclassing"] } +glib = "0.9" gobject-sys = "0.9" -gstreamer = { version = "0.14.4", features = ["subclassing", "v1_12"] } -gstreamer-base = { version = "0.14.0", features = ["subclassing"] } -gstreamer-audio = "0.14.0" -gstreamer-video = { version = "0.14.3", features = ["v1_12"] } +gstreamer = { version = "0.15", features = ["v1_12"] } +gstreamer-base = "0.15" +gstreamer-audio = "0.15" +gstreamer-video = { version = "0.15", features = ["v1_12"] } lazy_static = "1.1.0" byte-slice-cast = "0.2.0" diff --git a/src/ndiaudiosrc.rs b/src/ndiaudiosrc.rs index 880c90b4..5a9118d8 100644 --- a/src/ndiaudiosrc.rs +++ b/src/ndiaudiosrc.rs @@ -217,7 +217,7 @@ impl ObjectImpl for NdiAudioSrc { match *prop { subclass::Property("ndi-name", ..) => { let mut settings = self.settings.lock().unwrap(); - let ndi_name = value.get(); + let ndi_name = value.get().unwrap(); gst_debug!( self.cat, obj: basesrc, @@ -229,7 +229,7 @@ impl ObjectImpl for NdiAudioSrc { } subclass::Property("ip-address", ..) => { let mut settings = self.settings.lock().unwrap(); - let ip_address = value.get(); + let ip_address = value.get().unwrap(); gst_debug!( self.cat, obj: basesrc, @@ -241,7 +241,7 @@ impl ObjectImpl for NdiAudioSrc { } subclass::Property("receiver-ndi-name", ..) => { let mut settings = self.settings.lock().unwrap(); - let receiver_ndi_name = value.get(); + let receiver_ndi_name = value.get().unwrap(); gst_debug!( self.cat, obj: basesrc, @@ -254,7 +254,7 @@ impl ObjectImpl for NdiAudioSrc { } subclass::Property("connect-timeout", ..) => { let mut settings = self.settings.lock().unwrap(); - let connect_timeout = value.get().unwrap(); + let connect_timeout = value.get_some().unwrap(); gst_debug!( self.cat, obj: basesrc, @@ -266,7 +266,7 @@ impl ObjectImpl for NdiAudioSrc { } subclass::Property("timeout", ..) => { let mut settings = self.settings.lock().unwrap(); - let timeout = value.get().unwrap(); + let timeout = value.get_some().unwrap(); gst_debug!( self.cat, obj: basesrc, @@ -278,7 +278,7 @@ impl ObjectImpl for NdiAudioSrc { } subclass::Property("bandwidth", ..) => { let mut settings = self.settings.lock().unwrap(); - let bandwidth = value.get().unwrap(); + let bandwidth = value.get_some().unwrap(); gst_debug!( self.cat, obj: basesrc, @@ -290,7 +290,7 @@ impl ObjectImpl for NdiAudioSrc { } subclass::Property("timestamp-mode", ..) => { let mut settings = self.settings.lock().unwrap(); - let timestamp_mode = value.get().unwrap(); + let timestamp_mode = value.get_some().unwrap(); gst_debug!( self.cat, obj: basesrc, @@ -518,7 +518,7 @@ impl BaseSrcImpl for NdiAudioSrc { let mut state = self.state.lock().unwrap(); state.receiver = Some(recv); if state.info.as_ref() != Some(&info) { - let caps = info.to_caps().ok_or_else(|| { + let caps = info.to_caps().map_err(|_| { gst_element_error!( element, gst::ResourceError::Settings, diff --git a/src/ndivideosrc.rs b/src/ndivideosrc.rs index 6ae64016..9b89c28f 100644 --- a/src/ndivideosrc.rs +++ b/src/ndivideosrc.rs @@ -252,7 +252,7 @@ impl ObjectImpl for NdiVideoSrc { match *prop { subclass::Property("ndi-name", ..) => { let mut settings = self.settings.lock().unwrap(); - let ndi_name = value.get(); + let ndi_name = value.get().unwrap(); gst_debug!( self.cat, obj: basesrc, @@ -264,7 +264,7 @@ impl ObjectImpl for NdiVideoSrc { } subclass::Property("ip-address", ..) => { let mut settings = self.settings.lock().unwrap(); - let ip_address = value.get(); + let ip_address = value.get().unwrap(); gst_debug!( self.cat, obj: basesrc, @@ -276,7 +276,7 @@ impl ObjectImpl for NdiVideoSrc { } subclass::Property("receiver-ndi-name", ..) => { let mut settings = self.settings.lock().unwrap(); - let receiver_ndi_name = value.get(); + let receiver_ndi_name = value.get().unwrap(); gst_debug!( self.cat, obj: basesrc, @@ -289,7 +289,7 @@ impl ObjectImpl for NdiVideoSrc { } subclass::Property("connect-timeout", ..) => { let mut settings = self.settings.lock().unwrap(); - let connect_timeout = value.get().unwrap(); + let connect_timeout = value.get_some().unwrap(); gst_debug!( self.cat, obj: basesrc, @@ -301,7 +301,7 @@ impl ObjectImpl for NdiVideoSrc { } subclass::Property("timeout", ..) => { let mut settings = self.settings.lock().unwrap(); - let timeout = value.get().unwrap(); + let timeout = value.get_some().unwrap(); gst_debug!( self.cat, obj: basesrc, @@ -313,7 +313,7 @@ impl ObjectImpl for NdiVideoSrc { } subclass::Property("bandwidth", ..) => { let mut settings = self.settings.lock().unwrap(); - let bandwidth = value.get().unwrap(); + let bandwidth = value.get_some().unwrap(); gst_debug!( self.cat, obj: basesrc, @@ -325,7 +325,7 @@ impl ObjectImpl for NdiVideoSrc { } subclass::Property("timestamp-mode", ..) => { let mut settings = self.settings.lock().unwrap(); - let timestamp_mode = value.get().unwrap(); + let timestamp_mode = value.get_some().unwrap(); gst_debug!( self.cat, obj: basesrc, @@ -557,7 +557,7 @@ impl BaseSrcImpl for NdiVideoSrc { let mut state = self.state.lock().unwrap(); state.receiver = Some(recv); if state.info.as_ref() != Some(&info) { - let caps = info.to_caps().ok_or_else(|| { + let caps = info.to_caps().map_err(|_| { gst_element_error!( element, gst::ResourceError::Settings, diff --git a/src/receiver.rs b/src/receiver.rs index 4d40d83e..17d18897 100644 --- a/src/receiver.rs +++ b/src/receiver.rs @@ -1292,7 +1292,7 @@ impl Receiver { builder = builder.field_order(gst_video::VideoFieldOrder::TopFieldFirst); } - builder.build().ok_or_else(|| { + builder.build().map_err(|_| { gst_element_error!( element, gst::StreamError::Format, @@ -1341,7 +1341,7 @@ impl Receiver { builder = builder.field_order(gst_video::VideoFieldOrder::TopFieldFirst); } - builder.build().ok_or_else(|| { + builder.build().map_err(|_| { gst_element_error!( element, gst::StreamError::Format, @@ -1666,7 +1666,7 @@ impl Receiver { audio_frame.no_channels() as u32, ); - builder.build().ok_or_else(|| { + builder.build().map_err(|_| { gst_element_error!( element, gst::StreamError::Format, From 6aea804c6ccec9ac3ffa351f766fb84f97bf9257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 19 Dec 2019 00:49:09 +0200 Subject: [PATCH 2/2] Update byte-slice-cast to 0.3 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 835c7c40..388e4363 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ gstreamer-base = "0.15" gstreamer-audio = "0.15" gstreamer-video = { version = "0.15", features = ["v1_12"] } lazy_static = "1.1.0" -byte-slice-cast = "0.2.0" +byte-slice-cast = "0.3.0" [build-dependencies] gst-plugin-version-helper = "0.1"