2020-12-15 10:53:31 +00:00
|
|
|
// Take a look at the license at the top of the repository in the LICENSE file.
|
|
|
|
|
2020-06-09 01:06:49 +00:00
|
|
|
use glib::translate::*;
|
|
|
|
|
2020-12-17 22:38:06 +00:00
|
|
|
glib::wrapper! {
|
2020-06-09 01:06:49 +00:00
|
|
|
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
2021-06-01 13:15:59 +00:00
|
|
|
#[doc(alias = "GstControlPoint")]
|
2020-11-21 18:50:21 +00:00
|
|
|
pub struct ControlPoint(Boxed<ffi::GstControlPoint>);
|
2020-06-09 01:06:49 +00:00
|
|
|
|
|
|
|
match fn {
|
2020-11-21 18:50:21 +00:00
|
|
|
copy => |ptr| ffi::gst_control_point_copy(mut_override(ptr)),
|
|
|
|
free => |ptr| ffi::gst_control_point_free(ptr),
|
2021-04-14 20:30:38 +00:00
|
|
|
type_ => || ffi::gst_control_point_get_type(),
|
2020-06-09 01:06:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ControlPoint {
|
|
|
|
pub fn timestamp(&self) -> gst::ClockTime {
|
|
|
|
unsafe {
|
|
|
|
let ptr = self.to_glib_none().0;
|
2021-04-28 22:29:13 +00:00
|
|
|
try_from_glib((*ptr).timestamp).expect("undefined timestamp")
|
2020-06-09 01:06:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn value(&self) -> f64 {
|
|
|
|
unsafe {
|
|
|
|
let ptr = self.to_glib_none().0;
|
|
|
|
(*ptr).value
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe impl Send for ControlPoint {}
|
|
|
|
unsafe impl Sync for ControlPoint {}
|