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

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivia Nikolaidou <vivia@ahiru.eu>2022-08-18 15:04:15 +0300
committerVivia Nikolaidou <vivia@ahiru.eu>2022-08-22 17:58:43 +0300
commit560611134588f63270a569e92160ecac5ceabc37 (patch)
treeac5f4447c55c1e5dd4d8f15f92c335c36aa5bab8 /video/closedcaption/src/ccdetect/imp.rs
parent84f6484140098826b3f074d806e0eb052198df43 (diff)
plugins: Simplify code using ParamSpecBuilder
Diffstat (limited to 'video/closedcaption/src/ccdetect/imp.rs')
-rw-r--r--video/closedcaption/src/ccdetect/imp.rs42
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(),
]
});