2020-06-09 01:06:49 +00:00
|
|
|
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
|
|
|
// from gir-files (https://github.com/gtk-rs/gir-files)
|
2021-04-01 13:58:41 +00:00
|
|
|
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
2020-06-09 01:06:49 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
2020-11-21 13:46:33 +00:00
|
|
|
use crate::ClockTime;
|
|
|
|
use crate::Object;
|
2020-06-09 01:06:49 +00:00
|
|
|
use glib::object::IsA;
|
|
|
|
use glib::translate::*;
|
|
|
|
use std::mem;
|
|
|
|
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::wrapper! {
|
2021-06-02 07:47:51 +00:00
|
|
|
#[doc(alias = "GstControlSource")]
|
2020-11-21 13:46:33 +00:00
|
|
|
pub struct ControlSource(Object<ffi::GstControlSource, ffi::GstControlSourceClass>) @extends Object;
|
2020-06-09 01:06:49 +00:00
|
|
|
|
|
|
|
match fn {
|
2021-04-19 19:55:01 +00:00
|
|
|
type_ => || ffi::gst_control_source_get_type(),
|
2020-06-09 01:06:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe impl Send for ControlSource {}
|
|
|
|
unsafe impl Sync for ControlSource {}
|
|
|
|
|
|
|
|
pub const NONE_CONTROL_SOURCE: Option<&ControlSource> = None;
|
|
|
|
|
|
|
|
pub trait ControlSourceExt: 'static {
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_control_source_get_value")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "control_source_get_value")]
|
|
|
|
fn value(&self, timestamp: ClockTime) -> Option<f64>;
|
2020-06-09 01:06:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl<O: IsA<ControlSource>> ControlSourceExt for O {
|
2021-05-03 18:35:37 +00:00
|
|
|
fn value(&self, timestamp: ClockTime) -> Option<f64> {
|
2020-06-09 01:06:49 +00:00
|
|
|
unsafe {
|
|
|
|
let mut value = mem::MaybeUninit::uninit();
|
2020-11-21 13:46:33 +00:00
|
|
|
let ret = from_glib(ffi::gst_control_source_get_value(
|
2020-06-09 01:06:49 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
2021-04-27 15:10:39 +00:00
|
|
|
timestamp.into_glib(),
|
2020-06-09 01:06:49 +00:00
|
|
|
value.as_mut_ptr(),
|
|
|
|
));
|
|
|
|
let value = value.assume_init();
|
|
|
|
if ret {
|
|
|
|
Some(value)
|
|
|
|
} else {
|
|
|
|
None
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|