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)
|
2021-04-01 13:58:41 +00:00
|
|
|
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
2017-05-12 12:24:03 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
2020-11-21 13:46:33 +00:00
|
|
|
use crate::ClockTime;
|
|
|
|
use crate::ControlBinding;
|
2019-01-16 11:32:39 +00:00
|
|
|
use glib::object::Cast;
|
2017-05-12 12:24:03 +00:00
|
|
|
use glib::object::IsA;
|
2018-12-08 09:05:20 +00:00
|
|
|
use glib::signal::connect_raw;
|
2019-06-18 10:12:00 +00:00
|
|
|
use glib::signal::SignalHandlerId;
|
2017-05-12 12:24:03 +00:00
|
|
|
use glib::translate::*;
|
2017-08-18 13:29:21 +00:00
|
|
|
use std::boxed::Box as Box_;
|
2020-12-07 11:11:04 +00:00
|
|
|
use std::fmt;
|
2020-04-13 16:11:33 +00:00
|
|
|
use std::mem::transmute;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::wrapper! {
|
2021-06-02 07:47:51 +00:00
|
|
|
#[doc(alias = "GstObject")]
|
2020-11-21 13:46:33 +00:00
|
|
|
pub struct Object(Object<ffi::GstObject, ffi::GstObjectClass>);
|
2017-05-12 12:24:03 +00:00
|
|
|
|
|
|
|
match fn {
|
2021-04-19 19:55:01 +00:00
|
|
|
type_ => || ffi::gst_object_get_type(),
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Object {
|
2021-11-16 14:02:58 +00:00
|
|
|
pub const NONE: Option<&'static Object> = None;
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_object_check_uniqueness")]
|
2017-05-12 12:24:03 +00:00
|
|
|
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 {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib(ffi::gst_object_check_uniqueness(
|
2019-06-18 10:12:00 +00:00
|
|
|
list.to_glib_none().0,
|
|
|
|
name.to_glib_none().0,
|
|
|
|
))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
//#[doc(alias = "gst_object_default_deep_notify")]
|
2021-05-23 19:22:45 +00:00
|
|
|
//pub fn default_deep_notify(object: &impl IsA<glib::Object>, orig: &impl IsA<Object>, pspec: /*Ignored*/&glib::ParamSpec, excluded_props: &[&str]) {
|
2020-11-21 13:46:33 +00:00
|
|
|
// unsafe { TODO: call ffi:gst_object_default_deep_notify() }
|
2017-05-12 12:24:03 +00:00
|
|
|
//}
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
//#[doc(alias = "gst_object_replace")]
|
2021-05-23 19:22:45 +00:00
|
|
|
//pub fn replace(oldobj: Option<impl IsA<Object>>, newobj: Option<&impl IsA<Object>>) -> bool {
|
2020-11-21 13:46:33 +00:00
|
|
|
// unsafe { TODO: call ffi:gst_object_replace() }
|
2017-05-12 12:24:03 +00:00
|
|
|
//}
|
|
|
|
}
|
|
|
|
|
2020-12-07 11:11:04 +00:00
|
|
|
impl fmt::Display for Object {
|
|
|
|
#[inline]
|
|
|
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
2021-04-11 19:38:18 +00:00
|
|
|
f.write_str(&GstObjectExt::name(self))
|
2020-12-07 11:11:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-25 08:04:37 +00:00
|
|
|
unsafe impl Send for Object {}
|
|
|
|
unsafe impl Sync for Object {}
|
|
|
|
|
2018-12-08 09:05:20 +00:00
|
|
|
pub trait GstObjectExt: 'static {
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_object_add_control_binding")]
|
2021-05-23 19:22:45 +00:00
|
|
|
fn add_control_binding(
|
2020-06-09 01:06:49 +00:00
|
|
|
&self,
|
2021-05-23 19:22:45 +00:00
|
|
|
binding: &impl IsA<ControlBinding>,
|
2020-06-09 01:06:49 +00:00
|
|
|
) -> Result<(), glib::error::BoolError>;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_object_default_error")]
|
2019-11-10 16:55:02 +00:00
|
|
|
fn default_error(&self, error: &glib::Error, debug: Option<&str>);
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_object_get_control_binding")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_control_binding")]
|
2021-04-19 20:13:58 +00:00
|
|
|
fn control_binding(&self, property_name: &str) -> Option<ControlBinding>;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_object_get_control_rate")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_control_rate")]
|
2021-04-05 10:48:30 +00:00
|
|
|
fn control_rate(&self) -> Option<ClockTime>;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_object_get_name")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_name")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn name(&self) -> glib::GString;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_object_get_parent")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_parent")]
|
2022-01-04 18:02:58 +00:00
|
|
|
#[must_use]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn parent(&self) -> Option<Object>;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_object_get_path_string")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_path_string")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn path_string(&self) -> glib::GString;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_object_get_value")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_value")]
|
2021-04-05 10:48:30 +00:00
|
|
|
fn value(
|
|
|
|
&self,
|
|
|
|
property_name: &str,
|
|
|
|
timestamp: impl Into<Option<ClockTime>>,
|
|
|
|
) -> Option<glib::Value>;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
//#[doc(alias = "gst_object_get_value_array")]
|
2021-05-03 18:35:37 +00:00
|
|
|
//#[doc(alias = "get_value_array")]
|
2022-06-30 05:22:05 +00:00
|
|
|
//fn is_value_array(&self, property_name: &str, timestamp: impl Into<Option<ClockTime>>, interval: impl Into<Option<ClockTime>>, n_values: u32, values: /*Unimplemented*/Option<Basic: Pointer>) -> bool;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_object_has_active_control_bindings")]
|
2017-05-12 12:24:03 +00:00
|
|
|
fn has_active_control_bindings(&self) -> bool;
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_object_has_ancestor")]
|
2021-05-23 19:22:45 +00:00
|
|
|
fn has_ancestor(&self, ancestor: &impl IsA<Object>) -> bool;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_object_has_as_ancestor")]
|
2021-05-23 19:22:45 +00:00
|
|
|
fn has_as_ancestor(&self, ancestor: &impl IsA<Object>) -> bool;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_object_has_as_parent")]
|
2021-05-23 19:22:45 +00:00
|
|
|
fn has_as_parent(&self, parent: &impl IsA<Object>) -> bool;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_object_remove_control_binding")]
|
2021-05-23 19:22:45 +00:00
|
|
|
fn remove_control_binding(&self, binding: &impl IsA<ControlBinding>) -> bool;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_object_set_control_binding_disabled")]
|
2017-05-12 12:24:03 +00:00
|
|
|
fn set_control_binding_disabled(&self, property_name: &str, disabled: bool);
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_object_set_control_bindings_disabled")]
|
2017-05-12 12:24:03 +00:00
|
|
|
fn set_control_bindings_disabled(&self, disabled: bool);
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_object_set_control_rate")]
|
2021-04-05 10:48:30 +00:00
|
|
|
fn set_control_rate(&self, control_rate: impl Into<Option<ClockTime>>);
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_object_set_parent")]
|
2021-05-23 19:22:45 +00:00
|
|
|
fn set_parent(&self, parent: &impl IsA<Object>) -> Result<(), glib::error::BoolError>;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_object_suggest_next_sync")]
|
2021-04-05 10:48:30 +00:00
|
|
|
fn suggest_next_sync(&self) -> Option<ClockTime>;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_object_sync_values")]
|
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
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_object_unparent")]
|
2017-05-12 12:24:03 +00:00
|
|
|
fn unparent(&self);
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
//#[doc(alias = "deep-notify")]
|
2021-02-28 16:30:54 +00:00
|
|
|
//fn connect_deep_notify<Unsupported or ignored types>(&self, detail: Option<&str>, f: F) -> SignalHandlerId;
|
2017-08-18 13:29:21 +00:00
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "parent")]
|
|
|
|
fn connect_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 {
|
2021-05-23 19:22:45 +00:00
|
|
|
fn add_control_binding(
|
2020-06-09 01:06:49 +00:00
|
|
|
&self,
|
2021-05-23 19:22:45 +00:00
|
|
|
binding: &impl IsA<ControlBinding>,
|
2020-06-09 01:06:49 +00:00
|
|
|
) -> Result<(), glib::error::BoolError> {
|
|
|
|
unsafe {
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::result_from_gboolean!(
|
2020-11-21 13:46:33 +00:00
|
|
|
ffi::gst_object_add_control_binding(
|
2020-06-09 01:06:49 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
binding.as_ref().to_glib_none().0
|
|
|
|
),
|
|
|
|
"Failed to add control binding"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2019-11-10 16:55:02 +00:00
|
|
|
fn default_error(&self, error: &glib::Error, debug: Option<&str>) {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
ffi::gst_object_default_error(
|
2019-06-18 10:12:00 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-19 20:13:58 +00:00
|
|
|
fn control_binding(&self, property_name: &str) -> Option<ControlBinding> {
|
2020-06-09 01:06:49 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib_full(ffi::gst_object_get_control_binding(
|
2020-06-09 01:06:49 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
property_name.to_glib_none().0,
|
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2021-04-05 10:48:30 +00:00
|
|
|
fn control_rate(&self) -> Option<ClockTime> {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib(ffi::gst_object_get_control_rate(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn name(&self) -> glib::GString {
|
2020-11-21 13:46:33 +00:00
|
|
|
unsafe { from_glib_full(ffi::gst_object_get_name(self.as_ref().to_glib_none().0)) }
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn parent(&self) -> Option<Object> {
|
2020-11-21 13:46:33 +00:00
|
|
|
unsafe { from_glib_full(ffi::gst_object_get_parent(self.as_ref().to_glib_none().0)) }
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn path_string(&self) -> glib::GString {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib_full(ffi::gst_object_get_path_string(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-05 10:48:30 +00:00
|
|
|
fn value(
|
|
|
|
&self,
|
|
|
|
property_name: &str,
|
|
|
|
timestamp: impl Into<Option<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_object_get_value(
|
2020-06-09 01:06:49 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
property_name.to_glib_none().0,
|
2021-04-05 10:48:30 +00:00
|
|
|
timestamp.into().into_glib(),
|
2020-06-09 01:06:49 +00:00
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2022-06-30 05:22:05 +00:00
|
|
|
//fn is_value_array(&self, property_name: &str, timestamp: impl Into<Option<ClockTime>>, interval: impl Into<Option<ClockTime>>, n_values: u32, values: /*Unimplemented*/Option<Basic: Pointer>) -> bool {
|
2020-11-21 13:46:33 +00:00
|
|
|
// unsafe { TODO: call ffi:gst_object_get_value_array() }
|
2017-05-12 12:24:03 +00:00
|
|
|
//}
|
|
|
|
|
|
|
|
fn has_active_control_bindings(&self) -> bool {
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib(ffi::gst_object_has_active_control_bindings(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-23 19:22:45 +00:00
|
|
|
fn has_ancestor(&self, ancestor: &impl IsA<Object>) -> bool {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib(ffi::gst_object_has_ancestor(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
ancestor.as_ref().to_glib_none().0,
|
|
|
|
))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-23 19:22:45 +00:00
|
|
|
fn has_as_ancestor(&self, ancestor: &impl IsA<Object>) -> bool {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib(ffi::gst_object_has_as_ancestor(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
ancestor.as_ref().to_glib_none().0,
|
|
|
|
))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-23 19:22:45 +00:00
|
|
|
fn has_as_parent(&self, parent: &impl IsA<Object>) -> bool {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib(ffi::gst_object_has_as_parent(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
parent.as_ref().to_glib_none().0,
|
|
|
|
))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-23 19:22:45 +00:00
|
|
|
fn remove_control_binding(&self, binding: &impl IsA<ControlBinding>) -> bool {
|
2020-06-09 01:06:49 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib(ffi::gst_object_remove_control_binding(
|
2020-06-09 01:06:49 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
binding.as_ref().to_glib_none().0,
|
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
|
|
|
|
fn set_control_binding_disabled(&self, property_name: &str, disabled: bool) {
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
ffi::gst_object_set_control_binding_disabled(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
property_name.to_glib_none().0,
|
2021-04-27 15:10:39 +00:00
|
|
|
disabled.into_glib(),
|
2019-06-18 10:12:00 +00:00
|
|
|
);
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn set_control_bindings_disabled(&self, disabled: bool) {
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
ffi::gst_object_set_control_bindings_disabled(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
2021-04-27 15:10:39 +00:00
|
|
|
disabled.into_glib(),
|
2019-06-18 10:12:00 +00:00
|
|
|
);
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-05 10:48:30 +00:00
|
|
|
fn set_control_rate(&self, control_rate: impl Into<Option<ClockTime>>) {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
ffi::gst_object_set_control_rate(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
2021-04-05 10:48:30 +00:00
|
|
|
control_rate.into().into_glib(),
|
2019-06-18 10:12:00 +00:00
|
|
|
);
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-23 19:22:45 +00:00
|
|
|
fn set_parent(&self, parent: &impl IsA<Object>) -> Result<(), glib::error::BoolError> {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::result_from_gboolean!(
|
2020-11-21 13:46:33 +00:00
|
|
|
ffi::gst_object_set_parent(
|
2019-06-18 10:12:00 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-05 10:48:30 +00:00
|
|
|
fn suggest_next_sync(&self) -> Option<ClockTime> {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib(ffi::gst_object_suggest_next_sync(
|
2019-06-18 10:12:00 +00:00
|
|
|
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 {
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::result_from_gboolean!(
|
2021-04-27 15:10:39 +00:00
|
|
|
ffi::gst_object_sync_values(self.as_ref().to_glib_none().0, timestamp.into_glib()),
|
2019-06-18 10:12:00 +00:00
|
|
|
"Failed to sync values"
|
|
|
|
)
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn unparent(&self) {
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
ffi::gst_object_unparent(self.as_ref().to_glib_none().0);
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-28 16:30:54 +00:00
|
|
|
//fn connect_deep_notify<Unsupported or ignored types>(&self, detail: Option<&str>, f: F) -> SignalHandlerId {
|
2017-05-12 12:24:03 +00:00
|
|
|
// Ignored prop: GObject.ParamSpec
|
|
|
|
//}
|
2017-08-18 13:29:21 +00:00
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
fn connect_parent_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
2021-05-26 22:02:42 +00:00
|
|
|
unsafe extern "C" fn notify_parent_trampoline<
|
|
|
|
P: IsA<Object>,
|
|
|
|
F: Fn(&P) + Send + Sync + 'static,
|
|
|
|
>(
|
2020-11-21 13:46:33 +00:00
|
|
|
this: *mut ffi::GstObject,
|
|
|
|
_param_spec: glib::ffi::gpointer,
|
|
|
|
f: glib::ffi::gpointer,
|
2021-05-26 22:02:42 +00:00
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
2021-06-21 21:07:45 +00:00
|
|
|
f(Object::from_glib_borrow(this).unsafe_cast_ref())
|
2019-06-18 10:10:46 +00:00
|
|
|
}
|
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-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::parent\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_parent_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2017-08-18 13:29:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|