Commit ec6dde85 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

Replace ulong for the property notify watches with a custom NotifyWatchId type

parent a1a841af
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
#[allow(unused_imports)]
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use ChildProxy;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use ClockTime;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use ffi;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use ClockTime;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use ffi;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use Caps;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use Bus;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use Bus;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use DeviceProvider;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use Bus;
......@@ -89,12 +89,6 @@ pub trait ElementExt {
fn add_pad<P: IsA<Pad>>(&self, pad: &P) -> Result<(), glib::error::BoolError>;
#[cfg(any(feature = "v1_10", feature = "dox"))]
fn add_property_deep_notify_watch<'a, P: Into<Option<&'a str>>>(&self, property_name: P, include_value: bool) -> libc::c_ulong;
#[cfg(any(feature = "v1_10", feature = "dox"))]
fn add_property_notify_watch<'a, P: Into<Option<&'a str>>>(&self, property_name: P, include_value: bool) -> libc::c_ulong;
//#[cfg(any(feature = "v1_10", feature = "dox"))]
//fn call_async<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: /*Unknown conversion*//*Unimplemented*/ElementCallAsyncFunc, user_data: P, destroy_notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify);
......@@ -222,24 +216,6 @@ impl<O: IsA<Element> + IsA<glib::object::Object>> ElementExt for O {
}
}
#[cfg(any(feature = "v1_10", feature = "dox"))]
fn add_property_deep_notify_watch<'a, P: Into<Option<&'a str>>>(&self, property_name: P, include_value: bool) -> libc::c_ulong {
let property_name = property_name.into();
let property_name = property_name.to_glib_none();
unsafe {
ffi::gst_element_add_property_deep_notify_watch(self.to_glib_none().0, property_name.0, include_value.to_glib())
}
}
#[cfg(any(feature = "v1_10", feature = "dox"))]
fn add_property_notify_watch<'a, P: Into<Option<&'a str>>>(&self, property_name: P, include_value: bool) -> libc::c_ulong {
let property_name = property_name.into();
let property_name = property_name.to_glib_none();
unsafe {
ffi::gst_element_add_property_notify_watch(self.to_glib_none().0, property_name.0, include_value.to_glib())
}
}
//#[cfg(any(feature = "v1_10", feature = "dox"))]
//fn call_async<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: /*Unknown conversion*//*Unimplemented*/ElementCallAsyncFunc, user_data: P, destroy_notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_element_call_async() }
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use Caps;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use ffi;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use ffi;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use Bin;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use Object;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
mod bin;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use ClockTime;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use Caps;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use Caps;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use Bin;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use Error;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use ffi;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use Object;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use Caps;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use Object;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use Clock;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use Element;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use Element;
......
// This file was generated by gir (0fe730d) from gir-files (???)
// This file was generated by gir (12a28ac) from gir-files (???)
// DO NOT EDIT
use Error;
......
......@@ -10,7 +10,8 @@ use Element;
use glib;
use glib::IsA;
use glib::translate::{from_glib, from_glib_full, from_glib_none, FromGlibPtrContainer, ToGlibPtr};
use glib::translate::{from_glib, from_glib_full, from_glib_none, FromGlib, FromGlibPtrContainer,
ToGlib, ToGlibPtr};
use QueryRef;
use Event;
use Pad;
......@@ -19,6 +20,8 @@ use miniobject::MiniObject;
use std::ffi::CStr;
use libc;
use ffi;
use gobject_ffi;
......@@ -56,6 +59,24 @@ pub enum ElementMessageType {
Info,
}
#[derive(Debug, Default, PartialEq, Eq)]
pub struct NotifyWatchId(libc::c_ulong);
impl ToGlib for NotifyWatchId {
type GlibType = libc::c_ulong;
fn to_glib(&self) -> libc::c_ulong {
self.0
}
}
impl FromGlib<libc::c_ulong> for NotifyWatchId {
fn from_glib(val: libc::c_ulong) -> NotifyWatchId {
skip_assert_initialized!();
NotifyWatchId(val)
}
}
pub trait ElementExtManual {
fn query(&self, query: &mut QueryRef) -> bool;
......@@ -96,6 +117,23 @@ pub trait ElementExtManual {
fn get_pads(&self) -> Vec<Pad>;
fn get_sink_pads(&self) -> Vec<Pad>;
fn get_src_pads(&self) -> Vec<Pad>;
#[cfg(any(feature = "v1_10", feature = "dox"))]
fn add_property_deep_notify_watch<'a, P: Into<Option<&'a str>>>(
&self,
property_name: P,
include_value: bool,
) -> NotifyWatchId;
#[cfg(any(feature = "v1_10", feature = "dox"))]
fn add_property_notify_watch<'a, P: Into<Option<&'a str>>>(
&self,
property_name: P,
include_value: bool,
) -> NotifyWatchId;
#[cfg(any(feature = "v1_10", feature = "dox"))]
fn remove_property_notify_watch(&self, watch_id: NotifyWatchId);
}
impl<O: IsA<Element>> ElementExtManual for O {
......@@ -258,6 +296,47 @@ impl<O: IsA<Element>> ElementExtManual for O {
FromGlibPtrContainer::from_glib_none(elt.srcpads)
}
}
#[cfg(any(feature = "v1_10", feature = "dox"))]
fn add_property_deep_notify_watch<'a, P: Into<Option<&'a str>>>(
&self,
property_name: P,
include_value: bool,
) -> NotifyWatchId {
let property_name = property_name.into();
let property_name = property_name.to_glib_none();
unsafe {
from_glib(ffi::gst_element_add_property_deep_notify_watch(
self.to_glib_none().0,
property_name.0,
include_value.to_glib(),
))
}
}
#[cfg(any(feature = "v1_10", feature = "dox"))]
fn add_property_notify_watch<'a, P: Into<Option<&'a str>>>(
&self,
property_name: P,
include_value: bool,
) -> NotifyWatchId {
let property_name = property_name.into();
let property_name = property_name.to_glib_none();
unsafe {
from_glib(ffi::gst_element_add_property_notify_watch(
self.to_glib_none().0,
property_name.0,
include_value.to_glib(),
))
}
}
#[cfg(any(feature = "v1_10", feature = "dox"))]
fn remove_property_notify_watch(&self, watch_id: NotifyWatchId) {
unsafe {
ffi::gst_element_remove_property_notify_watch(self.to_glib_none().0, watch_id.0);
}
}
}
lazy_static!{
......
......@@ -100,7 +100,7 @@ mod tag_setter;
mod iterator;
mod device_provider;
mod parse_context;
pub use element::{ElementExtManual, ElementMessageType};
pub use element::{ElementExtManual, ElementMessageType, NotifyWatchId};
pub use element::{ELEMENT_METADATA_AUTHOR, ELEMENT_METADATA_DESCRIPTION, ELEMENT_METADATA_DOC_URI,
ELEMENT_METADATA_ICON_NAME, ELEMENT_METADATA_KLASS, ELEMENT_METADATA_LONGNAME};
pub use bin::BinExtManual;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment