diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2021-04-25 15:41:22 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2021-04-25 15:48:55 +0300 |
commit | 15cf738616fac8390ff1bac144f6fac49148b47d (patch) | |
tree | d0b5b35c187d053cd49d0c0aa5bba8a149de4b5e /generic/threadshare/src/appsrc/imp.rs | |
parent | 40765f7c53237e798565f9568caed7f4a4d6373c (diff) |
Update for Value trait refactoring
Diffstat (limited to 'generic/threadshare/src/appsrc/imp.rs')
-rw-r--r-- | generic/threadshare/src/appsrc/imp.rs | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/generic/threadshare/src/appsrc/imp.rs b/generic/threadshare/src/appsrc/imp.rs index 56c717945..bba794f95 100644 --- a/generic/threadshare/src/appsrc/imp.rs +++ b/generic/threadshare/src/appsrc/imp.rs @@ -584,14 +584,8 @@ impl ObjectImpl for AppSrc { ) .action() .class_handler(|_, args| { - let element = args[0] - .get::<super::AppSrc>() - .expect("signal arg") - .expect("missing signal arg"); - let buffer = args[1] - .get::<gst::Buffer>() - .expect("signal arg") - .expect("missing signal arg"); + let element = args[0].get::<super::AppSrc>().expect("signal arg"); + let buffer = args[1].get::<gst::Buffer>().expect("signal arg"); let appsrc = AppSrc::from_instance(&element); Some(appsrc.push_buffer(&element, buffer).to_value()) @@ -600,10 +594,7 @@ impl ObjectImpl for AppSrc { glib::subclass::Signal::builder("end-of-stream", &[], bool::static_type().into()) .action() .class_handler(|_, args| { - let element = args[0] - .get::<super::AppSrc>() - .expect("signal arg") - .expect("missing signal arg"); + let element = args[0].get::<super::AppSrc>().expect("signal arg"); let appsrc = AppSrc::from_instance(&element); Some(appsrc.end_of_stream(&element).to_value()) @@ -626,21 +617,21 @@ impl ObjectImpl for AppSrc { match pspec.name() { "context" => { settings.context = value - .get() + .get::<Option<String>>() .expect("type checked upstream") .unwrap_or_else(|| "".into()); } "context-wait" => { - settings.context_wait = value.get_some().expect("type checked upstream"); + settings.context_wait = value.get().expect("type checked upstream"); } "caps" => { settings.caps = value.get().expect("type checked upstream"); } "max-buffers" => { - settings.max_buffers = value.get_some().expect("type checked upstream"); + settings.max_buffers = value.get().expect("type checked upstream"); } "do-timestamp" => { - settings.do_timestamp = value.get_some().expect("type checked upstream"); + settings.do_timestamp = value.get().expect("type checked upstream"); } _ => unimplemented!(), } |