diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2022-10-22 19:06:29 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2022-10-22 19:50:24 +0300 |
commit | f058a5e2296d69456dae9a2960af79be7becfaa3 (patch) | |
tree | 3b46cc2a541b557e6b493f7b9aa36c13ff529139 /video | |
parent | f3546819edd26042f9d853a7f1ff7d24771f61a6 (diff) |
Various minor cleanups
Diffstat (limited to 'video')
-rw-r--r-- | video/cdg/tests/cdgdec.rs | 10 | ||||
-rw-r--r-- | video/closedcaption/src/transcriberbin/imp.rs | 4 | ||||
-rw-r--r-- | video/gtk4/examples/gtksink.rs | 2 | ||||
-rw-r--r-- | video/videofx/tests/colordetect.rs | 2 | ||||
-rw-r--r-- | video/videofx/tests/videocompare.rs | 6 |
5 files changed, 12 insertions, 12 deletions
diff --git a/video/cdg/tests/cdgdec.rs b/video/cdg/tests/cdgdec.rs index b5e071183..7810883b3 100644 --- a/video/cdg/tests/cdgdec.rs +++ b/video/cdg/tests/cdgdec.rs @@ -25,7 +25,7 @@ fn init() { fn test_cdgdec() { init(); - let pipeline = gst::Pipeline::new(Some("cdgdec-test")); + let pipeline = gst::Pipeline::builder().name("cdgdec-test").build(); let input_path = { let mut r = PathBuf::new(); @@ -50,14 +50,14 @@ fn test_cdgdec() { let parse = gst::ElementFactory::make("cdgparse").build().unwrap(); let dec = gst::ElementFactory::make("cdgdec").build().unwrap(); - let sink = gst::ElementFactory::make("appsink").build().unwrap(); + let sink = gst_app::AppSink::builder().build(); pipeline - .add_many(&[&filesrc, &parse, &dec, &sink]) + .add_many(&[&filesrc, &parse, &dec, sink.upcast_ref()]) .expect("failed to add elements to the pipeline"); - gst::Element::link_many(&[&filesrc, &parse, &dec, &sink]).expect("failed to link the elements"); + gst::Element::link_many(&[&filesrc, &parse, &dec, sink.upcast_ref()]) + .expect("failed to link the elements"); - let sink = sink.downcast::<gst_app::AppSink>().unwrap(); sink.set_callbacks( gst_app::AppSinkCallbacks::builder() // Add a handler to the "new-sample" signal. diff --git a/video/closedcaption/src/transcriberbin/imp.rs b/video/closedcaption/src/transcriberbin/imp.rs index 5e2636acc..ef8852c77 100644 --- a/video/closedcaption/src/transcriberbin/imp.rs +++ b/video/closedcaption/src/transcriberbin/imp.rs @@ -442,8 +442,8 @@ impl TranscriberBin { } fn build_state(&self) -> Result<State, Error> { - let internal_bin = gst::Bin::new(Some("internal")); - let transcription_bin = gst::Bin::new(Some("transcription-bin")); + let internal_bin = gst::Bin::builder().name("internal").build(); + let transcription_bin = gst::Bin::builder().name("transcription-bin").build(); let audio_tee = gst::ElementFactory::make("tee") // Protect passthrough enable (and resulting dynamic reconfigure) // from non-streaming thread diff --git a/video/gtk4/examples/gtksink.rs b/video/gtk4/examples/gtksink.rs index 0899d4802..ee2b4e2f9 100644 --- a/video/gtk4/examples/gtksink.rs +++ b/video/gtk4/examples/gtksink.rs @@ -6,7 +6,7 @@ use gtk::{gdk, gio, glib}; use std::cell::RefCell; fn create_ui(app: >k::Application) { - let pipeline = gst::Pipeline::new(None); + let pipeline = gst::Pipeline::default(); let src = gst::ElementFactory::make("videotestsrc").build().unwrap(); let overlay = gst::ElementFactory::make("clockoverlay") diff --git a/video/videofx/tests/colordetect.rs b/video/videofx/tests/colordetect.rs index 6b355ea4a..96cea95d2 100644 --- a/video/videofx/tests/colordetect.rs +++ b/video/videofx/tests/colordetect.rs @@ -21,7 +21,7 @@ fn init() { #[test] fn test_red_color() { init(); - let pipeline = gst::Pipeline::new(None); + let pipeline = gst::Pipeline::default(); let src = gst::ElementFactory::make("videotestsrc") .property_from_str("pattern", "red") diff --git a/video/videofx/tests/videocompare.rs b/video/videofx/tests/videocompare.rs index cc1ab724b..ee4ec40ed 100644 --- a/video/videofx/tests/videocompare.rs +++ b/video/videofx/tests/videocompare.rs @@ -60,7 +60,7 @@ fn test_can_find_similar_frames() { let max_distance = 0.0f64; - let pipeline = gst::Pipeline::new(None); + let pipeline = gst::Pipeline::default(); setup_pipeline( &pipeline, "red", @@ -106,7 +106,7 @@ fn test_can_find_similar_frames() { fn test_do_not_send_message_when_image_not_found() { init(); - let pipeline = gst::Pipeline::new(None); + let pipeline = gst::Pipeline::default(); setup_pipeline(&pipeline, "snow", "red", 0f64, HashAlgorithm::Blockhash); pipeline.set_state(gst::State::Playing).unwrap(); @@ -145,7 +145,7 @@ fn test_use_dssim_to_find_similar_frames() { let max_distance = 0.0f64; - let pipeline = gst::Pipeline::new(None); + let pipeline = gst::Pipeline::default(); setup_pipeline(&pipeline, "red", "red", max_distance, HashAlgorithm::Dssim); pipeline.set_state(gst::State::Playing).unwrap(); |