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