mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-16 12:55:13 +00:00
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.
This commit is contained in:
parent
7b5d887c5b
commit
6319d104a8
15 changed files with 23 additions and 23 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -811,7 +811,7 @@ impl ElementImpl for S3HlsSink {
|
|||
fn request_new_pad(
|
||||
&self,
|
||||
templ: &gst::PadTemplate,
|
||||
_name: Option<String>,
|
||||
_name: Option<&str>,
|
||||
_caps: Option<&gst::Caps>,
|
||||
) -> Option<gst::Pad> {
|
||||
let mut settings = self.settings.lock().unwrap();
|
||||
|
|
|
@ -753,7 +753,7 @@ impl ElementImpl for HlsSink3 {
|
|||
fn request_new_pad(
|
||||
&self,
|
||||
templ: &gst::PadTemplate,
|
||||
_name: Option<String>,
|
||||
_name: Option<&str>,
|
||||
_caps: Option<&gst::Caps>,
|
||||
) -> Option<gst::Pad> {
|
||||
let mut settings = self.settings.lock().unwrap();
|
||||
|
|
|
@ -129,7 +129,7 @@ impl ElementImpl for OnvifMetadataCombiner {
|
|||
fn request_new_pad(
|
||||
&self,
|
||||
_templ: &gst::PadTemplate,
|
||||
_name: Option<String>,
|
||||
_name: Option<&str>,
|
||||
_caps: Option<&gst::Caps>,
|
||||
) -> Option<gst::Pad> {
|
||||
gst::error!(
|
||||
|
@ -468,11 +468,11 @@ impl AggregatorImpl for OnvifMetadataCombiner {
|
|||
let templ_caps = templ.caps();
|
||||
|
||||
if let Some(filter) = filter {
|
||||
q.set_result(Some(
|
||||
q.set_result(
|
||||
&filter.intersect_with_mode(templ_caps, gst::CapsIntersectMode::First),
|
||||
));
|
||||
);
|
||||
} else {
|
||||
q.set_result(Some(templ_caps));
|
||||
q.set_result(templ_caps);
|
||||
}
|
||||
|
||||
true
|
||||
|
|
|
@ -1044,7 +1044,7 @@ impl OnvifMetadataParse {
|
|||
caps
|
||||
};
|
||||
|
||||
q.set_result(Some(&res));
|
||||
q.set_result(&res);
|
||||
|
||||
true
|
||||
}
|
||||
|
@ -1112,7 +1112,7 @@ impl OnvifMetadataParse {
|
|||
caps
|
||||
};
|
||||
|
||||
q.set_result(Some(&res));
|
||||
q.set_result(&res);
|
||||
|
||||
true
|
||||
}
|
||||
|
|
|
@ -806,7 +806,7 @@ impl ElementImpl for RaptorqDec {
|
|||
fn request_new_pad(
|
||||
&self,
|
||||
templ: &gst::PadTemplate,
|
||||
name: Option<String>,
|
||||
name: Option<&str>,
|
||||
_caps: Option<&gst::Caps>,
|
||||
) -> Option<gst::Pad> {
|
||||
let mut sinkpad_fec_guard = self.sinkpad_fec.lock().unwrap();
|
||||
|
@ -821,7 +821,7 @@ impl ElementImpl for RaptorqDec {
|
|||
return None;
|
||||
}
|
||||
|
||||
let sinkpad_fec = gst::Pad::builder_with_template(templ, name.as_deref())
|
||||
let sinkpad_fec = gst::Pad::builder_with_template(templ, name)
|
||||
.chain_function(|pad, parent, buffer| {
|
||||
Self::catch_panic_pad_function(
|
||||
parent,
|
||||
|
|
|
@ -130,10 +130,10 @@ impl ElementImpl for WhipSink {
|
|||
fn request_new_pad(
|
||||
&self,
|
||||
templ: &gst::PadTemplate,
|
||||
name: Option<String>,
|
||||
name: Option<&str>,
|
||||
caps: Option<&gst::Caps>,
|
||||
) -> Option<gst::Pad> {
|
||||
let wb_sink_pad = self.webrtcbin.request_pad(templ, name.as_deref(), caps)?;
|
||||
let wb_sink_pad = self.webrtcbin.request_pad(templ, name, caps)?;
|
||||
let sink_pad = gst::GhostPad::new(Some(&wb_sink_pad.name()), gst::PadDirection::Sink);
|
||||
|
||||
sink_pad.set_target(Some(&wb_sink_pad)).unwrap();
|
||||
|
|
|
@ -2723,7 +2723,7 @@ impl ElementImpl for WebRTCSink {
|
|||
fn request_new_pad(
|
||||
&self,
|
||||
templ: &gst::PadTemplate,
|
||||
_name: Option<String>,
|
||||
_name: Option<&str>,
|
||||
_caps: Option<&gst::Caps>,
|
||||
) -> Option<gst::Pad> {
|
||||
let element = self.instance();
|
||||
|
|
|
@ -1333,7 +1333,7 @@ impl ElementImpl for FallbackSwitch {
|
|||
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();
|
||||
|
|
|
@ -1991,7 +1991,7 @@ impl ElementImpl for ToggleRecord {
|
|||
fn request_new_pad(
|
||||
&self,
|
||||
_templ: &gst::PadTemplate,
|
||||
_name: Option<String>,
|
||||
_name: Option<&str>,
|
||||
_caps: Option<&gst::Caps>,
|
||||
) -> Option<gst::Pad> {
|
||||
let mut other_streams_guard = self.other_streams.lock();
|
||||
|
|
Loading…
Reference in a new issue