diff options
author | Vivia Nikolaidou <vivia@ahiru.eu> | 2022-08-18 15:04:15 +0300 |
---|---|---|
committer | Vivia Nikolaidou <vivia@ahiru.eu> | 2022-08-22 17:58:43 +0300 |
commit | 560611134588f63270a569e92160ecac5ceabc37 (patch) | |
tree | ac5f4447c55c1e5dd4d8f15f92c335c36aa5bab8 /video/closedcaption/src/ccdetect/imp.rs | |
parent | 84f6484140098826b3f074d806e0eb052198df43 (diff) |
plugins: Simplify code using ParamSpecBuilder
Diffstat (limited to 'video/closedcaption/src/ccdetect/imp.rs')
-rw-r--r-- | video/closedcaption/src/ccdetect/imp.rs | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/video/closedcaption/src/ccdetect/imp.rs b/video/closedcaption/src/ccdetect/imp.rs index 8e5baa1d9..e2b1f6150 100644 --- a/video/closedcaption/src/ccdetect/imp.rs +++ b/video/closedcaption/src/ccdetect/imp.rs @@ -218,29 +218,25 @@ impl ObjectImpl for CCDetect { fn properties() -> &'static [glib::ParamSpec] { static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { vec![ - glib::ParamSpecUInt64::new( - "window", - "Window", - "Window of time (in ns) to determine if captions exist in the stream", - 0, - u64::MAX - 1, - DEFAULT_WINDOW.nseconds(), - glib::ParamFlags::READWRITE | gst::PARAM_FLAG_MUTABLE_PLAYING, - ), - glib::ParamSpecBoolean::new( - "cc608", - "cc608", - "Whether CEA608 captions (CC1/CC3) have been detected", - DEFAULT_CC608, - glib::ParamFlags::READABLE, - ), - glib::ParamSpecBoolean::new( - "cc708", - "cc608", - "Whether CEA708 captions (cc_data) have been detected", - DEFAULT_CC708, - glib::ParamFlags::READABLE, - ), + glib::ParamSpecUInt64::builder("window") + .nick("Window") + .blurb("Window of time (in ns) to determine if captions exist in the stream") + .maximum(u64::MAX - 1) + .default_value(DEFAULT_WINDOW.nseconds()) + .mutable_playing() + .build(), + glib::ParamSpecBoolean::builder("cc608") + .nick("cc608") + .blurb("Whether CEA608 captions (CC1/CC3) have been detected") + .default_value(DEFAULT_CC608) + .read_only() + .build(), + glib::ParamSpecBoolean::builder("cc708") + .nick("cc608") + .blurb("Whether CEA708 captions (cc_data) have been detected") + .default_value(DEFAULT_CC708) + .read_only() + .build(), ] }); |