1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
4// DO NOT EDIT
5
6use crate::{ClockTime, Object};
7use glib::{prelude::*, translate::*};
8use std::mem;
9
10glib::wrapper! {
11 #[doc(alias = "GstControlSource")]
12 pub struct ControlSource(Object<ffi::GstControlSource, ffi::GstControlSourceClass>) @extends Object;
13
14 match fn {
15 type_ => || ffi::gst_control_source_get_type(),
16 }
17}
18
19impl ControlSource {
20 pub const NONE: Option<&'static ControlSource> = None;
21}
22
23unsafe impl Send for ControlSource {}
24unsafe impl Sync for ControlSource {}
25
26mod sealed {
27 pub trait Sealed {}
28 impl<T: super::IsA<super::ControlSource>> Sealed for T {}
29}
30
31pub trait ControlSourceExt: IsA<ControlSource> + sealed::Sealed + 'static {
32 #[doc(alias = "gst_control_source_get_value")]
33 #[doc(alias = "control_source_get_value")]
34 fn value(&self, timestamp: ClockTime) -> Option<f64> {
35 unsafe {
36 let mut value: MaybeUninit = mem::MaybeUninit::uninit();
37 let ret: bool = from_glib(val:ffi::gst_control_source_get_value(
38 self.as_ref().to_glib_none().0,
39 timestamp:timestamp.into_glib(),
40 value:value.as_mut_ptr(),
41 ));
42 if ret {
43 Some(value.assume_init())
44 } else {
45 None
46 }
47 }
48 }
49}
50
51impl<O: IsA<ControlSource>> ControlSourceExt for O {}
52