diff options
author | François Laignel <fengalin@free.fr> | 2022-10-20 21:18:35 +0300 |
---|---|---|
committer | François Laignel <fengalin@free.fr> | 2022-10-21 12:54:24 +0300 |
commit | 6319d104a85d49c7251a1649d297541b4618bf4f (patch) | |
tree | ee3af0e18bc7fbd047909f868c6ad6b834413787 /generic | |
parent | 7b5d887c5b00b330c4d31059299717641f31687f (diff) |
Take advantage of `Into<Option<_>>` args
Commit 24b7cfc8 applied changes related to nullability as declared
by gir. One consequence was that some functions signature ended up
requiring users to pass `Some(val)` when they could use `val`
before.
This commit applies changes on `gstreamer-rs` which, will honoring
the nullability stil allow users to pass `val` for the few affected
functions.
This commit also fixes the signature for `Element::request_new_pad`
which was updated upstream.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/fmp4/src/fmp4mux/imp.rs | 6 | ||||
-rw-r--r-- | generic/threadshare/src/appsrc/imp.rs | 2 | ||||
-rw-r--r-- | generic/threadshare/src/inputselector/imp.rs | 2 | ||||
-rw-r--r-- | generic/threadshare/src/proxy/imp.rs | 2 | ||||
-rw-r--r-- | generic/threadshare/src/tcpclientsrc/imp.rs | 2 | ||||
-rw-r--r-- | generic/threadshare/src/udpsrc/imp.rs | 2 |
6 files changed, 8 insertions, 8 deletions
diff --git a/generic/fmp4/src/fmp4mux/imp.rs b/generic/fmp4/src/fmp4mux/imp.rs index c840e4906..a7a8932dc 100644 --- a/generic/fmp4/src/fmp4mux/imp.rs +++ b/generic/fmp4/src/fmp4mux/imp.rs @@ -1772,7 +1772,7 @@ impl ElementImpl for FMP4Mux { fn request_new_pad( &self, templ: &gst::PadTemplate, - name: Option<String>, + name: Option<&str>, caps: Option<&gst::Caps>, ) -> Option<gst::Pad> { let state = self.state.lock().unwrap(); @@ -1813,9 +1813,9 @@ impl AggregatorImpl for FMP4Mux { if let Some(filter_caps) = q.filter() { let res = filter_caps .intersect_with_mode(&allowed_caps, gst::CapsIntersectMode::First); - q.set_result(Some(&res)); + q.set_result(&res); } else { - q.set_result(Some(&allowed_caps)); + q.set_result(&allowed_caps); } true diff --git a/generic/threadshare/src/appsrc/imp.rs b/generic/threadshare/src/appsrc/imp.rs index b4e64c9bd..b5636e08d 100644 --- a/generic/threadshare/src/appsrc/imp.rs +++ b/generic/threadshare/src/appsrc/imp.rs @@ -128,7 +128,7 @@ impl PadSrcHandler for AppSrcPadHandler { .unwrap_or_else(gst::Caps::new_any) }; - q.set_result(Some(&caps)); + q.set_result(&caps); true } diff --git a/generic/threadshare/src/inputselector/imp.rs b/generic/threadshare/src/inputselector/imp.rs index d29320b3e..c3e005ee6 100644 --- a/generic/threadshare/src/inputselector/imp.rs +++ b/generic/threadshare/src/inputselector/imp.rs @@ -545,7 +545,7 @@ impl ElementImpl for InputSelector { fn request_new_pad( &self, templ: &gst::PadTemplate, - _name: Option<String>, + _name: Option<&str>, _caps: Option<&gst::Caps>, ) -> Option<gst::Pad> { let mut state = self.state.lock().unwrap(); diff --git a/generic/threadshare/src/proxy/imp.rs b/generic/threadshare/src/proxy/imp.rs index 801f14c5b..862e0730a 100644 --- a/generic/threadshare/src/proxy/imp.rs +++ b/generic/threadshare/src/proxy/imp.rs @@ -743,7 +743,7 @@ impl PadSrcHandler for ProxySrcPadHandler { .unwrap_or_else(gst::Caps::new_any) }; - q.set_result(Some(&caps)); + q.set_result(&caps); true } diff --git a/generic/threadshare/src/tcpclientsrc/imp.rs b/generic/threadshare/src/tcpclientsrc/imp.rs index 00fc01b6f..f616407d3 100644 --- a/generic/threadshare/src/tcpclientsrc/imp.rs +++ b/generic/threadshare/src/tcpclientsrc/imp.rs @@ -142,7 +142,7 @@ impl PadSrcHandler for TcpClientSrcPadHandler { .unwrap_or_else(gst::Caps::new_any) }; - q.set_result(Some(&caps)); + q.set_result(&caps); true } diff --git a/generic/threadshare/src/udpsrc/imp.rs b/generic/threadshare/src/udpsrc/imp.rs index 31407965b..f6105d0b8 100644 --- a/generic/threadshare/src/udpsrc/imp.rs +++ b/generic/threadshare/src/udpsrc/imp.rs @@ -159,7 +159,7 @@ impl PadSrcHandler for UdpSrcPadHandler { .unwrap_or_else(gst::Caps::new_any) }; - q.set_result(Some(&caps)); + q.set_result(&caps); true } |