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/video
diff options
context:
space:
mode:
authorBilal Elmoussaoui <bil.elmoussaoui@gmail.com>2021-11-08 12:55:40 +0300
committerSebastian Dröge <sebastian@centricular.com>2021-11-08 15:43:53 +0300
commit82be7b3ac5911dd8b8cb13b3394f3159e57d6e3f (patch)
treee7e41d720aa7846d123734e7b8ad1ab42f2c82c0 /video
parentd9bda62a4720c0539a443a4e489645e9bb4af1eb (diff)
adapt to ObjectExt improvements
Diffstat (limited to 'video')
-rw-r--r--video/cdg/tests/cdgdec.rs4
-rw-r--r--video/closedcaption/src/transcriberbin/imp.rs36
-rw-r--r--video/closedcaption/tests/ccdetect.rs26
-rw-r--r--video/closedcaption/tests/mcc_enc.rs6
-rw-r--r--video/gtk4/examples/gtksink.rs8
-rw-r--r--video/rav1e/tests/rav1enc.rs2
6 files changed, 25 insertions, 57 deletions
diff --git a/video/cdg/tests/cdgdec.rs b/video/cdg/tests/cdgdec.rs
index 21d678dd..26305a39 100644
--- a/video/cdg/tests/cdgdec.rs
+++ b/video/cdg/tests/cdgdec.rs
@@ -36,9 +36,7 @@ fn test_cdgdec() {
// Ensure we are in push mode so 'blocksize' prop is used
let filesrc = gst::ElementFactory::make("pushfilesrc", None).unwrap();
- filesrc
- .set_property("location", input_path.to_str().unwrap())
- .expect("failed to set 'location' property");
+ filesrc.set_property("location", input_path.to_str().unwrap());
{
let child_proxy = filesrc.dynamic_cast_ref::<gst::ChildProxy>().unwrap();
child_proxy
diff --git a/video/closedcaption/src/transcriberbin/imp.rs b/video/closedcaption/src/transcriberbin/imp.rs
index 66f23712..b174b2a8 100644
--- a/video/closedcaption/src/transcriberbin/imp.rs
+++ b/video/closedcaption/src/transcriberbin/imp.rs
@@ -139,16 +139,12 @@ impl TranscriberBin {
state
.transcriber_queue
- .set_property("max-size-buffers", 0u32)
- .unwrap();
- state
- .transcriber_queue
- .set_property("max-size-time", 0u64)
- .unwrap();
+ .set_property("max-size-buffers", 0u32);
+ state.transcriber_queue.set_property("max-size-time", 0u64);
state.internal_bin.add(&state.transcription_bin)?;
- state.textwrap.set_property("lines", 2u32).unwrap();
+ state.textwrap.set_property("lines", 2u32);
state.transcription_bin.set_locked_state(true);
@@ -208,8 +204,7 @@ impl TranscriberBin {
state
.cccombiner
- .set_property("latency", 100 * gst::ClockTime::MSECOND)
- .unwrap();
+ .set_property("latency", 100 * gst::ClockTime::MSECOND);
self.audio_sinkpad
.set_target(Some(&state.internal_bin.static_pad("audio_sink").unwrap()))?;
@@ -234,21 +229,18 @@ impl TranscriberBin {
s.set("framerate", &state.framerate.unwrap());
- state.cccapsfilter.set_property("caps", &cc_caps).unwrap();
+ state.cccapsfilter.set_property("caps", &cc_caps);
let max_size_time = settings.latency + settings.accumulate_time;
for queue in &[&state.audio_queue_passthrough, &state.video_queue] {
- queue.set_property("max-size-bytes", 0u32).unwrap();
- queue.set_property("max-size-buffers", 0u32).unwrap();
- queue.set_property("max-size-time", max_size_time).unwrap();
+ queue.set_property("max-size-bytes", 0u32);
+ queue.set_property("max-size-buffers", 0u32);
+ queue.set_property("max-size-time", max_size_time);
}
let latency_ms = settings.latency.mseconds() as u32;
- state
- .transcriber
- .set_property("latency", latency_ms)
- .unwrap();
+ state.transcriber.set_property("latency", latency_ms);
if !settings.passthrough {
let audio_tee_pad = state.audio_tee.request_pad_simple("src_%u").unwrap();
@@ -349,20 +341,16 @@ impl TranscriberBin {
gst_debug!(CAT, obj: element, "setting CC mode {:?}", mode);
- state.tttocea608.set_property("mode", mode).unwrap();
+ state.tttocea608.set_property("mode", mode);
if mode.is_rollup() {
- state
- .textwrap
- .set_property("accumulate-time", 0u64)
- .unwrap();
+ state.textwrap.set_property("accumulate-time", 0u64);
} else {
let accumulate_time = self.settings.lock().unwrap().accumulate_time;
state
.textwrap
- .set_property("accumulate-time", accumulate_time)
- .unwrap();
+ .set_property("accumulate-time", accumulate_time);
}
}
diff --git a/video/closedcaption/tests/ccdetect.rs b/video/closedcaption/tests/ccdetect.rs
index 2153ff05..c456f797 100644
--- a/video/closedcaption/tests/ccdetect.rs
+++ b/video/closedcaption/tests/ccdetect.rs
@@ -71,10 +71,7 @@ fn test_have_cc_data_notify() {
let mut h = gst_check::Harness::new("ccdetect");
h.set_src_caps_str("closedcaption/x-cea-708,format=cc_data");
h.set_sink_caps_str("closedcaption/x-cea-708,format=cc_data");
- h.element()
- .unwrap()
- .set_property("window", 500_000_000u64)
- .unwrap();
+ h.element().unwrap().set_property("window", 500_000_000u64);
let state = Arc::new(Mutex::new(NotifyState::default()));
let state_c = state.clone();
@@ -83,7 +80,7 @@ fn test_have_cc_data_notify() {
.connect_notify(Some("cc608"), move |o, _pspec| {
let mut state_guard = state_c.lock().unwrap();
state_guard.cc608_count += 1;
- o.property("cc608").unwrap();
+ o.property_value("cc608");
});
let state_c = state.clone();
h.element()
@@ -91,7 +88,7 @@ fn test_have_cc_data_notify() {
.connect_notify(Some("cc708"), move |o, _pspec| {
let mut state_guard = state_c.lock().unwrap();
state_guard.cc708_count += 1;
- o.property("cc708").unwrap();
+ o.property_value("cc708");
});
/* valid cc608 data moves cc608 property to true */
@@ -137,10 +134,7 @@ fn test_cc_data_window() {
let mut h = gst_check::Harness::new("ccdetect");
h.set_src_caps_str("closedcaption/x-cea-708,format=cc_data");
h.set_sink_caps_str("closedcaption/x-cea-708,format=cc_data");
- h.element()
- .unwrap()
- .set_property("window", 500_000_000u64)
- .unwrap();
+ h.element().unwrap().set_property("window", 500_000_000u64);
let state = Arc::new(Mutex::new(NotifyState::default()));
let state_c = state.clone();
@@ -236,10 +230,7 @@ fn test_have_cdp_notify() {
let mut h = gst_check::Harness::new("ccdetect");
h.set_src_caps_str("closedcaption/x-cea-708,format=cdp");
h.set_sink_caps_str("closedcaption/x-cea-708,format=cdp");
- h.element()
- .unwrap()
- .set_property("window", 500_000_000u64)
- .unwrap();
+ h.element().unwrap().set_property("window", 500_000_000u64);
let state = Arc::new(Mutex::new(NotifyState::default()));
let state_c = state.clone();
@@ -307,7 +298,7 @@ fn test_malformed_cdp_notify() {
let mut h = gst_check::Harness::new("ccdetect");
h.set_src_caps_str("closedcaption/x-cea-708,format=cdp");
h.set_sink_caps_str("closedcaption/x-cea-708,format=cdp");
- h.element().unwrap().set_property("window", 0u64).unwrap();
+ h.element().unwrap().set_property("window", 0u64);
let state = Arc::new(Mutex::new(NotifyState::default()));
let state_c = state.clone();
@@ -386,10 +377,7 @@ fn test_gap_events() {
let mut h = gst_check::Harness::new("ccdetect");
h.set_src_caps_str("closedcaption/x-cea-708,format=cc_data");
h.set_sink_caps_str("closedcaption/x-cea-708,format=cc_data");
- h.element()
- .unwrap()
- .set_property("window", 500_000_000u64)
- .unwrap();
+ h.element().unwrap().set_property("window", 500_000_000u64);
let state = Arc::new(Mutex::new(NotifyState::default()));
let state_c = state.clone();
diff --git a/video/closedcaption/tests/mcc_enc.rs b/video/closedcaption/tests/mcc_enc.rs
index 8712dad0..f3e8c30c 100644
--- a/video/closedcaption/tests/mcc_enc.rs
+++ b/video/closedcaption/tests/mcc_enc.rs
@@ -93,13 +93,11 @@ Time Code Rate=30DF\r\n\
let mut h = gst_check::Harness::new("mccenc");
{
let enc = h.element().expect("could not create encoder");
- enc.set_property("uuid", "14720C04-857D-40E2-86FC-F080DE44CE74")
- .unwrap();
+ enc.set_property("uuid", "14720C04-857D-40E2-86FC-F080DE44CE74");
enc.set_property(
"creation-date",
glib::DateTime::new_utc(2018, 12, 27, 17, 34, 47.0).unwrap(),
- )
- .unwrap();
+ );
}
h.set_src_caps_str(
diff --git a/video/gtk4/examples/gtksink.rs b/video/gtk4/examples/gtksink.rs
index 82985b9c..eba0c94d 100644
--- a/video/gtk4/examples/gtksink.rs
+++ b/video/gtk4/examples/gtksink.rs
@@ -10,14 +10,10 @@ fn create_ui(app: &gtk::Application) {
let src = gst::ElementFactory::make("videotestsrc", None).unwrap();
let overlay = gst::ElementFactory::make("clockoverlay", None).unwrap();
- overlay.set_property("font-desc", "Monospace 42").unwrap();
+ overlay.set_property("font-desc", "Monospace 42");
let sink = gst::ElementFactory::make("gtk4paintablesink", None).unwrap();
- let paintable = sink
- .property("paintable")
- .unwrap()
- .get::<gdk::Paintable>()
- .unwrap();
+ let paintable = sink.property::<gdk::Paintable>("paintable");
pipeline.add_many(&[&src, &overlay, &sink]).unwrap();
src.link_filtered(
diff --git a/video/rav1e/tests/rav1enc.rs b/video/rav1e/tests/rav1enc.rs
index 24cff4eb..04dec7d9 100644
--- a/video/rav1e/tests/rav1enc.rs
+++ b/video/rav1e/tests/rav1enc.rs
@@ -121,7 +121,7 @@ fn test_encode(video_info: &gst_video::VideoInfo) {
let mut h = gst_check::Harness::new("rav1enc");
{
let rav1enc = h.element().unwrap();
- rav1enc.set_property("speed-preset", 10u32).unwrap();
+ rav1enc.set_property("speed-preset", 10u32);
}
h.play();
h.set_src_caps(video_info.to_caps().unwrap());