mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-22 09:31:06 +00:00
Remove various property bindings for properties that have getters/setters
This commit is contained in:
parent
80265967f7
commit
29f20ebe13
6 changed files with 52 additions and 136 deletions
49
Gir_Gst.toml
49
Gir_Gst.toml
|
@ -39,10 +39,8 @@ generate = [
|
|||
"Gst.URIError",
|
||||
"Gst.StructureChangeType",
|
||||
"Gst.StreamStatusType",
|
||||
"Gst.DeviceMonitor",
|
||||
"Gst.DeviceProvider",
|
||||
"Gst.DeviceProviderFactory",
|
||||
"Gst.StreamCollection",
|
||||
"Gst.StreamType",
|
||||
"Gst.StreamFlags",
|
||||
"Gst.PadLinkReturn",
|
||||
|
@ -215,6 +213,24 @@ status = "generate"
|
|||
# Caps is not a GObject
|
||||
ignore = true
|
||||
|
||||
[[object.property]]
|
||||
name = "device-class"
|
||||
# Has getter/setter functions
|
||||
ignore = true
|
||||
|
||||
[[object.property]]
|
||||
name = "display-name"
|
||||
# Has getter/setter functions
|
||||
ignore = true
|
||||
|
||||
[[object]]
|
||||
name = "Gst.DeviceMonitor"
|
||||
status = "generate"
|
||||
|
||||
[[object.property]]
|
||||
name = "show-all"
|
||||
# Has getter/setter functions
|
||||
ignore = true
|
||||
|
||||
[[object]]
|
||||
name = "Gst.Object"
|
||||
|
@ -302,6 +318,11 @@ status = "generate"
|
|||
# Buffer can be NULL
|
||||
ignore = true
|
||||
|
||||
[[object.property]]
|
||||
name = "template"
|
||||
# Has getter/setter functions
|
||||
ignore = true
|
||||
|
||||
[[object]]
|
||||
name = "Gst.Stream"
|
||||
status = "generate"
|
||||
|
@ -316,6 +337,30 @@ status = "generate"
|
|||
# TagList is not a GObject
|
||||
ignore = true
|
||||
|
||||
[[object.property]]
|
||||
name = "stream-flags"
|
||||
# Has setter/getter functions
|
||||
ignore = true
|
||||
|
||||
[[object.property]]
|
||||
name = "stream-id"
|
||||
# Has setter/getter functions
|
||||
ignore = true
|
||||
|
||||
[[object.property]]
|
||||
name = "stream-type"
|
||||
# Has setter/getter functions
|
||||
ignore = true
|
||||
|
||||
[[object]]
|
||||
name = "Gst.StreamCollection"
|
||||
status = "generate"
|
||||
|
||||
[[object.property]]
|
||||
name = "upstream-id"
|
||||
# Has setter/getter functions
|
||||
ignore = true
|
||||
|
||||
[[object]]
|
||||
name = "Gst.Plugin"
|
||||
status = "generate"
|
||||
|
|
|
@ -7,7 +7,6 @@ use Object;
|
|||
use Structure;
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::Value;
|
||||
use glib::object::Downcast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::connect;
|
||||
|
@ -47,10 +46,6 @@ pub trait DeviceExt {
|
|||
|
||||
fn reconfigure_element<P: IsA<Element>>(&self, element: &P) -> bool;
|
||||
|
||||
fn get_property_device_class(&self) -> Option<String>;
|
||||
|
||||
fn get_property_display_name(&self) -> Option<String>;
|
||||
|
||||
fn connect_removed<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> u64;
|
||||
}
|
||||
|
||||
|
@ -105,22 +100,6 @@ impl<O: IsA<Device> + IsA<glib::object::Object>> DeviceExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
fn get_property_device_class(&self) -> Option<String> {
|
||||
let mut value = Value::from(None::<&str>);
|
||||
unsafe {
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "device-class".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
}
|
||||
value.get()
|
||||
}
|
||||
|
||||
fn get_property_display_name(&self) -> Option<String> {
|
||||
let mut value = Value::from(None::<&str>);
|
||||
unsafe {
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "display-name".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
}
|
||||
value.get()
|
||||
}
|
||||
|
||||
fn connect_removed<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> u64 {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
||||
|
|
|
@ -6,8 +6,6 @@ use Caps;
|
|||
use Device;
|
||||
use Object;
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::Value;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
|
@ -53,13 +51,9 @@ pub trait DeviceMonitorExt {
|
|||
fn start(&self) -> bool;
|
||||
|
||||
fn stop(&self);
|
||||
|
||||
fn get_property_show_all(&self) -> bool;
|
||||
|
||||
fn set_property_show_all(&self, show_all: bool);
|
||||
}
|
||||
|
||||
impl<O: IsA<DeviceMonitor> + IsA<glib::object::Object>> DeviceMonitorExt for O {
|
||||
impl<O: IsA<DeviceMonitor>> DeviceMonitorExt for O {
|
||||
fn add_filter<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b Caps>>>(&self, classes: P, caps: Q) -> u32 {
|
||||
let classes = classes.into();
|
||||
let classes = classes.to_glib_none();
|
||||
|
@ -117,18 +111,4 @@ impl<O: IsA<DeviceMonitor> + IsA<glib::object::Object>> DeviceMonitorExt for O {
|
|||
ffi::gst_device_monitor_stop(self.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_show_all(&self) -> bool {
|
||||
let mut value = Value::from(&false);
|
||||
unsafe {
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "show-all".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
}
|
||||
value.get().unwrap()
|
||||
}
|
||||
|
||||
fn set_property_show_all(&self, show_all: bool) {
|
||||
unsafe {
|
||||
gobject_ffi::g_object_set_property(self.to_glib_none().0, "show-all".to_glib_none().0, Value::from(&show_all).to_glib_none().0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@ use PadTemplate;
|
|||
use Stream;
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::Value;
|
||||
use glib::object::Downcast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::connect;
|
||||
|
@ -224,10 +223,6 @@ pub trait PadExt {
|
|||
|
||||
fn use_fixed_caps(&self);
|
||||
|
||||
fn get_property_template(&self) -> Option<PadTemplate>;
|
||||
|
||||
fn set_property_template(&self, template: Option<&PadTemplate>);
|
||||
|
||||
fn connect_linked<F: Fn(&Self, &Pad) + Send + Sync + 'static>(&self, f: F) -> u64;
|
||||
|
||||
fn connect_unlinked<F: Fn(&Self, &Pad) + Send + Sync + 'static>(&self, f: F) -> u64;
|
||||
|
@ -638,20 +633,6 @@ impl<O: IsA<Pad> + IsA<glib::object::Object>> PadExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
fn get_property_template(&self) -> Option<PadTemplate> {
|
||||
let mut value = Value::from(None::<&PadTemplate>);
|
||||
unsafe {
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "template".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
}
|
||||
value.get()
|
||||
}
|
||||
|
||||
fn set_property_template(&self, template: Option<&PadTemplate>) {
|
||||
unsafe {
|
||||
gobject_ffi::g_object_set_property(self.to_glib_none().0, "template".to_glib_none().0, Value::from(template).to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_linked<F: Fn(&Self, &Pad) + Send + Sync + 'static>(&self, f: F) -> u64 {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, &Pad) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
||||
|
|
|
@ -4,19 +4,18 @@
|
|||
#[cfg(feature = "v1_10")]
|
||||
use Caps;
|
||||
use Object;
|
||||
#[cfg(feature = "v1_10")]
|
||||
use StreamFlags;
|
||||
#[cfg(feature = "v1_10")]
|
||||
use StreamType;
|
||||
#[cfg(feature = "v1_10")]
|
||||
use TagList;
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::Value;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::mem;
|
||||
use std::mem::transmute;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
|
@ -71,19 +70,9 @@ pub trait StreamExt {
|
|||
|
||||
#[cfg(feature = "v1_10")]
|
||||
fn set_tags<'a, P: Into<Option<&'a TagList>>>(&self, tags: P);
|
||||
|
||||
fn get_property_stream_flags(&self) -> StreamFlags;
|
||||
|
||||
fn set_property_stream_flags(&self, stream_flags: StreamFlags);
|
||||
|
||||
fn get_property_stream_id(&self) -> Option<String>;
|
||||
|
||||
fn get_property_stream_type(&self) -> StreamType;
|
||||
|
||||
fn set_property_stream_type(&self, stream_type: StreamType);
|
||||
}
|
||||
|
||||
impl<O: IsA<Stream> + IsA<glib::object::Object>> StreamExt for O {
|
||||
impl<O: IsA<Stream>> StreamExt for O {
|
||||
#[cfg(feature = "v1_10")]
|
||||
fn get_caps(&self) -> Option<Caps> {
|
||||
unsafe {
|
||||
|
@ -150,42 +139,4 @@ impl<O: IsA<Stream> + IsA<glib::object::Object>> StreamExt for O {
|
|||
ffi::gst_stream_set_tags(self.to_glib_none().0, tags.0);
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_stream_flags(&self) -> StreamFlags {
|
||||
let mut value = Value::from(&0u32);
|
||||
unsafe {
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "stream-flags".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
from_glib(transmute(value.get::<u32>().unwrap()))
|
||||
}
|
||||
}
|
||||
|
||||
fn set_property_stream_flags(&self, stream_flags: StreamFlags) {
|
||||
let stream_flags = stream_flags.to_glib().bits() as u32;
|
||||
unsafe {
|
||||
gobject_ffi::g_object_set_property(self.to_glib_none().0, "stream-flags".to_glib_none().0, Value::from(&stream_flags).to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_stream_id(&self) -> Option<String> {
|
||||
let mut value = Value::from(None::<&str>);
|
||||
unsafe {
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "stream-id".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
}
|
||||
value.get()
|
||||
}
|
||||
|
||||
fn get_property_stream_type(&self) -> StreamType {
|
||||
let mut value = Value::from(&0u32);
|
||||
unsafe {
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "stream-type".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
from_glib(transmute(value.get::<u32>().unwrap()))
|
||||
}
|
||||
}
|
||||
|
||||
fn set_property_stream_type(&self, stream_type: StreamType) {
|
||||
let stream_type = stream_type.to_glib().bits() as u32;
|
||||
unsafe {
|
||||
gobject_ffi::g_object_set_property(self.to_glib_none().0, "stream-type".to_glib_none().0, Value::from(&stream_type).to_glib_none().0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,8 +5,6 @@ use Object;
|
|||
#[cfg(feature = "v1_10")]
|
||||
use Stream;
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::Value;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
|
@ -50,14 +48,10 @@ pub trait StreamCollectionExt {
|
|||
#[cfg(feature = "v1_10")]
|
||||
fn get_upstream_id(&self) -> Option<String>;
|
||||
|
||||
fn get_property_upstream_id(&self) -> Option<String>;
|
||||
|
||||
fn set_property_upstream_id(&self, upstream_id: Option<&str>);
|
||||
|
||||
//fn connect_stream_notify<Unsupported or ignored types>(&self, f: F) -> u64;
|
||||
}
|
||||
|
||||
impl<O: IsA<StreamCollection> + IsA<glib::object::Object>> StreamCollectionExt for O {
|
||||
impl<O: IsA<StreamCollection>> StreamCollectionExt for O {
|
||||
#[cfg(feature = "v1_10")]
|
||||
fn add_stream(&self, stream: &Stream) -> bool {
|
||||
unsafe {
|
||||
|
@ -86,20 +80,6 @@ impl<O: IsA<StreamCollection> + IsA<glib::object::Object>> StreamCollectionExt f
|
|||
}
|
||||
}
|
||||
|
||||
fn get_property_upstream_id(&self) -> Option<String> {
|
||||
let mut value = Value::from(None::<&str>);
|
||||
unsafe {
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "upstream-id".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
}
|
||||
value.get()
|
||||
}
|
||||
|
||||
fn set_property_upstream_id(&self, upstream_id: Option<&str>) {
|
||||
unsafe {
|
||||
gobject_ffi::g_object_set_property(self.to_glib_none().0, "upstream-id".to_glib_none().0, Value::from(upstream_id).to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
//fn connect_stream_notify<Unsupported or ignored types>(&self, f: F) -> u64 {
|
||||
// Ignored p0: GObject.ParamSpec
|
||||
//}
|
||||
|
|
Loading…
Reference in a new issue