2018-04-23 17:34:22 +00:00
|
|
|
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
|
|
|
// from gir-files (https://github.com/gtk-rs/gir-files)
|
2017-05-12 12:24:03 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
|
|
|
use ClockTime;
|
|
|
|
use Error;
|
|
|
|
use ffi;
|
2017-06-24 09:02:24 +00:00
|
|
|
use glib;
|
2018-12-09 16:06:12 +00:00
|
|
|
use glib::GString;
|
2019-01-16 11:32:39 +00:00
|
|
|
use glib::object::Cast;
|
2017-05-12 12:24:03 +00:00
|
|
|
use glib::object::IsA;
|
2017-09-09 13:01:32 +00:00
|
|
|
use glib::signal::SignalHandlerId;
|
2018-12-08 09:05:20 +00:00
|
|
|
use glib::signal::connect_raw;
|
2017-05-12 12:24:03 +00:00
|
|
|
use glib::translate::*;
|
2017-07-19 18:41:25 +00:00
|
|
|
use glib_ffi;
|
2017-08-18 13:29:21 +00:00
|
|
|
use std::boxed::Box as Box_;
|
|
|
|
use std::mem::transmute;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
|
|
|
glib_wrapper! {
|
2019-01-16 11:32:39 +00:00
|
|
|
pub struct Object(Object<ffi::GstObject, ffi::GstObjectClass, ObjectClass>);
|
2017-05-12 12:24:03 +00:00
|
|
|
|
|
|
|
match fn {
|
|
|
|
get_type => || ffi::gst_object_get_type(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Object {
|
|
|
|
pub fn check_uniqueness(list: &[Object], name: &str) -> bool {
|
2017-07-10 09:36:15 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
|
|
|
from_glib(ffi::gst_object_check_uniqueness(list.to_glib_none().0, name.to_glib_none().0))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-29 13:53:44 +00:00
|
|
|
//pub fn default_deep_notify<P: IsA<glib::Object>, Q: IsA<Object>>(object: &P, orig: &Q, pspec: /*Ignored*/&glib::ParamSpec, excluded_props: &[&str]) {
|
2017-05-12 12:24:03 +00:00
|
|
|
// unsafe { TODO: call ffi::gst_object_default_deep_notify() }
|
|
|
|
//}
|
|
|
|
|
2019-01-29 13:53:44 +00:00
|
|
|
//pub fn ref_sink(object: /*Unimplemented*/Option<Fundamental: Pointer>) -> /*Unimplemented*/Option<Fundamental: Pointer> {
|
2017-05-12 12:24:03 +00:00
|
|
|
// unsafe { TODO: call ffi::gst_object_ref_sink() }
|
|
|
|
//}
|
|
|
|
|
|
|
|
//pub fn replace<'a, 'b, P: IsA<Object> + 'a, Q: Into<Option<&'a P>>, R: IsA<Object> + 'b, S: Into<Option<&'b R>>>(oldobj: Q, newobj: S) -> bool {
|
|
|
|
// unsafe { TODO: call ffi::gst_object_replace() }
|
|
|
|
//}
|
|
|
|
}
|
|
|
|
|
2017-06-25 08:04:37 +00:00
|
|
|
unsafe impl Send for Object {}
|
|
|
|
unsafe impl Sync for Object {}
|
|
|
|
|
2019-01-16 11:32:39 +00:00
|
|
|
pub const NONE_OBJECT: Option<&Object> = None;
|
|
|
|
|
2018-12-08 09:05:20 +00:00
|
|
|
pub trait GstObjectExt: 'static {
|
2019-01-29 13:53:44 +00:00
|
|
|
//fn add_control_binding(&self, binding: /*Ignored*/&ControlBinding) -> bool;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
|
|
|
fn default_error<'a, P: Into<Option<&'a str>>>(&self, error: &Error, debug: P);
|
|
|
|
|
|
|
|
//fn get_control_binding(&self, property_name: &str) -> /*Ignored*/Option<ControlBinding>;
|
|
|
|
|
|
|
|
fn get_control_rate(&self) -> ClockTime;
|
|
|
|
|
2017-06-25 08:16:36 +00:00
|
|
|
//fn get_g_value_array(&self, property_name: &str, timestamp: ClockTime, interval: ClockTime, values: /*Ignored*/&[&glib::Value]) -> bool;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2018-12-09 16:06:12 +00:00
|
|
|
fn get_name(&self) -> GString;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
|
|
|
fn get_parent(&self) -> Option<Object>;
|
|
|
|
|
2018-12-09 16:06:12 +00:00
|
|
|
fn get_path_string(&self) -> GString;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
|
|
|
//fn get_value(&self, property_name: &str, timestamp: ClockTime) -> /*Ignored*/Option<glib::Value>;
|
|
|
|
|
2019-01-29 13:53:44 +00:00
|
|
|
//fn get_value_array(&self, property_name: &str, timestamp: ClockTime, interval: ClockTime, n_values: u32, values: /*Unimplemented*/Option<Fundamental: Pointer>) -> bool;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
|
|
|
fn has_active_control_bindings(&self) -> bool;
|
|
|
|
|
|
|
|
fn has_ancestor<P: IsA<Object>>(&self, ancestor: &P) -> bool;
|
|
|
|
|
|
|
|
fn has_as_ancestor<P: IsA<Object>>(&self, ancestor: &P) -> bool;
|
|
|
|
|
|
|
|
fn has_as_parent<P: IsA<Object>>(&self, parent: &P) -> bool;
|
|
|
|
|
2019-01-29 13:53:44 +00:00
|
|
|
//fn remove_control_binding(&self, binding: /*Ignored*/&ControlBinding) -> bool;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
|
|
|
fn set_control_binding_disabled(&self, property_name: &str, disabled: bool);
|
|
|
|
|
|
|
|
fn set_control_bindings_disabled(&self, disabled: bool);
|
|
|
|
|
|
|
|
fn set_control_rate(&self, control_rate: ClockTime);
|
|
|
|
|
2017-12-20 16:31:08 +00:00
|
|
|
fn set_name(&self, name: &str) -> Result<(), glib::error::BoolError>;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2017-06-24 09:02:24 +00:00
|
|
|
fn set_parent<P: IsA<Object>>(&self, parent: &P) -> Result<(), glib::error::BoolError>;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
|
|
|
fn suggest_next_sync(&self) -> ClockTime;
|
|
|
|
|
2017-06-24 09:02:24 +00:00
|
|
|
fn sync_values(&self, timestamp: ClockTime) -> Result<(), glib::error::BoolError>;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
|
|
|
fn unparent(&self);
|
|
|
|
|
2017-09-09 13:01:32 +00:00
|
|
|
//fn connect_deep_notify<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
|
2017-08-18 13:29:21 +00:00
|
|
|
|
2017-09-09 13:01:32 +00:00
|
|
|
fn connect_property_name_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
|
2017-08-18 13:29:21 +00:00
|
|
|
|
2017-09-09 13:01:32 +00:00
|
|
|
fn connect_property_parent_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 09:05:20 +00:00
|
|
|
impl<O: IsA<Object>> GstObjectExt for O {
|
2019-01-29 13:53:44 +00:00
|
|
|
//fn add_control_binding(&self, binding: /*Ignored*/&ControlBinding) -> bool {
|
2017-05-12 12:24:03 +00:00
|
|
|
// unsafe { TODO: call ffi::gst_object_add_control_binding() }
|
|
|
|
//}
|
|
|
|
|
|
|
|
fn default_error<'a, P: Into<Option<&'a str>>>(&self, error: &Error, debug: P) {
|
|
|
|
let debug = debug.into();
|
|
|
|
unsafe {
|
2019-01-16 11:32:39 +00:00
|
|
|
ffi::gst_object_default_error(self.as_ref().to_glib_none().0, error.to_glib_none().0, debug.to_glib_none().0);
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//fn get_control_binding(&self, property_name: &str) -> /*Ignored*/Option<ControlBinding> {
|
|
|
|
// unsafe { TODO: call ffi::gst_object_get_control_binding() }
|
|
|
|
//}
|
|
|
|
|
|
|
|
fn get_control_rate(&self) -> ClockTime {
|
|
|
|
unsafe {
|
2019-01-16 11:32:39 +00:00
|
|
|
from_glib(ffi::gst_object_get_control_rate(self.as_ref().to_glib_none().0))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-25 08:16:36 +00:00
|
|
|
//fn get_g_value_array(&self, property_name: &str, timestamp: ClockTime, interval: ClockTime, values: /*Ignored*/&[&glib::Value]) -> bool {
|
2017-05-12 12:24:03 +00:00
|
|
|
// unsafe { TODO: call ffi::gst_object_get_g_value_array() }
|
|
|
|
//}
|
|
|
|
|
2018-12-09 16:06:12 +00:00
|
|
|
fn get_name(&self) -> GString {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2019-01-16 11:32:39 +00:00
|
|
|
from_glib_full(ffi::gst_object_get_name(self.as_ref().to_glib_none().0))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn get_parent(&self) -> Option<Object> {
|
|
|
|
unsafe {
|
2019-01-16 11:32:39 +00:00
|
|
|
from_glib_full(ffi::gst_object_get_parent(self.as_ref().to_glib_none().0))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-09 16:06:12 +00:00
|
|
|
fn get_path_string(&self) -> GString {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2019-01-16 11:32:39 +00:00
|
|
|
from_glib_full(ffi::gst_object_get_path_string(self.as_ref().to_glib_none().0))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//fn get_value(&self, property_name: &str, timestamp: ClockTime) -> /*Ignored*/Option<glib::Value> {
|
|
|
|
// unsafe { TODO: call ffi::gst_object_get_value() }
|
|
|
|
//}
|
|
|
|
|
2019-01-29 13:53:44 +00:00
|
|
|
//fn get_value_array(&self, property_name: &str, timestamp: ClockTime, interval: ClockTime, n_values: u32, values: /*Unimplemented*/Option<Fundamental: Pointer>) -> bool {
|
2017-05-12 12:24:03 +00:00
|
|
|
// unsafe { TODO: call ffi::gst_object_get_value_array() }
|
|
|
|
//}
|
|
|
|
|
|
|
|
fn has_active_control_bindings(&self) -> bool {
|
|
|
|
unsafe {
|
2019-01-16 11:32:39 +00:00
|
|
|
from_glib(ffi::gst_object_has_active_control_bindings(self.as_ref().to_glib_none().0))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn has_ancestor<P: IsA<Object>>(&self, ancestor: &P) -> bool {
|
|
|
|
unsafe {
|
2019-01-16 11:32:39 +00:00
|
|
|
from_glib(ffi::gst_object_has_ancestor(self.as_ref().to_glib_none().0, ancestor.as_ref().to_glib_none().0))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn has_as_ancestor<P: IsA<Object>>(&self, ancestor: &P) -> bool {
|
|
|
|
unsafe {
|
2019-01-16 11:32:39 +00:00
|
|
|
from_glib(ffi::gst_object_has_as_ancestor(self.as_ref().to_glib_none().0, ancestor.as_ref().to_glib_none().0))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn has_as_parent<P: IsA<Object>>(&self, parent: &P) -> bool {
|
|
|
|
unsafe {
|
2019-01-16 11:32:39 +00:00
|
|
|
from_glib(ffi::gst_object_has_as_parent(self.as_ref().to_glib_none().0, parent.as_ref().to_glib_none().0))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-29 13:53:44 +00:00
|
|
|
//fn remove_control_binding(&self, binding: /*Ignored*/&ControlBinding) -> bool {
|
2017-05-12 12:24:03 +00:00
|
|
|
// unsafe { TODO: call ffi::gst_object_remove_control_binding() }
|
|
|
|
//}
|
|
|
|
|
|
|
|
fn set_control_binding_disabled(&self, property_name: &str, disabled: bool) {
|
|
|
|
unsafe {
|
2019-01-16 11:32:39 +00:00
|
|
|
ffi::gst_object_set_control_binding_disabled(self.as_ref().to_glib_none().0, property_name.to_glib_none().0, disabled.to_glib());
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn set_control_bindings_disabled(&self, disabled: bool) {
|
|
|
|
unsafe {
|
2019-01-16 11:32:39 +00:00
|
|
|
ffi::gst_object_set_control_bindings_disabled(self.as_ref().to_glib_none().0, disabled.to_glib());
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn set_control_rate(&self, control_rate: ClockTime) {
|
|
|
|
unsafe {
|
2019-01-16 11:32:39 +00:00
|
|
|
ffi::gst_object_set_control_rate(self.as_ref().to_glib_none().0, control_rate.to_glib());
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-20 16:31:08 +00:00
|
|
|
fn set_name(&self, name: &str) -> Result<(), glib::error::BoolError> {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2019-01-16 11:32:39 +00:00
|
|
|
glib_result_from_gboolean!(ffi::gst_object_set_name(self.as_ref().to_glib_none().0, name.to_glib_none().0), "Failed to set object name")
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-24 09:02:24 +00:00
|
|
|
fn set_parent<P: IsA<Object>>(&self, parent: &P) -> Result<(), glib::error::BoolError> {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2019-01-16 11:32:39 +00:00
|
|
|
glib_result_from_gboolean!(ffi::gst_object_set_parent(self.as_ref().to_glib_none().0, parent.as_ref().to_glib_none().0), "Failed to set parent object")
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn suggest_next_sync(&self) -> ClockTime {
|
|
|
|
unsafe {
|
2019-01-16 11:32:39 +00:00
|
|
|
from_glib(ffi::gst_object_suggest_next_sync(self.as_ref().to_glib_none().0))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-24 09:02:24 +00:00
|
|
|
fn sync_values(&self, timestamp: ClockTime) -> Result<(), glib::error::BoolError> {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2019-01-16 11:32:39 +00:00
|
|
|
glib_result_from_gboolean!(ffi::gst_object_sync_values(self.as_ref().to_glib_none().0, timestamp.to_glib()), "Failed to sync values")
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn unparent(&self) {
|
|
|
|
unsafe {
|
2019-01-16 11:32:39 +00:00
|
|
|
ffi::gst_object_unparent(self.as_ref().to_glib_none().0);
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-09-09 13:01:32 +00:00
|
|
|
//fn connect_deep_notify<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
|
2017-05-12 12:24:03 +00:00
|
|
|
// Ignored prop: GObject.ParamSpec
|
|
|
|
//}
|
2017-08-18 13:29:21 +00:00
|
|
|
|
2017-09-09 13:01:32 +00:00
|
|
|
fn connect_property_name_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
2017-08-18 13:29:21 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-01-16 11:32:39 +00:00
|
|
|
connect_raw(self.as_ptr() as *mut _, b"notify::name\0".as_ptr() as *const _,
|
2019-01-29 13:53:44 +00:00
|
|
|
Some(transmute(notify_name_trampoline::<Self, F> as usize)), Box_::into_raw(f))
|
2017-08-18 13:29:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-09-09 13:01:32 +00:00
|
|
|
fn connect_property_parent_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
2017-08-18 13:29:21 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-01-16 11:32:39 +00:00
|
|
|
connect_raw(self.as_ptr() as *mut _, b"notify::parent\0".as_ptr() as *const _,
|
2019-01-29 13:53:44 +00:00
|
|
|
Some(transmute(notify_parent_trampoline::<Self, F> as usize)), Box_::into_raw(f))
|
2017-08-18 13:29:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-29 13:53:44 +00:00
|
|
|
unsafe extern "C" fn notify_name_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstObject, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
2017-08-18 13:29:21 +00:00
|
|
|
where P: IsA<Object> {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: &F = transmute(f);
|
2019-01-16 11:32:39 +00:00
|
|
|
f(&Object::from_glib_borrow(this).unsafe_cast())
|
2017-08-18 13:29:21 +00:00
|
|
|
}
|
|
|
|
|
2019-01-29 13:53:44 +00:00
|
|
|
unsafe extern "C" fn notify_parent_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut ffi::GstObject, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
|
2017-08-18 13:29:21 +00:00
|
|
|
where P: IsA<Object> {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: &F = transmute(f);
|
2019-01-16 11:32:39 +00:00
|
|
|
f(&Object::from_glib_borrow(this).unsafe_cast())
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|