gstreamer-rs/gstreamer/src/auto/control_binding.rs

113 lines
3.5 KiB
Rust
Raw Normal View History

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)
// 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 glib::StaticType;
2020-12-17 22:34:53 +00:00
glib::wrapper! {
#[doc(alias = "GstControlBinding")]
2020-11-21 13:46:33 +00:00
pub struct ControlBinding(Object<ffi::GstControlBinding, ffi::GstControlBindingClass>) @extends Object;
2020-06-09 01:06:49 +00:00
match fn {
type_ => || ffi::gst_control_binding_get_type(),
2020-06-09 01:06:49 +00:00
}
}
unsafe impl Send for ControlBinding {}
unsafe impl Sync for ControlBinding {}
pub const NONE_CONTROL_BINDING: Option<&ControlBinding> = None;
pub trait ControlBindingExt: 'static {
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_control_binding_get_value")]
#[doc(alias = "get_value")]
2021-04-19 20:13:58 +00:00
fn value(&self, timestamp: ClockTime) -> Option<glib::Value>;
2020-06-09 01:06:49 +00:00
2020-12-08 13:00:17 +00:00
//#[doc(alias = "gst_control_binding_get_value_array")]
//#[doc(alias = "get_value_array")]
//fn is_value_array(&self, timestamp: impl Into<Option<ClockTime>>, interval: impl Into<Option<ClockTime>>, values: /*Unimplemented*/&[&Fundamental: Pointer]) -> bool;
2020-06-09 01:06:49 +00:00
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_control_binding_is_disabled")]
2020-06-09 01:06:49 +00:00
fn is_disabled(&self) -> bool;
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_control_binding_set_disabled")]
2020-06-09 01:06:49 +00:00
fn set_disabled(&self, disabled: bool);
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_control_binding_sync_values")]
fn sync_values(
2020-06-09 01:06:49 +00:00
&self,
object: &impl IsA<Object>,
2020-06-09 01:06:49 +00:00
timestamp: ClockTime,
last_sync: impl Into<Option<ClockTime>>,
2020-06-09 01:06:49 +00:00
) -> bool;
2021-04-11 19:38:18 +00:00
fn object(&self) -> Option<Object>;
2020-06-09 01:06:49 +00:00
}
impl<O: IsA<ControlBinding>> ControlBindingExt for O {
2021-04-19 20:13:58 +00:00
fn value(&self, timestamp: ClockTime) -> Option<glib::Value> {
2020-06-09 01:06:49 +00:00
unsafe {
2020-11-21 13:46:33 +00:00
from_glib_full(ffi::gst_control_binding_get_value(
2020-06-09 01:06:49 +00:00
self.as_ref().to_glib_none().0,
timestamp.into_glib(),
2020-06-09 01:06:49 +00:00
))
}
}
//fn is_value_array(&self, timestamp: impl Into<Option<ClockTime>>, interval: impl Into<Option<ClockTime>>, values: /*Unimplemented*/&[&Fundamental: Pointer]) -> bool {
2020-11-21 13:46:33 +00:00
// unsafe { TODO: call ffi:gst_control_binding_get_value_array() }
2020-06-09 01:06:49 +00:00
//}
fn is_disabled(&self) -> bool {
unsafe {
2020-11-21 13:46:33 +00:00
from_glib(ffi::gst_control_binding_is_disabled(
2020-06-09 01:06:49 +00:00
self.as_ref().to_glib_none().0,
))
}
}
fn set_disabled(&self, disabled: bool) {
unsafe {
2020-11-21 13:46:33 +00:00
ffi::gst_control_binding_set_disabled(
2020-06-09 01:06:49 +00:00
self.as_ref().to_glib_none().0,
disabled.into_glib(),
2020-06-09 01:06:49 +00:00
);
}
}
fn sync_values(
2020-06-09 01:06:49 +00:00
&self,
object: &impl IsA<Object>,
2020-06-09 01:06:49 +00:00
timestamp: ClockTime,
last_sync: impl Into<Option<ClockTime>>,
2020-06-09 01:06:49 +00:00
) -> bool {
unsafe {
2020-11-21 13:46:33 +00:00
from_glib(ffi::gst_control_binding_sync_values(
2020-06-09 01:06:49 +00:00
self.as_ref().to_glib_none().0,
object.as_ref().to_glib_none().0,
timestamp.into_glib(),
last_sync.into().into_glib(),
2020-06-09 01:06:49 +00:00
))
}
}
2021-04-11 19:38:18 +00:00
fn object(&self) -> Option<Object> {
2020-06-09 01:06:49 +00:00
unsafe {
2020-11-27 13:37:24 +00:00
let mut value = glib::Value::from_type(<Object as StaticType>::static_type());
2020-11-21 13:46:33 +00:00
glib::gobject_ffi::g_object_get_property(
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
2020-06-09 01:06:49 +00:00
b"object\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `object` getter")
}
}
}