Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sdroege/gst-plugin-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorFrançois Laignel <fengalin@free.fr>2022-10-20 21:18:35 +0300
committerFrançois Laignel <fengalin@free.fr>2022-10-21 12:54:24 +0300
commit6319d104a85d49c7251a1649d297541b4618bf4f (patch)
treeee3af0e18bc7fbd047909f868c6ad6b834413787 /net
parent7b5d887c5b00b330c4d31059299717641f31687f (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 'net')
-rw-r--r--net/aws/src/s3hlssink/imp.rs2
-rw-r--r--net/hlssink3/src/imp.rs2
-rw-r--r--net/onvif/src/onvifmetadatacombiner/imp.rs8
-rw-r--r--net/onvif/src/onvifmetadataparse/imp.rs4
-rw-r--r--net/raptorq/src/raptorqdec/imp.rs4
-rw-r--r--net/webrtc-http/src/whipsink/imp.rs4
-rw-r--r--net/webrtc/src/webrtcsink/imp.rs2
7 files changed, 13 insertions, 13 deletions
diff --git a/net/aws/src/s3hlssink/imp.rs b/net/aws/src/s3hlssink/imp.rs
index 3e1b9470..f59498b0 100644
--- a/net/aws/src/s3hlssink/imp.rs
+++ b/net/aws/src/s3hlssink/imp.rs
@@ -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();
diff --git a/net/hlssink3/src/imp.rs b/net/hlssink3/src/imp.rs
index 88db601d..030203cc 100644
--- a/net/hlssink3/src/imp.rs
+++ b/net/hlssink3/src/imp.rs
@@ -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();
diff --git a/net/onvif/src/onvifmetadatacombiner/imp.rs b/net/onvif/src/onvifmetadatacombiner/imp.rs
index 891f396f..6fba3c69 100644
--- a/net/onvif/src/onvifmetadatacombiner/imp.rs
+++ b/net/onvif/src/onvifmetadatacombiner/imp.rs
@@ -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
diff --git a/net/onvif/src/onvifmetadataparse/imp.rs b/net/onvif/src/onvifmetadataparse/imp.rs
index 3f6ffcd7..3833d2b9 100644
--- a/net/onvif/src/onvifmetadataparse/imp.rs
+++ b/net/onvif/src/onvifmetadataparse/imp.rs
@@ -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
}
diff --git a/net/raptorq/src/raptorqdec/imp.rs b/net/raptorq/src/raptorqdec/imp.rs
index b12f76a9..84e682f1 100644
--- a/net/raptorq/src/raptorqdec/imp.rs
+++ b/net/raptorq/src/raptorqdec/imp.rs
@@ -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,
diff --git a/net/webrtc-http/src/whipsink/imp.rs b/net/webrtc-http/src/whipsink/imp.rs
index 8c94d8f6..27a3fa42 100644
--- a/net/webrtc-http/src/whipsink/imp.rs
+++ b/net/webrtc-http/src/whipsink/imp.rs
@@ -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();
diff --git a/net/webrtc/src/webrtcsink/imp.rs b/net/webrtc/src/webrtcsink/imp.rs
index 04ce51ad..3d2adc42 100644
--- a/net/webrtc/src/webrtcsink/imp.rs
+++ b/net/webrtc/src/webrtcsink/imp.rs
@@ -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();