Run rustfmt also over all the generated code

This commit is contained in:
Sebastian Dröge 2019-06-18 13:12:00 +03:00
parent e5aa6f59f9
commit b87ffa17bb
175 changed files with 13469 additions and 4587 deletions

View file

@ -2,12 +2,12 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib::object::ObjectType as ObjectType_;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::Value;
use glib::object::ObjectType as ObjectType_;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::translate::*;
use glib_sys;
use gobject_sys;
use gst;
@ -28,62 +28,63 @@ impl AppSink {
#[cfg(any(feature = "v1_12", feature = "dox"))]
pub fn get_buffer_list_support(&self) -> bool {
unsafe {
from_glib(gst_app_sys::gst_app_sink_get_buffer_list_support(self.to_glib_none().0))
from_glib(gst_app_sys::gst_app_sink_get_buffer_list_support(
self.to_glib_none().0,
))
}
}
pub fn get_caps(&self) -> Option<gst::Caps> {
unsafe {
from_glib_full(gst_app_sys::gst_app_sink_get_caps(self.to_glib_none().0))
}
unsafe { from_glib_full(gst_app_sys::gst_app_sink_get_caps(self.to_glib_none().0)) }
}
pub fn get_drop(&self) -> bool {
unsafe {
from_glib(gst_app_sys::gst_app_sink_get_drop(self.to_glib_none().0))
}
unsafe { from_glib(gst_app_sys::gst_app_sink_get_drop(self.to_glib_none().0)) }
}
pub fn get_emit_signals(&self) -> bool {
unsafe {
from_glib(gst_app_sys::gst_app_sink_get_emit_signals(self.to_glib_none().0))
from_glib(gst_app_sys::gst_app_sink_get_emit_signals(
self.to_glib_none().0,
))
}
}
pub fn get_max_buffers(&self) -> u32 {
unsafe {
gst_app_sys::gst_app_sink_get_max_buffers(self.to_glib_none().0)
}
unsafe { gst_app_sys::gst_app_sink_get_max_buffers(self.to_glib_none().0) }
}
pub fn get_wait_on_eos(&self) -> bool {
unsafe {
from_glib(gst_app_sys::gst_app_sink_get_wait_on_eos(self.to_glib_none().0))
from_glib(gst_app_sys::gst_app_sink_get_wait_on_eos(
self.to_glib_none().0,
))
}
}
pub fn is_eos(&self) -> bool {
unsafe {
from_glib(gst_app_sys::gst_app_sink_is_eos(self.to_glib_none().0))
}
unsafe { from_glib(gst_app_sys::gst_app_sink_is_eos(self.to_glib_none().0)) }
}
pub fn pull_preroll(&self) -> Option<gst::Sample> {
unsafe {
from_glib_full(gst_app_sys::gst_app_sink_pull_preroll(self.to_glib_none().0))
from_glib_full(gst_app_sys::gst_app_sink_pull_preroll(
self.to_glib_none().0,
))
}
}
pub fn pull_sample(&self) -> Option<gst::Sample> {
unsafe {
from_glib_full(gst_app_sys::gst_app_sink_pull_sample(self.to_glib_none().0))
}
unsafe { from_glib_full(gst_app_sys::gst_app_sink_pull_sample(self.to_glib_none().0)) }
}
#[cfg(any(feature = "v1_12", feature = "dox"))]
pub fn set_buffer_list_support(&self, enable_lists: bool) {
unsafe {
gst_app_sys::gst_app_sink_set_buffer_list_support(self.to_glib_none().0, enable_lists.to_glib());
gst_app_sys::gst_app_sink_set_buffer_list_support(
self.to_glib_none().0,
enable_lists.to_glib(),
);
}
}
@ -124,132 +125,242 @@ impl AppSink {
#[cfg(any(feature = "v1_10", feature = "dox"))]
pub fn try_pull_preroll(&self, timeout: gst::ClockTime) -> Option<gst::Sample> {
unsafe {
from_glib_full(gst_app_sys::gst_app_sink_try_pull_preroll(self.to_glib_none().0, timeout.to_glib()))
from_glib_full(gst_app_sys::gst_app_sink_try_pull_preroll(
self.to_glib_none().0,
timeout.to_glib(),
))
}
}
#[cfg(any(feature = "v1_10", feature = "dox"))]
pub fn try_pull_sample(&self, timeout: gst::ClockTime) -> Option<gst::Sample> {
unsafe {
from_glib_full(gst_app_sys::gst_app_sink_try_pull_sample(self.to_glib_none().0, timeout.to_glib()))
from_glib_full(gst_app_sys::gst_app_sink_try_pull_sample(
self.to_glib_none().0,
timeout.to_glib(),
))
}
}
pub fn get_property_buffer_list(&self) -> bool {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"buffer-list\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"buffer-list\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
pub fn set_property_buffer_list(&self, buffer_list: bool) {
unsafe {
gobject_sys::g_object_set_property(self.as_ptr() as *mut gobject_sys::GObject, b"buffer-list\0".as_ptr() as *const _, Value::from(&buffer_list).to_glib_none().0);
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"buffer-list\0".as_ptr() as *const _,
Value::from(&buffer_list).to_glib_none().0,
);
}
}
pub fn get_property_eos(&self) -> bool {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"eos\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"eos\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
pub fn connect_eos<F: Fn(&AppSink) + Send + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn eos_trampoline<F: Fn(&AppSink) + Send + 'static>(this: *mut gst_app_sys::GstAppSink, f: glib_sys::gpointer) {
unsafe extern "C" fn eos_trampoline<F: Fn(&AppSink) + Send + 'static>(
this: *mut gst_app_sys::GstAppSink,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"eos\0".as_ptr() as *const _,
Some(transmute(eos_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"eos\0".as_ptr() as *const _,
Some(transmute(eos_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_buffer_list_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_buffer_list_trampoline<F: Fn(&AppSink) + Send + Sync + 'static>(this: *mut gst_app_sys::GstAppSink, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_buffer_list_notify<F: Fn(&AppSink) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_buffer_list_trampoline<
F: Fn(&AppSink) + Send + Sync + 'static,
>(
this: *mut gst_app_sys::GstAppSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::buffer-list\0".as_ptr() as *const _,
Some(transmute(notify_buffer_list_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::buffer-list\0".as_ptr() as *const _,
Some(transmute(notify_buffer_list_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_caps_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_caps_trampoline<F: Fn(&AppSink) + Send + Sync + 'static>(this: *mut gst_app_sys::GstAppSink, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_caps_notify<F: Fn(&AppSink) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_caps_trampoline<F: Fn(&AppSink) + Send + Sync + 'static>(
this: *mut gst_app_sys::GstAppSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::caps\0".as_ptr() as *const _,
Some(transmute(notify_caps_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::caps\0".as_ptr() as *const _,
Some(transmute(notify_caps_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_drop_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_drop_trampoline<F: Fn(&AppSink) + Send + Sync + 'static>(this: *mut gst_app_sys::GstAppSink, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_drop_notify<F: Fn(&AppSink) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_drop_trampoline<F: Fn(&AppSink) + Send + Sync + 'static>(
this: *mut gst_app_sys::GstAppSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::drop\0".as_ptr() as *const _,
Some(transmute(notify_drop_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::drop\0".as_ptr() as *const _,
Some(transmute(notify_drop_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_emit_signals_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_emit_signals_trampoline<F: Fn(&AppSink) + Send + Sync + 'static>(this: *mut gst_app_sys::GstAppSink, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_emit_signals_notify<F: Fn(&AppSink) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_emit_signals_trampoline<
F: Fn(&AppSink) + Send + Sync + 'static,
>(
this: *mut gst_app_sys::GstAppSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::emit-signals\0".as_ptr() as *const _,
Some(transmute(notify_emit_signals_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::emit-signals\0".as_ptr() as *const _,
Some(transmute(notify_emit_signals_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_eos_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_eos_trampoline<F: Fn(&AppSink) + Send + Sync + 'static>(this: *mut gst_app_sys::GstAppSink, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_eos_notify<F: Fn(&AppSink) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_eos_trampoline<F: Fn(&AppSink) + Send + Sync + 'static>(
this: *mut gst_app_sys::GstAppSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::eos\0".as_ptr() as *const _,
Some(transmute(notify_eos_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::eos\0".as_ptr() as *const _,
Some(transmute(notify_eos_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_max_buffers_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_max_buffers_trampoline<F: Fn(&AppSink) + Send + Sync + 'static>(this: *mut gst_app_sys::GstAppSink, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_max_buffers_notify<F: Fn(&AppSink) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_max_buffers_trampoline<
F: Fn(&AppSink) + Send + Sync + 'static,
>(
this: *mut gst_app_sys::GstAppSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::max-buffers\0".as_ptr() as *const _,
Some(transmute(notify_max_buffers_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::max-buffers\0".as_ptr() as *const _,
Some(transmute(notify_max_buffers_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_wait_on_eos_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_wait_on_eos_trampoline<F: Fn(&AppSink) + Send + Sync + 'static>(this: *mut gst_app_sys::GstAppSink, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_wait_on_eos_notify<F: Fn(&AppSink) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_wait_on_eos_trampoline<
F: Fn(&AppSink) + Send + Sync + 'static,
>(
this: *mut gst_app_sys::GstAppSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::wait-on-eos\0".as_ptr() as *const _,
Some(transmute(notify_wait_on_eos_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::wait-on-eos\0".as_ptr() as *const _,
Some(transmute(notify_wait_on_eos_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
}

View file

@ -2,13 +2,12 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use AppStreamType;
use glib::object::ObjectType as ObjectType_;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::Value;
use glib::object::ObjectType as ObjectType_;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::translate::*;
use glib_sys;
use gobject_sys;
use gst;
@ -17,6 +16,7 @@ use gst_base;
use libc;
use std::boxed::Box as Box_;
use std::mem::transmute;
use AppStreamType;
glib_wrapper! {
pub struct AppSrc(Object<gst_app_sys::GstAppSrc, gst_app_sys::GstAppSrcClass, AppSrcClass>) @extends gst_base::BaseSrc, gst::Element, gst::Object, @implements gst::URIHandler;
@ -28,45 +28,39 @@ glib_wrapper! {
impl AppSrc {
pub fn get_caps(&self) -> Option<gst::Caps> {
unsafe {
from_glib_full(gst_app_sys::gst_app_src_get_caps(self.to_glib_none().0))
}
unsafe { from_glib_full(gst_app_sys::gst_app_src_get_caps(self.to_glib_none().0)) }
}
pub fn get_current_level_bytes(&self) -> u64 {
unsafe {
gst_app_sys::gst_app_src_get_current_level_bytes(self.to_glib_none().0)
}
unsafe { gst_app_sys::gst_app_src_get_current_level_bytes(self.to_glib_none().0) }
}
#[cfg(any(feature = "v1_10", feature = "dox"))]
pub fn get_duration(&self) -> gst::ClockTime {
unsafe {
from_glib(gst_app_sys::gst_app_src_get_duration(self.to_glib_none().0))
}
unsafe { from_glib(gst_app_sys::gst_app_src_get_duration(self.to_glib_none().0)) }
}
pub fn get_emit_signals(&self) -> bool {
unsafe {
from_glib(gst_app_sys::gst_app_src_get_emit_signals(self.to_glib_none().0))
from_glib(gst_app_sys::gst_app_src_get_emit_signals(
self.to_glib_none().0,
))
}
}
pub fn get_max_bytes(&self) -> u64 {
unsafe {
gst_app_sys::gst_app_src_get_max_bytes(self.to_glib_none().0)
}
unsafe { gst_app_sys::gst_app_src_get_max_bytes(self.to_glib_none().0) }
}
pub fn get_size(&self) -> i64 {
unsafe {
gst_app_sys::gst_app_src_get_size(self.to_glib_none().0)
}
unsafe { gst_app_sys::gst_app_src_get_size(self.to_glib_none().0) }
}
pub fn get_stream_type(&self) -> AppStreamType {
unsafe {
from_glib(gst_app_sys::gst_app_src_get_stream_type(self.to_glib_none().0))
from_glib(gst_app_sys::gst_app_src_get_stream_type(
self.to_glib_none().0,
))
}
}
@ -114,290 +108,537 @@ impl AppSrc {
pub fn get_property_block(&self) -> bool {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"block\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"block\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
pub fn set_property_block(&self, block: bool) {
unsafe {
gobject_sys::g_object_set_property(self.as_ptr() as *mut gobject_sys::GObject, b"block\0".as_ptr() as *const _, Value::from(&block).to_glib_none().0);
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"block\0".as_ptr() as *const _,
Value::from(&block).to_glib_none().0,
);
}
}
pub fn get_property_duration(&self) -> u64 {
unsafe {
let mut value = Value::from_type(<u64 as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"duration\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"duration\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
pub fn set_property_duration(&self, duration: u64) {
unsafe {
gobject_sys::g_object_set_property(self.as_ptr() as *mut gobject_sys::GObject, b"duration\0".as_ptr() as *const _, Value::from(&duration).to_glib_none().0);
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"duration\0".as_ptr() as *const _,
Value::from(&duration).to_glib_none().0,
);
}
}
pub fn get_property_format(&self) -> gst::Format {
unsafe {
let mut value = Value::from_type(<gst::Format as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"format\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"format\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
pub fn set_property_format(&self, format: gst::Format) {
unsafe {
gobject_sys::g_object_set_property(self.as_ptr() as *mut gobject_sys::GObject, b"format\0".as_ptr() as *const _, Value::from(&format).to_glib_none().0);
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"format\0".as_ptr() as *const _,
Value::from(&format).to_glib_none().0,
);
}
}
pub fn get_property_is_live(&self) -> bool {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"is-live\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"is-live\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
pub fn set_property_is_live(&self, is_live: bool) {
unsafe {
gobject_sys::g_object_set_property(self.as_ptr() as *mut gobject_sys::GObject, b"is-live\0".as_ptr() as *const _, Value::from(&is_live).to_glib_none().0);
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"is-live\0".as_ptr() as *const _,
Value::from(&is_live).to_glib_none().0,
);
}
}
pub fn get_property_max_latency(&self) -> i64 {
unsafe {
let mut value = Value::from_type(<i64 as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"max-latency\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"max-latency\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
pub fn set_property_max_latency(&self, max_latency: i64) {
unsafe {
gobject_sys::g_object_set_property(self.as_ptr() as *mut gobject_sys::GObject, b"max-latency\0".as_ptr() as *const _, Value::from(&max_latency).to_glib_none().0);
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"max-latency\0".as_ptr() as *const _,
Value::from(&max_latency).to_glib_none().0,
);
}
}
pub fn get_property_min_latency(&self) -> i64 {
unsafe {
let mut value = Value::from_type(<i64 as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"min-latency\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"min-latency\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
pub fn set_property_min_latency(&self, min_latency: i64) {
unsafe {
gobject_sys::g_object_set_property(self.as_ptr() as *mut gobject_sys::GObject, b"min-latency\0".as_ptr() as *const _, Value::from(&min_latency).to_glib_none().0);
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"min-latency\0".as_ptr() as *const _,
Value::from(&min_latency).to_glib_none().0,
);
}
}
pub fn get_property_min_percent(&self) -> u32 {
unsafe {
let mut value = Value::from_type(<u32 as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"min-percent\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"min-percent\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
pub fn set_property_min_percent(&self, min_percent: u32) {
unsafe {
gobject_sys::g_object_set_property(self.as_ptr() as *mut gobject_sys::GObject, b"min-percent\0".as_ptr() as *const _, Value::from(&min_percent).to_glib_none().0);
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"min-percent\0".as_ptr() as *const _,
Value::from(&min_percent).to_glib_none().0,
);
}
}
pub fn connect_enough_data<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn enough_data_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut gst_app_sys::GstAppSrc, f: glib_sys::gpointer) {
pub fn connect_enough_data<F: Fn(&AppSrc) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn enough_data_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(
this: *mut gst_app_sys::GstAppSrc,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"enough-data\0".as_ptr() as *const _,
Some(transmute(enough_data_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"enough-data\0".as_ptr() as *const _,
Some(transmute(enough_data_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_need_data<F: Fn(&AppSrc, u32) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn need_data_trampoline<F: Fn(&AppSrc, u32) + Send + Sync + 'static>(this: *mut gst_app_sys::GstAppSrc, length: libc::c_uint, f: glib_sys::gpointer) {
pub fn connect_need_data<F: Fn(&AppSrc, u32) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn need_data_trampoline<F: Fn(&AppSrc, u32) + Send + Sync + 'static>(
this: *mut gst_app_sys::GstAppSrc,
length: libc::c_uint,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this), length)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"need-data\0".as_ptr() as *const _,
Some(transmute(need_data_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"need-data\0".as_ptr() as *const _,
Some(transmute(need_data_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_seek_data<F: Fn(&AppSrc, u64) -> bool + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn seek_data_trampoline<F: Fn(&AppSrc, u64) -> bool + Send + Sync + 'static>(this: *mut gst_app_sys::GstAppSrc, offset: u64, f: glib_sys::gpointer) -> glib_sys::gboolean {
pub fn connect_seek_data<F: Fn(&AppSrc, u64) -> bool + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn seek_data_trampoline<
F: Fn(&AppSrc, u64) -> bool + Send + Sync + 'static,
>(
this: *mut gst_app_sys::GstAppSrc,
offset: u64,
f: glib_sys::gpointer,
) -> glib_sys::gboolean {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this), offset).to_glib()
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"seek-data\0".as_ptr() as *const _,
Some(transmute(seek_data_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"seek-data\0".as_ptr() as *const _,
Some(transmute(seek_data_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_block_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_block_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut gst_app_sys::GstAppSrc, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_block_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_block_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(
this: *mut gst_app_sys::GstAppSrc,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::block\0".as_ptr() as *const _,
Some(transmute(notify_block_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::block\0".as_ptr() as *const _,
Some(transmute(notify_block_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_caps_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_caps_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut gst_app_sys::GstAppSrc, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_caps_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_caps_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(
this: *mut gst_app_sys::GstAppSrc,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::caps\0".as_ptr() as *const _,
Some(transmute(notify_caps_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::caps\0".as_ptr() as *const _,
Some(transmute(notify_caps_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_current_level_bytes_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_current_level_bytes_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut gst_app_sys::GstAppSrc, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_current_level_bytes_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_current_level_bytes_trampoline<
F: Fn(&AppSrc) + Send + Sync + 'static,
>(
this: *mut gst_app_sys::GstAppSrc,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::current-level-bytes\0".as_ptr() as *const _,
Some(transmute(notify_current_level_bytes_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::current-level-bytes\0".as_ptr() as *const _,
Some(transmute(
notify_current_level_bytes_trampoline::<F> as usize,
)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_duration_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_duration_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut gst_app_sys::GstAppSrc, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_duration_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_duration_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(
this: *mut gst_app_sys::GstAppSrc,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::duration\0".as_ptr() as *const _,
Some(transmute(notify_duration_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::duration\0".as_ptr() as *const _,
Some(transmute(notify_duration_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_emit_signals_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_emit_signals_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut gst_app_sys::GstAppSrc, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_emit_signals_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_emit_signals_trampoline<
F: Fn(&AppSrc) + Send + Sync + 'static,
>(
this: *mut gst_app_sys::GstAppSrc,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::emit-signals\0".as_ptr() as *const _,
Some(transmute(notify_emit_signals_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::emit-signals\0".as_ptr() as *const _,
Some(transmute(notify_emit_signals_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_format_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_format_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut gst_app_sys::GstAppSrc, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_format_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_format_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(
this: *mut gst_app_sys::GstAppSrc,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::format\0".as_ptr() as *const _,
Some(transmute(notify_format_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::format\0".as_ptr() as *const _,
Some(transmute(notify_format_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_is_live_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_is_live_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut gst_app_sys::GstAppSrc, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_is_live_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_is_live_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(
this: *mut gst_app_sys::GstAppSrc,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::is-live\0".as_ptr() as *const _,
Some(transmute(notify_is_live_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::is-live\0".as_ptr() as *const _,
Some(transmute(notify_is_live_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_max_bytes_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_max_bytes_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut gst_app_sys::GstAppSrc, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_max_bytes_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_max_bytes_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(
this: *mut gst_app_sys::GstAppSrc,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::max-bytes\0".as_ptr() as *const _,
Some(transmute(notify_max_bytes_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::max-bytes\0".as_ptr() as *const _,
Some(transmute(notify_max_bytes_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_max_latency_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_max_latency_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut gst_app_sys::GstAppSrc, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_max_latency_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_max_latency_trampoline<
F: Fn(&AppSrc) + Send + Sync + 'static,
>(
this: *mut gst_app_sys::GstAppSrc,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::max-latency\0".as_ptr() as *const _,
Some(transmute(notify_max_latency_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::max-latency\0".as_ptr() as *const _,
Some(transmute(notify_max_latency_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_min_latency_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_min_latency_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut gst_app_sys::GstAppSrc, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_min_latency_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_min_latency_trampoline<
F: Fn(&AppSrc) + Send + Sync + 'static,
>(
this: *mut gst_app_sys::GstAppSrc,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::min-latency\0".as_ptr() as *const _,
Some(transmute(notify_min_latency_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::min-latency\0".as_ptr() as *const _,
Some(transmute(notify_min_latency_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_min_percent_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_min_percent_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut gst_app_sys::GstAppSrc, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_min_percent_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_min_percent_trampoline<
F: Fn(&AppSrc) + Send + Sync + 'static,
>(
this: *mut gst_app_sys::GstAppSrc,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::min-percent\0".as_ptr() as *const _,
Some(transmute(notify_min_percent_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::min-percent\0".as_ptr() as *const _,
Some(transmute(notify_min_percent_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_size_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_size_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut gst_app_sys::GstAppSrc, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_size_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_size_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(
this: *mut gst_app_sys::GstAppSrc,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::size\0".as_ptr() as *const _,
Some(transmute(notify_size_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::size\0".as_ptr() as *const _,
Some(transmute(notify_size_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_stream_type_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_stream_type_trampoline<F: Fn(&AppSrc) + Send + Sync + 'static>(this: *mut gst_app_sys::GstAppSrc, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_stream_type_notify<F: Fn(&AppSrc) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_stream_type_trampoline<
F: Fn(&AppSrc) + Send + Sync + 'static,
>(
this: *mut gst_app_sys::GstAppSrc,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::stream-type\0".as_ptr() as *const _,
Some(transmute(notify_stream_type_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::stream-type\0".as_ptr() as *const _,
Some(transmute(notify_stream_type_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
}

View file

@ -2,18 +2,17 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib::StaticType;
use glib::Type;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::FromValueOptional;
use glib::value::SetValue;
use glib::value::Value;
use glib::StaticType;
use glib::Type;
use gobject_sys;
use gst_app_sys;
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum AppStreamType {
Stream,
Seekable,
@ -31,7 +30,7 @@ impl ToGlib for AppStreamType {
AppStreamType::Stream => gst_app_sys::GST_APP_STREAM_TYPE_STREAM,
AppStreamType::Seekable => gst_app_sys::GST_APP_STREAM_TYPE_SEEKABLE,
AppStreamType::RandomAccess => gst_app_sys::GST_APP_STREAM_TYPE_RANDOM_ACCESS,
AppStreamType::__Unknown(value) => value
AppStreamType::__Unknown(value) => value,
}
}
}
@ -72,4 +71,3 @@ impl SetValue for AppStreamType {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}

View file

@ -12,5 +12,4 @@ mod enums;
pub use self::enums::AppStreamType;
#[doc(hidden)]
pub mod traits {
}
pub mod traits {}

View file

@ -27,7 +27,6 @@ pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue
#[allow(clippy::unreadable_literal)]
#[allow(clippy::too_many_arguments)]
#[allow(clippy::match_same_arms)]
#[rustfmt::skip]
mod auto;
pub use auto::*;

View file

@ -21,45 +21,63 @@ glib_wrapper! {
impl AudioStreamAlign {
#[cfg(any(feature = "v1_14", feature = "dox"))]
pub fn new(rate: i32, alignment_threshold: gst::ClockTime, discont_wait: gst::ClockTime) -> AudioStreamAlign {
pub fn new(
rate: i32,
alignment_threshold: gst::ClockTime,
discont_wait: gst::ClockTime,
) -> AudioStreamAlign {
assert_initialized_main_thread!();
unsafe {
from_glib_full(gst_audio_sys::gst_audio_stream_align_new(rate, alignment_threshold.to_glib(), discont_wait.to_glib()))
from_glib_full(gst_audio_sys::gst_audio_stream_align_new(
rate,
alignment_threshold.to_glib(),
discont_wait.to_glib(),
))
}
}
#[cfg(any(feature = "v1_14", feature = "dox"))]
pub fn get_alignment_threshold(&mut self) -> gst::ClockTime {
unsafe {
from_glib(gst_audio_sys::gst_audio_stream_align_get_alignment_threshold(self.to_glib_none_mut().0))
from_glib(
gst_audio_sys::gst_audio_stream_align_get_alignment_threshold(
self.to_glib_none_mut().0,
),
)
}
}
#[cfg(any(feature = "v1_14", feature = "dox"))]
pub fn get_discont_wait(&mut self) -> gst::ClockTime {
unsafe {
from_glib(gst_audio_sys::gst_audio_stream_align_get_discont_wait(self.to_glib_none_mut().0))
from_glib(gst_audio_sys::gst_audio_stream_align_get_discont_wait(
self.to_glib_none_mut().0,
))
}
}
#[cfg(any(feature = "v1_14", feature = "dox"))]
pub fn get_rate(&mut self) -> i32 {
unsafe {
gst_audio_sys::gst_audio_stream_align_get_rate(self.to_glib_none_mut().0)
}
unsafe { gst_audio_sys::gst_audio_stream_align_get_rate(self.to_glib_none_mut().0) }
}
#[cfg(any(feature = "v1_14", feature = "dox"))]
pub fn get_samples_since_discont(&mut self) -> u64 {
unsafe {
gst_audio_sys::gst_audio_stream_align_get_samples_since_discont(self.to_glib_none_mut().0)
gst_audio_sys::gst_audio_stream_align_get_samples_since_discont(
self.to_glib_none_mut().0,
)
}
}
#[cfg(any(feature = "v1_14", feature = "dox"))]
pub fn get_timestamp_at_discont(&mut self) -> gst::ClockTime {
unsafe {
from_glib(gst_audio_sys::gst_audio_stream_align_get_timestamp_at_discont(self.to_glib_none_mut().0))
from_glib(
gst_audio_sys::gst_audio_stream_align_get_timestamp_at_discont(
self.to_glib_none_mut().0,
),
)
}
}
@ -73,14 +91,20 @@ impl AudioStreamAlign {
#[cfg(any(feature = "v1_14", feature = "dox"))]
pub fn set_alignment_threshold(&mut self, alignment_threshold: gst::ClockTime) {
unsafe {
gst_audio_sys::gst_audio_stream_align_set_alignment_threshold(self.to_glib_none_mut().0, alignment_threshold.to_glib());
gst_audio_sys::gst_audio_stream_align_set_alignment_threshold(
self.to_glib_none_mut().0,
alignment_threshold.to_glib(),
);
}
}
#[cfg(any(feature = "v1_14", feature = "dox"))]
pub fn set_discont_wait(&mut self, discont_wait: gst::ClockTime) {
unsafe {
gst_audio_sys::gst_audio_stream_align_set_discont_wait(self.to_glib_none_mut().0, discont_wait.to_glib());
gst_audio_sys::gst_audio_stream_align_set_discont_wait(
self.to_glib_none_mut().0,
discont_wait.to_glib(),
);
}
}

View file

@ -2,18 +2,17 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib::StaticType;
use glib::Type;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::FromValueOptional;
use glib::value::SetValue;
use glib::value::Value;
use glib::StaticType;
use glib::Type;
use gobject_sys;
use gst_audio_sys;
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum AudioChannelPosition {
None,
Mono,
@ -60,34 +59,70 @@ impl ToGlib for AudioChannelPosition {
AudioChannelPosition::Mono => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_MONO,
AudioChannelPosition::Invalid => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_INVALID,
AudioChannelPosition::FrontLeft => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,
AudioChannelPosition::FrontRight => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,
AudioChannelPosition::FrontCenter => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER,
AudioChannelPosition::FrontRight => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT
}
AudioChannelPosition::FrontCenter => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER
}
AudioChannelPosition::Lfe1 => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_LFE1,
AudioChannelPosition::RearLeft => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_REAR_LEFT,
AudioChannelPosition::RearRight => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT,
AudioChannelPosition::FrontLeftOfCenter => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER,
AudioChannelPosition::FrontRightOfCenter => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER,
AudioChannelPosition::RearCenter => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_REAR_CENTER,
AudioChannelPosition::FrontLeftOfCenter => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER
}
AudioChannelPosition::FrontRightOfCenter => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER
}
AudioChannelPosition::RearCenter => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_REAR_CENTER
}
AudioChannelPosition::Lfe2 => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_LFE2,
AudioChannelPosition::SideLeft => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT,
AudioChannelPosition::SideRight => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT,
AudioChannelPosition::TopFrontLeft => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_LEFT,
AudioChannelPosition::TopFrontRight => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_RIGHT,
AudioChannelPosition::TopFrontCenter => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_CENTER,
AudioChannelPosition::TopFrontLeft => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_LEFT
}
AudioChannelPosition::TopFrontRight => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_RIGHT
}
AudioChannelPosition::TopFrontCenter => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_FRONT_CENTER
}
AudioChannelPosition::TopCenter => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_CENTER,
AudioChannelPosition::TopRearLeft => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_REAR_LEFT,
AudioChannelPosition::TopRearRight => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_REAR_RIGHT,
AudioChannelPosition::TopSideLeft => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_SIDE_LEFT,
AudioChannelPosition::TopSideRight => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_SIDE_RIGHT,
AudioChannelPosition::TopRearCenter => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_REAR_CENTER,
AudioChannelPosition::BottomFrontCenter => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_BOTTOM_FRONT_CENTER,
AudioChannelPosition::BottomFrontLeft => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_BOTTOM_FRONT_LEFT,
AudioChannelPosition::BottomFrontRight => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_BOTTOM_FRONT_RIGHT,
AudioChannelPosition::TopRearLeft => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_REAR_LEFT
}
AudioChannelPosition::TopRearRight => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_REAR_RIGHT
}
AudioChannelPosition::TopSideLeft => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_SIDE_LEFT
}
AudioChannelPosition::TopSideRight => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_SIDE_RIGHT
}
AudioChannelPosition::TopRearCenter => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_TOP_REAR_CENTER
}
AudioChannelPosition::BottomFrontCenter => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_BOTTOM_FRONT_CENTER
}
AudioChannelPosition::BottomFrontLeft => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_BOTTOM_FRONT_LEFT
}
AudioChannelPosition::BottomFrontRight => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_BOTTOM_FRONT_RIGHT
}
AudioChannelPosition::WideLeft => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_WIDE_LEFT,
AudioChannelPosition::WideRight => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_WIDE_RIGHT,
AudioChannelPosition::SurroundLeft => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_SURROUND_LEFT,
AudioChannelPosition::SurroundRight => gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_SURROUND_RIGHT,
AudioChannelPosition::__Unknown(value) => value
AudioChannelPosition::SurroundLeft => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_SURROUND_LEFT
}
AudioChannelPosition::SurroundRight => {
gst_audio_sys::GST_AUDIO_CHANNEL_POSITION_SURROUND_RIGHT
}
AudioChannelPosition::__Unknown(value) => value,
}
}
}
@ -157,8 +192,7 @@ impl SetValue for AudioChannelPosition {
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum AudioFormat {
Unknown,
Encoded,
@ -234,7 +268,7 @@ impl ToGlib for AudioFormat {
AudioFormat::F32be => gst_audio_sys::GST_AUDIO_FORMAT_F32BE,
AudioFormat::F64le => gst_audio_sys::GST_AUDIO_FORMAT_F64LE,
AudioFormat::F64be => gst_audio_sys::GST_AUDIO_FORMAT_F64BE,
AudioFormat::__Unknown(value) => value
AudioFormat::__Unknown(value) => value,
}
}
}
@ -305,8 +339,7 @@ impl SetValue for AudioFormat {
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum AudioLayout {
Interleaved,
NonInterleaved,
@ -322,7 +355,7 @@ impl ToGlib for AudioLayout {
match *self {
AudioLayout::Interleaved => gst_audio_sys::GST_AUDIO_LAYOUT_INTERLEAVED,
AudioLayout::NonInterleaved => gst_audio_sys::GST_AUDIO_LAYOUT_NON_INTERLEAVED,
AudioLayout::__Unknown(value) => value
AudioLayout::__Unknown(value) => value,
}
}
}
@ -363,8 +396,7 @@ impl SetValue for AudioLayout {
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum StreamVolumeFormat {
Linear,
Cubic,
@ -382,7 +414,7 @@ impl ToGlib for StreamVolumeFormat {
StreamVolumeFormat::Linear => gst_audio_sys::GST_STREAM_VOLUME_FORMAT_LINEAR,
StreamVolumeFormat::Cubic => gst_audio_sys::GST_STREAM_VOLUME_FORMAT_CUBIC,
StreamVolumeFormat::Db => gst_audio_sys::GST_STREAM_VOLUME_FORMAT_DB,
StreamVolumeFormat::__Unknown(value) => value
StreamVolumeFormat::__Unknown(value) => value,
}
}
}
@ -399,4 +431,3 @@ impl FromGlib<gst_audio_sys::GstStreamVolumeFormat> for StreamVolumeFormat {
}
}
}

View file

@ -2,13 +2,13 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib::StaticType;
use glib::Type;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::FromValueOptional;
use glib::value::SetValue;
use glib::value::Value;
use glib::StaticType;
use glib::Type;
use gobject_sys;
use gst_audio_sys;
@ -158,4 +158,3 @@ impl SetValue for AudioPackFlags {
gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
}
}

View file

@ -3,8 +3,8 @@
// DO NOT EDIT
mod stream_volume;
pub use self::stream_volume::{StreamVolume, NONE_STREAM_VOLUME};
pub use self::stream_volume::StreamVolumeExt;
pub use self::stream_volume::{StreamVolume, NONE_STREAM_VOLUME};
#[cfg(any(feature = "v1_14", feature = "dox"))]
mod audio_stream_align;

View file

@ -2,16 +2,16 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use StreamVolumeFormat;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib_sys;
use gst_audio_sys;
use std::boxed::Box as Box_;
use std::mem::transmute;
use StreamVolumeFormat;
glib_wrapper! {
pub struct StreamVolume(Interface<gst_audio_sys::GstStreamVolume>);
@ -44,61 +44,101 @@ pub trait StreamVolumeExt: 'static {
fn set_volume(&self, format: StreamVolumeFormat, val: f64);
fn connect_property_mute_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_mute_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_volume_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_volume_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
}
impl<O: IsA<StreamVolume>> StreamVolumeExt for O {
fn get_mute(&self) -> bool {
unsafe {
from_glib(gst_audio_sys::gst_stream_volume_get_mute(self.as_ref().to_glib_none().0))
from_glib(gst_audio_sys::gst_stream_volume_get_mute(
self.as_ref().to_glib_none().0,
))
}
}
fn get_volume(&self, format: StreamVolumeFormat) -> f64 {
unsafe {
gst_audio_sys::gst_stream_volume_get_volume(self.as_ref().to_glib_none().0, format.to_glib())
gst_audio_sys::gst_stream_volume_get_volume(
self.as_ref().to_glib_none().0,
format.to_glib(),
)
}
}
fn set_mute(&self, mute: bool) {
unsafe {
gst_audio_sys::gst_stream_volume_set_mute(self.as_ref().to_glib_none().0, mute.to_glib());
gst_audio_sys::gst_stream_volume_set_mute(
self.as_ref().to_glib_none().0,
mute.to_glib(),
);
}
}
fn set_volume(&self, format: StreamVolumeFormat, val: f64) {
unsafe {
gst_audio_sys::gst_stream_volume_set_volume(self.as_ref().to_glib_none().0, format.to_glib(), val);
gst_audio_sys::gst_stream_volume_set_volume(
self.as_ref().to_glib_none().0,
format.to_glib(),
val,
);
}
}
fn connect_property_mute_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_mute_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut gst_audio_sys::GstStreamVolume, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<StreamVolume>
fn connect_property_mute_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_mute_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_audio_sys::GstStreamVolume,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<StreamVolume>,
{
let f: &F = &*(f as *const F);
f(&StreamVolume::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::mute\0".as_ptr() as *const _,
Some(transmute(notify_mute_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::mute\0".as_ptr() as *const _,
Some(transmute(notify_mute_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_volume_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_volume_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut gst_audio_sys::GstStreamVolume, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<StreamVolume>
fn connect_property_volume_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_volume_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_audio_sys::GstStreamVolume,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<StreamVolume>,
{
let f: &F = &*(f as *const F);
f(&StreamVolume::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::volume\0".as_ptr() as *const _,
Some(transmute(notify_volume_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::volume\0".as_ptr() as *const _,
Some(transmute(notify_volume_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
}

View file

@ -35,7 +35,6 @@ pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue
#[allow(clippy::unreadable_literal)]
#[allow(clippy::too_many_arguments)]
#[allow(clippy::match_same_arms)]
#[rustfmt::skip]
mod auto;
pub use auto::*;

View file

@ -3,8 +3,8 @@
// DO NOT EDIT
use glib;
use glib::ObjectExt;
use glib::translate::*;
use glib::ObjectExt;
use gst;
use gst_base_sys;
use std::mem;
@ -20,21 +20,15 @@ glib_wrapper! {
impl Adapter {
pub fn new() -> Adapter {
assert_initialized_main_thread!();
unsafe {
from_glib_full(gst_base_sys::gst_adapter_new())
}
unsafe { from_glib_full(gst_base_sys::gst_adapter_new()) }
}
pub fn available(&self) -> usize {
unsafe {
gst_base_sys::gst_adapter_available(self.to_glib_none().0)
}
unsafe { gst_base_sys::gst_adapter_available(self.to_glib_none().0) }
}
pub fn available_fast(&self) -> usize {
unsafe {
gst_base_sys::gst_adapter_available_fast(self.to_glib_none().0)
}
unsafe { gst_base_sys::gst_adapter_available_fast(self.to_glib_none().0) }
}
pub fn clear(&self) {
@ -45,20 +39,24 @@ impl Adapter {
pub fn copy_bytes(&self, offset: usize, size: usize) -> Option<glib::Bytes> {
unsafe {
from_glib_full(gst_base_sys::gst_adapter_copy_bytes(self.to_glib_none().0, offset, size))
from_glib_full(gst_base_sys::gst_adapter_copy_bytes(
self.to_glib_none().0,
offset,
size,
))
}
}
pub fn distance_from_discont(&self) -> u64 {
unsafe {
gst_base_sys::gst_adapter_distance_from_discont(self.to_glib_none().0)
}
unsafe { gst_base_sys::gst_adapter_distance_from_discont(self.to_glib_none().0) }
}
#[cfg(any(feature = "v1_10", feature = "dox"))]
pub fn dts_at_discont(&self) -> gst::ClockTime {
unsafe {
from_glib(gst_base_sys::gst_adapter_dts_at_discont(self.to_glib_none().0))
from_glib(gst_base_sys::gst_adapter_dts_at_discont(
self.to_glib_none().0,
))
}
}
@ -70,53 +68,85 @@ impl Adapter {
pub fn get_buffer(&self, nbytes: usize) -> Option<gst::Buffer> {
unsafe {
from_glib_full(gst_base_sys::gst_adapter_get_buffer(self.to_glib_none().0, nbytes))
from_glib_full(gst_base_sys::gst_adapter_get_buffer(
self.to_glib_none().0,
nbytes,
))
}
}
pub fn get_buffer_fast(&self, nbytes: usize) -> Option<gst::Buffer> {
unsafe {
from_glib_full(gst_base_sys::gst_adapter_get_buffer_fast(self.to_glib_none().0, nbytes))
from_glib_full(gst_base_sys::gst_adapter_get_buffer_fast(
self.to_glib_none().0,
nbytes,
))
}
}
pub fn get_buffer_list(&self, nbytes: usize) -> Option<gst::BufferList> {
unsafe {
from_glib_full(gst_base_sys::gst_adapter_get_buffer_list(self.to_glib_none().0, nbytes))
from_glib_full(gst_base_sys::gst_adapter_get_buffer_list(
self.to_glib_none().0,
nbytes,
))
}
}
pub fn get_list(&self, nbytes: usize) -> Vec<gst::Buffer> {
unsafe {
FromGlibPtrContainer::from_glib_full(gst_base_sys::gst_adapter_get_list(self.to_glib_none().0, nbytes))
FromGlibPtrContainer::from_glib_full(gst_base_sys::gst_adapter_get_list(
self.to_glib_none().0,
nbytes,
))
}
}
pub fn masked_scan_uint32(&self, mask: u32, pattern: u32, offset: usize, size: usize) -> isize {
unsafe {
gst_base_sys::gst_adapter_masked_scan_uint32(self.to_glib_none().0, mask, pattern, offset, size)
gst_base_sys::gst_adapter_masked_scan_uint32(
self.to_glib_none().0,
mask,
pattern,
offset,
size,
)
}
}
pub fn masked_scan_uint32_peek(&self, mask: u32, pattern: u32, offset: usize, size: usize) -> (isize, u32) {
pub fn masked_scan_uint32_peek(
&self,
mask: u32,
pattern: u32,
offset: usize,
size: usize,
) -> (isize, u32) {
unsafe {
let mut value = mem::uninitialized();
let ret = gst_base_sys::gst_adapter_masked_scan_uint32_peek(self.to_glib_none().0, mask, pattern, offset, size, &mut value);
let ret = gst_base_sys::gst_adapter_masked_scan_uint32_peek(
self.to_glib_none().0,
mask,
pattern,
offset,
size,
&mut value,
);
(ret, value)
}
}
#[cfg(any(feature = "v1_10", feature = "dox"))]
pub fn offset_at_discont(&self) -> u64 {
unsafe {
gst_base_sys::gst_adapter_offset_at_discont(self.to_glib_none().0)
}
unsafe { gst_base_sys::gst_adapter_offset_at_discont(self.to_glib_none().0) }
}
pub fn prev_dts(&self) -> (gst::ClockTime, u64) {
unsafe {
let mut distance = mem::uninitialized();
let ret = from_glib(gst_base_sys::gst_adapter_prev_dts(self.to_glib_none().0, &mut distance));
let ret = from_glib(gst_base_sys::gst_adapter_prev_dts(
self.to_glib_none().0,
&mut distance,
));
(ret, distance)
}
}
@ -124,7 +154,11 @@ impl Adapter {
pub fn prev_dts_at_offset(&self, offset: usize) -> (gst::ClockTime, u64) {
unsafe {
let mut distance = mem::uninitialized();
let ret = from_glib(gst_base_sys::gst_adapter_prev_dts_at_offset(self.to_glib_none().0, offset, &mut distance));
let ret = from_glib(gst_base_sys::gst_adapter_prev_dts_at_offset(
self.to_glib_none().0,
offset,
&mut distance,
));
(ret, distance)
}
}
@ -141,7 +175,10 @@ impl Adapter {
pub fn prev_pts(&self) -> (gst::ClockTime, u64) {
unsafe {
let mut distance = mem::uninitialized();
let ret = from_glib(gst_base_sys::gst_adapter_prev_pts(self.to_glib_none().0, &mut distance));
let ret = from_glib(gst_base_sys::gst_adapter_prev_pts(
self.to_glib_none().0,
&mut distance,
));
(ret, distance)
}
}
@ -149,7 +186,11 @@ impl Adapter {
pub fn prev_pts_at_offset(&self, offset: usize) -> (gst::ClockTime, u64) {
unsafe {
let mut distance = mem::uninitialized();
let ret = from_glib(gst_base_sys::gst_adapter_prev_pts_at_offset(self.to_glib_none().0, offset, &mut distance));
let ret = from_glib(gst_base_sys::gst_adapter_prev_pts_at_offset(
self.to_glib_none().0,
offset,
&mut distance,
));
(ret, distance)
}
}
@ -157,31 +198,45 @@ impl Adapter {
#[cfg(any(feature = "v1_10", feature = "dox"))]
pub fn pts_at_discont(&self) -> gst::ClockTime {
unsafe {
from_glib(gst_base_sys::gst_adapter_pts_at_discont(self.to_glib_none().0))
from_glib(gst_base_sys::gst_adapter_pts_at_discont(
self.to_glib_none().0,
))
}
}
pub fn take_buffer(&self, nbytes: usize) -> Option<gst::Buffer> {
unsafe {
from_glib_full(gst_base_sys::gst_adapter_take_buffer(self.to_glib_none().0, nbytes))
from_glib_full(gst_base_sys::gst_adapter_take_buffer(
self.to_glib_none().0,
nbytes,
))
}
}
pub fn take_buffer_fast(&self, nbytes: usize) -> Option<gst::Buffer> {
unsafe {
from_glib_full(gst_base_sys::gst_adapter_take_buffer_fast(self.to_glib_none().0, nbytes))
from_glib_full(gst_base_sys::gst_adapter_take_buffer_fast(
self.to_glib_none().0,
nbytes,
))
}
}
pub fn take_buffer_list(&self, nbytes: usize) -> Option<gst::BufferList> {
unsafe {
from_glib_full(gst_base_sys::gst_adapter_take_buffer_list(self.to_glib_none().0, nbytes))
from_glib_full(gst_base_sys::gst_adapter_take_buffer_list(
self.to_glib_none().0,
nbytes,
))
}
}
pub fn take_list(&self, nbytes: usize) -> Vec<gst::Buffer> {
unsafe {
FromGlibPtrContainer::from_glib_full(gst_base_sys::gst_adapter_take_list(self.to_glib_none().0, nbytes))
FromGlibPtrContainer::from_glib_full(gst_base_sys::gst_adapter_take_list(
self.to_glib_none().0,
nbytes,
))
}
}
}

View file

@ -2,13 +2,13 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib::StaticType;
use glib::Value;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::Value;
use glib_sys;
use gobject_sys;
use gst;
@ -53,9 +53,15 @@ pub trait AggregatorExt: 'static {
fn set_property_start_time(&self, start_time: u64);
#[cfg(any(feature = "v1_14", feature = "dox"))]
fn connect_property_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_start_time_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_start_time_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
}
impl<O: IsA<Aggregator>> AggregatorExt for O {
@ -67,78 +73,121 @@ impl<O: IsA<Aggregator>> AggregatorExt for O {
#[cfg(any(feature = "v1_14", feature = "dox"))]
fn get_buffer_pool(&self) -> Option<gst::BufferPool> {
unsafe {
from_glib_full(gst_base_sys::gst_aggregator_get_buffer_pool(self.as_ref().to_glib_none().0))
from_glib_full(gst_base_sys::gst_aggregator_get_buffer_pool(
self.as_ref().to_glib_none().0,
))
}
}
#[cfg(any(feature = "v1_14", feature = "dox"))]
fn get_latency(&self) -> gst::ClockTime {
unsafe {
from_glib(gst_base_sys::gst_aggregator_get_latency(self.as_ref().to_glib_none().0))
from_glib(gst_base_sys::gst_aggregator_get_latency(
self.as_ref().to_glib_none().0,
))
}
}
#[cfg(any(feature = "v1_14", feature = "dox"))]
fn set_latency(&self, min_latency: gst::ClockTime, max_latency: gst::ClockTime) {
unsafe {
gst_base_sys::gst_aggregator_set_latency(self.as_ref().to_glib_none().0, min_latency.to_glib(), max_latency.to_glib());
gst_base_sys::gst_aggregator_set_latency(
self.as_ref().to_glib_none().0,
min_latency.to_glib(),
max_latency.to_glib(),
);
}
}
#[cfg(any(feature = "v1_14", feature = "dox"))]
fn set_src_caps(&self, caps: &gst::Caps) {
unsafe {
gst_base_sys::gst_aggregator_set_src_caps(self.as_ref().to_glib_none().0, caps.to_glib_none().0);
gst_base_sys::gst_aggregator_set_src_caps(
self.as_ref().to_glib_none().0,
caps.to_glib_none().0,
);
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
fn simple_get_next_time(&self) -> gst::ClockTime {
unsafe {
from_glib(gst_base_sys::gst_aggregator_simple_get_next_time(self.as_ref().to_glib_none().0))
from_glib(gst_base_sys::gst_aggregator_simple_get_next_time(
self.as_ref().to_glib_none().0,
))
}
}
fn get_property_start_time(&self) -> u64 {
unsafe {
let mut value = Value::from_type(<u64 as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"start-time\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"start-time\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
fn set_property_start_time(&self, start_time: u64) {
unsafe {
gobject_sys::g_object_set_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"start-time\0".as_ptr() as *const _, Value::from(&start_time).to_glib_none().0);
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"start-time\0".as_ptr() as *const _,
Value::from(&start_time).to_glib_none().0,
);
}
}
#[cfg(any(feature = "v1_14", feature = "dox"))]
fn connect_property_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_latency_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut gst_base_sys::GstAggregator, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<Aggregator>
fn connect_property_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_latency_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_base_sys::GstAggregator,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<Aggregator>,
{
let f: &F = &*(f as *const F);
f(&Aggregator::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::latency\0".as_ptr() as *const _,
Some(transmute(notify_latency_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::latency\0".as_ptr() as *const _,
Some(transmute(notify_latency_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_start_time_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_start_time_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut gst_base_sys::GstAggregator, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<Aggregator>
fn connect_property_start_time_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_start_time_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_base_sys::GstAggregator,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<Aggregator>,
{
let f: &F = &*(f as *const F);
f(&Aggregator::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::start-time\0".as_ptr() as *const _,
Some(transmute(notify_start_time_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::start-time\0".as_ptr() as *const _,
Some(transmute(notify_start_time_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
}

View file

@ -2,15 +2,15 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
#[cfg(any(feature = "v1_16", feature = "dox"))]
use glib::StaticType;
#[cfg(any(feature = "v1_16", feature = "dox"))]
use glib::Value;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::translate::*;
use glib_sys;
#[cfg(any(feature = "v1_16", feature = "dox"))]
use gobject_sys;
@ -55,45 +55,61 @@ pub trait AggregatorPadExt: 'static {
#[cfg(any(feature = "v1_16", feature = "dox"))]
fn set_property_emit_signals(&self, emit_signals: bool);
fn connect_buffer_consumed<F: Fn(&Self, &gst::Buffer) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_buffer_consumed<F: Fn(&Self, &gst::Buffer) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
#[cfg(any(feature = "v1_16", feature = "dox"))]
fn connect_property_emit_signals_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_emit_signals_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
}
impl<O: IsA<AggregatorPad>> AggregatorPadExt for O {
#[cfg(any(feature = "v1_14", feature = "dox"))]
fn drop_buffer(&self) -> bool {
unsafe {
from_glib(gst_base_sys::gst_aggregator_pad_drop_buffer(self.as_ref().to_glib_none().0))
from_glib(gst_base_sys::gst_aggregator_pad_drop_buffer(
self.as_ref().to_glib_none().0,
))
}
}
#[cfg(any(feature = "v1_14_1", feature = "dox"))]
fn has_buffer(&self) -> bool {
unsafe {
from_glib(gst_base_sys::gst_aggregator_pad_has_buffer(self.as_ref().to_glib_none().0))
from_glib(gst_base_sys::gst_aggregator_pad_has_buffer(
self.as_ref().to_glib_none().0,
))
}
}
#[cfg(any(feature = "v1_14", feature = "dox"))]
fn is_eos(&self) -> bool {
unsafe {
from_glib(gst_base_sys::gst_aggregator_pad_is_eos(self.as_ref().to_glib_none().0))
from_glib(gst_base_sys::gst_aggregator_pad_is_eos(
self.as_ref().to_glib_none().0,
))
}
}
#[cfg(any(feature = "v1_14", feature = "dox"))]
fn peek_buffer(&self) -> Option<gst::Buffer> {
unsafe {
from_glib_full(gst_base_sys::gst_aggregator_pad_peek_buffer(self.as_ref().to_glib_none().0))
from_glib_full(gst_base_sys::gst_aggregator_pad_peek_buffer(
self.as_ref().to_glib_none().0,
))
}
}
#[cfg(any(feature = "v1_14", feature = "dox"))]
fn pop_buffer(&self) -> Option<gst::Buffer> {
unsafe {
from_glib_full(gst_base_sys::gst_aggregator_pad_pop_buffer(self.as_ref().to_glib_none().0))
from_glib_full(gst_base_sys::gst_aggregator_pad_pop_buffer(
self.as_ref().to_glib_none().0,
))
}
}
@ -101,7 +117,11 @@ impl<O: IsA<AggregatorPad>> AggregatorPadExt for O {
fn get_property_emit_signals(&self) -> bool {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"emit-signals\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"emit-signals\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
@ -109,36 +129,70 @@ impl<O: IsA<AggregatorPad>> AggregatorPadExt for O {
#[cfg(any(feature = "v1_16", feature = "dox"))]
fn set_property_emit_signals(&self, emit_signals: bool) {
unsafe {
gobject_sys::g_object_set_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"emit-signals\0".as_ptr() as *const _, Value::from(&emit_signals).to_glib_none().0);
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"emit-signals\0".as_ptr() as *const _,
Value::from(&emit_signals).to_glib_none().0,
);
}
}
fn connect_buffer_consumed<F: Fn(&Self, &gst::Buffer) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn buffer_consumed_trampoline<P, F: Fn(&P, &gst::Buffer) + Send + Sync + 'static>(this: *mut gst_base_sys::GstAggregatorPad, object: *mut gst_sys::GstBuffer, f: glib_sys::gpointer)
where P: IsA<AggregatorPad>
fn connect_buffer_consumed<F: Fn(&Self, &gst::Buffer) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn buffer_consumed_trampoline<
P,
F: Fn(&P, &gst::Buffer) + Send + Sync + 'static,
>(
this: *mut gst_base_sys::GstAggregatorPad,
object: *mut gst_sys::GstBuffer,
f: glib_sys::gpointer,
) where
P: IsA<AggregatorPad>,
{
let f: &F = &*(f as *const F);
f(&AggregatorPad::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(object))
f(
&AggregatorPad::from_glib_borrow(this).unsafe_cast(),
&from_glib_borrow(object),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"buffer-consumed\0".as_ptr() as *const _,
Some(transmute(buffer_consumed_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"buffer-consumed\0".as_ptr() as *const _,
Some(transmute(buffer_consumed_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
fn connect_property_emit_signals_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_emit_signals_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut gst_base_sys::GstAggregatorPad, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<AggregatorPad>
fn connect_property_emit_signals_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_emit_signals_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_base_sys::GstAggregatorPad,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<AggregatorPad>,
{
let f: &F = &*(f as *const F);
f(&AggregatorPad::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::emit-signals\0".as_ptr() as *const _,
Some(transmute(notify_emit_signals_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::emit-signals\0".as_ptr() as *const _,
Some(transmute(
notify_emit_signals_trampoline::<Self, F> as usize,
)),
Box_::into_raw(f),
)
}
}
}

View file

@ -2,13 +2,13 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib::StaticType;
use glib::Value;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::Value;
use glib_sys;
use gobject_sys;
use gst;
@ -59,13 +59,22 @@ pub trait BaseParseExt: 'static {
fn set_property_disable_passthrough(&self, disable_passthrough: bool);
fn connect_property_disable_passthrough_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_disable_passthrough_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
}
impl<O: IsA<BaseParse>> BaseParseExt for O {
fn add_index_entry(&self, offset: u64, ts: gst::ClockTime, key: bool, force: bool) -> bool {
unsafe {
from_glib(gst_base_sys::gst_base_parse_add_index_entry(self.as_ref().to_glib_none().0, offset, ts.to_glib(), key.to_glib(), force.to_glib()))
from_glib(gst_base_sys::gst_base_parse_add_index_entry(
self.as_ref().to_glib_none().0,
offset,
ts.to_glib(),
key.to_glib(),
force.to_glib(),
))
}
}
@ -78,55 +87,84 @@ impl<O: IsA<BaseParse>> BaseParseExt for O {
fn merge_tags(&self, tags: Option<&gst::TagList>, mode: gst::TagMergeMode) {
unsafe {
gst_base_sys::gst_base_parse_merge_tags(self.as_ref().to_glib_none().0, tags.to_glib_none().0, mode.to_glib());
gst_base_sys::gst_base_parse_merge_tags(
self.as_ref().to_glib_none().0,
tags.to_glib_none().0,
mode.to_glib(),
);
}
}
fn set_average_bitrate(&self, bitrate: u32) {
unsafe {
gst_base_sys::gst_base_parse_set_average_bitrate(self.as_ref().to_glib_none().0, bitrate);
gst_base_sys::gst_base_parse_set_average_bitrate(
self.as_ref().to_glib_none().0,
bitrate,
);
}
}
fn set_has_timing_info(&self, has_timing: bool) {
unsafe {
gst_base_sys::gst_base_parse_set_has_timing_info(self.as_ref().to_glib_none().0, has_timing.to_glib());
gst_base_sys::gst_base_parse_set_has_timing_info(
self.as_ref().to_glib_none().0,
has_timing.to_glib(),
);
}
}
fn set_infer_ts(&self, infer_ts: bool) {
unsafe {
gst_base_sys::gst_base_parse_set_infer_ts(self.as_ref().to_glib_none().0, infer_ts.to_glib());
gst_base_sys::gst_base_parse_set_infer_ts(
self.as_ref().to_glib_none().0,
infer_ts.to_glib(),
);
}
}
fn set_latency(&self, min_latency: gst::ClockTime, max_latency: gst::ClockTime) {
unsafe {
gst_base_sys::gst_base_parse_set_latency(self.as_ref().to_glib_none().0, min_latency.to_glib(), max_latency.to_glib());
gst_base_sys::gst_base_parse_set_latency(
self.as_ref().to_glib_none().0,
min_latency.to_glib(),
max_latency.to_glib(),
);
}
}
fn set_min_frame_size(&self, min_size: u32) {
unsafe {
gst_base_sys::gst_base_parse_set_min_frame_size(self.as_ref().to_glib_none().0, min_size);
gst_base_sys::gst_base_parse_set_min_frame_size(
self.as_ref().to_glib_none().0,
min_size,
);
}
}
fn set_passthrough(&self, passthrough: bool) {
unsafe {
gst_base_sys::gst_base_parse_set_passthrough(self.as_ref().to_glib_none().0, passthrough.to_glib());
gst_base_sys::gst_base_parse_set_passthrough(
self.as_ref().to_glib_none().0,
passthrough.to_glib(),
);
}
}
fn set_pts_interpolation(&self, pts_interpolate: bool) {
unsafe {
gst_base_sys::gst_base_parse_set_pts_interpolation(self.as_ref().to_glib_none().0, pts_interpolate.to_glib());
gst_base_sys::gst_base_parse_set_pts_interpolation(
self.as_ref().to_glib_none().0,
pts_interpolate.to_glib(),
);
}
}
fn set_syncable(&self, syncable: bool) {
unsafe {
gst_base_sys::gst_base_parse_set_syncable(self.as_ref().to_glib_none().0, syncable.to_glib());
gst_base_sys::gst_base_parse_set_syncable(
self.as_ref().to_glib_none().0,
syncable.to_glib(),
);
}
}
@ -139,28 +177,52 @@ impl<O: IsA<BaseParse>> BaseParseExt for O {
fn get_property_disable_passthrough(&self) -> bool {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"disable-passthrough\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"disable-passthrough\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
fn set_property_disable_passthrough(&self, disable_passthrough: bool) {
unsafe {
gobject_sys::g_object_set_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"disable-passthrough\0".as_ptr() as *const _, Value::from(&disable_passthrough).to_glib_none().0);
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"disable-passthrough\0".as_ptr() as *const _,
Value::from(&disable_passthrough).to_glib_none().0,
);
}
}
fn connect_property_disable_passthrough_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_disable_passthrough_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut gst_base_sys::GstBaseParse, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<BaseParse>
fn connect_property_disable_passthrough_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_disable_passthrough_trampoline<
P,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut gst_base_sys::GstBaseParse,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<BaseParse>,
{
let f: &F = &*(f as *const F);
f(&BaseParse::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::disable-passthrough\0".as_ptr() as *const _,
Some(transmute(notify_disable_passthrough_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::disable-passthrough\0".as_ptr() as *const _,
Some(transmute(
notify_disable_passthrough_trampoline::<Self, F> as usize,
)),
Box_::into_raw(f),
)
}
}
}

View file

@ -2,13 +2,13 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib::StaticType;
use glib::Value;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::Value;
use glib_sys;
use gobject_sys;
use gst;
@ -105,30 +105,66 @@ pub trait BaseSinkExt: 'static {
fn set_property_qos(&self, qos: bool);
fn connect_property_async_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_async_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_blocksize_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_blocksize_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_enable_last_sample_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_enable_last_sample_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_last_sample_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_last_sample_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_max_bitrate_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_max_bitrate_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_max_lateness_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_max_lateness_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
#[cfg(any(feature = "v1_16", feature = "dox"))]
fn connect_property_processing_deadline_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_processing_deadline_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_render_delay_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_render_delay_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_sync_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_sync_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_throttle_time_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_throttle_time_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_ts_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_ts_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
}
impl<O: IsA<BaseSink>> BaseSinkExt for O {
@ -137,88 +173,96 @@ impl<O: IsA<BaseSink>> BaseSinkExt for O {
//}
fn get_blocksize(&self) -> u32 {
unsafe {
gst_base_sys::gst_base_sink_get_blocksize(self.as_ref().to_glib_none().0)
}
unsafe { gst_base_sys::gst_base_sink_get_blocksize(self.as_ref().to_glib_none().0) }
}
#[cfg(any(feature = "v1_12", feature = "dox"))]
fn get_drop_out_of_segment(&self) -> bool {
unsafe {
from_glib(gst_base_sys::gst_base_sink_get_drop_out_of_segment(self.as_ref().to_glib_none().0))
from_glib(gst_base_sys::gst_base_sink_get_drop_out_of_segment(
self.as_ref().to_glib_none().0,
))
}
}
fn get_last_sample(&self) -> Option<gst::Sample> {
unsafe {
from_glib_full(gst_base_sys::gst_base_sink_get_last_sample(self.as_ref().to_glib_none().0))
from_glib_full(gst_base_sys::gst_base_sink_get_last_sample(
self.as_ref().to_glib_none().0,
))
}
}
fn get_latency(&self) -> gst::ClockTime {
unsafe {
from_glib(gst_base_sys::gst_base_sink_get_latency(self.as_ref().to_glib_none().0))
from_glib(gst_base_sys::gst_base_sink_get_latency(
self.as_ref().to_glib_none().0,
))
}
}
fn get_max_bitrate(&self) -> u64 {
unsafe {
gst_base_sys::gst_base_sink_get_max_bitrate(self.as_ref().to_glib_none().0)
}
unsafe { gst_base_sys::gst_base_sink_get_max_bitrate(self.as_ref().to_glib_none().0) }
}
fn get_max_lateness(&self) -> i64 {
unsafe {
gst_base_sys::gst_base_sink_get_max_lateness(self.as_ref().to_glib_none().0)
}
unsafe { gst_base_sys::gst_base_sink_get_max_lateness(self.as_ref().to_glib_none().0) }
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
fn get_processing_deadline(&self) -> gst::ClockTime {
unsafe {
from_glib(gst_base_sys::gst_base_sink_get_processing_deadline(self.as_ref().to_glib_none().0))
from_glib(gst_base_sys::gst_base_sink_get_processing_deadline(
self.as_ref().to_glib_none().0,
))
}
}
fn get_render_delay(&self) -> gst::ClockTime {
unsafe {
from_glib(gst_base_sys::gst_base_sink_get_render_delay(self.as_ref().to_glib_none().0))
from_glib(gst_base_sys::gst_base_sink_get_render_delay(
self.as_ref().to_glib_none().0,
))
}
}
fn get_sync(&self) -> bool {
unsafe {
from_glib(gst_base_sys::gst_base_sink_get_sync(self.as_ref().to_glib_none().0))
from_glib(gst_base_sys::gst_base_sink_get_sync(
self.as_ref().to_glib_none().0,
))
}
}
fn get_throttle_time(&self) -> u64 {
unsafe {
gst_base_sys::gst_base_sink_get_throttle_time(self.as_ref().to_glib_none().0)
}
unsafe { gst_base_sys::gst_base_sink_get_throttle_time(self.as_ref().to_glib_none().0) }
}
fn get_ts_offset(&self) -> gst::ClockTimeDiff {
unsafe {
gst_base_sys::gst_base_sink_get_ts_offset(self.as_ref().to_glib_none().0)
}
unsafe { gst_base_sys::gst_base_sink_get_ts_offset(self.as_ref().to_glib_none().0) }
}
fn is_async_enabled(&self) -> bool {
unsafe {
from_glib(gst_base_sys::gst_base_sink_is_async_enabled(self.as_ref().to_glib_none().0))
from_glib(gst_base_sys::gst_base_sink_is_async_enabled(
self.as_ref().to_glib_none().0,
))
}
}
fn is_last_sample_enabled(&self) -> bool {
unsafe {
from_glib(gst_base_sys::gst_base_sink_is_last_sample_enabled(self.as_ref().to_glib_none().0))
from_glib(gst_base_sys::gst_base_sink_is_last_sample_enabled(
self.as_ref().to_glib_none().0,
))
}
}
fn is_qos_enabled(&self) -> bool {
unsafe {
from_glib(gst_base_sys::gst_base_sink_is_qos_enabled(self.as_ref().to_glib_none().0))
from_glib(gst_base_sys::gst_base_sink_is_qos_enabled(
self.as_ref().to_glib_none().0,
))
}
}
@ -228,14 +272,32 @@ impl<O: IsA<BaseSink>> BaseSinkExt for O {
let mut upstream_live = mem::uninitialized();
let mut min_latency = mem::uninitialized();
let mut max_latency = mem::uninitialized();
let ret = from_glib(gst_base_sys::gst_base_sink_query_latency(self.as_ref().to_glib_none().0, &mut live, &mut upstream_live, &mut min_latency, &mut max_latency));
if ret { Some((from_glib(live), from_glib(upstream_live), from_glib(min_latency), from_glib(max_latency))) } else { None }
let ret = from_glib(gst_base_sys::gst_base_sink_query_latency(
self.as_ref().to_glib_none().0,
&mut live,
&mut upstream_live,
&mut min_latency,
&mut max_latency,
));
if ret {
Some((
from_glib(live),
from_glib(upstream_live),
from_glib(min_latency),
from_glib(max_latency),
))
} else {
None
}
}
}
fn set_async_enabled(&self, enabled: bool) {
unsafe {
gst_base_sys::gst_base_sink_set_async_enabled(self.as_ref().to_glib_none().0, enabled.to_glib());
gst_base_sys::gst_base_sink_set_async_enabled(
self.as_ref().to_glib_none().0,
enabled.to_glib(),
);
}
}
@ -248,44 +310,65 @@ impl<O: IsA<BaseSink>> BaseSinkExt for O {
#[cfg(any(feature = "v1_12", feature = "dox"))]
fn set_drop_out_of_segment(&self, drop_out_of_segment: bool) {
unsafe {
gst_base_sys::gst_base_sink_set_drop_out_of_segment(self.as_ref().to_glib_none().0, drop_out_of_segment.to_glib());
gst_base_sys::gst_base_sink_set_drop_out_of_segment(
self.as_ref().to_glib_none().0,
drop_out_of_segment.to_glib(),
);
}
}
fn set_last_sample_enabled(&self, enabled: bool) {
unsafe {
gst_base_sys::gst_base_sink_set_last_sample_enabled(self.as_ref().to_glib_none().0, enabled.to_glib());
gst_base_sys::gst_base_sink_set_last_sample_enabled(
self.as_ref().to_glib_none().0,
enabled.to_glib(),
);
}
}
fn set_max_bitrate(&self, max_bitrate: u64) {
unsafe {
gst_base_sys::gst_base_sink_set_max_bitrate(self.as_ref().to_glib_none().0, max_bitrate);
gst_base_sys::gst_base_sink_set_max_bitrate(
self.as_ref().to_glib_none().0,
max_bitrate,
);
}
}
fn set_max_lateness(&self, max_lateness: i64) {
unsafe {
gst_base_sys::gst_base_sink_set_max_lateness(self.as_ref().to_glib_none().0, max_lateness);
gst_base_sys::gst_base_sink_set_max_lateness(
self.as_ref().to_glib_none().0,
max_lateness,
);
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
fn set_processing_deadline(&self, processing_deadline: gst::ClockTime) {
unsafe {
gst_base_sys::gst_base_sink_set_processing_deadline(self.as_ref().to_glib_none().0, processing_deadline.to_glib());
gst_base_sys::gst_base_sink_set_processing_deadline(
self.as_ref().to_glib_none().0,
processing_deadline.to_glib(),
);
}
}
fn set_qos_enabled(&self, enabled: bool) {
unsafe {
gst_base_sys::gst_base_sink_set_qos_enabled(self.as_ref().to_glib_none().0, enabled.to_glib());
gst_base_sys::gst_base_sink_set_qos_enabled(
self.as_ref().to_glib_none().0,
enabled.to_glib(),
);
}
}
fn set_render_delay(&self, delay: gst::ClockTime) {
unsafe {
gst_base_sys::gst_base_sink_set_render_delay(self.as_ref().to_glib_none().0, delay.to_glib());
gst_base_sys::gst_base_sink_set_render_delay(
self.as_ref().to_glib_none().0,
delay.to_glib(),
);
}
}
@ -310,7 +393,11 @@ impl<O: IsA<BaseSink>> BaseSinkExt for O {
fn wait_clock(&self, time: gst::ClockTime) -> (gst::ClockReturn, gst::ClockTimeDiff) {
unsafe {
let mut jitter = mem::uninitialized();
let ret = from_glib(gst_base_sys::gst_base_sink_wait_clock(self.as_ref().to_glib_none().0, time.to_glib(), &mut jitter));
let ret = from_glib(gst_base_sys::gst_base_sink_wait_clock(
self.as_ref().to_glib_none().0,
time.to_glib(),
&mut jitter,
));
(ret, jitter)
}
}
@ -318,211 +405,383 @@ impl<O: IsA<BaseSink>> BaseSinkExt for O {
fn get_property_async(&self) -> bool {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"async\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"async\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
fn set_property_async(&self, async: bool) {
unsafe {
gobject_sys::g_object_set_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"async\0".as_ptr() as *const _, Value::from(&async).to_glib_none().0);
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"async\0".as_ptr() as *const _,
Value::from(&async).to_glib_none().0,
);
}
}
fn get_property_enable_last_sample(&self) -> bool {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"enable-last-sample\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"enable-last-sample\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
fn set_property_enable_last_sample(&self, enable_last_sample: bool) {
unsafe {
gobject_sys::g_object_set_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"enable-last-sample\0".as_ptr() as *const _, Value::from(&enable_last_sample).to_glib_none().0);
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"enable-last-sample\0".as_ptr() as *const _,
Value::from(&enable_last_sample).to_glib_none().0,
);
}
}
fn get_property_qos(&self) -> bool {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"qos\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"qos\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
fn set_property_qos(&self, qos: bool) {
unsafe {
gobject_sys::g_object_set_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"qos\0".as_ptr() as *const _, Value::from(&qos).to_glib_none().0);
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"qos\0".as_ptr() as *const _,
Value::from(&qos).to_glib_none().0,
);
}
}
fn connect_property_async_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_async_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut gst_base_sys::GstBaseSink, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<BaseSink>
fn connect_property_async_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_async_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_base_sys::GstBaseSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<BaseSink>,
{
let f: &F = &*(f as *const F);
f(&BaseSink::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::async\0".as_ptr() as *const _,
Some(transmute(notify_async_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::async\0".as_ptr() as *const _,
Some(transmute(notify_async_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_blocksize_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_blocksize_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut gst_base_sys::GstBaseSink, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<BaseSink>
fn connect_property_blocksize_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_blocksize_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_base_sys::GstBaseSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<BaseSink>,
{
let f: &F = &*(f as *const F);
f(&BaseSink::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::blocksize\0".as_ptr() as *const _,
Some(transmute(notify_blocksize_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::blocksize\0".as_ptr() as *const _,
Some(transmute(notify_blocksize_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_enable_last_sample_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_enable_last_sample_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut gst_base_sys::GstBaseSink, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<BaseSink>
fn connect_property_enable_last_sample_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_enable_last_sample_trampoline<
P,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut gst_base_sys::GstBaseSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<BaseSink>,
{
let f: &F = &*(f as *const F);
f(&BaseSink::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::enable-last-sample\0".as_ptr() as *const _,
Some(transmute(notify_enable_last_sample_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::enable-last-sample\0".as_ptr() as *const _,
Some(transmute(
notify_enable_last_sample_trampoline::<Self, F> as usize,
)),
Box_::into_raw(f),
)
}
}
fn connect_property_last_sample_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_last_sample_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut gst_base_sys::GstBaseSink, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<BaseSink>
fn connect_property_last_sample_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_last_sample_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_base_sys::GstBaseSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<BaseSink>,
{
let f: &F = &*(f as *const F);
f(&BaseSink::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::last-sample\0".as_ptr() as *const _,
Some(transmute(notify_last_sample_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::last-sample\0".as_ptr() as *const _,
Some(transmute(notify_last_sample_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_max_bitrate_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_max_bitrate_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut gst_base_sys::GstBaseSink, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<BaseSink>
fn connect_property_max_bitrate_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_max_bitrate_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_base_sys::GstBaseSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<BaseSink>,
{
let f: &F = &*(f as *const F);
f(&BaseSink::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::max-bitrate\0".as_ptr() as *const _,
Some(transmute(notify_max_bitrate_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::max-bitrate\0".as_ptr() as *const _,
Some(transmute(notify_max_bitrate_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_max_lateness_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_max_lateness_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut gst_base_sys::GstBaseSink, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<BaseSink>
fn connect_property_max_lateness_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_max_lateness_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_base_sys::GstBaseSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<BaseSink>,
{
let f: &F = &*(f as *const F);
f(&BaseSink::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::max-lateness\0".as_ptr() as *const _,
Some(transmute(notify_max_lateness_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::max-lateness\0".as_ptr() as *const _,
Some(transmute(
notify_max_lateness_trampoline::<Self, F> as usize,
)),
Box_::into_raw(f),
)
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
fn connect_property_processing_deadline_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_processing_deadline_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut gst_base_sys::GstBaseSink, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<BaseSink>
fn connect_property_processing_deadline_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_processing_deadline_trampoline<
P,
F: Fn(&P) + Send + Sync + 'static,
>(
this: *mut gst_base_sys::GstBaseSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<BaseSink>,
{
let f: &F = &*(f as *const F);
f(&BaseSink::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::processing-deadline\0".as_ptr() as *const _,
Some(transmute(notify_processing_deadline_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::processing-deadline\0".as_ptr() as *const _,
Some(transmute(
notify_processing_deadline_trampoline::<Self, F> as usize,
)),
Box_::into_raw(f),
)
}
}
fn connect_property_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_qos_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut gst_base_sys::GstBaseSink, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<BaseSink>
fn connect_property_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_qos_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_base_sys::GstBaseSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<BaseSink>,
{
let f: &F = &*(f as *const F);
f(&BaseSink::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::qos\0".as_ptr() as *const _,
Some(transmute(notify_qos_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::qos\0".as_ptr() as *const _,
Some(transmute(notify_qos_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_render_delay_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_render_delay_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut gst_base_sys::GstBaseSink, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<BaseSink>
fn connect_property_render_delay_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_render_delay_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_base_sys::GstBaseSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<BaseSink>,
{
let f: &F = &*(f as *const F);
f(&BaseSink::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::render-delay\0".as_ptr() as *const _,
Some(transmute(notify_render_delay_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::render-delay\0".as_ptr() as *const _,
Some(transmute(
notify_render_delay_trampoline::<Self, F> as usize,
)),
Box_::into_raw(f),
)
}
}
fn connect_property_sync_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_sync_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut gst_base_sys::GstBaseSink, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<BaseSink>
fn connect_property_sync_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_sync_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_base_sys::GstBaseSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<BaseSink>,
{
let f: &F = &*(f as *const F);
f(&BaseSink::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::sync\0".as_ptr() as *const _,
Some(transmute(notify_sync_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::sync\0".as_ptr() as *const _,
Some(transmute(notify_sync_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_throttle_time_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_throttle_time_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut gst_base_sys::GstBaseSink, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<BaseSink>
fn connect_property_throttle_time_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_throttle_time_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_base_sys::GstBaseSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<BaseSink>,
{
let f: &F = &*(f as *const F);
f(&BaseSink::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::throttle-time\0".as_ptr() as *const _,
Some(transmute(notify_throttle_time_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::throttle-time\0".as_ptr() as *const _,
Some(transmute(
notify_throttle_time_trampoline::<Self, F> as usize,
)),
Box_::into_raw(f),
)
}
}
fn connect_property_ts_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_ts_offset_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut gst_base_sys::GstBaseSink, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<BaseSink>
fn connect_property_ts_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_ts_offset_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_base_sys::GstBaseSink,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<BaseSink>,
{
let f: &F = &*(f as *const F);
f(&BaseSink::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::ts-offset\0".as_ptr() as *const _,
Some(transmute(notify_ts_offset_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::ts-offset\0".as_ptr() as *const _,
Some(transmute(notify_ts_offset_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
}

View file

@ -3,13 +3,13 @@
// DO NOT EDIT
use glib;
use glib::StaticType;
use glib::Value;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::Value;
use glib_sys;
use gobject_sys;
use gst;
@ -72,13 +72,25 @@ pub trait BaseSrcExt: 'static {
fn set_property_typefind(&self, typefind: bool);
fn connect_property_blocksize_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_blocksize_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_do_timestamp_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_do_timestamp_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_num_buffers_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_num_buffers_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_typefind_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_typefind_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
}
impl<O: IsA<BaseSrc>> BaseSrcExt for O {
@ -87,38 +99,49 @@ impl<O: IsA<BaseSrc>> BaseSrcExt for O {
//}
fn get_blocksize(&self) -> u32 {
unsafe {
gst_base_sys::gst_base_src_get_blocksize(self.as_ref().to_glib_none().0)
}
unsafe { gst_base_sys::gst_base_src_get_blocksize(self.as_ref().to_glib_none().0) }
}
fn get_buffer_pool(&self) -> Option<gst::BufferPool> {
unsafe {
from_glib_full(gst_base_sys::gst_base_src_get_buffer_pool(self.as_ref().to_glib_none().0))
from_glib_full(gst_base_sys::gst_base_src_get_buffer_pool(
self.as_ref().to_glib_none().0,
))
}
}
fn get_do_timestamp(&self) -> bool {
unsafe {
from_glib(gst_base_sys::gst_base_src_get_do_timestamp(self.as_ref().to_glib_none().0))
from_glib(gst_base_sys::gst_base_src_get_do_timestamp(
self.as_ref().to_glib_none().0,
))
}
}
fn is_async(&self) -> bool {
unsafe {
from_glib(gst_base_sys::gst_base_src_is_async(self.as_ref().to_glib_none().0))
from_glib(gst_base_sys::gst_base_src_is_async(
self.as_ref().to_glib_none().0,
))
}
}
fn is_live(&self) -> bool {
unsafe {
from_glib(gst_base_sys::gst_base_src_is_live(self.as_ref().to_glib_none().0))
from_glib(gst_base_sys::gst_base_src_is_live(
self.as_ref().to_glib_none().0,
))
}
}
fn new_seamless_segment(&self, start: i64, stop: i64, time: i64) -> bool {
unsafe {
from_glib(gst_base_sys::gst_base_src_new_seamless_segment(self.as_ref().to_glib_none().0, start, stop, time))
from_glib(gst_base_sys::gst_base_src_new_seamless_segment(
self.as_ref().to_glib_none().0,
start,
stop,
time,
))
}
}
@ -127,8 +150,21 @@ impl<O: IsA<BaseSrc>> BaseSrcExt for O {
let mut live = mem::uninitialized();
let mut min_latency = mem::uninitialized();
let mut max_latency = mem::uninitialized();
let ret = from_glib(gst_base_sys::gst_base_src_query_latency(self.as_ref().to_glib_none().0, &mut live, &mut min_latency, &mut max_latency));
if ret { Some((from_glib(live), from_glib(min_latency), from_glib(max_latency))) } else { None }
let ret = from_glib(gst_base_sys::gst_base_src_query_latency(
self.as_ref().to_glib_none().0,
&mut live,
&mut min_latency,
&mut max_latency,
));
if ret {
Some((
from_glib(live),
from_glib(min_latency),
from_glib(max_latency),
))
} else {
None
}
}
}
@ -140,7 +176,10 @@ impl<O: IsA<BaseSrc>> BaseSrcExt for O {
fn set_automatic_eos(&self, automatic_eos: bool) {
unsafe {
gst_base_sys::gst_base_src_set_automatic_eos(self.as_ref().to_glib_none().0, automatic_eos.to_glib());
gst_base_sys::gst_base_src_set_automatic_eos(
self.as_ref().to_glib_none().0,
automatic_eos.to_glib(),
);
}
}
@ -152,19 +191,31 @@ impl<O: IsA<BaseSrc>> BaseSrcExt for O {
fn set_caps(&self, caps: &gst::Caps) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(gst_base_sys::gst_base_src_set_caps(self.as_ref().to_glib_none().0, caps.to_glib_none().0), "Failed to set caps")
glib_result_from_gboolean!(
gst_base_sys::gst_base_src_set_caps(
self.as_ref().to_glib_none().0,
caps.to_glib_none().0
),
"Failed to set caps"
)
}
}
fn set_do_timestamp(&self, timestamp: bool) {
unsafe {
gst_base_sys::gst_base_src_set_do_timestamp(self.as_ref().to_glib_none().0, timestamp.to_glib());
gst_base_sys::gst_base_src_set_do_timestamp(
self.as_ref().to_glib_none().0,
timestamp.to_glib(),
);
}
}
fn set_dynamic_size(&self, dynamic: bool) {
unsafe {
gst_base_sys::gst_base_src_set_dynamic_size(self.as_ref().to_glib_none().0, dynamic.to_glib());
gst_base_sys::gst_base_src_set_dynamic_size(
self.as_ref().to_glib_none().0,
dynamic.to_glib(),
);
}
}
@ -183,84 +234,146 @@ impl<O: IsA<BaseSrc>> BaseSrcExt for O {
fn get_property_num_buffers(&self) -> i32 {
unsafe {
let mut value = Value::from_type(<i32 as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"num-buffers\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"num-buffers\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
fn set_property_num_buffers(&self, num_buffers: i32) {
unsafe {
gobject_sys::g_object_set_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"num-buffers\0".as_ptr() as *const _, Value::from(&num_buffers).to_glib_none().0);
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"num-buffers\0".as_ptr() as *const _,
Value::from(&num_buffers).to_glib_none().0,
);
}
}
fn get_property_typefind(&self) -> bool {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"typefind\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"typefind\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
fn set_property_typefind(&self, typefind: bool) {
unsafe {
gobject_sys::g_object_set_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"typefind\0".as_ptr() as *const _, Value::from(&typefind).to_glib_none().0);
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"typefind\0".as_ptr() as *const _,
Value::from(&typefind).to_glib_none().0,
);
}
}
fn connect_property_blocksize_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_blocksize_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut gst_base_sys::GstBaseSrc, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<BaseSrc>
fn connect_property_blocksize_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_blocksize_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_base_sys::GstBaseSrc,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<BaseSrc>,
{
let f: &F = &*(f as *const F);
f(&BaseSrc::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::blocksize\0".as_ptr() as *const _,
Some(transmute(notify_blocksize_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::blocksize\0".as_ptr() as *const _,
Some(transmute(notify_blocksize_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_do_timestamp_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_do_timestamp_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut gst_base_sys::GstBaseSrc, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<BaseSrc>
fn connect_property_do_timestamp_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_do_timestamp_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_base_sys::GstBaseSrc,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<BaseSrc>,
{
let f: &F = &*(f as *const F);
f(&BaseSrc::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::do-timestamp\0".as_ptr() as *const _,
Some(transmute(notify_do_timestamp_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::do-timestamp\0".as_ptr() as *const _,
Some(transmute(
notify_do_timestamp_trampoline::<Self, F> as usize,
)),
Box_::into_raw(f),
)
}
}
fn connect_property_num_buffers_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_num_buffers_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut gst_base_sys::GstBaseSrc, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<BaseSrc>
fn connect_property_num_buffers_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_num_buffers_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_base_sys::GstBaseSrc,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<BaseSrc>,
{
let f: &F = &*(f as *const F);
f(&BaseSrc::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::num-buffers\0".as_ptr() as *const _,
Some(transmute(notify_num_buffers_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::num-buffers\0".as_ptr() as *const _,
Some(transmute(notify_num_buffers_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_typefind_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_typefind_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut gst_base_sys::GstBaseSrc, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<BaseSrc>
fn connect_property_typefind_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_typefind_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_base_sys::GstBaseSrc,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<BaseSrc>,
{
let f: &F = &*(f as *const F);
f(&BaseSrc::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::typefind\0".as_ptr() as *const _,
Some(transmute(notify_typefind_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::typefind\0".as_ptr() as *const _,
Some(transmute(notify_typefind_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
}

View file

@ -3,13 +3,13 @@
// DO NOT EDIT
use glib;
use glib::StaticType;
use glib::Value;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::Value;
use glib_sys;
use gobject_sys;
use gst;
@ -63,7 +63,10 @@ pub trait BaseTransformExt: 'static {
fn set_property_qos(&self, qos: bool);
fn connect_property_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
}
impl<O: IsA<BaseTransform>> BaseTransformExt for O {
@ -73,25 +76,33 @@ impl<O: IsA<BaseTransform>> BaseTransformExt for O {
fn get_buffer_pool(&self) -> Option<gst::BufferPool> {
unsafe {
from_glib_full(gst_base_sys::gst_base_transform_get_buffer_pool(self.as_ref().to_glib_none().0))
from_glib_full(gst_base_sys::gst_base_transform_get_buffer_pool(
self.as_ref().to_glib_none().0,
))
}
}
fn is_in_place(&self) -> bool {
unsafe {
from_glib(gst_base_sys::gst_base_transform_is_in_place(self.as_ref().to_glib_none().0))
from_glib(gst_base_sys::gst_base_transform_is_in_place(
self.as_ref().to_glib_none().0,
))
}
}
fn is_passthrough(&self) -> bool {
unsafe {
from_glib(gst_base_sys::gst_base_transform_is_passthrough(self.as_ref().to_glib_none().0))
from_glib(gst_base_sys::gst_base_transform_is_passthrough(
self.as_ref().to_glib_none().0,
))
}
}
fn is_qos_enabled(&self) -> bool {
unsafe {
from_glib(gst_base_sys::gst_base_transform_is_qos_enabled(self.as_ref().to_glib_none().0))
from_glib(gst_base_sys::gst_base_transform_is_qos_enabled(
self.as_ref().to_glib_none().0,
))
}
}
@ -109,71 +120,116 @@ impl<O: IsA<BaseTransform>> BaseTransformExt for O {
fn set_gap_aware(&self, gap_aware: bool) {
unsafe {
gst_base_sys::gst_base_transform_set_gap_aware(self.as_ref().to_glib_none().0, gap_aware.to_glib());
gst_base_sys::gst_base_transform_set_gap_aware(
self.as_ref().to_glib_none().0,
gap_aware.to_glib(),
);
}
}
fn set_in_place(&self, in_place: bool) {
unsafe {
gst_base_sys::gst_base_transform_set_in_place(self.as_ref().to_glib_none().0, in_place.to_glib());
gst_base_sys::gst_base_transform_set_in_place(
self.as_ref().to_glib_none().0,
in_place.to_glib(),
);
}
}
fn set_passthrough(&self, passthrough: bool) {
unsafe {
gst_base_sys::gst_base_transform_set_passthrough(self.as_ref().to_glib_none().0, passthrough.to_glib());
gst_base_sys::gst_base_transform_set_passthrough(
self.as_ref().to_glib_none().0,
passthrough.to_glib(),
);
}
}
fn set_prefer_passthrough(&self, prefer_passthrough: bool) {
unsafe {
gst_base_sys::gst_base_transform_set_prefer_passthrough(self.as_ref().to_glib_none().0, prefer_passthrough.to_glib());
gst_base_sys::gst_base_transform_set_prefer_passthrough(
self.as_ref().to_glib_none().0,
prefer_passthrough.to_glib(),
);
}
}
fn set_qos_enabled(&self, enabled: bool) {
unsafe {
gst_base_sys::gst_base_transform_set_qos_enabled(self.as_ref().to_glib_none().0, enabled.to_glib());
gst_base_sys::gst_base_transform_set_qos_enabled(
self.as_ref().to_glib_none().0,
enabled.to_glib(),
);
}
}
fn update_qos(&self, proportion: f64, diff: gst::ClockTimeDiff, timestamp: gst::ClockTime) {
unsafe {
gst_base_sys::gst_base_transform_update_qos(self.as_ref().to_glib_none().0, proportion, diff, timestamp.to_glib());
gst_base_sys::gst_base_transform_update_qos(
self.as_ref().to_glib_none().0,
proportion,
diff,
timestamp.to_glib(),
);
}
}
fn update_src_caps(&self, updated_caps: &gst::Caps) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(gst_base_sys::gst_base_transform_update_src_caps(self.as_ref().to_glib_none().0, updated_caps.to_glib_none().0), "Failed to update src caps")
glib_result_from_gboolean!(
gst_base_sys::gst_base_transform_update_src_caps(
self.as_ref().to_glib_none().0,
updated_caps.to_glib_none().0
),
"Failed to update src caps"
)
}
}
fn get_property_qos(&self) -> bool {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"qos\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"qos\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
fn set_property_qos(&self, qos: bool) {
unsafe {
gobject_sys::g_object_set_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"qos\0".as_ptr() as *const _, Value::from(&qos).to_glib_none().0);
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"qos\0".as_ptr() as *const _,
Value::from(&qos).to_glib_none().0,
);
}
}
fn connect_property_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_qos_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut gst_base_sys::GstBaseTransform, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<BaseTransform>
fn connect_property_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_qos_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_base_sys::GstBaseTransform,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<BaseTransform>,
{
let f: &F = &*(f as *const F);
f(&BaseTransform::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::qos\0".as_ptr() as *const _,
Some(transmute(notify_qos_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::qos\0".as_ptr() as *const _,
Some(transmute(notify_qos_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
}

View file

@ -32,4 +32,3 @@ impl FromGlib<gst_base_sys::GstBaseParseFrameFlags> for BaseParseFrameFlags {
BaseParseFrameFlags::from_bits_truncate(value)
}
}

View file

@ -8,48 +8,84 @@ use gst;
use gst_base_sys;
use std::mem;
pub fn type_find_helper<P: IsA<gst::Pad>>(src: &P, size: u64) -> Option<gst::Caps> {
assert_initialized_main_thread!();
unsafe {
from_glib_full(gst_base_sys::gst_type_find_helper(src.as_ref().to_glib_none().0, size))
from_glib_full(gst_base_sys::gst_type_find_helper(
src.as_ref().to_glib_none().0,
size,
))
}
}
pub fn type_find_helper_for_buffer<P: IsA<gst::Object>>(obj: Option<&P>, buf: &gst::Buffer) -> (Option<gst::Caps>, gst::TypeFindProbability) {
pub fn type_find_helper_for_buffer<P: IsA<gst::Object>>(
obj: Option<&P>,
buf: &gst::Buffer,
) -> (Option<gst::Caps>, gst::TypeFindProbability) {
assert_initialized_main_thread!();
unsafe {
let mut prob = mem::uninitialized();
let ret = from_glib_full(gst_base_sys::gst_type_find_helper_for_buffer(obj.map(|p| p.as_ref()).to_glib_none().0, buf.to_glib_none().0, &mut prob));
let ret = from_glib_full(gst_base_sys::gst_type_find_helper_for_buffer(
obj.map(|p| p.as_ref()).to_glib_none().0,
buf.to_glib_none().0,
&mut prob,
));
(ret, from_glib(prob))
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
pub fn type_find_helper_for_buffer_with_extension<P: IsA<gst::Object>>(obj: Option<&P>, buf: &gst::Buffer, extension: Option<&str>) -> (Option<gst::Caps>, gst::TypeFindProbability) {
pub fn type_find_helper_for_buffer_with_extension<P: IsA<gst::Object>>(
obj: Option<&P>,
buf: &gst::Buffer,
extension: Option<&str>,
) -> (Option<gst::Caps>, gst::TypeFindProbability) {
assert_initialized_main_thread!();
unsafe {
let mut prob = mem::uninitialized();
let ret = from_glib_full(gst_base_sys::gst_type_find_helper_for_buffer_with_extension(obj.map(|p| p.as_ref()).to_glib_none().0, buf.to_glib_none().0, extension.to_glib_none().0, &mut prob));
let ret = from_glib_full(
gst_base_sys::gst_type_find_helper_for_buffer_with_extension(
obj.map(|p| p.as_ref()).to_glib_none().0,
buf.to_glib_none().0,
extension.to_glib_none().0,
&mut prob,
),
);
(ret, from_glib(prob))
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
pub fn type_find_helper_for_data_with_extension<P: IsA<gst::Object>>(obj: Option<&P>, data: &[u8], extension: Option<&str>) -> (Option<gst::Caps>, gst::TypeFindProbability) {
pub fn type_find_helper_for_data_with_extension<P: IsA<gst::Object>>(
obj: Option<&P>,
data: &[u8],
extension: Option<&str>,
) -> (Option<gst::Caps>, gst::TypeFindProbability) {
assert_initialized_main_thread!();
let size = data.len() as usize;
unsafe {
let mut prob = mem::uninitialized();
let ret = from_glib_full(gst_base_sys::gst_type_find_helper_for_data_with_extension(obj.map(|p| p.as_ref()).to_glib_none().0, data.to_glib_none().0, size, extension.to_glib_none().0, &mut prob));
let ret = from_glib_full(gst_base_sys::gst_type_find_helper_for_data_with_extension(
obj.map(|p| p.as_ref()).to_glib_none().0,
data.to_glib_none().0,
size,
extension.to_glib_none().0,
&mut prob,
));
(ret, from_glib(prob))
}
}
pub fn type_find_helper_for_extension<P: IsA<gst::Object>>(obj: Option<&P>, extension: &str) -> Option<gst::Caps> {
pub fn type_find_helper_for_extension<P: IsA<gst::Object>>(
obj: Option<&P>,
extension: &str,
) -> Option<gst::Caps> {
assert_initialized_main_thread!();
unsafe {
from_glib_full(gst_base_sys::gst_type_find_helper_for_extension(obj.map(|p| p.as_ref()).to_glib_none().0, extension.to_glib_none().0))
from_glib_full(gst_base_sys::gst_type_find_helper_for_extension(
obj.map(|p| p.as_ref()).to_glib_none().0,
extension.to_glib_none().0,
))
}
}

View file

@ -8,32 +8,32 @@ pub use self::adapter::{Adapter, AdapterClass};
#[cfg(any(feature = "v1_14", feature = "dox"))]
mod aggregator;
#[cfg(any(feature = "v1_14", feature = "dox"))]
pub use self::aggregator::{Aggregator, AggregatorClass, NONE_AGGREGATOR};
#[cfg(any(feature = "v1_14", feature = "dox"))]
pub use self::aggregator::AggregatorExt;
#[cfg(any(feature = "v1_14", feature = "dox"))]
pub use self::aggregator::{Aggregator, AggregatorClass, NONE_AGGREGATOR};
#[cfg(any(feature = "v1_14", feature = "dox"))]
mod aggregator_pad;
#[cfg(any(feature = "v1_14", feature = "dox"))]
pub use self::aggregator_pad::{AggregatorPad, AggregatorPadClass, NONE_AGGREGATOR_PAD};
#[cfg(any(feature = "v1_14", feature = "dox"))]
pub use self::aggregator_pad::AggregatorPadExt;
#[cfg(any(feature = "v1_14", feature = "dox"))]
pub use self::aggregator_pad::{AggregatorPad, AggregatorPadClass, NONE_AGGREGATOR_PAD};
mod base_parse;
pub use self::base_parse::{BaseParse, BaseParseClass, NONE_BASE_PARSE};
pub use self::base_parse::BaseParseExt;
pub use self::base_parse::{BaseParse, BaseParseClass, NONE_BASE_PARSE};
mod base_sink;
pub use self::base_sink::{BaseSink, BaseSinkClass, NONE_BASE_SINK};
pub use self::base_sink::BaseSinkExt;
pub use self::base_sink::{BaseSink, BaseSinkClass, NONE_BASE_SINK};
mod base_src;
pub use self::base_src::{BaseSrc, BaseSrcClass, NONE_BASE_SRC};
pub use self::base_src::BaseSrcExt;
pub use self::base_src::{BaseSrc, BaseSrcClass, NONE_BASE_SRC};
mod base_transform;
pub use self::base_transform::{BaseTransform, BaseTransformClass, NONE_BASE_TRANSFORM};
pub use self::base_transform::BaseTransformExt;
pub use self::base_transform::{BaseTransform, BaseTransformClass, NONE_BASE_TRANSFORM};
mod push_src;
pub use self::push_src::{PushSrc, PushSrcClass, NONE_PUSH_SRC};

View file

@ -2,10 +2,10 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use BaseSrc;
use glib::translate::*;
use gst;
use gst_base_sys;
use BaseSrc;
glib_wrapper! {
pub struct PushSrc(Object<gst_base_sys::GstPushSrc, gst_base_sys::GstPushSrcClass, PushSrcClass>) @extends BaseSrc, gst::Element, gst::Object;

View file

@ -38,7 +38,6 @@ pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue
#[allow(clippy::too_many_arguments)]
#[allow(clippy::match_same_arms)]
#[allow(clippy::type_complexity)]
#[rustfmt::skip]
mod auto;
pub use auto::functions::*;
pub use auto::*;

View file

@ -6,5 +6,4 @@ mod test_clock;
pub use self::test_clock::{TestClock, TestClockClass};
#[doc(hidden)]
pub mod traits {
}
pub mod traits {}

View file

@ -2,13 +2,13 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib::StaticType;
use glib::Value;
use glib::object::Cast;
use glib::object::ObjectType as ObjectType_;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::Value;
use glib_sys;
use gobject_sys;
use gst;
@ -27,15 +27,16 @@ glib_wrapper! {
impl TestClock {
pub fn new() -> TestClock {
assert_initialized_main_thread!();
unsafe {
gst::Clock::from_glib_full(gst_check_sys::gst_test_clock_new()).unsafe_cast()
}
unsafe { gst::Clock::from_glib_full(gst_check_sys::gst_test_clock_new()).unsafe_cast() }
}
pub fn new_with_start_time(start_time: gst::ClockTime) -> TestClock {
assert_initialized_main_thread!();
unsafe {
gst::Clock::from_glib_full(gst_check_sys::gst_test_clock_new_with_start_time(start_time.to_glib())).unsafe_cast()
gst::Clock::from_glib_full(gst_check_sys::gst_test_clock_new_with_start_time(
start_time.to_glib(),
))
.unsafe_cast()
}
}
@ -46,14 +47,14 @@ impl TestClock {
}
pub fn crank(&self) -> bool {
unsafe {
from_glib(gst_check_sys::gst_test_clock_crank(self.to_glib_none().0))
}
unsafe { from_glib(gst_check_sys::gst_test_clock_crank(self.to_glib_none().0)) }
}
pub fn get_next_entry_time(&self) -> gst::ClockTime {
unsafe {
from_glib(gst_check_sys::gst_test_clock_get_next_entry_time(self.to_glib_none().0))
from_glib(gst_check_sys::gst_test_clock_get_next_entry_time(
self.to_glib_none().0,
))
}
}
@ -62,9 +63,7 @@ impl TestClock {
//}
pub fn peek_id_count(&self) -> u32 {
unsafe {
gst_check_sys::gst_test_clock_peek_id_count(self.to_glib_none().0)
}
unsafe { gst_check_sys::gst_test_clock_peek_id_count(self.to_glib_none().0) }
}
//pub fn peek_next_pending_id(&self, pending_id: /*Ignored*/&mut gst::ClockID) -> bool {
@ -107,21 +106,33 @@ impl TestClock {
pub fn get_property_clock_type(&self) -> gst::ClockType {
unsafe {
let mut value = Value::from_type(<gst::ClockType as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"clock-type\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"clock-type\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
pub fn set_property_clock_type(&self, clock_type: gst::ClockType) {
unsafe {
gobject_sys::g_object_set_property(self.as_ptr() as *mut gobject_sys::GObject, b"clock-type\0".as_ptr() as *const _, Value::from(&clock_type).to_glib_none().0);
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"clock-type\0".as_ptr() as *const _,
Value::from(&clock_type).to_glib_none().0,
);
}
}
pub fn get_property_start_time(&self) -> u64 {
unsafe {
let mut value = Value::from_type(<u64 as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"start-time\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"start-time\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
@ -130,15 +141,28 @@ impl TestClock {
// unsafe { TODO: call gst_check_sys:gst_test_clock_id_list_get_latest_time() }
//}
pub fn connect_property_clock_type_notify<F: Fn(&TestClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_clock_type_trampoline<F: Fn(&TestClock) + Send + Sync + 'static>(this: *mut gst_check_sys::GstTestClock, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_clock_type_notify<F: Fn(&TestClock) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_clock_type_trampoline<
F: Fn(&TestClock) + Send + Sync + 'static,
>(
this: *mut gst_check_sys::GstTestClock,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::clock-type\0".as_ptr() as *const _,
Some(transmute(notify_clock_type_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::clock-type\0".as_ptr() as *const _,
Some(transmute(notify_clock_type_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
}

View file

@ -29,7 +29,6 @@ pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue
#[allow(clippy::too_many_arguments)]
#[allow(clippy::match_same_arms)]
#[allow(clippy::type_complexity)]
#[rustfmt::skip]
mod auto;
pub use auto::*;

View file

@ -2,26 +2,26 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use Error;
use Extractable;
#[cfg(feature = "futures")]
use futures::future;
use ges_sys;
use gio;
use gio_sys;
use glib;
use glib::GString;
use glib::Value;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::GString;
use glib::Value;
use glib_sys;
use gobject_sys;
use std::boxed::Box as Box_;
use std::mem::transmute;
use std::ptr;
use Error;
use Extractable;
glib_wrapper! {
pub struct Asset(Object<ges_sys::GESAsset, ges_sys::GESAssetClass, AssetClass>);
@ -35,52 +35,88 @@ impl Asset {
pub fn needs_reload(extractable_type: glib::types::Type, id: &str) -> bool {
assert_initialized_main_thread!();
unsafe {
from_glib(ges_sys::ges_asset_needs_reload(extractable_type.to_glib(), id.to_glib_none().0))
from_glib(ges_sys::ges_asset_needs_reload(
extractable_type.to_glib(),
id.to_glib_none().0,
))
}
}
pub fn request(extractable_type: glib::types::Type, id: Option<&str>) -> Result<Option<Asset>, Error> {
pub fn request(
extractable_type: glib::types::Type,
id: Option<&str>,
) -> Result<Option<Asset>, Error> {
assert_initialized_main_thread!();
unsafe {
let mut error = ptr::null_mut();
let ret = ges_sys::ges_asset_request(extractable_type.to_glib(), id.to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
let ret = ges_sys::ges_asset_request(
extractable_type.to_glib(),
id.to_glib_none().0,
&mut error,
);
if error.is_null() {
Ok(from_glib_full(ret))
} else {
Err(from_glib_full(error))
}
}
}
pub fn request_async<P: IsA<gio::Cancellable>, Q: FnOnce(Result<Asset, Error>) + Send + 'static>(extractable_type: glib::types::Type, id: &str, cancellable: Option<&P>, callback: Q) {
pub fn request_async<
P: IsA<gio::Cancellable>,
Q: FnOnce(Result<Asset, Error>) + Send + 'static,
>(
extractable_type: glib::types::Type,
id: &str,
cancellable: Option<&P>,
callback: Q,
) {
assert_initialized_main_thread!();
let user_data: Box<Q> = Box::new(callback);
unsafe extern "C" fn request_async_trampoline<Q: FnOnce(Result<Asset, Error>) + Send + 'static>(_source_object: *mut gobject_sys::GObject, res: *mut gio_sys::GAsyncResult, user_data: glib_sys::gpointer) {
unsafe extern "C" fn request_async_trampoline<
Q: FnOnce(Result<Asset, Error>) + Send + 'static,
>(
_source_object: *mut gobject_sys::GObject,
res: *mut gio_sys::GAsyncResult,
user_data: glib_sys::gpointer,
) {
let mut error = ptr::null_mut();
let ret = ges_sys::ges_asset_request_finish(res, &mut error);
let result = if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) };
let result = if error.is_null() {
Ok(from_glib_full(ret))
} else {
Err(from_glib_full(error))
};
let callback: Box<Q> = Box::from_raw(user_data as *mut _);
callback(result);
}
let callback = request_async_trampoline::<Q>;
unsafe {
ges_sys::ges_asset_request_async(extractable_type.to_glib(), id.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, Some(callback), Box::into_raw(user_data) as *mut _);
ges_sys::ges_asset_request_async(
extractable_type.to_glib(),
id.to_glib_none().0,
cancellable.map(|p| p.as_ref()).to_glib_none().0,
Some(callback),
Box::into_raw(user_data) as *mut _,
);
}
}
#[cfg(feature = "futures")]
pub fn request_async_future(extractable_type: glib::types::Type, id: &str) -> Box_<dyn future::Future<Output = Result<Asset, Error>> + std::marker::Unpin> {
use gio::GioFuture;
pub fn request_async_future(
extractable_type: glib::types::Type,
id: &str,
) -> Box_<dyn future::Future<Output = Result<Asset, Error>> + std::marker::Unpin> {
use fragile::Fragile;
use gio::GioFuture;
let id = String::from(id);
GioFuture::new(&(), move |_obj, send| {
let cancellable = gio::Cancellable::new();
let send = Fragile::new(send);
Self::request_async(
extractable_type,
&id,
Some(&cancellable),
move |res| {
Self::request_async(extractable_type, &id, Some(&cancellable), move |res| {
let _ = send.into_inner().send(res);
},
);
});
cancellable
})
@ -112,7 +148,8 @@ pub trait AssetExt: 'static {
fn connect_property_proxy_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_proxy_target_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_proxy_target_notify<F: Fn(&Self) + 'static>(&self, f: F)
-> SignalHandlerId;
}
impl<O: IsA<Asset>> AssetExt for O {
@ -120,89 +157,130 @@ impl<O: IsA<Asset>> AssetExt for O {
unsafe {
let mut error = ptr::null_mut();
let ret = ges_sys::ges_asset_extract(self.as_ref().to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_none(ret)) } else { Err(from_glib_full(error)) }
if error.is_null() {
Ok(from_glib_none(ret))
} else {
Err(from_glib_full(error))
}
}
}
fn get_error(&self) -> Option<Error> {
unsafe {
from_glib_none(ges_sys::ges_asset_get_error(self.as_ref().to_glib_none().0))
}
unsafe { from_glib_none(ges_sys::ges_asset_get_error(self.as_ref().to_glib_none().0)) }
}
fn get_extractable_type(&self) -> glib::types::Type {
unsafe {
from_glib(ges_sys::ges_asset_get_extractable_type(self.as_ref().to_glib_none().0))
from_glib(ges_sys::ges_asset_get_extractable_type(
self.as_ref().to_glib_none().0,
))
}
}
fn get_id(&self) -> Option<GString> {
unsafe {
from_glib_none(ges_sys::ges_asset_get_id(self.as_ref().to_glib_none().0))
}
unsafe { from_glib_none(ges_sys::ges_asset_get_id(self.as_ref().to_glib_none().0)) }
}
fn get_proxy(&self) -> Option<Asset> {
unsafe {
from_glib_none(ges_sys::ges_asset_get_proxy(self.as_ref().to_glib_none().0))
}
unsafe { from_glib_none(ges_sys::ges_asset_get_proxy(self.as_ref().to_glib_none().0)) }
}
fn get_proxy_target(&self) -> Option<Asset> {
unsafe {
from_glib_none(ges_sys::ges_asset_get_proxy_target(self.as_ref().to_glib_none().0))
from_glib_none(ges_sys::ges_asset_get_proxy_target(
self.as_ref().to_glib_none().0,
))
}
}
fn list_proxies(&self) -> Vec<Asset> {
unsafe {
FromGlibPtrContainer::from_glib_none(ges_sys::ges_asset_list_proxies(self.as_ref().to_glib_none().0))
FromGlibPtrContainer::from_glib_none(ges_sys::ges_asset_list_proxies(
self.as_ref().to_glib_none().0,
))
}
}
fn set_proxy<P: IsA<Asset>>(&self, proxy: Option<&P>) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_asset_set_proxy(self.as_ref().to_glib_none().0, proxy.map(|p| p.as_ref()).to_glib_none().0), "Failed to set proxy")
glib_result_from_gboolean!(
ges_sys::ges_asset_set_proxy(
self.as_ref().to_glib_none().0,
proxy.map(|p| p.as_ref()).to_glib_none().0
),
"Failed to set proxy"
)
}
}
fn unproxy<P: IsA<Asset>>(&self, proxy: &P) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_asset_unproxy(self.as_ref().to_glib_none().0, proxy.as_ref().to_glib_none().0), "Failed to unproxy asset")
glib_result_from_gboolean!(
ges_sys::ges_asset_unproxy(
self.as_ref().to_glib_none().0,
proxy.as_ref().to_glib_none().0
),
"Failed to unproxy asset"
)
}
}
fn set_property_proxy_target(&self, proxy_target: Option<&Asset>) {
unsafe {
gobject_sys::g_object_set_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"proxy-target\0".as_ptr() as *const _, Value::from(proxy_target).to_glib_none().0);
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"proxy-target\0".as_ptr() as *const _,
Value::from(proxy_target).to_glib_none().0,
);
}
}
fn connect_property_proxy_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_proxy_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESAsset, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<Asset>
unsafe extern "C" fn notify_proxy_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESAsset,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<Asset>,
{
let f: &F = &*(f as *const F);
f(&Asset::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::proxy\0".as_ptr() as *const _,
Some(transmute(notify_proxy_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::proxy\0".as_ptr() as *const _,
Some(transmute(notify_proxy_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_proxy_target_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_proxy_target_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESAsset, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<Asset>
fn connect_property_proxy_target_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_proxy_target_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESAsset,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<Asset>,
{
let f: &F = &*(f as *const F);
f(&Asset::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::proxy-target\0".as_ptr() as *const _,
Some(transmute(notify_proxy_target_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::proxy-target\0".as_ptr() as *const _,
Some(transmute(
notify_proxy_target_trampoline::<Self, F> as usize,
)),
Box_::into_raw(f),
)
}
}
}

View file

@ -2,11 +2,11 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use ges_sys;
use glib::translate::*;
use Extractable;
use TimelineElement;
use TrackElement;
use ges_sys;
use glib::translate::*;
glib_wrapper! {
pub struct BaseEffect(Object<ges_sys::GESBaseEffect, ges_sys::GESBaseEffectClass, BaseEffectClass>) @extends TrackElement, TimelineElement, @implements Extractable;

View file

@ -2,6 +2,16 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use ges_sys;
use glib;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib_sys;
use std::boxed::Box as Box_;
use std::mem::transmute;
use Asset;
use BaseEffect;
use Container;
@ -11,16 +21,6 @@ use TimelineElement;
use Track;
use TrackElement;
use TrackType;
use ges_sys;
use glib;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::translate::*;
use glib_sys;
use std::boxed::Box as Box_;
use std::mem::transmute;
glib_wrapper! {
pub struct Clip(Object<ges_sys::GESClip, ges_sys::GESClipClass, ClipClass>) @extends Container, TimelineElement, @implements Extractable;
@ -35,9 +35,18 @@ pub const NONE_CLIP: Option<&Clip> = None;
pub trait ClipExt: 'static {
fn add_asset<P: IsA<Asset>>(&self, asset: &P) -> Option<TrackElement>;
fn find_track_element<P: IsA<Track>>(&self, track: Option<&P>, type_: glib::types::Type) -> Option<TrackElement>;
fn find_track_element<P: IsA<Track>>(
&self,
track: Option<&P>,
type_: glib::types::Type,
) -> Option<TrackElement>;
fn find_track_elements<P: IsA<Track>>(&self, track: Option<&P>, track_type: TrackType, type_: glib::types::Type) -> Vec<TrackElement>;
fn find_track_elements<P: IsA<Track>>(
&self,
track: Option<&P>,
track_type: TrackType,
type_: glib::types::Type,
) -> Vec<TrackElement>;
fn get_layer(&self) -> Option<Layer>;
@ -53,121 +62,216 @@ pub trait ClipExt: 'static {
fn set_supported_formats(&self, supportedformats: TrackType);
fn set_top_effect_index<P: IsA<BaseEffect>>(&self, effect: &P, newindex: u32) -> Result<(), glib::error::BoolError>;
fn set_top_effect_index<P: IsA<BaseEffect>>(
&self,
effect: &P,
newindex: u32,
) -> Result<(), glib::error::BoolError>;
fn set_top_effect_priority<P: IsA<BaseEffect>>(&self, effect: &P, newpriority: u32) -> Result<(), glib::error::BoolError>;
fn set_top_effect_priority<P: IsA<BaseEffect>>(
&self,
effect: &P,
newpriority: u32,
) -> Result<(), glib::error::BoolError>;
fn split(&self, position: u64) -> Option<Clip>;
fn connect_property_layer_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_supported_formats_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_supported_formats_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
}
impl<O: IsA<Clip>> ClipExt for O {
fn add_asset<P: IsA<Asset>>(&self, asset: &P) -> Option<TrackElement> {
unsafe {
from_glib_none(ges_sys::ges_clip_add_asset(self.as_ref().to_glib_none().0, asset.as_ref().to_glib_none().0))
from_glib_none(ges_sys::ges_clip_add_asset(
self.as_ref().to_glib_none().0,
asset.as_ref().to_glib_none().0,
))
}
}
fn find_track_element<P: IsA<Track>>(&self, track: Option<&P>, type_: glib::types::Type) -> Option<TrackElement> {
fn find_track_element<P: IsA<Track>>(
&self,
track: Option<&P>,
type_: glib::types::Type,
) -> Option<TrackElement> {
unsafe {
from_glib_full(ges_sys::ges_clip_find_track_element(self.as_ref().to_glib_none().0, track.map(|p| p.as_ref()).to_glib_none().0, type_.to_glib()))
from_glib_full(ges_sys::ges_clip_find_track_element(
self.as_ref().to_glib_none().0,
track.map(|p| p.as_ref()).to_glib_none().0,
type_.to_glib(),
))
}
}
fn find_track_elements<P: IsA<Track>>(&self, track: Option<&P>, track_type: TrackType, type_: glib::types::Type) -> Vec<TrackElement> {
fn find_track_elements<P: IsA<Track>>(
&self,
track: Option<&P>,
track_type: TrackType,
type_: glib::types::Type,
) -> Vec<TrackElement> {
unsafe {
FromGlibPtrContainer::from_glib_full(ges_sys::ges_clip_find_track_elements(self.as_ref().to_glib_none().0, track.map(|p| p.as_ref()).to_glib_none().0, track_type.to_glib(), type_.to_glib()))
FromGlibPtrContainer::from_glib_full(ges_sys::ges_clip_find_track_elements(
self.as_ref().to_glib_none().0,
track.map(|p| p.as_ref()).to_glib_none().0,
track_type.to_glib(),
type_.to_glib(),
))
}
}
fn get_layer(&self) -> Option<Layer> {
unsafe {
from_glib_full(ges_sys::ges_clip_get_layer(self.as_ref().to_glib_none().0))
}
unsafe { from_glib_full(ges_sys::ges_clip_get_layer(self.as_ref().to_glib_none().0)) }
}
fn get_supported_formats(&self) -> TrackType {
unsafe {
from_glib(ges_sys::ges_clip_get_supported_formats(self.as_ref().to_glib_none().0))
from_glib(ges_sys::ges_clip_get_supported_formats(
self.as_ref().to_glib_none().0,
))
}
}
fn get_top_effect_index<P: IsA<BaseEffect>>(&self, effect: &P) -> i32 {
unsafe {
ges_sys::ges_clip_get_top_effect_index(self.as_ref().to_glib_none().0, effect.as_ref().to_glib_none().0)
ges_sys::ges_clip_get_top_effect_index(
self.as_ref().to_glib_none().0,
effect.as_ref().to_glib_none().0,
)
}
}
fn get_top_effect_position<P: IsA<BaseEffect>>(&self, effect: &P) -> i32 {
unsafe {
ges_sys::ges_clip_get_top_effect_position(self.as_ref().to_glib_none().0, effect.as_ref().to_glib_none().0)
ges_sys::ges_clip_get_top_effect_position(
self.as_ref().to_glib_none().0,
effect.as_ref().to_glib_none().0,
)
}
}
fn get_top_effects(&self) -> Vec<TrackElement> {
unsafe {
FromGlibPtrContainer::from_glib_full(ges_sys::ges_clip_get_top_effects(self.as_ref().to_glib_none().0))
FromGlibPtrContainer::from_glib_full(ges_sys::ges_clip_get_top_effects(
self.as_ref().to_glib_none().0,
))
}
}
fn move_to_layer<P: IsA<Layer>>(&self, layer: &P) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_clip_move_to_layer(self.as_ref().to_glib_none().0, layer.as_ref().to_glib_none().0), "Failed to move clip to specified layer")
glib_result_from_gboolean!(
ges_sys::ges_clip_move_to_layer(
self.as_ref().to_glib_none().0,
layer.as_ref().to_glib_none().0
),
"Failed to move clip to specified layer"
)
}
}
fn set_supported_formats(&self, supportedformats: TrackType) {
unsafe {
ges_sys::ges_clip_set_supported_formats(self.as_ref().to_glib_none().0, supportedformats.to_glib());
ges_sys::ges_clip_set_supported_formats(
self.as_ref().to_glib_none().0,
supportedformats.to_glib(),
);
}
}
fn set_top_effect_index<P: IsA<BaseEffect>>(&self, effect: &P, newindex: u32) -> Result<(), glib::error::BoolError> {
fn set_top_effect_index<P: IsA<BaseEffect>>(
&self,
effect: &P,
newindex: u32,
) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_clip_set_top_effect_index(self.as_ref().to_glib_none().0, effect.as_ref().to_glib_none().0, newindex), "Failed to move effect")
glib_result_from_gboolean!(
ges_sys::ges_clip_set_top_effect_index(
self.as_ref().to_glib_none().0,
effect.as_ref().to_glib_none().0,
newindex
),
"Failed to move effect"
)
}
}
fn set_top_effect_priority<P: IsA<BaseEffect>>(&self, effect: &P, newpriority: u32) -> Result<(), glib::error::BoolError> {
fn set_top_effect_priority<P: IsA<BaseEffect>>(
&self,
effect: &P,
newpriority: u32,
) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_clip_set_top_effect_priority(self.as_ref().to_glib_none().0, effect.as_ref().to_glib_none().0, newpriority), "Failed to the set top effect priority")
glib_result_from_gboolean!(
ges_sys::ges_clip_set_top_effect_priority(
self.as_ref().to_glib_none().0,
effect.as_ref().to_glib_none().0,
newpriority
),
"Failed to the set top effect priority"
)
}
}
fn split(&self, position: u64) -> Option<Clip> {
unsafe {
from_glib_none(ges_sys::ges_clip_split(self.as_ref().to_glib_none().0, position))
from_glib_none(ges_sys::ges_clip_split(
self.as_ref().to_glib_none().0,
position,
))
}
}
fn connect_property_layer_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_layer_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESClip, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<Clip>
unsafe extern "C" fn notify_layer_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESClip,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<Clip>,
{
let f: &F = &*(f as *const F);
f(&Clip::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::layer\0".as_ptr() as *const _,
Some(transmute(notify_layer_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::layer\0".as_ptr() as *const _,
Some(transmute(notify_layer_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_supported_formats_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_supported_formats_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESClip, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<Clip>
fn connect_property_supported_formats_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_supported_formats_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESClip,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<Clip>,
{
let f: &F = &*(f as *const F);
f(&Clip::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::supported-formats\0".as_ptr() as *const _,
Some(transmute(notify_supported_formats_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::supported-formats\0".as_ptr() as *const _,
Some(transmute(
notify_supported_formats_trampoline::<Self, F> as usize,
)),
Box_::into_raw(f),
)
}
}
}

View file

@ -2,24 +2,24 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use ges_sys;
use glib;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::Value;
use glib_sys;
use gobject_sys;
use std::boxed::Box as Box_;
use std::mem::transmute;
use Edge;
use EditMode;
use Extractable;
use Layer;
use TimelineElement;
use ges_sys;
use glib;
use glib::StaticType;
use glib::Value;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::translate::*;
use glib_sys;
use gobject_sys;
use std::boxed::Box as Box_;
use std::mem::transmute;
glib_wrapper! {
pub struct Container(Object<ges_sys::GESContainer, ges_sys::GESContainerClass, ContainerClass>) @extends TimelineElement, @implements Extractable;
@ -32,9 +32,7 @@ glib_wrapper! {
impl Container {
pub fn group(containers: &[Container]) -> Option<Container> {
assert_initialized_main_thread!();
unsafe {
from_glib_none(ges_sys::ges_container_group(containers.to_glib_none().0))
}
unsafe { from_glib_none(ges_sys::ges_container_group(containers.to_glib_none().0)) }
}
}
@ -43,7 +41,14 @@ pub const NONE_CONTAINER: Option<&Container> = None;
pub trait GESContainerExt: 'static {
fn add<P: IsA<TimelineElement>>(&self, child: &P) -> Result<(), glib::error::BoolError>;
fn edit(&self, layers: &[Layer], new_layer_priority: i32, mode: EditMode, edge: Edge, position: u64) -> Result<(), glib::error::BoolError>;
fn edit(
&self,
layers: &[Layer],
new_layer_priority: i32,
mode: EditMode,
edge: Edge,
position: u64,
) -> Result<(), glib::error::BoolError>;
fn get_children(&self, recursive: bool) -> Vec<TimelineElement>;
@ -53,9 +58,15 @@ pub trait GESContainerExt: 'static {
fn get_property_height(&self) -> u32;
fn connect_child_added<F: Fn(&Self, &TimelineElement) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_child_added<F: Fn(&Self, &TimelineElement) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_child_removed<F: Fn(&Self, &TimelineElement) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_child_removed<F: Fn(&Self, &TimelineElement) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
}
@ -63,81 +74,156 @@ pub trait GESContainerExt: 'static {
impl<O: IsA<Container>> GESContainerExt for O {
fn add<P: IsA<TimelineElement>>(&self, child: &P) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_container_add(self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0), "Failed to add element")
glib_result_from_gboolean!(
ges_sys::ges_container_add(
self.as_ref().to_glib_none().0,
child.as_ref().to_glib_none().0
),
"Failed to add element"
)
}
}
fn edit(&self, layers: &[Layer], new_layer_priority: i32, mode: EditMode, edge: Edge, position: u64) -> Result<(), glib::error::BoolError> {
fn edit(
&self,
layers: &[Layer],
new_layer_priority: i32,
mode: EditMode,
edge: Edge,
position: u64,
) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_container_edit(self.as_ref().to_glib_none().0, layers.to_glib_none().0, new_layer_priority, mode.to_glib(), edge.to_glib(), position), "Failed to edit container")
glib_result_from_gboolean!(
ges_sys::ges_container_edit(
self.as_ref().to_glib_none().0,
layers.to_glib_none().0,
new_layer_priority,
mode.to_glib(),
edge.to_glib(),
position
),
"Failed to edit container"
)
}
}
fn get_children(&self, recursive: bool) -> Vec<TimelineElement> {
unsafe {
FromGlibPtrContainer::from_glib_full(ges_sys::ges_container_get_children(self.as_ref().to_glib_none().0, recursive.to_glib()))
FromGlibPtrContainer::from_glib_full(ges_sys::ges_container_get_children(
self.as_ref().to_glib_none().0,
recursive.to_glib(),
))
}
}
fn remove<P: IsA<TimelineElement>>(&self, child: &P) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_container_remove(self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0), "Failed to remove element")
glib_result_from_gboolean!(
ges_sys::ges_container_remove(
self.as_ref().to_glib_none().0,
child.as_ref().to_glib_none().0
),
"Failed to remove element"
)
}
}
fn ungroup(&self, recursive: bool) -> Vec<Container> {
unsafe {
FromGlibPtrContainer::from_glib_full(ges_sys::ges_container_ungroup(self.as_ref().to_glib_full(), recursive.to_glib()))
FromGlibPtrContainer::from_glib_full(ges_sys::ges_container_ungroup(
self.as_ref().to_glib_full(),
recursive.to_glib(),
))
}
}
fn get_property_height(&self) -> u32 {
unsafe {
let mut value = Value::from_type(<u32 as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"height\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"height\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
fn connect_child_added<F: Fn(&Self, &TimelineElement) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn child_added_trampoline<P, F: Fn(&P, &TimelineElement) + 'static>(this: *mut ges_sys::GESContainer, element: *mut ges_sys::GESTimelineElement, f: glib_sys::gpointer)
where P: IsA<Container>
fn connect_child_added<F: Fn(&Self, &TimelineElement) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn child_added_trampoline<P, F: Fn(&P, &TimelineElement) + 'static>(
this: *mut ges_sys::GESContainer,
element: *mut ges_sys::GESTimelineElement,
f: glib_sys::gpointer,
) where
P: IsA<Container>,
{
let f: &F = &*(f as *const F);
f(&Container::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(element))
f(
&Container::from_glib_borrow(this).unsafe_cast(),
&from_glib_borrow(element),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"child-added\0".as_ptr() as *const _,
Some(transmute(child_added_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"child-added\0".as_ptr() as *const _,
Some(transmute(child_added_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_child_removed<F: Fn(&Self, &TimelineElement) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn child_removed_trampoline<P, F: Fn(&P, &TimelineElement) + 'static>(this: *mut ges_sys::GESContainer, element: *mut ges_sys::GESTimelineElement, f: glib_sys::gpointer)
where P: IsA<Container>
fn connect_child_removed<F: Fn(&Self, &TimelineElement) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn child_removed_trampoline<P, F: Fn(&P, &TimelineElement) + 'static>(
this: *mut ges_sys::GESContainer,
element: *mut ges_sys::GESTimelineElement,
f: glib_sys::gpointer,
) where
P: IsA<Container>,
{
let f: &F = &*(f as *const F);
f(&Container::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(element))
f(
&Container::from_glib_borrow(this).unsafe_cast(),
&from_glib_borrow(element),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"child-removed\0".as_ptr() as *const _,
Some(transmute(child_removed_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"child-removed\0".as_ptr() as *const _,
Some(transmute(child_removed_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_height_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESContainer, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<Container>
unsafe extern "C" fn notify_height_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESContainer,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<Container>,
{
let f: &F = &*(f as *const F);
f(&Container::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::height\0".as_ptr() as *const _,
Some(transmute(notify_height_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::height\0".as_ptr() as *const _,
Some(transmute(notify_height_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
}

View file

@ -2,17 +2,17 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use ges_sys;
use glib::object::IsA;
use glib::translate::*;
use glib::GString;
use glib::StaticType;
use glib::Value;
use gobject_sys;
use BaseEffect;
use Extractable;
use TimelineElement;
use TrackElement;
use ges_sys;
use glib::GString;
use glib::StaticType;
use glib::Value;
use glib::object::IsA;
use glib::translate::*;
use gobject_sys;
glib_wrapper! {
pub struct Effect(Object<ges_sys::GESEffect, ges_sys::GESEffectClass, EffectClass>) @extends BaseEffect, TrackElement, TimelineElement, @implements Extractable;
@ -25,9 +25,7 @@ glib_wrapper! {
impl Effect {
pub fn new(bin_description: &str) -> Option<Effect> {
assert_initialized_main_thread!();
unsafe {
from_glib_none(ges_sys::ges_effect_new(bin_description.to_glib_none().0))
}
unsafe { from_glib_none(ges_sys::ges_effect_new(bin_description.to_glib_none().0)) }
}
}
@ -41,7 +39,11 @@ impl<O: IsA<Effect>> EffectExt for O {
fn get_property_bin_description(&self) -> Option<GString> {
unsafe {
let mut value = Value::from_type(<GString as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"bin-description\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"bin-description\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get()
}
}

View file

@ -3,17 +3,16 @@
// DO NOT EDIT
use ges_sys;
use glib::StaticType;
use glib::Type;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::FromValueOptional;
use glib::value::SetValue;
use glib::value::Value;
use glib::StaticType;
use glib::Type;
use gobject_sys;
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum Edge {
EdgeStart,
EdgeEnd,
@ -31,7 +30,7 @@ impl ToGlib for Edge {
Edge::EdgeStart => ges_sys::GES_EDGE_START,
Edge::EdgeEnd => ges_sys::GES_EDGE_END,
Edge::EdgeNone => ges_sys::GES_EDGE_NONE,
Edge::__Unknown(value) => value
Edge::__Unknown(value) => value,
}
}
}
@ -73,8 +72,7 @@ impl SetValue for Edge {
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum EditMode {
EditNormal,
EditRipple,
@ -96,7 +94,7 @@ impl ToGlib for EditMode {
EditMode::EditRoll => ges_sys::GES_EDIT_MODE_ROLL,
EditMode::EditTrim => ges_sys::GES_EDIT_MODE_TRIM,
EditMode::EditSlide => ges_sys::GES_EDIT_MODE_SLIDE,
EditMode::__Unknown(value) => value
EditMode::__Unknown(value) => value,
}
}
}
@ -139,4 +137,3 @@ impl SetValue for EditMode {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}

View file

@ -2,12 +2,12 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use Asset;
use ges_sys;
use glib;
use glib::GString;
use glib::object::IsA;
use glib::translate::*;
use glib::GString;
use Asset;
glib_wrapper! {
pub struct Extractable(Interface<ges_sys::GESExtractable>);
@ -30,19 +30,29 @@ pub trait ExtractableExt: 'static {
impl<O: IsA<Extractable>> ExtractableExt for O {
fn get_asset(&self) -> Option<Asset> {
unsafe {
from_glib_none(ges_sys::ges_extractable_get_asset(self.as_ref().to_glib_none().0))
from_glib_none(ges_sys::ges_extractable_get_asset(
self.as_ref().to_glib_none().0,
))
}
}
fn get_id(&self) -> Option<GString> {
unsafe {
from_glib_full(ges_sys::ges_extractable_get_id(self.as_ref().to_glib_none().0))
from_glib_full(ges_sys::ges_extractable_get_id(
self.as_ref().to_glib_none().0,
))
}
}
fn set_asset<P: IsA<Asset>>(&self, asset: &P) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_extractable_set_asset(self.as_ref().to_glib_none().0, asset.as_ref().to_glib_none().0), "Failed to set asset")
glib_result_from_gboolean!(
ges_sys::ges_extractable_set_asset(
self.as_ref().to_glib_none().0,
asset.as_ref().to_glib_none().0
),
"Failed to set asset"
)
}
}
}

View file

@ -3,13 +3,13 @@
// DO NOT EDIT
use ges_sys;
use glib::StaticType;
use glib::Type;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::FromValueOptional;
use glib::value::SetValue;
use glib::value::Value;
use glib::StaticType;
use glib::Type;
use gobject_sys;
bitflags! {
@ -113,4 +113,3 @@ impl SetValue for TrackType {
gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
}
}

View file

@ -2,21 +2,21 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use Container;
use Extractable;
use TimelineElement;
use ges_sys;
use glib::StaticType;
use glib::Value;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::Value;
use glib_sys;
use gobject_sys;
use std::boxed::Box as Box_;
use std::mem::transmute;
use Container;
use Extractable;
use TimelineElement;
glib_wrapper! {
pub struct Group(Object<ges_sys::GESGroup, ges_sys::GESGroupClass, GroupClass>) @extends Container, TimelineElement, @implements Extractable;
@ -29,9 +29,7 @@ glib_wrapper! {
impl Group {
pub fn new() -> Group {
assert_initialized_main_thread!();
unsafe {
from_glib_none(ges_sys::ges_group_new())
}
unsafe { from_glib_none(ges_sys::ges_group_new()) }
}
}
@ -68,7 +66,8 @@ pub trait GroupExt: 'static {
fn connect_property_in_point_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_max_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_max_duration_notify<F: Fn(&Self) + 'static>(&self, f: F)
-> SignalHandlerId;
fn connect_property_priority_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
@ -79,140 +78,225 @@ impl<O: IsA<Group>> GroupExt for O {
fn get_property_duration(&self) -> u64 {
unsafe {
let mut value = Value::from_type(<u64 as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"duration\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"duration\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
fn set_property_duration(&self, duration: u64) {
unsafe {
gobject_sys::g_object_set_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"duration\0".as_ptr() as *const _, Value::from(&duration).to_glib_none().0);
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"duration\0".as_ptr() as *const _,
Value::from(&duration).to_glib_none().0,
);
}
}
fn get_property_in_point(&self) -> u64 {
unsafe {
let mut value = Value::from_type(<u64 as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"in-point\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"in-point\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
fn set_property_in_point(&self, in_point: u64) {
unsafe {
gobject_sys::g_object_set_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"in-point\0".as_ptr() as *const _, Value::from(&in_point).to_glib_none().0);
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"in-point\0".as_ptr() as *const _,
Value::from(&in_point).to_glib_none().0,
);
}
}
fn get_property_max_duration(&self) -> u64 {
unsafe {
let mut value = Value::from_type(<u64 as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"max-duration\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"max-duration\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
fn set_property_max_duration(&self, max_duration: u64) {
unsafe {
gobject_sys::g_object_set_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"max-duration\0".as_ptr() as *const _, Value::from(&max_duration).to_glib_none().0);
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"max-duration\0".as_ptr() as *const _,
Value::from(&max_duration).to_glib_none().0,
);
}
}
fn get_property_priority(&self) -> u32 {
unsafe {
let mut value = Value::from_type(<u32 as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"priority\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"priority\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
fn set_property_priority(&self, priority: u32) {
unsafe {
gobject_sys::g_object_set_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"priority\0".as_ptr() as *const _, Value::from(&priority).to_glib_none().0);
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"priority\0".as_ptr() as *const _,
Value::from(&priority).to_glib_none().0,
);
}
}
fn get_property_start(&self) -> u64 {
unsafe {
let mut value = Value::from_type(<u64 as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"start\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"start\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
fn set_property_start(&self, start: u64) {
unsafe {
gobject_sys::g_object_set_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"start\0".as_ptr() as *const _, Value::from(&start).to_glib_none().0);
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"start\0".as_ptr() as *const _,
Value::from(&start).to_glib_none().0,
);
}
}
fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_duration_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESGroup, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<Group>
unsafe extern "C" fn notify_duration_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESGroup,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<Group>,
{
let f: &F = &*(f as *const F);
f(&Group::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::duration\0".as_ptr() as *const _,
Some(transmute(notify_duration_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::duration\0".as_ptr() as *const _,
Some(transmute(notify_duration_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_in_point_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_in_point_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESGroup, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<Group>
unsafe extern "C" fn notify_in_point_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESGroup,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<Group>,
{
let f: &F = &*(f as *const F);
f(&Group::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::in-point\0".as_ptr() as *const _,
Some(transmute(notify_in_point_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::in-point\0".as_ptr() as *const _,
Some(transmute(notify_in_point_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_max_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_max_duration_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESGroup, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<Group>
fn connect_property_max_duration_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_max_duration_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESGroup,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<Group>,
{
let f: &F = &*(f as *const F);
f(&Group::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::max-duration\0".as_ptr() as *const _,
Some(transmute(notify_max_duration_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::max-duration\0".as_ptr() as *const _,
Some(transmute(
notify_max_duration_trampoline::<Self, F> as usize,
)),
Box_::into_raw(f),
)
}
}
fn connect_property_priority_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_priority_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESGroup, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<Group>
unsafe extern "C" fn notify_priority_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESGroup,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<Group>,
{
let f: &F = &*(f as *const F);
f(&Group::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::priority\0".as_ptr() as *const _,
Some(transmute(notify_priority_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::priority\0".as_ptr() as *const _,
Some(transmute(notify_priority_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_start_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_start_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESGroup, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<Group>
unsafe extern "C" fn notify_start_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESGroup,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<Group>,
{
let f: &F = &*(f as *const F);
f(&Group::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::start\0".as_ptr() as *const _,
Some(transmute(notify_start_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::start\0".as_ptr() as *const _,
Some(transmute(notify_start_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
}

View file

@ -2,22 +2,22 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use Asset;
use Clip;
use Extractable;
use Timeline;
use TrackType;
use ges_sys;
use glib;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib_sys;
use gst;
use std::boxed::Box as Box_;
use std::mem::transmute;
use Asset;
use Clip;
use Extractable;
use Timeline;
use TrackType;
glib_wrapper! {
pub struct Layer(Object<ges_sys::GESLayer, ges_sys::GESLayerClass, LayerClass>) @implements Extractable;
@ -30,9 +30,7 @@ glib_wrapper! {
impl Layer {
pub fn new() -> Layer {
assert_initialized_main_thread!();
unsafe {
from_glib_none(ges_sys::ges_layer_new())
}
unsafe { from_glib_none(ges_sys::ges_layer_new()) }
}
}
@ -45,7 +43,14 @@ impl Default for Layer {
pub const NONE_LAYER: Option<&Layer> = None;
pub trait LayerExt: 'static {
fn add_asset<P: IsA<Asset>>(&self, asset: &P, start: gst::ClockTime, inpoint: gst::ClockTime, duration: gst::ClockTime, track_types: TrackType) -> Option<Clip>;
fn add_asset<P: IsA<Asset>>(
&self,
asset: &P,
start: gst::ClockTime,
inpoint: gst::ClockTime,
duration: gst::ClockTime,
track_types: TrackType,
) -> Option<Clip>;
fn add_clip<P: IsA<Clip>>(&self, clip: &P) -> Result<(), glib::error::BoolError>;
@ -76,76 +81,116 @@ pub trait LayerExt: 'static {
fn connect_clip_removed<F: Fn(&Self, &Clip) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_auto_transition_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_auto_transition_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
#[cfg_attr(feature = "v1_16", deprecated)]
fn connect_property_priority_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
}
impl<O: IsA<Layer>> LayerExt for O {
fn add_asset<P: IsA<Asset>>(&self, asset: &P, start: gst::ClockTime, inpoint: gst::ClockTime, duration: gst::ClockTime, track_types: TrackType) -> Option<Clip> {
fn add_asset<P: IsA<Asset>>(
&self,
asset: &P,
start: gst::ClockTime,
inpoint: gst::ClockTime,
duration: gst::ClockTime,
track_types: TrackType,
) -> Option<Clip> {
unsafe {
from_glib_none(ges_sys::ges_layer_add_asset(self.as_ref().to_glib_none().0, asset.as_ref().to_glib_none().0, start.to_glib(), inpoint.to_glib(), duration.to_glib(), track_types.to_glib()))
from_glib_none(ges_sys::ges_layer_add_asset(
self.as_ref().to_glib_none().0,
asset.as_ref().to_glib_none().0,
start.to_glib(),
inpoint.to_glib(),
duration.to_glib(),
track_types.to_glib(),
))
}
}
fn add_clip<P: IsA<Clip>>(&self, clip: &P) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_layer_add_clip(self.as_ref().to_glib_none().0, clip.as_ref().to_glib_none().0), "Failed to add clip")
glib_result_from_gboolean!(
ges_sys::ges_layer_add_clip(
self.as_ref().to_glib_none().0,
clip.as_ref().to_glib_none().0
),
"Failed to add clip"
)
}
}
fn get_auto_transition(&self) -> bool {
unsafe {
from_glib(ges_sys::ges_layer_get_auto_transition(self.as_ref().to_glib_none().0))
from_glib(ges_sys::ges_layer_get_auto_transition(
self.as_ref().to_glib_none().0,
))
}
}
fn get_clips(&self) -> Vec<Clip> {
unsafe {
FromGlibPtrContainer::from_glib_full(ges_sys::ges_layer_get_clips(self.as_ref().to_glib_none().0))
FromGlibPtrContainer::from_glib_full(ges_sys::ges_layer_get_clips(
self.as_ref().to_glib_none().0,
))
}
}
fn get_clips_in_interval(&self, start: gst::ClockTime, end: gst::ClockTime) -> Vec<Clip> {
unsafe {
FromGlibPtrContainer::from_glib_full(ges_sys::ges_layer_get_clips_in_interval(self.as_ref().to_glib_none().0, start.to_glib(), end.to_glib()))
FromGlibPtrContainer::from_glib_full(ges_sys::ges_layer_get_clips_in_interval(
self.as_ref().to_glib_none().0,
start.to_glib(),
end.to_glib(),
))
}
}
fn get_duration(&self) -> gst::ClockTime {
unsafe {
from_glib(ges_sys::ges_layer_get_duration(self.as_ref().to_glib_none().0))
from_glib(ges_sys::ges_layer_get_duration(
self.as_ref().to_glib_none().0,
))
}
}
fn get_priority(&self) -> u32 {
unsafe {
ges_sys::ges_layer_get_priority(self.as_ref().to_glib_none().0)
}
unsafe { ges_sys::ges_layer_get_priority(self.as_ref().to_glib_none().0) }
}
fn get_timeline(&self) -> Option<Timeline> {
unsafe {
from_glib_none(ges_sys::ges_layer_get_timeline(self.as_ref().to_glib_none().0))
from_glib_none(ges_sys::ges_layer_get_timeline(
self.as_ref().to_glib_none().0,
))
}
}
fn is_empty(&self) -> bool {
unsafe {
from_glib(ges_sys::ges_layer_is_empty(self.as_ref().to_glib_none().0))
}
unsafe { from_glib(ges_sys::ges_layer_is_empty(self.as_ref().to_glib_none().0)) }
}
fn remove_clip<P: IsA<Clip>>(&self, clip: &P) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_layer_remove_clip(self.as_ref().to_glib_none().0, clip.as_ref().to_glib_none().0), "Failed to remove clip")
glib_result_from_gboolean!(
ges_sys::ges_layer_remove_clip(
self.as_ref().to_glib_none().0,
clip.as_ref().to_glib_none().0
),
"Failed to remove clip"
)
}
}
fn set_auto_transition(&self, auto_transition: bool) {
unsafe {
ges_sys::ges_layer_set_auto_transition(self.as_ref().to_glib_none().0, auto_transition.to_glib());
ges_sys::ges_layer_set_auto_transition(
self.as_ref().to_glib_none().0,
auto_transition.to_glib(),
);
}
}
@ -157,63 +202,109 @@ impl<O: IsA<Layer>> LayerExt for O {
fn set_timeline<P: IsA<Timeline>>(&self, timeline: &P) {
unsafe {
ges_sys::ges_layer_set_timeline(self.as_ref().to_glib_none().0, timeline.as_ref().to_glib_none().0);
ges_sys::ges_layer_set_timeline(
self.as_ref().to_glib_none().0,
timeline.as_ref().to_glib_none().0,
);
}
}
fn connect_clip_added<F: Fn(&Self, &Clip) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn clip_added_trampoline<P, F: Fn(&P, &Clip) + 'static>(this: *mut ges_sys::GESLayer, clip: *mut ges_sys::GESClip, f: glib_sys::gpointer)
where P: IsA<Layer>
unsafe extern "C" fn clip_added_trampoline<P, F: Fn(&P, &Clip) + 'static>(
this: *mut ges_sys::GESLayer,
clip: *mut ges_sys::GESClip,
f: glib_sys::gpointer,
) where
P: IsA<Layer>,
{
let f: &F = &*(f as *const F);
f(&Layer::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(clip))
f(
&Layer::from_glib_borrow(this).unsafe_cast(),
&from_glib_borrow(clip),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"clip-added\0".as_ptr() as *const _,
Some(transmute(clip_added_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"clip-added\0".as_ptr() as *const _,
Some(transmute(clip_added_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_clip_removed<F: Fn(&Self, &Clip) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn clip_removed_trampoline<P, F: Fn(&P, &Clip) + 'static>(this: *mut ges_sys::GESLayer, clip: *mut ges_sys::GESClip, f: glib_sys::gpointer)
where P: IsA<Layer>
unsafe extern "C" fn clip_removed_trampoline<P, F: Fn(&P, &Clip) + 'static>(
this: *mut ges_sys::GESLayer,
clip: *mut ges_sys::GESClip,
f: glib_sys::gpointer,
) where
P: IsA<Layer>,
{
let f: &F = &*(f as *const F);
f(&Layer::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(clip))
f(
&Layer::from_glib_borrow(this).unsafe_cast(),
&from_glib_borrow(clip),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"clip-removed\0".as_ptr() as *const _,
Some(transmute(clip_removed_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"clip-removed\0".as_ptr() as *const _,
Some(transmute(clip_removed_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_auto_transition_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_auto_transition_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESLayer, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<Layer>
fn connect_property_auto_transition_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_auto_transition_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESLayer,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<Layer>,
{
let f: &F = &*(f as *const F);
f(&Layer::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::auto-transition\0".as_ptr() as *const _,
Some(transmute(notify_auto_transition_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::auto-transition\0".as_ptr() as *const _,
Some(transmute(
notify_auto_transition_trampoline::<Self, F> as usize,
)),
Box_::into_raw(f),
)
}
}
fn connect_property_priority_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_priority_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESLayer, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<Layer>
unsafe extern "C" fn notify_priority_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESLayer,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<Layer>,
{
let f: &F = &*(f as *const F);
f(&Layer::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::priority\0".as_ptr() as *const _,
Some(transmute(notify_priority_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::priority\0".as_ptr() as *const _,
Some(transmute(notify_priority_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
}

View file

@ -3,71 +3,71 @@
// DO NOT EDIT
mod asset;
pub use self::asset::{Asset, AssetClass, NONE_ASSET};
pub use self::asset::AssetExt;
pub use self::asset::{Asset, AssetClass, NONE_ASSET};
mod base_effect;
pub use self::base_effect::{BaseEffect, BaseEffectClass, NONE_BASE_EFFECT};
mod clip;
pub use self::clip::{Clip, ClipClass, NONE_CLIP};
pub use self::clip::ClipExt;
pub use self::clip::{Clip, ClipClass, NONE_CLIP};
mod container;
pub use self::container::{Container, ContainerClass, NONE_CONTAINER};
pub use self::container::GESContainerExt;
pub use self::container::{Container, ContainerClass, NONE_CONTAINER};
mod effect;
pub use self::effect::{Effect, EffectClass, NONE_EFFECT};
pub use self::effect::EffectExt;
pub use self::effect::{Effect, EffectClass, NONE_EFFECT};
mod extractable;
pub use self::extractable::{Extractable, NONE_EXTRACTABLE};
pub use self::extractable::ExtractableExt;
pub use self::extractable::{Extractable, NONE_EXTRACTABLE};
mod group;
pub use self::group::{Group, GroupClass, NONE_GROUP};
pub use self::group::GroupExt;
pub use self::group::{Group, GroupClass, NONE_GROUP};
mod layer;
pub use self::layer::{Layer, LayerClass, NONE_LAYER};
pub use self::layer::LayerExt;
pub use self::layer::{Layer, LayerClass, NONE_LAYER};
mod pipeline;
pub use self::pipeline::{Pipeline, PipelineClass, NONE_PIPELINE};
pub use self::pipeline::GESPipelineExt;
pub use self::pipeline::{Pipeline, PipelineClass, NONE_PIPELINE};
mod project;
pub use self::project::{Project, ProjectClass, NONE_PROJECT};
pub use self::project::ProjectExt;
pub use self::project::{Project, ProjectClass, NONE_PROJECT};
mod timeline;
pub use self::timeline::{Timeline, TimelineClass, NONE_TIMELINE};
pub use self::timeline::TimelineExt;
pub use self::timeline::{Timeline, TimelineClass, NONE_TIMELINE};
mod timeline_element;
pub use self::timeline_element::{TimelineElement, TimelineElementClass, NONE_TIMELINE_ELEMENT};
pub use self::timeline_element::TimelineElementExt;
pub use self::timeline_element::{TimelineElement, TimelineElementClass, NONE_TIMELINE_ELEMENT};
mod track;
pub use self::track::{Track, TrackClass, NONE_TRACK};
pub use self::track::GESTrackExt;
pub use self::track::{Track, TrackClass, NONE_TRACK};
mod track_element;
pub use self::track_element::{TrackElement, TrackElementClass, NONE_TRACK_ELEMENT};
pub use self::track_element::TrackElementExt;
pub use self::track_element::{TrackElement, TrackElementClass, NONE_TRACK_ELEMENT};
mod uri_clip;
pub use self::uri_clip::{UriClip, UriClipClass, NONE_URI_CLIP};
pub use self::uri_clip::UriClipExt;
pub use self::uri_clip::{UriClip, UriClipClass, NONE_URI_CLIP};
mod uri_clip_asset;
pub use self::uri_clip_asset::{UriClipAsset, UriClipAssetClass, NONE_URI_CLIP_ASSET};
pub use self::uri_clip_asset::UriClipAssetExt;
pub use self::uri_clip_asset::{UriClipAsset, UriClipAssetClass, NONE_URI_CLIP_ASSET};
mod uri_source_asset;
pub use self::uri_source_asset::{UriSourceAsset, UriSourceAssetClass, NONE_URI_SOURCE_ASSET};
pub use self::uri_source_asset::UriSourceAssetExt;
pub use self::uri_source_asset::{UriSourceAsset, UriSourceAssetClass, NONE_URI_SOURCE_ASSET};
mod enums;
pub use self::enums::Edge;
@ -81,18 +81,18 @@ pub use self::flags::TrackType;
pub mod traits {
pub use super::AssetExt;
pub use super::ClipExt;
pub use super::GESContainerExt;
pub use super::EffectExt;
pub use super::ExtractableExt;
pub use super::GESContainerExt;
pub use super::GESPipelineExt;
pub use super::GESTrackExt;
pub use super::GroupExt;
pub use super::LayerExt;
pub use super::GESPipelineExt;
pub use super::ProjectExt;
pub use super::TimelineExt;
pub use super::TimelineElementExt;
pub use super::GESTrackExt;
pub use super::TimelineExt;
pub use super::TrackElementExt;
pub use super::UriClipExt;
pub use super::UriClipAssetExt;
pub use super::UriClipExt;
pub use super::UriSourceAssetExt;
}

View file

@ -2,18 +2,15 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use Error;
use PipelineFlags;
use Timeline;
use ges_sys;
use glib;
use glib::StaticType;
use glib::Value;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::Value;
use glib_sys;
use gobject_sys;
use gst;
@ -21,6 +18,9 @@ use gst_pbutils;
use std::boxed::Box as Box_;
use std::mem::transmute;
use std::ptr;
use Error;
use PipelineFlags;
use Timeline;
glib_wrapper! {
pub struct Pipeline(Object<ges_sys::GESPipeline, ges_sys::GESPipelineClass, PipelineClass>) @extends gst::Pipeline, gst::Element, gst::Object;
@ -33,9 +33,7 @@ glib_wrapper! {
impl Pipeline {
pub fn new() -> Pipeline {
assert_initialized_main_thread!();
unsafe {
from_glib_none(ges_sys::ges_pipeline_new())
}
unsafe { from_glib_none(ges_sys::ges_pipeline_new()) }
}
}
@ -62,11 +60,21 @@ pub trait GESPipelineExt: 'static {
fn preview_set_video_sink<P: IsA<gst::Element>>(&self, sink: &P);
fn save_thumbnail(&self, width: i32, height: i32, format: &str, location: &str) -> Result<(), Error>;
fn save_thumbnail(
&self,
width: i32,
height: i32,
format: &str,
location: &str,
) -> Result<(), Error>;
fn set_mode(&self, mode: PipelineFlags) -> Result<(), glib::error::BoolError>;
fn set_render_settings<P: IsA<gst_pbutils::EncodingProfile>>(&self, output_uri: &str, profile: &P) -> Result<(), glib::error::BoolError>;
fn set_render_settings<P: IsA<gst_pbutils::EncodingProfile>>(
&self,
output_uri: &str,
profile: &P,
) -> Result<(), glib::error::BoolError>;
fn set_timeline<P: IsA<Timeline>>(&self, timeline: &P) -> Result<(), glib::error::BoolError>;
@ -88,7 +96,8 @@ pub trait GESPipelineExt: 'static {
fn set_property_video_sink(&self, video_sink: Option<&gst::Element>);
fn connect_property_audio_filter_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_audio_filter_notify<F: Fn(&Self) + 'static>(&self, f: F)
-> SignalHandlerId;
fn connect_property_audio_sink_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
@ -96,7 +105,8 @@ pub trait GESPipelineExt: 'static {
fn connect_property_timeline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_video_filter_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_video_filter_notify<F: Fn(&Self) + 'static>(&self, f: F)
-> SignalHandlerId;
fn connect_property_video_sink_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
}
@ -104,104 +114,180 @@ pub trait GESPipelineExt: 'static {
impl<O: IsA<Pipeline>> GESPipelineExt for O {
fn get_mode(&self) -> PipelineFlags {
unsafe {
from_glib(ges_sys::ges_pipeline_get_mode(self.as_ref().to_glib_none().0))
from_glib(ges_sys::ges_pipeline_get_mode(
self.as_ref().to_glib_none().0,
))
}
}
fn get_thumbnail(&self, caps: &gst::Caps) -> Option<gst::Sample> {
unsafe {
from_glib_full(ges_sys::ges_pipeline_get_thumbnail(self.as_ref().to_glib_none().0, caps.to_glib_none().0))
from_glib_full(ges_sys::ges_pipeline_get_thumbnail(
self.as_ref().to_glib_none().0,
caps.to_glib_none().0,
))
}
}
fn get_thumbnail_rgb24(&self, width: i32, height: i32) -> Option<gst::Sample> {
unsafe {
from_glib_full(ges_sys::ges_pipeline_get_thumbnail_rgb24(self.as_ref().to_glib_none().0, width, height))
from_glib_full(ges_sys::ges_pipeline_get_thumbnail_rgb24(
self.as_ref().to_glib_none().0,
width,
height,
))
}
}
fn preview_get_audio_sink(&self) -> Option<gst::Element> {
unsafe {
from_glib_full(ges_sys::ges_pipeline_preview_get_audio_sink(self.as_ref().to_glib_none().0))
from_glib_full(ges_sys::ges_pipeline_preview_get_audio_sink(
self.as_ref().to_glib_none().0,
))
}
}
fn preview_get_video_sink(&self) -> Option<gst::Element> {
unsafe {
from_glib_full(ges_sys::ges_pipeline_preview_get_video_sink(self.as_ref().to_glib_none().0))
from_glib_full(ges_sys::ges_pipeline_preview_get_video_sink(
self.as_ref().to_glib_none().0,
))
}
}
fn preview_set_audio_sink<P: IsA<gst::Element>>(&self, sink: &P) {
unsafe {
ges_sys::ges_pipeline_preview_set_audio_sink(self.as_ref().to_glib_none().0, sink.as_ref().to_glib_none().0);
ges_sys::ges_pipeline_preview_set_audio_sink(
self.as_ref().to_glib_none().0,
sink.as_ref().to_glib_none().0,
);
}
}
fn preview_set_video_sink<P: IsA<gst::Element>>(&self, sink: &P) {
unsafe {
ges_sys::ges_pipeline_preview_set_video_sink(self.as_ref().to_glib_none().0, sink.as_ref().to_glib_none().0);
ges_sys::ges_pipeline_preview_set_video_sink(
self.as_ref().to_glib_none().0,
sink.as_ref().to_glib_none().0,
);
}
}
fn save_thumbnail(&self, width: i32, height: i32, format: &str, location: &str) -> Result<(), Error> {
fn save_thumbnail(
&self,
width: i32,
height: i32,
format: &str,
location: &str,
) -> Result<(), Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ges_sys::ges_pipeline_save_thumbnail(self.as_ref().to_glib_none().0, width, height, format.to_glib_none().0, location.to_glib_none().0, &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
let _ = ges_sys::ges_pipeline_save_thumbnail(
self.as_ref().to_glib_none().0,
width,
height,
format.to_glib_none().0,
location.to_glib_none().0,
&mut error,
);
if error.is_null() {
Ok(())
} else {
Err(from_glib_full(error))
}
}
}
fn set_mode(&self, mode: PipelineFlags) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_pipeline_set_mode(self.as_ref().to_glib_none().0, mode.to_glib()), "Failed to set mode")
glib_result_from_gboolean!(
ges_sys::ges_pipeline_set_mode(self.as_ref().to_glib_none().0, mode.to_glib()),
"Failed to set mode"
)
}
}
fn set_render_settings<P: IsA<gst_pbutils::EncodingProfile>>(&self, output_uri: &str, profile: &P) -> Result<(), glib::error::BoolError> {
fn set_render_settings<P: IsA<gst_pbutils::EncodingProfile>>(
&self,
output_uri: &str,
profile: &P,
) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_pipeline_set_render_settings(self.as_ref().to_glib_none().0, output_uri.to_glib_none().0, profile.as_ref().to_glib_none().0), "Failed to set render settings")
glib_result_from_gboolean!(
ges_sys::ges_pipeline_set_render_settings(
self.as_ref().to_glib_none().0,
output_uri.to_glib_none().0,
profile.as_ref().to_glib_none().0
),
"Failed to set render settings"
)
}
}
fn set_timeline<P: IsA<Timeline>>(&self, timeline: &P) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_pipeline_set_timeline(self.as_ref().to_glib_none().0, timeline.as_ref().to_glib_full()), "Failed to set timeline")
glib_result_from_gboolean!(
ges_sys::ges_pipeline_set_timeline(
self.as_ref().to_glib_none().0,
timeline.as_ref().to_glib_full()
),
"Failed to set timeline"
)
}
}
fn get_property_audio_filter(&self) -> Option<gst::Element> {
unsafe {
let mut value = Value::from_type(<gst::Element as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"audio-filter\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"audio-filter\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get()
}
}
fn set_property_audio_filter(&self, audio_filter: Option<&gst::Element>) {
unsafe {
gobject_sys::g_object_set_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"audio-filter\0".as_ptr() as *const _, Value::from(audio_filter).to_glib_none().0);
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"audio-filter\0".as_ptr() as *const _,
Value::from(audio_filter).to_glib_none().0,
);
}
}
fn get_property_audio_sink(&self) -> Option<gst::Element> {
unsafe {
let mut value = Value::from_type(<gst::Element as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"audio-sink\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"audio-sink\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get()
}
}
fn set_property_audio_sink(&self, audio_sink: Option<&gst::Element>) {
unsafe {
gobject_sys::g_object_set_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"audio-sink\0".as_ptr() as *const _, Value::from(audio_sink).to_glib_none().0);
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"audio-sink\0".as_ptr() as *const _,
Value::from(audio_sink).to_glib_none().0,
);
}
}
fn get_property_timeline(&self) -> Option<Timeline> {
unsafe {
let mut value = Value::from_type(<Timeline as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"timeline\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"timeline\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get()
}
}
@ -209,112 +295,186 @@ impl<O: IsA<Pipeline>> GESPipelineExt for O {
fn get_property_video_filter(&self) -> Option<gst::Element> {
unsafe {
let mut value = Value::from_type(<gst::Element as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"video-filter\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"video-filter\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get()
}
}
fn set_property_video_filter(&self, video_filter: Option<&gst::Element>) {
unsafe {
gobject_sys::g_object_set_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"video-filter\0".as_ptr() as *const _, Value::from(video_filter).to_glib_none().0);
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"video-filter\0".as_ptr() as *const _,
Value::from(video_filter).to_glib_none().0,
);
}
}
fn get_property_video_sink(&self) -> Option<gst::Element> {
unsafe {
let mut value = Value::from_type(<gst::Element as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"video-sink\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"video-sink\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get()
}
}
fn set_property_video_sink(&self, video_sink: Option<&gst::Element>) {
unsafe {
gobject_sys::g_object_set_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"video-sink\0".as_ptr() as *const _, Value::from(video_sink).to_glib_none().0);
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"video-sink\0".as_ptr() as *const _,
Value::from(video_sink).to_glib_none().0,
);
}
}
fn connect_property_audio_filter_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_audio_filter_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESPipeline, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<Pipeline>
fn connect_property_audio_filter_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_audio_filter_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESPipeline,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<Pipeline>,
{
let f: &F = &*(f as *const F);
f(&Pipeline::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::audio-filter\0".as_ptr() as *const _,
Some(transmute(notify_audio_filter_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::audio-filter\0".as_ptr() as *const _,
Some(transmute(
notify_audio_filter_trampoline::<Self, F> as usize,
)),
Box_::into_raw(f),
)
}
}
fn connect_property_audio_sink_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_audio_sink_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESPipeline, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<Pipeline>
unsafe extern "C" fn notify_audio_sink_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESPipeline,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<Pipeline>,
{
let f: &F = &*(f as *const F);
f(&Pipeline::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::audio-sink\0".as_ptr() as *const _,
Some(transmute(notify_audio_sink_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::audio-sink\0".as_ptr() as *const _,
Some(transmute(notify_audio_sink_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_mode_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESPipeline, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<Pipeline>
unsafe extern "C" fn notify_mode_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESPipeline,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<Pipeline>,
{
let f: &F = &*(f as *const F);
f(&Pipeline::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::mode\0".as_ptr() as *const _,
Some(transmute(notify_mode_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::mode\0".as_ptr() as *const _,
Some(transmute(notify_mode_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_timeline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_timeline_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESPipeline, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<Pipeline>
unsafe extern "C" fn notify_timeline_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESPipeline,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<Pipeline>,
{
let f: &F = &*(f as *const F);
f(&Pipeline::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::timeline\0".as_ptr() as *const _,
Some(transmute(notify_timeline_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::timeline\0".as_ptr() as *const _,
Some(transmute(notify_timeline_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_video_filter_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_video_filter_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESPipeline, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<Pipeline>
fn connect_property_video_filter_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_video_filter_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESPipeline,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<Pipeline>,
{
let f: &F = &*(f as *const F);
f(&Pipeline::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::video-filter\0".as_ptr() as *const _,
Some(transmute(notify_video_filter_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::video-filter\0".as_ptr() as *const _,
Some(transmute(
notify_video_filter_trampoline::<Self, F> as usize,
)),
Box_::into_raw(f),
)
}
}
fn connect_property_video_sink_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_video_sink_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESPipeline, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<Pipeline>
unsafe extern "C" fn notify_video_sink_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESPipeline,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<Pipeline>,
{
let f: &F = &*(f as *const F);
f(&Pipeline::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::video-sink\0".as_ptr() as *const _,
Some(transmute(notify_video_sink_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::video-sink\0".as_ptr() as *const _,
Some(transmute(notify_video_sink_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
}

View file

@ -2,23 +2,23 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use Asset;
use Error;
use Timeline;
use ges_sys;
use glib;
use glib::GString;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::GString;
use glib_sys;
use gst_pbutils;
use libc;
use std::boxed::Box as Box_;
use std::mem::transmute;
use std::ptr;
use Asset;
use Error;
use Timeline;
glib_wrapper! {
pub struct Project(Object<ges_sys::GESProject, ges_sys::GESProjectClass, ProjectClass>) @extends Asset;
@ -31,9 +31,7 @@ glib_wrapper! {
impl Project {
pub fn new(uri: Option<&str>) -> Project {
assert_initialized_main_thread!();
unsafe {
from_glib_full(ges_sys::ges_project_new(uri.to_glib_none().0))
}
unsafe { from_glib_full(ges_sys::ges_project_new(uri.to_glib_none().0)) }
}
}
@ -42,11 +40,18 @@ pub const NONE_PROJECT: Option<&Project> = None;
pub trait ProjectExt: 'static {
fn add_asset<P: IsA<Asset>>(&self, asset: &P) -> bool;
fn add_encoding_profile<P: IsA<gst_pbutils::EncodingProfile>>(&self, profile: &P) -> Result<(), glib::error::BoolError>;
fn add_encoding_profile<P: IsA<gst_pbutils::EncodingProfile>>(
&self,
profile: &P,
) -> Result<(), glib::error::BoolError>;
fn create_asset(&self, id: Option<&str>, extractable_type: glib::types::Type) -> bool;
fn create_asset_sync(&self, id: Option<&str>, extractable_type: glib::types::Type) -> Result<Option<Asset>, Error>;
fn create_asset_sync(
&self,
id: Option<&str>,
extractable_type: glib::types::Type,
) -> Result<Option<Asset>, Error>;
fn get_asset(&self, id: &str, extractable_type: glib::types::Type) -> Option<Asset>;
@ -62,7 +67,13 @@ pub trait ProjectExt: 'static {
fn remove_asset<P: IsA<Asset>>(&self, asset: &P) -> Result<(), glib::error::BoolError>;
fn save<P: IsA<Timeline>, Q: IsA<Asset>>(&self, timeline: &P, uri: &str, formatter_asset: Option<&Q>, overwrite: bool) -> Result<(), Error>;
fn save<P: IsA<Timeline>, Q: IsA<Asset>>(
&self,
timeline: &P,
uri: &str,
formatter_asset: Option<&Q>,
overwrite: bool,
) -> Result<(), Error>;
fn connect_asset_added<F: Fn(&Self, &Asset) + 'static>(&self, f: F) -> SignalHandlerId;
@ -70,173 +81,336 @@ pub trait ProjectExt: 'static {
fn connect_asset_removed<F: Fn(&Self, &Asset) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_error_loading_asset<F: Fn(&Self, &Error, &str, glib::types::Type) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_error_loading_asset<F: Fn(&Self, &Error, &str, glib::types::Type) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_loaded<F: Fn(&Self, &Timeline) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_missing_uri<F: Fn(&Self, &Error, &Asset) -> Option<GString> + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_missing_uri<F: Fn(&Self, &Error, &Asset) -> Option<GString> + 'static>(
&self,
f: F,
) -> SignalHandlerId;
}
impl<O: IsA<Project>> ProjectExt for O {
fn add_asset<P: IsA<Asset>>(&self, asset: &P) -> bool {
unsafe {
from_glib(ges_sys::ges_project_add_asset(self.as_ref().to_glib_none().0, asset.as_ref().to_glib_none().0))
from_glib(ges_sys::ges_project_add_asset(
self.as_ref().to_glib_none().0,
asset.as_ref().to_glib_none().0,
))
}
}
fn add_encoding_profile<P: IsA<gst_pbutils::EncodingProfile>>(&self, profile: &P) -> Result<(), glib::error::BoolError> {
fn add_encoding_profile<P: IsA<gst_pbutils::EncodingProfile>>(
&self,
profile: &P,
) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_project_add_encoding_profile(self.as_ref().to_glib_none().0, profile.as_ref().to_glib_none().0), "Failed to add profile")
glib_result_from_gboolean!(
ges_sys::ges_project_add_encoding_profile(
self.as_ref().to_glib_none().0,
profile.as_ref().to_glib_none().0
),
"Failed to add profile"
)
}
}
fn create_asset(&self, id: Option<&str>, extractable_type: glib::types::Type) -> bool {
unsafe {
from_glib(ges_sys::ges_project_create_asset(self.as_ref().to_glib_none().0, id.to_glib_none().0, extractable_type.to_glib()))
from_glib(ges_sys::ges_project_create_asset(
self.as_ref().to_glib_none().0,
id.to_glib_none().0,
extractable_type.to_glib(),
))
}
}
fn create_asset_sync(&self, id: Option<&str>, extractable_type: glib::types::Type) -> Result<Option<Asset>, Error> {
fn create_asset_sync(
&self,
id: Option<&str>,
extractable_type: glib::types::Type,
) -> Result<Option<Asset>, Error> {
unsafe {
let mut error = ptr::null_mut();
let ret = ges_sys::ges_project_create_asset_sync(self.as_ref().to_glib_none().0, id.to_glib_none().0, extractable_type.to_glib(), &mut error);
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
let ret = ges_sys::ges_project_create_asset_sync(
self.as_ref().to_glib_none().0,
id.to_glib_none().0,
extractable_type.to_glib(),
&mut error,
);
if error.is_null() {
Ok(from_glib_full(ret))
} else {
Err(from_glib_full(error))
}
}
}
fn get_asset(&self, id: &str, extractable_type: glib::types::Type) -> Option<Asset> {
unsafe {
from_glib_full(ges_sys::ges_project_get_asset(self.as_ref().to_glib_none().0, id.to_glib_none().0, extractable_type.to_glib()))
from_glib_full(ges_sys::ges_project_get_asset(
self.as_ref().to_glib_none().0,
id.to_glib_none().0,
extractable_type.to_glib(),
))
}
}
fn get_loading_assets(&self) -> Vec<Asset> {
unsafe {
FromGlibPtrContainer::from_glib_full(ges_sys::ges_project_get_loading_assets(self.as_ref().to_glib_none().0))
FromGlibPtrContainer::from_glib_full(ges_sys::ges_project_get_loading_assets(
self.as_ref().to_glib_none().0,
))
}
}
fn get_uri(&self) -> Option<GString> {
unsafe {
from_glib_full(ges_sys::ges_project_get_uri(self.as_ref().to_glib_none().0))
}
unsafe { from_glib_full(ges_sys::ges_project_get_uri(self.as_ref().to_glib_none().0)) }
}
fn list_assets(&self, filter: glib::types::Type) -> Vec<Asset> {
unsafe {
FromGlibPtrContainer::from_glib_full(ges_sys::ges_project_list_assets(self.as_ref().to_glib_none().0, filter.to_glib()))
FromGlibPtrContainer::from_glib_full(ges_sys::ges_project_list_assets(
self.as_ref().to_glib_none().0,
filter.to_glib(),
))
}
}
fn list_encoding_profiles(&self) -> Vec<gst_pbutils::EncodingProfile> {
unsafe {
FromGlibPtrContainer::from_glib_none(ges_sys::ges_project_list_encoding_profiles(self.as_ref().to_glib_none().0))
FromGlibPtrContainer::from_glib_none(ges_sys::ges_project_list_encoding_profiles(
self.as_ref().to_glib_none().0,
))
}
}
fn load<P: IsA<Timeline>>(&self, timeline: &P) -> Result<(), Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ges_sys::ges_project_load(self.as_ref().to_glib_none().0, timeline.as_ref().to_glib_none().0, &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
let _ = ges_sys::ges_project_load(
self.as_ref().to_glib_none().0,
timeline.as_ref().to_glib_none().0,
&mut error,
);
if error.is_null() {
Ok(())
} else {
Err(from_glib_full(error))
}
}
}
fn remove_asset<P: IsA<Asset>>(&self, asset: &P) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_project_remove_asset(self.as_ref().to_glib_none().0, asset.as_ref().to_glib_none().0), "Failed to remove asset")
glib_result_from_gboolean!(
ges_sys::ges_project_remove_asset(
self.as_ref().to_glib_none().0,
asset.as_ref().to_glib_none().0
),
"Failed to remove asset"
)
}
}
fn save<P: IsA<Timeline>, Q: IsA<Asset>>(&self, timeline: &P, uri: &str, formatter_asset: Option<&Q>, overwrite: bool) -> Result<(), Error> {
fn save<P: IsA<Timeline>, Q: IsA<Asset>>(
&self,
timeline: &P,
uri: &str,
formatter_asset: Option<&Q>,
overwrite: bool,
) -> Result<(), Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ges_sys::ges_project_save(self.as_ref().to_glib_none().0, timeline.as_ref().to_glib_none().0, uri.to_glib_none().0, formatter_asset.map(|p| p.as_ref()).to_glib_none().0, overwrite.to_glib(), &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
let _ = ges_sys::ges_project_save(
self.as_ref().to_glib_none().0,
timeline.as_ref().to_glib_none().0,
uri.to_glib_none().0,
formatter_asset.map(|p| p.as_ref()).to_glib_none().0,
overwrite.to_glib(),
&mut error,
);
if error.is_null() {
Ok(())
} else {
Err(from_glib_full(error))
}
}
}
fn connect_asset_added<F: Fn(&Self, &Asset) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn asset_added_trampoline<P, F: Fn(&P, &Asset) + 'static>(this: *mut ges_sys::GESProject, asset: *mut ges_sys::GESAsset, f: glib_sys::gpointer)
where P: IsA<Project>
unsafe extern "C" fn asset_added_trampoline<P, F: Fn(&P, &Asset) + 'static>(
this: *mut ges_sys::GESProject,
asset: *mut ges_sys::GESAsset,
f: glib_sys::gpointer,
) where
P: IsA<Project>,
{
let f: &F = &*(f as *const F);
f(&Project::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(asset))
f(
&Project::from_glib_borrow(this).unsafe_cast(),
&from_glib_borrow(asset),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"asset-added\0".as_ptr() as *const _,
Some(transmute(asset_added_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"asset-added\0".as_ptr() as *const _,
Some(transmute(asset_added_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_asset_loading<F: Fn(&Self, &Asset) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn asset_loading_trampoline<P, F: Fn(&P, &Asset) + 'static>(this: *mut ges_sys::GESProject, asset: *mut ges_sys::GESAsset, f: glib_sys::gpointer)
where P: IsA<Project>
unsafe extern "C" fn asset_loading_trampoline<P, F: Fn(&P, &Asset) + 'static>(
this: *mut ges_sys::GESProject,
asset: *mut ges_sys::GESAsset,
f: glib_sys::gpointer,
) where
P: IsA<Project>,
{
let f: &F = &*(f as *const F);
f(&Project::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(asset))
f(
&Project::from_glib_borrow(this).unsafe_cast(),
&from_glib_borrow(asset),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"asset-loading\0".as_ptr() as *const _,
Some(transmute(asset_loading_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"asset-loading\0".as_ptr() as *const _,
Some(transmute(asset_loading_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_asset_removed<F: Fn(&Self, &Asset) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn asset_removed_trampoline<P, F: Fn(&P, &Asset) + 'static>(this: *mut ges_sys::GESProject, asset: *mut ges_sys::GESAsset, f: glib_sys::gpointer)
where P: IsA<Project>
unsafe extern "C" fn asset_removed_trampoline<P, F: Fn(&P, &Asset) + 'static>(
this: *mut ges_sys::GESProject,
asset: *mut ges_sys::GESAsset,
f: glib_sys::gpointer,
) where
P: IsA<Project>,
{
let f: &F = &*(f as *const F);
f(&Project::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(asset))
f(
&Project::from_glib_borrow(this).unsafe_cast(),
&from_glib_borrow(asset),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"asset-removed\0".as_ptr() as *const _,
Some(transmute(asset_removed_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"asset-removed\0".as_ptr() as *const _,
Some(transmute(asset_removed_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_error_loading_asset<F: Fn(&Self, &Error, &str, glib::types::Type) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn error_loading_asset_trampoline<P, F: Fn(&P, &Error, &str, glib::types::Type) + 'static>(this: *mut ges_sys::GESProject, error: *mut glib_sys::GError, id: *mut libc::c_char, extractable_type: glib_sys::GType, f: glib_sys::gpointer)
where P: IsA<Project>
fn connect_error_loading_asset<F: Fn(&Self, &Error, &str, glib::types::Type) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn error_loading_asset_trampoline<
P,
F: Fn(&P, &Error, &str, glib::types::Type) + 'static,
>(
this: *mut ges_sys::GESProject,
error: *mut glib_sys::GError,
id: *mut libc::c_char,
extractable_type: glib_sys::GType,
f: glib_sys::gpointer,
) where
P: IsA<Project>,
{
let f: &F = &*(f as *const F);
f(&Project::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(error), &GString::from_glib_borrow(id), from_glib(extractable_type))
f(
&Project::from_glib_borrow(this).unsafe_cast(),
&from_glib_borrow(error),
&GString::from_glib_borrow(id),
from_glib(extractable_type),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"error-loading-asset\0".as_ptr() as *const _,
Some(transmute(error_loading_asset_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"error-loading-asset\0".as_ptr() as *const _,
Some(transmute(
error_loading_asset_trampoline::<Self, F> as usize,
)),
Box_::into_raw(f),
)
}
}
fn connect_loaded<F: Fn(&Self, &Timeline) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn loaded_trampoline<P, F: Fn(&P, &Timeline) + 'static>(this: *mut ges_sys::GESProject, timeline: *mut ges_sys::GESTimeline, f: glib_sys::gpointer)
where P: IsA<Project>
unsafe extern "C" fn loaded_trampoline<P, F: Fn(&P, &Timeline) + 'static>(
this: *mut ges_sys::GESProject,
timeline: *mut ges_sys::GESTimeline,
f: glib_sys::gpointer,
) where
P: IsA<Project>,
{
let f: &F = &*(f as *const F);
f(&Project::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(timeline))
f(
&Project::from_glib_borrow(this).unsafe_cast(),
&from_glib_borrow(timeline),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"loaded\0".as_ptr() as *const _,
Some(transmute(loaded_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"loaded\0".as_ptr() as *const _,
Some(transmute(loaded_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_missing_uri<F: Fn(&Self, &Error, &Asset) -> Option<GString> + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn missing_uri_trampoline<P, F: Fn(&P, &Error, &Asset) -> Option<GString> + 'static>(this: *mut ges_sys::GESProject, error: *mut glib_sys::GError, wrong_asset: *mut ges_sys::GESAsset, f: glib_sys::gpointer) -> *mut libc::c_char
where P: IsA<Project>
fn connect_missing_uri<F: Fn(&Self, &Error, &Asset) -> Option<GString> + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn missing_uri_trampoline<
P,
F: Fn(&P, &Error, &Asset) -> Option<GString> + 'static,
>(
this: *mut ges_sys::GESProject,
error: *mut glib_sys::GError,
wrong_asset: *mut ges_sys::GESAsset,
f: glib_sys::gpointer,
) -> *mut libc::c_char
where
P: IsA<Project>,
{
let f: &F = &*(f as *const F);
f(&Project::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(error), &from_glib_borrow(wrong_asset)).to_glib_full()
f(
&Project::from_glib_borrow(this).unsafe_cast(),
&from_glib_borrow(error),
&from_glib_borrow(wrong_asset),
)
.to_glib_full()
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"missing-uri\0".as_ptr() as *const _,
Some(transmute(missing_uri_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"missing-uri\0".as_ptr() as *const _,
Some(transmute(missing_uri_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
}

View file

@ -2,6 +2,18 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use ges_sys;
use glib;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib_sys;
use gst;
use std::boxed::Box as Box_;
use std::mem::transmute;
use std::ptr;
use Asset;
use Error;
use Extractable;
@ -10,18 +22,6 @@ use Layer;
use TimelineElement;
use Track;
use TrackElement;
use ges_sys;
use glib;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::translate::*;
use glib_sys;
use gst;
use std::boxed::Box as Box_;
use std::mem::transmute;
use std::ptr;
glib_wrapper! {
pub struct Timeline(Object<ges_sys::GESTimeline, ges_sys::GESTimelineClass, TimelineClass>) @extends gst::Element, gst::Object, @implements Extractable;
@ -34,16 +34,12 @@ glib_wrapper! {
impl Timeline {
pub fn new() -> Timeline {
assert_initialized_main_thread!();
unsafe {
from_glib_none(ges_sys::ges_timeline_new())
}
unsafe { from_glib_none(ges_sys::ges_timeline_new()) }
}
pub fn new_audio_video() -> Timeline {
assert_initialized_main_thread!();
unsafe {
from_glib_none(ges_sys::ges_timeline_new_audio_video())
}
unsafe { from_glib_none(ges_sys::ges_timeline_new_audio_video()) }
}
pub fn new_from_uri(uri: &str) -> Result<Option<Timeline>, Error> {
@ -51,7 +47,11 @@ impl Timeline {
unsafe {
let mut error = ptr::null_mut();
let ret = ges_sys::ges_timeline_new_from_uri(uri.to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_none(ret)) } else { Err(from_glib_full(error)) }
if error.is_null() {
Ok(from_glib_none(ret))
} else {
Err(from_glib_full(error))
}
}
}
}
@ -99,15 +99,29 @@ pub trait TimelineExt: 'static {
fn load_from_uri(&self, uri: &str) -> Result<(), Error>;
fn move_layer<P: IsA<Layer>>(&self, layer: &P, new_layer_priority: u32) -> Result<(), glib::error::BoolError>;
fn move_layer<P: IsA<Layer>>(
&self,
layer: &P,
new_layer_priority: u32,
) -> Result<(), glib::error::BoolError>;
fn paste_element<P: IsA<TimelineElement>>(&self, element: &P, position: gst::ClockTime, layer_priority: i32) -> Option<TimelineElement>;
fn paste_element<P: IsA<TimelineElement>>(
&self,
element: &P,
position: gst::ClockTime,
layer_priority: i32,
) -> Option<TimelineElement>;
fn remove_layer<P: IsA<Layer>>(&self, layer: &P) -> Result<(), glib::error::BoolError>;
fn remove_track<P: IsA<Track>>(&self, track: &P) -> Result<(), glib::error::BoolError>;
fn save_to_uri<P: IsA<Asset>>(&self, uri: &str, formatter_asset: Option<&P>, overwrite: bool) -> Result<(), Error>;
fn save_to_uri<P: IsA<Asset>>(
&self,
uri: &str,
formatter_asset: Option<&P>,
overwrite: bool,
) -> Result<(), Error>;
fn set_auto_transition(&self, auto_transition: bool);
@ -125,195 +139,327 @@ pub trait TimelineExt: 'static {
//fn connect_select_tracks_for_object<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
fn connect_snapping_ended<F: Fn(&Self, &TrackElement, &TrackElement, u64) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_snapping_ended<F: Fn(&Self, &TrackElement, &TrackElement, u64) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_snapping_started<F: Fn(&Self, &TrackElement, &TrackElement, u64) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_snapping_started<F: Fn(&Self, &TrackElement, &TrackElement, u64) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_track_added<F: Fn(&Self, &Track) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_track_removed<F: Fn(&Self, &Track) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_auto_transition_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_auto_transition_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_snapping_distance_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_snapping_distance_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
}
impl<O: IsA<Timeline>> TimelineExt for O {
fn add_layer<P: IsA<Layer>>(&self, layer: &P) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_timeline_add_layer(self.as_ref().to_glib_none().0, layer.as_ref().to_glib_none().0), "Failed to add layer")
glib_result_from_gboolean!(
ges_sys::ges_timeline_add_layer(
self.as_ref().to_glib_none().0,
layer.as_ref().to_glib_none().0
),
"Failed to add layer"
)
}
}
fn add_track<P: IsA<Track>>(&self, track: &P) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_timeline_add_track(self.as_ref().to_glib_none().0, track.as_ref().to_glib_full()), "Failed to add track")
glib_result_from_gboolean!(
ges_sys::ges_timeline_add_track(
self.as_ref().to_glib_none().0,
track.as_ref().to_glib_full()
),
"Failed to add track"
)
}
}
fn append_layer(&self) -> Layer {
unsafe {
from_glib_none(ges_sys::ges_timeline_append_layer(self.as_ref().to_glib_none().0))
from_glib_none(ges_sys::ges_timeline_append_layer(
self.as_ref().to_glib_none().0,
))
}
}
fn commit(&self) -> bool {
unsafe {
from_glib(ges_sys::ges_timeline_commit(self.as_ref().to_glib_none().0))
}
unsafe { from_glib(ges_sys::ges_timeline_commit(self.as_ref().to_glib_none().0)) }
}
fn commit_sync(&self) -> bool {
unsafe {
from_glib(ges_sys::ges_timeline_commit_sync(self.as_ref().to_glib_none().0))
from_glib(ges_sys::ges_timeline_commit_sync(
self.as_ref().to_glib_none().0,
))
}
}
fn get_auto_transition(&self) -> bool {
unsafe {
from_glib(ges_sys::ges_timeline_get_auto_transition(self.as_ref().to_glib_none().0))
from_glib(ges_sys::ges_timeline_get_auto_transition(
self.as_ref().to_glib_none().0,
))
}
}
fn get_duration(&self) -> gst::ClockTime {
unsafe {
from_glib(ges_sys::ges_timeline_get_duration(self.as_ref().to_glib_none().0))
from_glib(ges_sys::ges_timeline_get_duration(
self.as_ref().to_glib_none().0,
))
}
}
fn get_element(&self, name: &str) -> Option<TimelineElement> {
unsafe {
from_glib_full(ges_sys::ges_timeline_get_element(self.as_ref().to_glib_none().0, name.to_glib_none().0))
from_glib_full(ges_sys::ges_timeline_get_element(
self.as_ref().to_glib_none().0,
name.to_glib_none().0,
))
}
}
fn get_groups(&self) -> Vec<Group> {
unsafe {
FromGlibPtrContainer::from_glib_none(ges_sys::ges_timeline_get_groups(self.as_ref().to_glib_none().0))
FromGlibPtrContainer::from_glib_none(ges_sys::ges_timeline_get_groups(
self.as_ref().to_glib_none().0,
))
}
}
fn get_layer(&self, priority: u32) -> Option<Layer> {
unsafe {
from_glib_full(ges_sys::ges_timeline_get_layer(self.as_ref().to_glib_none().0, priority))
from_glib_full(ges_sys::ges_timeline_get_layer(
self.as_ref().to_glib_none().0,
priority,
))
}
}
fn get_layers(&self) -> Vec<Layer> {
unsafe {
FromGlibPtrContainer::from_glib_full(ges_sys::ges_timeline_get_layers(self.as_ref().to_glib_none().0))
FromGlibPtrContainer::from_glib_full(ges_sys::ges_timeline_get_layers(
self.as_ref().to_glib_none().0,
))
}
}
fn get_pad_for_track<P: IsA<Track>>(&self, track: &P) -> Option<gst::Pad> {
unsafe {
from_glib_none(ges_sys::ges_timeline_get_pad_for_track(self.as_ref().to_glib_none().0, track.as_ref().to_glib_none().0))
from_glib_none(ges_sys::ges_timeline_get_pad_for_track(
self.as_ref().to_glib_none().0,
track.as_ref().to_glib_none().0,
))
}
}
fn get_snapping_distance(&self) -> gst::ClockTime {
unsafe {
from_glib(ges_sys::ges_timeline_get_snapping_distance(self.as_ref().to_glib_none().0))
from_glib(ges_sys::ges_timeline_get_snapping_distance(
self.as_ref().to_glib_none().0,
))
}
}
fn get_track_for_pad<P: IsA<gst::Pad>>(&self, pad: &P) -> Option<Track> {
unsafe {
from_glib_none(ges_sys::ges_timeline_get_track_for_pad(self.as_ref().to_glib_none().0, pad.as_ref().to_glib_none().0))
from_glib_none(ges_sys::ges_timeline_get_track_for_pad(
self.as_ref().to_glib_none().0,
pad.as_ref().to_glib_none().0,
))
}
}
fn get_tracks(&self) -> Vec<Track> {
unsafe {
FromGlibPtrContainer::from_glib_full(ges_sys::ges_timeline_get_tracks(self.as_ref().to_glib_none().0))
FromGlibPtrContainer::from_glib_full(ges_sys::ges_timeline_get_tracks(
self.as_ref().to_glib_none().0,
))
}
}
fn is_empty(&self) -> bool {
unsafe {
from_glib(ges_sys::ges_timeline_is_empty(self.as_ref().to_glib_none().0))
from_glib(ges_sys::ges_timeline_is_empty(
self.as_ref().to_glib_none().0,
))
}
}
fn load_from_uri(&self, uri: &str) -> Result<(), Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ges_sys::ges_timeline_load_from_uri(self.as_ref().to_glib_none().0, uri.to_glib_none().0, &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
let _ = ges_sys::ges_timeline_load_from_uri(
self.as_ref().to_glib_none().0,
uri.to_glib_none().0,
&mut error,
);
if error.is_null() {
Ok(())
} else {
Err(from_glib_full(error))
}
}
}
fn move_layer<P: IsA<Layer>>(&self, layer: &P, new_layer_priority: u32) -> Result<(), glib::error::BoolError> {
fn move_layer<P: IsA<Layer>>(
&self,
layer: &P,
new_layer_priority: u32,
) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_timeline_move_layer(self.as_ref().to_glib_none().0, layer.as_ref().to_glib_none().0, new_layer_priority), "Failed to move layer")
glib_result_from_gboolean!(
ges_sys::ges_timeline_move_layer(
self.as_ref().to_glib_none().0,
layer.as_ref().to_glib_none().0,
new_layer_priority
),
"Failed to move layer"
)
}
}
fn paste_element<P: IsA<TimelineElement>>(&self, element: &P, position: gst::ClockTime, layer_priority: i32) -> Option<TimelineElement> {
fn paste_element<P: IsA<TimelineElement>>(
&self,
element: &P,
position: gst::ClockTime,
layer_priority: i32,
) -> Option<TimelineElement> {
unsafe {
from_glib_none(ges_sys::ges_timeline_paste_element(self.as_ref().to_glib_none().0, element.as_ref().to_glib_none().0, position.to_glib(), layer_priority))
from_glib_none(ges_sys::ges_timeline_paste_element(
self.as_ref().to_glib_none().0,
element.as_ref().to_glib_none().0,
position.to_glib(),
layer_priority,
))
}
}
fn remove_layer<P: IsA<Layer>>(&self, layer: &P) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_timeline_remove_layer(self.as_ref().to_glib_none().0, layer.as_ref().to_glib_none().0), "Failed to remove layer")
glib_result_from_gboolean!(
ges_sys::ges_timeline_remove_layer(
self.as_ref().to_glib_none().0,
layer.as_ref().to_glib_none().0
),
"Failed to remove layer"
)
}
}
fn remove_track<P: IsA<Track>>(&self, track: &P) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_timeline_remove_track(self.as_ref().to_glib_none().0, track.as_ref().to_glib_none().0), "Failed to remove track")
glib_result_from_gboolean!(
ges_sys::ges_timeline_remove_track(
self.as_ref().to_glib_none().0,
track.as_ref().to_glib_none().0
),
"Failed to remove track"
)
}
}
fn save_to_uri<P: IsA<Asset>>(&self, uri: &str, formatter_asset: Option<&P>, overwrite: bool) -> Result<(), Error> {
fn save_to_uri<P: IsA<Asset>>(
&self,
uri: &str,
formatter_asset: Option<&P>,
overwrite: bool,
) -> Result<(), Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ges_sys::ges_timeline_save_to_uri(self.as_ref().to_glib_none().0, uri.to_glib_none().0, formatter_asset.map(|p| p.as_ref()).to_glib_none().0, overwrite.to_glib(), &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
let _ = ges_sys::ges_timeline_save_to_uri(
self.as_ref().to_glib_none().0,
uri.to_glib_none().0,
formatter_asset.map(|p| p.as_ref()).to_glib_none().0,
overwrite.to_glib(),
&mut error,
);
if error.is_null() {
Ok(())
} else {
Err(from_glib_full(error))
}
}
}
fn set_auto_transition(&self, auto_transition: bool) {
unsafe {
ges_sys::ges_timeline_set_auto_transition(self.as_ref().to_glib_none().0, auto_transition.to_glib());
ges_sys::ges_timeline_set_auto_transition(
self.as_ref().to_glib_none().0,
auto_transition.to_glib(),
);
}
}
fn set_snapping_distance(&self, snapping_distance: gst::ClockTime) {
unsafe {
ges_sys::ges_timeline_set_snapping_distance(self.as_ref().to_glib_none().0, snapping_distance.to_glib());
ges_sys::ges_timeline_set_snapping_distance(
self.as_ref().to_glib_none().0,
snapping_distance.to_glib(),
);
}
}
fn connect_commited<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn commited_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESTimeline, f: glib_sys::gpointer)
where P: IsA<Timeline>
unsafe extern "C" fn commited_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESTimeline,
f: glib_sys::gpointer,
) where
P: IsA<Timeline>,
{
let f: &F = &*(f as *const F);
f(&Timeline::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"commited\0".as_ptr() as *const _,
Some(transmute(commited_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"commited\0".as_ptr() as *const _,
Some(transmute(commited_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_group_added<F: Fn(&Self, &Group) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn group_added_trampoline<P, F: Fn(&P, &Group) + 'static>(this: *mut ges_sys::GESTimeline, group: *mut ges_sys::GESGroup, f: glib_sys::gpointer)
where P: IsA<Timeline>
unsafe extern "C" fn group_added_trampoline<P, F: Fn(&P, &Group) + 'static>(
this: *mut ges_sys::GESTimeline,
group: *mut ges_sys::GESGroup,
f: glib_sys::gpointer,
) where
P: IsA<Timeline>,
{
let f: &F = &*(f as *const F);
f(&Timeline::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(group))
f(
&Timeline::from_glib_borrow(this).unsafe_cast(),
&from_glib_borrow(group),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"group-added\0".as_ptr() as *const _,
Some(transmute(group_added_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"group-added\0".as_ptr() as *const _,
Some(transmute(group_added_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
@ -322,30 +468,52 @@ impl<O: IsA<Timeline>> TimelineExt for O {
//}
fn connect_layer_added<F: Fn(&Self, &Layer) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn layer_added_trampoline<P, F: Fn(&P, &Layer) + 'static>(this: *mut ges_sys::GESTimeline, layer: *mut ges_sys::GESLayer, f: glib_sys::gpointer)
where P: IsA<Timeline>
unsafe extern "C" fn layer_added_trampoline<P, F: Fn(&P, &Layer) + 'static>(
this: *mut ges_sys::GESTimeline,
layer: *mut ges_sys::GESLayer,
f: glib_sys::gpointer,
) where
P: IsA<Timeline>,
{
let f: &F = &*(f as *const F);
f(&Timeline::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(layer))
f(
&Timeline::from_glib_borrow(this).unsafe_cast(),
&from_glib_borrow(layer),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"layer-added\0".as_ptr() as *const _,
Some(transmute(layer_added_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"layer-added\0".as_ptr() as *const _,
Some(transmute(layer_added_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_layer_removed<F: Fn(&Self, &Layer) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn layer_removed_trampoline<P, F: Fn(&P, &Layer) + 'static>(this: *mut ges_sys::GESTimeline, layer: *mut ges_sys::GESLayer, f: glib_sys::gpointer)
where P: IsA<Timeline>
unsafe extern "C" fn layer_removed_trampoline<P, F: Fn(&P, &Layer) + 'static>(
this: *mut ges_sys::GESTimeline,
layer: *mut ges_sys::GESLayer,
f: glib_sys::gpointer,
) where
P: IsA<Timeline>,
{
let f: &F = &*(f as *const F);
f(&Timeline::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(layer))
f(
&Timeline::from_glib_borrow(this).unsafe_cast(),
&from_glib_borrow(layer),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"layer-removed\0".as_ptr() as *const _,
Some(transmute(layer_removed_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"layer-removed\0".as_ptr() as *const _,
Some(transmute(layer_removed_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
@ -353,101 +521,199 @@ impl<O: IsA<Timeline>> TimelineExt for O {
// Empty ctype return value *.PtrArray TypeId { ns_id: 1, id: 16 }
//}
fn connect_snapping_ended<F: Fn(&Self, &TrackElement, &TrackElement, u64) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn snapping_ended_trampoline<P, F: Fn(&P, &TrackElement, &TrackElement, u64) + 'static>(this: *mut ges_sys::GESTimeline, obj1: *mut ges_sys::GESTrackElement, obj2: *mut ges_sys::GESTrackElement, position: u64, f: glib_sys::gpointer)
where P: IsA<Timeline>
fn connect_snapping_ended<F: Fn(&Self, &TrackElement, &TrackElement, u64) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn snapping_ended_trampoline<
P,
F: Fn(&P, &TrackElement, &TrackElement, u64) + 'static,
>(
this: *mut ges_sys::GESTimeline,
obj1: *mut ges_sys::GESTrackElement,
obj2: *mut ges_sys::GESTrackElement,
position: u64,
f: glib_sys::gpointer,
) where
P: IsA<Timeline>,
{
let f: &F = &*(f as *const F);
f(&Timeline::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(obj1), &from_glib_borrow(obj2), position)
f(
&Timeline::from_glib_borrow(this).unsafe_cast(),
&from_glib_borrow(obj1),
&from_glib_borrow(obj2),
position,
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"snapping-ended\0".as_ptr() as *const _,
Some(transmute(snapping_ended_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"snapping-ended\0".as_ptr() as *const _,
Some(transmute(snapping_ended_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_snapping_started<F: Fn(&Self, &TrackElement, &TrackElement, u64) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn snapping_started_trampoline<P, F: Fn(&P, &TrackElement, &TrackElement, u64) + 'static>(this: *mut ges_sys::GESTimeline, obj1: *mut ges_sys::GESTrackElement, obj2: *mut ges_sys::GESTrackElement, position: u64, f: glib_sys::gpointer)
where P: IsA<Timeline>
fn connect_snapping_started<F: Fn(&Self, &TrackElement, &TrackElement, u64) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn snapping_started_trampoline<
P,
F: Fn(&P, &TrackElement, &TrackElement, u64) + 'static,
>(
this: *mut ges_sys::GESTimeline,
obj1: *mut ges_sys::GESTrackElement,
obj2: *mut ges_sys::GESTrackElement,
position: u64,
f: glib_sys::gpointer,
) where
P: IsA<Timeline>,
{
let f: &F = &*(f as *const F);
f(&Timeline::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(obj1), &from_glib_borrow(obj2), position)
f(
&Timeline::from_glib_borrow(this).unsafe_cast(),
&from_glib_borrow(obj1),
&from_glib_borrow(obj2),
position,
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"snapping-started\0".as_ptr() as *const _,
Some(transmute(snapping_started_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"snapping-started\0".as_ptr() as *const _,
Some(transmute(snapping_started_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_track_added<F: Fn(&Self, &Track) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn track_added_trampoline<P, F: Fn(&P, &Track) + 'static>(this: *mut ges_sys::GESTimeline, track: *mut ges_sys::GESTrack, f: glib_sys::gpointer)
where P: IsA<Timeline>
unsafe extern "C" fn track_added_trampoline<P, F: Fn(&P, &Track) + 'static>(
this: *mut ges_sys::GESTimeline,
track: *mut ges_sys::GESTrack,
f: glib_sys::gpointer,
) where
P: IsA<Timeline>,
{
let f: &F = &*(f as *const F);
f(&Timeline::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(track))
f(
&Timeline::from_glib_borrow(this).unsafe_cast(),
&from_glib_borrow(track),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"track-added\0".as_ptr() as *const _,
Some(transmute(track_added_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"track-added\0".as_ptr() as *const _,
Some(transmute(track_added_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_track_removed<F: Fn(&Self, &Track) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn track_removed_trampoline<P, F: Fn(&P, &Track) + 'static>(this: *mut ges_sys::GESTimeline, track: *mut ges_sys::GESTrack, f: glib_sys::gpointer)
where P: IsA<Timeline>
unsafe extern "C" fn track_removed_trampoline<P, F: Fn(&P, &Track) + 'static>(
this: *mut ges_sys::GESTimeline,
track: *mut ges_sys::GESTrack,
f: glib_sys::gpointer,
) where
P: IsA<Timeline>,
{
let f: &F = &*(f as *const F);
f(&Timeline::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(track))
f(
&Timeline::from_glib_borrow(this).unsafe_cast(),
&from_glib_borrow(track),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"track-removed\0".as_ptr() as *const _,
Some(transmute(track_removed_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"track-removed\0".as_ptr() as *const _,
Some(transmute(track_removed_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_auto_transition_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_auto_transition_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESTimeline, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<Timeline>
fn connect_property_auto_transition_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_auto_transition_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESTimeline,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<Timeline>,
{
let f: &F = &*(f as *const F);
f(&Timeline::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::auto-transition\0".as_ptr() as *const _,
Some(transmute(notify_auto_transition_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::auto-transition\0".as_ptr() as *const _,
Some(transmute(
notify_auto_transition_trampoline::<Self, F> as usize,
)),
Box_::into_raw(f),
)
}
}
fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_duration_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESTimeline, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<Timeline>
unsafe extern "C" fn notify_duration_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESTimeline,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<Timeline>,
{
let f: &F = &*(f as *const F);
f(&Timeline::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::duration\0".as_ptr() as *const _,
Some(transmute(notify_duration_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::duration\0".as_ptr() as *const _,
Some(transmute(notify_duration_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_snapping_distance_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_snapping_distance_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESTimeline, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<Timeline>
fn connect_property_snapping_distance_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_snapping_distance_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESTimeline,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<Timeline>,
{
let f: &F = &*(f as *const F);
f(&Timeline::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::snapping-distance\0".as_ptr() as *const _,
Some(transmute(notify_snapping_distance_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::snapping-distance\0".as_ptr() as *const _,
Some(transmute(
notify_snapping_distance_trampoline::<Self, F> as usize,
)),
Box_::into_raw(f),
)
}
}
}

View file

@ -2,24 +2,24 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use Extractable;
use Timeline;
use TrackType;
use ges_sys;
use glib;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::GString;
use glib::StaticType;
use glib::Value;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::translate::*;
use glib_sys;
use gobject_sys;
use gst;
use std::boxed::Box as Box_;
use std::mem::transmute;
use Extractable;
use Timeline;
use TrackType;
glib_wrapper! {
pub struct TimelineElement(Object<ges_sys::GESTimelineElement, ges_sys::GESTimelineElementClass, TimelineElementClass>) @implements Extractable;
@ -98,7 +98,8 @@ pub trait TimelineElementExt: 'static {
fn set_name(&self, name: Option<&str>) -> Result<(), glib::error::BoolError>;
fn set_parent<P: IsA<TimelineElement>>(&self, parent: &P) -> Result<(), glib::error::BoolError>;
fn set_parent<P: IsA<TimelineElement>>(&self, parent: &P)
-> Result<(), glib::error::BoolError>;
fn set_priority(&self, priority: u32) -> bool;
@ -122,7 +123,8 @@ pub trait TimelineElementExt: 'static {
fn connect_property_in_point_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_max_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_max_duration_notify<F: Fn(&Self) + 'static>(&self, f: F)
-> SignalHandlerId;
fn connect_property_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
@ -144,7 +146,10 @@ impl<O: IsA<TimelineElement>> TimelineElementExt for O {
fn copy(&self, deep: bool) -> Option<TimelineElement> {
unsafe {
from_glib_none(ges_sys::ges_timeline_element_copy(self.as_ref().to_glib_none().0, deep.to_glib()))
from_glib_none(ges_sys::ges_timeline_element_copy(
self.as_ref().to_glib_none().0,
deep.to_glib(),
))
}
}
@ -166,67 +171,81 @@ impl<O: IsA<TimelineElement>> TimelineElementExt for O {
fn get_duration(&self) -> gst::ClockTime {
unsafe {
from_glib(ges_sys::ges_timeline_element_get_duration(self.as_ref().to_glib_none().0))
from_glib(ges_sys::ges_timeline_element_get_duration(
self.as_ref().to_glib_none().0,
))
}
}
fn get_inpoint(&self) -> gst::ClockTime {
unsafe {
from_glib(ges_sys::ges_timeline_element_get_inpoint(self.as_ref().to_glib_none().0))
from_glib(ges_sys::ges_timeline_element_get_inpoint(
self.as_ref().to_glib_none().0,
))
}
}
fn get_layer_priority(&self) -> u32 {
unsafe {
ges_sys::ges_timeline_element_get_layer_priority(self.as_ref().to_glib_none().0)
}
unsafe { ges_sys::ges_timeline_element_get_layer_priority(self.as_ref().to_glib_none().0) }
}
fn get_max_duration(&self) -> gst::ClockTime {
unsafe {
from_glib(ges_sys::ges_timeline_element_get_max_duration(self.as_ref().to_glib_none().0))
from_glib(ges_sys::ges_timeline_element_get_max_duration(
self.as_ref().to_glib_none().0,
))
}
}
fn get_name(&self) -> Option<GString> {
unsafe {
from_glib_full(ges_sys::ges_timeline_element_get_name(self.as_ref().to_glib_none().0))
from_glib_full(ges_sys::ges_timeline_element_get_name(
self.as_ref().to_glib_none().0,
))
}
}
fn get_parent(&self) -> Option<TimelineElement> {
unsafe {
from_glib_full(ges_sys::ges_timeline_element_get_parent(self.as_ref().to_glib_none().0))
from_glib_full(ges_sys::ges_timeline_element_get_parent(
self.as_ref().to_glib_none().0,
))
}
}
fn get_priority(&self) -> u32 {
unsafe {
ges_sys::ges_timeline_element_get_priority(self.as_ref().to_glib_none().0)
}
unsafe { ges_sys::ges_timeline_element_get_priority(self.as_ref().to_glib_none().0) }
}
fn get_start(&self) -> gst::ClockTime {
unsafe {
from_glib(ges_sys::ges_timeline_element_get_start(self.as_ref().to_glib_none().0))
from_glib(ges_sys::ges_timeline_element_get_start(
self.as_ref().to_glib_none().0,
))
}
}
fn get_timeline(&self) -> Option<Timeline> {
unsafe {
from_glib_full(ges_sys::ges_timeline_element_get_timeline(self.as_ref().to_glib_none().0))
from_glib_full(ges_sys::ges_timeline_element_get_timeline(
self.as_ref().to_glib_none().0,
))
}
}
fn get_toplevel_parent(&self) -> Option<TimelineElement> {
unsafe {
from_glib_full(ges_sys::ges_timeline_element_get_toplevel_parent(self.as_ref().to_glib_none().0))
from_glib_full(ges_sys::ges_timeline_element_get_toplevel_parent(
self.as_ref().to_glib_none().0,
))
}
}
fn get_track_types(&self) -> TrackType {
unsafe {
from_glib(ges_sys::ges_timeline_element_get_track_types(self.as_ref().to_glib_none().0))
from_glib(ges_sys::ges_timeline_element_get_track_types(
self.as_ref().to_glib_none().0,
))
}
}
@ -240,7 +259,10 @@ impl<O: IsA<TimelineElement>> TimelineElementExt for O {
fn paste(&self, paste_position: gst::ClockTime) -> Option<TimelineElement> {
unsafe {
from_glib_none(ges_sys::ges_timeline_element_paste(self.as_ref().to_glib_none().0, paste_position.to_glib()))
from_glib_none(ges_sys::ges_timeline_element_paste(
self.as_ref().to_glib_none().0,
paste_position.to_glib(),
))
}
}
@ -250,25 +272,49 @@ impl<O: IsA<TimelineElement>> TimelineElementExt for O {
fn ripple(&self, start: gst::ClockTime) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_timeline_element_ripple(self.as_ref().to_glib_none().0, start.to_glib()), "Failed to ripple")
glib_result_from_gboolean!(
ges_sys::ges_timeline_element_ripple(
self.as_ref().to_glib_none().0,
start.to_glib()
),
"Failed to ripple"
)
}
}
fn ripple_end(&self, end: gst::ClockTime) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_timeline_element_ripple_end(self.as_ref().to_glib_none().0, end.to_glib()), "Failed to ripple")
glib_result_from_gboolean!(
ges_sys::ges_timeline_element_ripple_end(
self.as_ref().to_glib_none().0,
end.to_glib()
),
"Failed to ripple"
)
}
}
fn roll_end(&self, end: gst::ClockTime) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_timeline_element_roll_end(self.as_ref().to_glib_none().0, end.to_glib()), "Failed to roll")
glib_result_from_gboolean!(
ges_sys::ges_timeline_element_roll_end(
self.as_ref().to_glib_none().0,
end.to_glib()
),
"Failed to roll"
)
}
}
fn roll_start(&self, start: gst::ClockTime) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_timeline_element_roll_start(self.as_ref().to_glib_none().0, start.to_glib()), "Failed to roll")
glib_result_from_gboolean!(
ges_sys::ges_timeline_element_roll_start(
self.as_ref().to_glib_none().0,
start.to_glib()
),
"Failed to roll"
)
}
}
@ -290,83 +336,138 @@ impl<O: IsA<TimelineElement>> TimelineElementExt for O {
fn set_duration(&self, duration: gst::ClockTime) -> bool {
unsafe {
from_glib(ges_sys::ges_timeline_element_set_duration(self.as_ref().to_glib_none().0, duration.to_glib()))
from_glib(ges_sys::ges_timeline_element_set_duration(
self.as_ref().to_glib_none().0,
duration.to_glib(),
))
}
}
fn set_inpoint(&self, inpoint: gst::ClockTime) -> bool {
unsafe {
from_glib(ges_sys::ges_timeline_element_set_inpoint(self.as_ref().to_glib_none().0, inpoint.to_glib()))
from_glib(ges_sys::ges_timeline_element_set_inpoint(
self.as_ref().to_glib_none().0,
inpoint.to_glib(),
))
}
}
fn set_max_duration(&self, maxduration: gst::ClockTime) -> bool {
unsafe {
from_glib(ges_sys::ges_timeline_element_set_max_duration(self.as_ref().to_glib_none().0, maxduration.to_glib()))
from_glib(ges_sys::ges_timeline_element_set_max_duration(
self.as_ref().to_glib_none().0,
maxduration.to_glib(),
))
}
}
fn set_name(&self, name: Option<&str>) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_timeline_element_set_name(self.as_ref().to_glib_none().0, name.to_glib_none().0), "Failed to set name")
glib_result_from_gboolean!(
ges_sys::ges_timeline_element_set_name(
self.as_ref().to_glib_none().0,
name.to_glib_none().0
),
"Failed to set name"
)
}
}
fn set_parent<P: IsA<TimelineElement>>(&self, parent: &P) -> Result<(), glib::error::BoolError> {
fn set_parent<P: IsA<TimelineElement>>(
&self,
parent: &P,
) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_timeline_element_set_parent(self.as_ref().to_glib_none().0, parent.as_ref().to_glib_none().0), "`TimelineElement` already had a parent or its parent was the same as specified")
glib_result_from_gboolean!(
ges_sys::ges_timeline_element_set_parent(
self.as_ref().to_glib_none().0,
parent.as_ref().to_glib_none().0
),
"`TimelineElement` already had a parent or its parent was the same as specified"
)
}
}
fn set_priority(&self, priority: u32) -> bool {
unsafe {
from_glib(ges_sys::ges_timeline_element_set_priority(self.as_ref().to_glib_none().0, priority))
from_glib(ges_sys::ges_timeline_element_set_priority(
self.as_ref().to_glib_none().0,
priority,
))
}
}
fn set_start(&self, start: gst::ClockTime) -> bool {
unsafe {
from_glib(ges_sys::ges_timeline_element_set_start(self.as_ref().to_glib_none().0, start.to_glib()))
from_glib(ges_sys::ges_timeline_element_set_start(
self.as_ref().to_glib_none().0,
start.to_glib(),
))
}
}
fn set_timeline<P: IsA<Timeline>>(&self, timeline: &P) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_timeline_element_set_timeline(self.as_ref().to_glib_none().0, timeline.as_ref().to_glib_none().0), "`Failed to set timeline")
glib_result_from_gboolean!(
ges_sys::ges_timeline_element_set_timeline(
self.as_ref().to_glib_none().0,
timeline.as_ref().to_glib_none().0
),
"`Failed to set timeline"
)
}
}
fn trim(&self, start: gst::ClockTime) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_timeline_element_trim(self.as_ref().to_glib_none().0, start.to_glib()), "`Failed to trim")
glib_result_from_gboolean!(
ges_sys::ges_timeline_element_trim(self.as_ref().to_glib_none().0, start.to_glib()),
"`Failed to trim"
)
}
}
fn get_property_in_point(&self) -> u64 {
unsafe {
let mut value = Value::from_type(<u64 as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"in-point\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"in-point\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
fn set_property_in_point(&self, in_point: u64) {
unsafe {
gobject_sys::g_object_set_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"in-point\0".as_ptr() as *const _, Value::from(&in_point).to_glib_none().0);
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"in-point\0".as_ptr() as *const _,
Value::from(&in_point).to_glib_none().0,
);
}
}
fn get_property_serialize(&self) -> bool {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"serialize\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"serialize\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
fn set_property_serialize(&self, serialize: bool) {
unsafe {
gobject_sys::g_object_set_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"serialize\0".as_ptr() as *const _, Value::from(&serialize).to_glib_none().0);
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"serialize\0".as_ptr() as *const _,
Value::from(&serialize).to_glib_none().0,
);
}
}
@ -375,128 +476,205 @@ impl<O: IsA<TimelineElement>> TimelineElementExt for O {
//}
fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_duration_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESTimelineElement, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<TimelineElement>
unsafe extern "C" fn notify_duration_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESTimelineElement,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<TimelineElement>,
{
let f: &F = &*(f as *const F);
f(&TimelineElement::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::duration\0".as_ptr() as *const _,
Some(transmute(notify_duration_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::duration\0".as_ptr() as *const _,
Some(transmute(notify_duration_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_in_point_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_in_point_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESTimelineElement, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<TimelineElement>
unsafe extern "C" fn notify_in_point_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESTimelineElement,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<TimelineElement>,
{
let f: &F = &*(f as *const F);
f(&TimelineElement::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::in-point\0".as_ptr() as *const _,
Some(transmute(notify_in_point_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::in-point\0".as_ptr() as *const _,
Some(transmute(notify_in_point_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_max_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_max_duration_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESTimelineElement, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<TimelineElement>
fn connect_property_max_duration_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_max_duration_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESTimelineElement,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<TimelineElement>,
{
let f: &F = &*(f as *const F);
f(&TimelineElement::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::max-duration\0".as_ptr() as *const _,
Some(transmute(notify_max_duration_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::max-duration\0".as_ptr() as *const _,
Some(transmute(
notify_max_duration_trampoline::<Self, F> as usize,
)),
Box_::into_raw(f),
)
}
}
fn connect_property_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_name_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESTimelineElement, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<TimelineElement>
unsafe extern "C" fn notify_name_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESTimelineElement,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<TimelineElement>,
{
let f: &F = &*(f as *const F);
f(&TimelineElement::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::name\0".as_ptr() as *const _,
Some(transmute(notify_name_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::name\0".as_ptr() as *const _,
Some(transmute(notify_name_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_parent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_parent_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESTimelineElement, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<TimelineElement>
unsafe extern "C" fn notify_parent_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESTimelineElement,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<TimelineElement>,
{
let f: &F = &*(f as *const F);
f(&TimelineElement::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::parent\0".as_ptr() as *const _,
Some(transmute(notify_parent_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::parent\0".as_ptr() as *const _,
Some(transmute(notify_parent_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_priority_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_priority_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESTimelineElement, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<TimelineElement>
unsafe extern "C" fn notify_priority_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESTimelineElement,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<TimelineElement>,
{
let f: &F = &*(f as *const F);
f(&TimelineElement::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::priority\0".as_ptr() as *const _,
Some(transmute(notify_priority_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::priority\0".as_ptr() as *const _,
Some(transmute(notify_priority_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_serialize_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_serialize_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESTimelineElement, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<TimelineElement>
unsafe extern "C" fn notify_serialize_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESTimelineElement,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<TimelineElement>,
{
let f: &F = &*(f as *const F);
f(&TimelineElement::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::serialize\0".as_ptr() as *const _,
Some(transmute(notify_serialize_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::serialize\0".as_ptr() as *const _,
Some(transmute(notify_serialize_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_start_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_start_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESTimelineElement, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<TimelineElement>
unsafe extern "C" fn notify_start_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESTimelineElement,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<TimelineElement>,
{
let f: &F = &*(f as *const F);
f(&TimelineElement::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::start\0".as_ptr() as *const _,
Some(transmute(notify_start_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::start\0".as_ptr() as *const _,
Some(transmute(notify_start_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_timeline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_timeline_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESTimelineElement, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<TimelineElement>
unsafe extern "C" fn notify_timeline_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESTimelineElement,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<TimelineElement>,
{
let f: &F = &*(f as *const F);
f(&TimelineElement::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::timeline\0".as_ptr() as *const _,
Some(transmute(notify_timeline_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::timeline\0".as_ptr() as *const _,
Some(transmute(notify_timeline_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
}

View file

@ -2,23 +2,23 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use Timeline;
use TrackElement;
use TrackType;
use ges_sys;
use glib;
use glib::StaticType;
use glib::Value;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::Value;
use glib_sys;
use gobject_sys;
use gst;
use std::boxed::Box as Box_;
use std::mem::transmute;
use Timeline;
use TrackElement;
use TrackType;
glib_wrapper! {
pub struct Track(Object<ges_sys::GESTrack, ges_sys::GESTrackClass, TrackClass>) @extends gst::Element, gst::Object;
@ -31,9 +31,7 @@ glib_wrapper! {
impl Track {
pub fn new(type_: TrackType, caps: &gst::Caps) -> Track {
assert_initialized_main_thread!();
unsafe {
from_glib_none(ges_sys::ges_track_new(type_.to_glib(), caps.to_glib_full()))
}
unsafe { from_glib_none(ges_sys::ges_track_new(type_.to_glib(), caps.to_glib_full())) }
}
}
@ -52,7 +50,10 @@ pub trait GESTrackExt: 'static {
fn get_timeline(&self) -> Option<Timeline>;
fn remove_element<P: IsA<TrackElement>>(&self, object: &P) -> Result<(), glib::error::BoolError>;
fn remove_element<P: IsA<TrackElement>>(
&self,
object: &P,
) -> Result<(), glib::error::BoolError>;
//fn set_create_element_for_gap_func<P: Fn(&Track) -> gst::Element + 'static>(&self, func: P);
@ -72,57 +73,83 @@ pub trait GESTrackExt: 'static {
fn connect_commited<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_track_element_added<F: Fn(&Self, &TrackElement) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_track_element_added<F: Fn(&Self, &TrackElement) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_track_element_removed<F: Fn(&Self, &TrackElement) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_track_element_removed<F: Fn(&Self, &TrackElement) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_mixing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_restriction_caps_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_restriction_caps_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
}
impl<O: IsA<Track>> GESTrackExt for O {
fn add_element<P: IsA<TrackElement>>(&self, object: &P) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_track_add_element(self.as_ref().to_glib_none().0, object.as_ref().to_glib_none().0), "Failed to add element")
glib_result_from_gboolean!(
ges_sys::ges_track_add_element(
self.as_ref().to_glib_none().0,
object.as_ref().to_glib_none().0
),
"Failed to add element"
)
}
}
fn commit(&self) -> bool {
unsafe {
from_glib(ges_sys::ges_track_commit(self.as_ref().to_glib_none().0))
}
unsafe { from_glib(ges_sys::ges_track_commit(self.as_ref().to_glib_none().0)) }
}
fn get_caps(&self) -> Option<gst::Caps> {
unsafe {
from_glib_none(ges_sys::ges_track_get_caps(self.as_ref().to_glib_none().0))
}
unsafe { from_glib_none(ges_sys::ges_track_get_caps(self.as_ref().to_glib_none().0)) }
}
fn get_elements(&self) -> Vec<TrackElement> {
unsafe {
FromGlibPtrContainer::from_glib_full(ges_sys::ges_track_get_elements(self.as_ref().to_glib_none().0))
FromGlibPtrContainer::from_glib_full(ges_sys::ges_track_get_elements(
self.as_ref().to_glib_none().0,
))
}
}
fn get_mixing(&self) -> bool {
unsafe {
from_glib(ges_sys::ges_track_get_mixing(self.as_ref().to_glib_none().0))
from_glib(ges_sys::ges_track_get_mixing(
self.as_ref().to_glib_none().0,
))
}
}
fn get_timeline(&self) -> Option<Timeline> {
unsafe {
from_glib_none(ges_sys::ges_track_get_timeline(self.as_ref().to_glib_none().0))
from_glib_none(ges_sys::ges_track_get_timeline(
self.as_ref().to_glib_none().0,
))
}
}
fn remove_element<P: IsA<TrackElement>>(&self, object: &P) -> Result<(), glib::error::BoolError> {
fn remove_element<P: IsA<TrackElement>>(
&self,
object: &P,
) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_track_remove_element(self.as_ref().to_glib_none().0, object.as_ref().to_glib_none().0), "Failed to remove element")
glib_result_from_gboolean!(
ges_sys::ges_track_remove_element(
self.as_ref().to_glib_none().0,
object.as_ref().to_glib_none().0
),
"Failed to remove element"
)
}
}
@ -138,26 +165,39 @@ impl<O: IsA<Track>> GESTrackExt for O {
fn set_restriction_caps(&self, caps: &gst::Caps) {
unsafe {
ges_sys::ges_track_set_restriction_caps(self.as_ref().to_glib_none().0, caps.to_glib_none().0);
ges_sys::ges_track_set_restriction_caps(
self.as_ref().to_glib_none().0,
caps.to_glib_none().0,
);
}
}
fn set_timeline<P: IsA<Timeline>>(&self, timeline: &P) {
unsafe {
ges_sys::ges_track_set_timeline(self.as_ref().to_glib_none().0, timeline.as_ref().to_glib_none().0);
ges_sys::ges_track_set_timeline(
self.as_ref().to_glib_none().0,
timeline.as_ref().to_glib_none().0,
);
}
}
fn update_restriction_caps(&self, caps: &gst::Caps) {
unsafe {
ges_sys::ges_track_update_restriction_caps(self.as_ref().to_glib_none().0, caps.to_glib_none().0);
ges_sys::ges_track_update_restriction_caps(
self.as_ref().to_glib_none().0,
caps.to_glib_none().0,
);
}
}
fn get_property_duration(&self) -> u64 {
unsafe {
let mut value = Value::from_type(<u64 as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"duration\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"duration\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
@ -165,7 +205,11 @@ impl<O: IsA<Track>> GESTrackExt for O {
fn get_property_restriction_caps(&self) -> Option<gst::Caps> {
unsafe {
let mut value = Value::from_type(<gst::Caps as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"restriction-caps\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"restriction-caps\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get()
}
}
@ -173,92 +217,167 @@ impl<O: IsA<Track>> GESTrackExt for O {
fn get_property_track_type(&self) -> TrackType {
unsafe {
let mut value = Value::from_type(<TrackType as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"track-type\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"track-type\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
fn connect_commited<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn commited_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESTrack, f: glib_sys::gpointer)
where P: IsA<Track>
unsafe extern "C" fn commited_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESTrack,
f: glib_sys::gpointer,
) where
P: IsA<Track>,
{
let f: &F = &*(f as *const F);
f(&Track::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"commited\0".as_ptr() as *const _,
Some(transmute(commited_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"commited\0".as_ptr() as *const _,
Some(transmute(commited_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_track_element_added<F: Fn(&Self, &TrackElement) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn track_element_added_trampoline<P, F: Fn(&P, &TrackElement) + 'static>(this: *mut ges_sys::GESTrack, effect: *mut ges_sys::GESTrackElement, f: glib_sys::gpointer)
where P: IsA<Track>
fn connect_track_element_added<F: Fn(&Self, &TrackElement) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn track_element_added_trampoline<P, F: Fn(&P, &TrackElement) + 'static>(
this: *mut ges_sys::GESTrack,
effect: *mut ges_sys::GESTrackElement,
f: glib_sys::gpointer,
) where
P: IsA<Track>,
{
let f: &F = &*(f as *const F);
f(&Track::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(effect))
f(
&Track::from_glib_borrow(this).unsafe_cast(),
&from_glib_borrow(effect),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"track-element-added\0".as_ptr() as *const _,
Some(transmute(track_element_added_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"track-element-added\0".as_ptr() as *const _,
Some(transmute(
track_element_added_trampoline::<Self, F> as usize,
)),
Box_::into_raw(f),
)
}
}
fn connect_track_element_removed<F: Fn(&Self, &TrackElement) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn track_element_removed_trampoline<P, F: Fn(&P, &TrackElement) + 'static>(this: *mut ges_sys::GESTrack, effect: *mut ges_sys::GESTrackElement, f: glib_sys::gpointer)
where P: IsA<Track>
fn connect_track_element_removed<F: Fn(&Self, &TrackElement) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn track_element_removed_trampoline<
P,
F: Fn(&P, &TrackElement) + 'static,
>(
this: *mut ges_sys::GESTrack,
effect: *mut ges_sys::GESTrackElement,
f: glib_sys::gpointer,
) where
P: IsA<Track>,
{
let f: &F = &*(f as *const F);
f(&Track::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(effect))
f(
&Track::from_glib_borrow(this).unsafe_cast(),
&from_glib_borrow(effect),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"track-element-removed\0".as_ptr() as *const _,
Some(transmute(track_element_removed_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"track-element-removed\0".as_ptr() as *const _,
Some(transmute(
track_element_removed_trampoline::<Self, F> as usize,
)),
Box_::into_raw(f),
)
}
}
fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_duration_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESTrack, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<Track>
unsafe extern "C" fn notify_duration_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESTrack,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<Track>,
{
let f: &F = &*(f as *const F);
f(&Track::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::duration\0".as_ptr() as *const _,
Some(transmute(notify_duration_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::duration\0".as_ptr() as *const _,
Some(transmute(notify_duration_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_mixing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_mixing_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESTrack, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<Track>
unsafe extern "C" fn notify_mixing_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESTrack,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<Track>,
{
let f: &F = &*(f as *const F);
f(&Track::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::mixing\0".as_ptr() as *const _,
Some(transmute(notify_mixing_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::mixing\0".as_ptr() as *const _,
Some(transmute(notify_mixing_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_restriction_caps_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_restriction_caps_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESTrack, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<Track>
fn connect_property_restriction_caps_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_restriction_caps_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESTrack,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<Track>,
{
let f: &F = &*(f as *const F);
f(&Track::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::restriction-caps\0".as_ptr() as *const _,
Some(transmute(notify_restriction_caps_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::restriction-caps\0".as_ptr() as *const _,
Some(transmute(
notify_restriction_caps_trampoline::<Self, F> as usize,
)),
Box_::into_raw(f),
)
}
}
}

View file

@ -2,6 +2,21 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use ges_sys;
use glib;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::GString;
use glib::StaticType;
use glib::Value;
use glib_sys;
use gobject_sys;
use gst;
use std::boxed::Box as Box_;
use std::mem::transmute;
use Edge;
use EditMode;
use Extractable;
@ -9,21 +24,6 @@ use Layer;
use TimelineElement;
use Track;
use TrackType;
use ges_sys;
use glib;
use glib::GString;
use glib::StaticType;
use glib::Value;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::translate::*;
use glib_sys;
use gobject_sys;
use gst;
use std::boxed::Box as Box_;
use std::mem::transmute;
glib_wrapper! {
pub struct TrackElement(Object<ges_sys::GESTrackElement, ges_sys::GESTrackElementClass, TrackElementClass>) @extends TimelineElement, @implements Extractable;
@ -36,9 +36,21 @@ glib_wrapper! {
pub const NONE_TRACK_ELEMENT: Option<&TrackElement> = None;
pub trait TrackElementExt: 'static {
fn add_children_props<P: IsA<gst::Element>>(&self, element: &P, wanted_categories: &[&str], blacklist: &[&str], whitelist: &[&str]);
fn add_children_props<P: IsA<gst::Element>>(
&self,
element: &P,
wanted_categories: &[&str],
blacklist: &[&str],
whitelist: &[&str],
);
fn edit(&self, layers: &[Layer], mode: EditMode, edge: Edge, position: u64) -> Result<(), glib::error::BoolError>;
fn edit(
&self,
layers: &[Layer],
mode: EditMode,
edge: Edge,
position: u64,
) -> Result<(), glib::error::BoolError>;
//fn get_all_control_bindings(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 6, id: 83 };
@ -80,15 +92,42 @@ pub trait TrackElementExt: 'static {
}
impl<O: IsA<TrackElement>> TrackElementExt for O {
fn add_children_props<P: IsA<gst::Element>>(&self, element: &P, wanted_categories: &[&str], blacklist: &[&str], whitelist: &[&str]) {
fn add_children_props<P: IsA<gst::Element>>(
&self,
element: &P,
wanted_categories: &[&str],
blacklist: &[&str],
whitelist: &[&str],
) {
unsafe {
ges_sys::ges_track_element_add_children_props(self.as_ref().to_glib_none().0, element.as_ref().to_glib_none().0, wanted_categories.to_glib_none().0, blacklist.to_glib_none().0, whitelist.to_glib_none().0);
ges_sys::ges_track_element_add_children_props(
self.as_ref().to_glib_none().0,
element.as_ref().to_glib_none().0,
wanted_categories.to_glib_none().0,
blacklist.to_glib_none().0,
whitelist.to_glib_none().0,
);
}
}
fn edit(&self, layers: &[Layer], mode: EditMode, edge: Edge, position: u64) -> Result<(), glib::error::BoolError> {
fn edit(
&self,
layers: &[Layer],
mode: EditMode,
edge: Edge,
position: u64,
) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_track_element_edit(self.as_ref().to_glib_none().0, layers.to_glib_none().0, mode.to_glib(), edge.to_glib(), position), "Failed to edit")
glib_result_from_gboolean!(
ges_sys::ges_track_element_edit(
self.as_ref().to_glib_none().0,
layers.to_glib_none().0,
mode.to_glib(),
edge.to_glib(),
position
),
"Failed to edit"
)
}
}
@ -102,37 +141,49 @@ impl<O: IsA<TrackElement>> TrackElementExt for O {
fn get_element(&self) -> Option<gst::Element> {
unsafe {
from_glib_none(ges_sys::ges_track_element_get_element(self.as_ref().to_glib_none().0))
from_glib_none(ges_sys::ges_track_element_get_element(
self.as_ref().to_glib_none().0,
))
}
}
fn get_gnlobject(&self) -> Option<gst::Element> {
unsafe {
from_glib_none(ges_sys::ges_track_element_get_gnlobject(self.as_ref().to_glib_none().0))
from_glib_none(ges_sys::ges_track_element_get_gnlobject(
self.as_ref().to_glib_none().0,
))
}
}
fn get_nleobject(&self) -> Option<gst::Element> {
unsafe {
from_glib_none(ges_sys::ges_track_element_get_nleobject(self.as_ref().to_glib_none().0))
from_glib_none(ges_sys::ges_track_element_get_nleobject(
self.as_ref().to_glib_none().0,
))
}
}
fn get_track(&self) -> Option<Track> {
unsafe {
from_glib_none(ges_sys::ges_track_element_get_track(self.as_ref().to_glib_none().0))
from_glib_none(ges_sys::ges_track_element_get_track(
self.as_ref().to_glib_none().0,
))
}
}
fn get_track_type(&self) -> TrackType {
unsafe {
from_glib(ges_sys::ges_track_element_get_track_type(self.as_ref().to_glib_none().0))
from_glib(ges_sys::ges_track_element_get_track_type(
self.as_ref().to_glib_none().0,
))
}
}
fn is_active(&self) -> bool {
unsafe {
from_glib(ges_sys::ges_track_element_is_active(self.as_ref().to_glib_none().0))
from_glib(ges_sys::ges_track_element_is_active(
self.as_ref().to_glib_none().0,
))
}
}
@ -142,13 +193,22 @@ impl<O: IsA<TrackElement>> TrackElementExt for O {
fn remove_control_binding(&self, property_name: &str) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(ges_sys::ges_track_element_remove_control_binding(self.as_ref().to_glib_none().0, property_name.to_glib_none().0), "Failed to remove control binding")
glib_result_from_gboolean!(
ges_sys::ges_track_element_remove_control_binding(
self.as_ref().to_glib_none().0,
property_name.to_glib_none().0
),
"Failed to remove control binding"
)
}
}
fn set_active(&self, active: bool) -> bool {
unsafe {
from_glib(ges_sys::ges_track_element_set_active(self.as_ref().to_glib_none().0, active.to_glib()))
from_glib(ges_sys::ges_track_element_set_active(
self.as_ref().to_glib_none().0,
active.to_glib(),
))
}
}
@ -158,14 +218,21 @@ impl<O: IsA<TrackElement>> TrackElementExt for O {
fn set_track_type(&self, type_: TrackType) {
unsafe {
ges_sys::ges_track_element_set_track_type(self.as_ref().to_glib_none().0, type_.to_glib());
ges_sys::ges_track_element_set_track_type(
self.as_ref().to_glib_none().0,
type_.to_glib(),
);
}
}
fn get_property_active(&self) -> bool {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"active\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"active\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
@ -179,44 +246,68 @@ impl<O: IsA<TrackElement>> TrackElementExt for O {
//}
fn connect_property_active_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_active_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESTrackElement, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<TrackElement>
unsafe extern "C" fn notify_active_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESTrackElement,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<TrackElement>,
{
let f: &F = &*(f as *const F);
f(&TrackElement::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::active\0".as_ptr() as *const _,
Some(transmute(notify_active_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::active\0".as_ptr() as *const _,
Some(transmute(notify_active_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_track_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_track_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESTrackElement, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<TrackElement>
unsafe extern "C" fn notify_track_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESTrackElement,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<TrackElement>,
{
let f: &F = &*(f as *const F);
f(&TrackElement::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::track\0".as_ptr() as *const _,
Some(transmute(notify_track_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::track\0".as_ptr() as *const _,
Some(transmute(notify_track_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_track_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_track_type_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESTrackElement, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<TrackElement>
unsafe extern "C" fn notify_track_type_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESTrackElement,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<TrackElement>,
{
let f: &F = &*(f as *const F);
f(&TrackElement::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::track-type\0".as_ptr() as *const _,
Some(transmute(notify_track_type_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::track-type\0".as_ptr() as *const _,
Some(transmute(notify_track_type_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
}

View file

@ -2,23 +2,23 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use Clip;
use Container;
use Extractable;
use TimelineElement;
use ges_sys;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::GString;
use glib::StaticType;
use glib::Value;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::translate::*;
use glib_sys;
use gobject_sys;
use std::boxed::Box as Box_;
use std::mem::transmute;
use Clip;
use Container;
use Extractable;
use TimelineElement;
glib_wrapper! {
pub struct UriClip(Object<ges_sys::GESUriClip, ges_sys::GESUriClipClass, UriClipClass>) @extends Clip, Container, TimelineElement, @implements Extractable;
@ -31,9 +31,7 @@ glib_wrapper! {
impl UriClip {
pub fn new(uri: &str) -> Option<UriClip> {
assert_initialized_main_thread!();
unsafe {
from_glib_none(ges_sys::ges_uri_clip_new(uri.to_glib_none().0))
}
unsafe { from_glib_none(ges_sys::ges_uri_clip_new(uri.to_glib_none().0)) }
}
}
@ -58,25 +56,34 @@ pub trait UriClipExt: 'static {
fn connect_property_mute_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_supported_formats_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_supported_formats_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId;
}
impl<O: IsA<UriClip>> UriClipExt for O {
fn get_uri(&self) -> Option<GString> {
unsafe {
from_glib_none(ges_sys::ges_uri_clip_get_uri(self.as_ref().to_glib_none().0))
from_glib_none(ges_sys::ges_uri_clip_get_uri(
self.as_ref().to_glib_none().0,
))
}
}
fn is_image(&self) -> bool {
unsafe {
from_glib(ges_sys::ges_uri_clip_is_image(self.as_ref().to_glib_none().0))
from_glib(ges_sys::ges_uri_clip_is_image(
self.as_ref().to_glib_none().0,
))
}
}
fn is_muted(&self) -> bool {
unsafe {
from_glib(ges_sys::ges_uri_clip_is_muted(self.as_ref().to_glib_none().0))
from_glib(ges_sys::ges_uri_clip_is_muted(
self.as_ref().to_glib_none().0,
))
}
}
@ -95,7 +102,11 @@ impl<O: IsA<UriClip>> UriClipExt for O {
fn get_property_is_image(&self) -> bool {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"is-image\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"is-image\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
@ -103,50 +114,83 @@ impl<O: IsA<UriClip>> UriClipExt for O {
fn get_property_mute(&self) -> bool {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"mute\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"mute\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
fn connect_property_is_image_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_is_image_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESUriClip, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<UriClip>
unsafe extern "C" fn notify_is_image_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESUriClip,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<UriClip>,
{
let f: &F = &*(f as *const F);
f(&UriClip::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::is-image\0".as_ptr() as *const _,
Some(transmute(notify_is_image_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::is-image\0".as_ptr() as *const _,
Some(transmute(notify_is_image_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_mute_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_mute_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESUriClip, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<UriClip>
unsafe extern "C" fn notify_mute_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESUriClip,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<UriClip>,
{
let f: &F = &*(f as *const F);
f(&UriClip::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::mute\0".as_ptr() as *const _,
Some(transmute(notify_mute_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::mute\0".as_ptr() as *const _,
Some(transmute(notify_mute_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_property_supported_formats_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_supported_formats_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESUriClip, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<UriClip>
fn connect_property_supported_formats_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_supported_formats_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESUriClip,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<UriClip>,
{
let f: &F = &*(f as *const F);
f(&UriClip::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::supported-formats\0".as_ptr() as *const _,
Some(transmute(notify_supported_formats_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::supported-formats\0".as_ptr() as *const _,
Some(transmute(
notify_supported_formats_trampoline::<Self, F> as usize,
)),
Box_::into_raw(f),
)
}
}
}

View file

@ -2,16 +2,13 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use Asset;
use Error;
use UriSourceAsset;
use ges_sys;
use glib::Value;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::Value;
use glib_sys;
use gobject_sys;
use gst;
@ -19,6 +16,9 @@ use gst_pbutils;
use std::boxed::Box as Box_;
use std::mem::transmute;
use std::ptr;
use Asset;
use Error;
use UriSourceAsset;
glib_wrapper! {
pub struct UriClipAsset(Object<ges_sys::GESUriClipAsset, ges_sys::GESUriClipAssetClass, UriClipAssetClass>) @extends Asset;
@ -42,7 +42,11 @@ impl UriClipAsset {
unsafe {
let mut error = ptr::null_mut();
let ret = ges_sys::ges_uri_clip_asset_request_sync(uri.to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
if error.is_null() {
Ok(from_glib_full(ret))
} else {
Err(from_glib_full(error))
}
}
}
}
@ -66,45 +70,65 @@ pub trait UriClipAssetExt: 'static {
impl<O: IsA<UriClipAsset>> UriClipAssetExt for O {
fn get_duration(&self) -> gst::ClockTime {
unsafe {
from_glib(ges_sys::ges_uri_clip_asset_get_duration(self.as_ref().to_glib_none().0))
from_glib(ges_sys::ges_uri_clip_asset_get_duration(
self.as_ref().to_glib_none().0,
))
}
}
fn get_info(&self) -> Option<gst_pbutils::DiscovererInfo> {
unsafe {
from_glib_none(ges_sys::ges_uri_clip_asset_get_info(const_override(self.as_ref().to_glib_none().0)))
from_glib_none(ges_sys::ges_uri_clip_asset_get_info(const_override(
self.as_ref().to_glib_none().0,
)))
}
}
fn get_stream_assets(&self) -> Vec<UriSourceAsset> {
unsafe {
FromGlibPtrContainer::from_glib_none(ges_sys::ges_uri_clip_asset_get_stream_assets(self.as_ref().to_glib_none().0))
FromGlibPtrContainer::from_glib_none(ges_sys::ges_uri_clip_asset_get_stream_assets(
self.as_ref().to_glib_none().0,
))
}
}
fn is_image(&self) -> bool {
unsafe {
from_glib(ges_sys::ges_uri_clip_asset_is_image(self.as_ref().to_glib_none().0))
from_glib(ges_sys::ges_uri_clip_asset_is_image(
self.as_ref().to_glib_none().0,
))
}
}
fn set_property_duration(&self, duration: u64) {
unsafe {
gobject_sys::g_object_set_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"duration\0".as_ptr() as *const _, Value::from(&duration).to_glib_none().0);
gobject_sys::g_object_set_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"duration\0".as_ptr() as *const _,
Value::from(&duration).to_glib_none().0,
);
}
}
fn connect_property_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_duration_trampoline<P, F: Fn(&P) + 'static>(this: *mut ges_sys::GESUriClipAsset, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<UriClipAsset>
unsafe extern "C" fn notify_duration_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ges_sys::GESUriClipAsset,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<UriClipAsset>,
{
let f: &F = &*(f as *const F);
f(&UriClipAsset::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::duration\0".as_ptr() as *const _,
Some(transmute(notify_duration_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::duration\0".as_ptr() as *const _,
Some(transmute(notify_duration_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
}

View file

@ -2,13 +2,13 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use Asset;
use UriClipAsset;
use ges_sys;
use glib::GString;
use glib::object::IsA;
use glib::translate::*;
use glib::GString;
use gst_pbutils;
use Asset;
use UriClipAsset;
glib_wrapper! {
pub struct UriSourceAsset(Object<ges_sys::GESUriSourceAsset, ges_sys::GESUriSourceAssetClass, UriSourceAssetClass>) @extends Asset;
@ -31,19 +31,25 @@ pub trait UriSourceAssetExt: 'static {
impl<O: IsA<UriSourceAsset>> UriSourceAssetExt for O {
fn get_filesource_asset(&self) -> Option<UriClipAsset> {
unsafe {
from_glib_none(ges_sys::ges_uri_source_asset_get_filesource_asset(self.as_ref().to_glib_none().0))
from_glib_none(ges_sys::ges_uri_source_asset_get_filesource_asset(
self.as_ref().to_glib_none().0,
))
}
}
fn get_stream_info(&self) -> Option<gst_pbutils::DiscovererStreamInfo> {
unsafe {
from_glib_none(ges_sys::ges_uri_source_asset_get_stream_info(self.as_ref().to_glib_none().0))
from_glib_none(ges_sys::ges_uri_source_asset_get_stream_info(
self.as_ref().to_glib_none().0,
))
}
}
fn get_stream_uri(&self) -> Option<GString> {
unsafe {
from_glib_none(ges_sys::ges_uri_source_asset_get_stream_uri(self.as_ref().to_glib_none().0))
from_glib_none(ges_sys::ges_uri_source_asset_get_stream_uri(
self.as_ref().to_glib_none().0,
))
}
}
}

View file

@ -69,7 +69,6 @@ macro_rules! skip_assert_initialized {
#[allow(clippy::unreadable_literal)]
#[allow(clippy::too_many_arguments)]
#[allow(clippy::match_same_arms)]
#[rustfmt::skip]
mod auto;
pub use auto::*;

View file

@ -2,20 +2,19 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib::Quark;
use glib::StaticType;
use glib::Type;
use glib::error::ErrorDomain;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::FromValueOptional;
use glib::value::SetValue;
use glib::value::Value;
use glib::Quark;
use glib::StaticType;
use glib::Type;
use gobject_sys;
use gst_gl_sys;
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum GLContextError {
Failed,
WrongConfig,
@ -38,8 +37,10 @@ impl ToGlib for GLContextError {
GLContextError::WrongApi => gst_gl_sys::GST_GL_CONTEXT_ERROR_WRONG_API,
GLContextError::OldLibs => gst_gl_sys::GST_GL_CONTEXT_ERROR_OLD_LIBS,
GLContextError::CreateContext => gst_gl_sys::GST_GL_CONTEXT_ERROR_CREATE_CONTEXT,
GLContextError::ResourceUnavailable => gst_gl_sys::GST_GL_CONTEXT_ERROR_RESOURCE_UNAVAILABLE,
GLContextError::__Unknown(value) => value
GLContextError::ResourceUnavailable => {
gst_gl_sys::GST_GL_CONTEXT_ERROR_RESOURCE_UNAVAILABLE
}
GLContextError::__Unknown(value) => value,
}
}
}
@ -108,8 +109,7 @@ impl SetValue for GLContextError {
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum GLFormat {
Luminance,
Alpha,
@ -153,7 +153,7 @@ impl ToGlib for GLFormat {
GLFormat::Rgba16 => gst_gl_sys::GST_GL_RGBA16,
GLFormat::DepthComponent16 => gst_gl_sys::GST_GL_DEPTH_COMPONENT16,
GLFormat::Depth24Stencil8 => gst_gl_sys::GST_GL_DEPTH24_STENCIL8,
GLFormat::__Unknown(value) => value
GLFormat::__Unknown(value) => value,
}
}
}
@ -208,8 +208,7 @@ impl SetValue for GLFormat {
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum GLQueryType {
None,
TimeElapsed,
@ -227,7 +226,7 @@ impl ToGlib for GLQueryType {
GLQueryType::None => gst_gl_sys::GST_GL_QUERY_NONE,
GLQueryType::TimeElapsed => gst_gl_sys::GST_GL_QUERY_TIME_ELAPSED,
GLQueryType::Timestamp => gst_gl_sys::GST_GL_QUERY_TIMESTAMP,
GLQueryType::__Unknown(value) => value
GLQueryType::__Unknown(value) => value,
}
}
}
@ -269,8 +268,7 @@ impl SetValue for GLQueryType {
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum GLSLError {
Compile,
Link,
@ -288,7 +286,7 @@ impl ToGlib for GLSLError {
GLSLError::Compile => gst_gl_sys::GST_GLSL_ERROR_COMPILE,
GLSLError::Link => gst_gl_sys::GST_GLSL_ERROR_LINK,
GLSLError::Program => gst_gl_sys::GST_GLSL_ERROR_PROGRAM,
GLSLError::__Unknown(value) => value
GLSLError::__Unknown(value) => value,
}
}
}
@ -351,8 +349,7 @@ impl SetValue for GLSLError {
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum GLSLVersion {
None,
_100,
@ -398,7 +395,7 @@ impl ToGlib for GLSLVersion {
GLSLVersion::_430 => gst_gl_sys::GST_GLSL_VERSION_430,
GLSLVersion::_440 => gst_gl_sys::GST_GLSL_VERSION_440,
GLSLVersion::_450 => gst_gl_sys::GST_GLSL_VERSION_450,
GLSLVersion::__Unknown(value) => value
GLSLVersion::__Unknown(value) => value,
}
}
}
@ -454,8 +451,7 @@ impl SetValue for GLSLVersion {
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum GLStereoDownmix {
GreenMagentaDubois,
RedCyanDubois,
@ -470,10 +466,16 @@ impl ToGlib for GLStereoDownmix {
fn to_glib(&self) -> gst_gl_sys::GstGLStereoDownmix {
match *self {
GLStereoDownmix::GreenMagentaDubois => gst_gl_sys::GST_GL_STEREO_DOWNMIX_ANAGLYPH_GREEN_MAGENTA_DUBOIS,
GLStereoDownmix::RedCyanDubois => gst_gl_sys::GST_GL_STEREO_DOWNMIX_ANAGLYPH_RED_CYAN_DUBOIS,
GLStereoDownmix::AmberBlueDubois => gst_gl_sys::GST_GL_STEREO_DOWNMIX_ANAGLYPH_AMBER_BLUE_DUBOIS,
GLStereoDownmix::__Unknown(value) => value
GLStereoDownmix::GreenMagentaDubois => {
gst_gl_sys::GST_GL_STEREO_DOWNMIX_ANAGLYPH_GREEN_MAGENTA_DUBOIS
}
GLStereoDownmix::RedCyanDubois => {
gst_gl_sys::GST_GL_STEREO_DOWNMIX_ANAGLYPH_RED_CYAN_DUBOIS
}
GLStereoDownmix::AmberBlueDubois => {
gst_gl_sys::GST_GL_STEREO_DOWNMIX_ANAGLYPH_AMBER_BLUE_DUBOIS
}
GLStereoDownmix::__Unknown(value) => value,
}
}
}
@ -515,8 +517,7 @@ impl SetValue for GLStereoDownmix {
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum GLTextureTarget {
None,
_2d,
@ -536,7 +537,7 @@ impl ToGlib for GLTextureTarget {
GLTextureTarget::_2d => gst_gl_sys::GST_GL_TEXTURE_TARGET_2D,
GLTextureTarget::Rectangle => gst_gl_sys::GST_GL_TEXTURE_TARGET_RECTANGLE,
GLTextureTarget::ExternalOes => gst_gl_sys::GST_GL_TEXTURE_TARGET_EXTERNAL_OES,
GLTextureTarget::__Unknown(value) => value
GLTextureTarget::__Unknown(value) => value,
}
}
}
@ -579,8 +580,7 @@ impl SetValue for GLTextureTarget {
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum GLUploadReturn {
Done,
Error,
@ -602,7 +602,7 @@ impl ToGlib for GLUploadReturn {
GLUploadReturn::Unsupported => gst_gl_sys::GST_GL_UPLOAD_UNSUPPORTED,
GLUploadReturn::Reconfigure => gst_gl_sys::GST_GL_UPLOAD_RECONFIGURE,
GLUploadReturn::UnsharedGlContext => gst_gl_sys::GST_GL_UPLOAD_UNSHARED_GL_CONTEXT,
GLUploadReturn::__Unknown(value) => value
GLUploadReturn::__Unknown(value) => value,
}
}
}
@ -646,8 +646,7 @@ impl SetValue for GLUploadReturn {
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum GLWindowError {
Failed,
OldLibs,
@ -664,8 +663,10 @@ impl ToGlib for GLWindowError {
match *self {
GLWindowError::Failed => gst_gl_sys::GST_GL_WINDOW_ERROR_FAILED,
GLWindowError::OldLibs => gst_gl_sys::GST_GL_WINDOW_ERROR_OLD_LIBS,
GLWindowError::ResourceUnavailable => gst_gl_sys::GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE,
GLWindowError::__Unknown(value) => value
GLWindowError::ResourceUnavailable => {
gst_gl_sys::GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE
}
GLWindowError::__Unknown(value) => value,
}
}
}
@ -727,4 +728,3 @@ impl SetValue for GLWindowError {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}

View file

@ -2,13 +2,13 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib::StaticType;
use glib::Type;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::FromValueOptional;
use glib::value::SetValue;
use glib::value::Value;
use glib::StaticType;
use glib::Type;
use gobject_sys;
use gst_gl_sys;
@ -223,4 +223,3 @@ impl SetValue for GLSLProfile {
gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
}
}

View file

@ -2,20 +2,20 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use GLContext;
use glib::StaticType;
use glib::Value;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::Value;
use glib_sys;
use gobject_sys;
use gst;
use gst_gl_sys;
use std::boxed::Box as Box_;
use std::mem::transmute;
use GLContext;
glib_wrapper! {
pub struct GLBaseFilter(Object<gst_gl_sys::GstGLBaseFilter, gst_gl_sys::GstGLBaseFilterClass, GLBaseFilterClass>) @extends gst::Object;
@ -36,36 +36,56 @@ pub trait GLBaseFilterExt: 'static {
fn get_property_context(&self) -> Option<GLContext>;
fn connect_property_context_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_context_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
}
impl<O: IsA<GLBaseFilter>> GLBaseFilterExt for O {
#[cfg(any(feature = "v1_16", feature = "dox"))]
fn find_gl_context(&self) -> bool {
unsafe {
from_glib(gst_gl_sys::gst_gl_base_filter_find_gl_context(self.as_ref().to_glib_none().0))
from_glib(gst_gl_sys::gst_gl_base_filter_find_gl_context(
self.as_ref().to_glib_none().0,
))
}
}
fn get_property_context(&self) -> Option<GLContext> {
unsafe {
let mut value = Value::from_type(<GLContext as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"context\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.to_glib_none().0 as *mut gobject_sys::GObject,
b"context\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get()
}
}
fn connect_property_context_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_context_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(this: *mut gst_gl_sys::GstGLBaseFilter, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer)
where P: IsA<GLBaseFilter>
fn connect_property_context_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_context_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
this: *mut gst_gl_sys::GstGLBaseFilter,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) where
P: IsA<GLBaseFilter>,
{
let f: &F = &*(f as *const F);
f(&GLBaseFilter::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::context\0".as_ptr() as *const _,
Some(transmute(notify_context_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::context\0".as_ptr() as *const _,
Some(transmute(notify_context_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
}

View file

@ -2,12 +2,12 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use GLContext;
use glib;
use glib::object::IsA;
use glib::translate::*;
use gst;
use gst_gl_sys;
use GLContext;
glib_wrapper! {
pub struct GLColorConvert(Object<gst_gl_sys::GstGLColorConvert, gst_gl_sys::GstGLColorConvertClass, GLColorConvertClass>) @extends gst::Object;
@ -21,20 +21,43 @@ impl GLColorConvert {
pub fn new<P: IsA<GLContext>>(context: &P) -> GLColorConvert {
skip_assert_initialized!();
unsafe {
from_glib_full(gst_gl_sys::gst_gl_color_convert_new(context.as_ref().to_glib_none().0))
from_glib_full(gst_gl_sys::gst_gl_color_convert_new(
context.as_ref().to_glib_none().0,
))
}
}
pub fn set_caps(&self, in_caps: &gst::Caps, out_caps: &gst::Caps) -> Result<(), glib::error::BoolError> {
pub fn set_caps(
&self,
in_caps: &gst::Caps,
out_caps: &gst::Caps,
) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(gst_gl_sys::gst_gl_color_convert_set_caps(self.to_glib_none().0, in_caps.to_glib_none().0, out_caps.to_glib_none().0), "Failed to set caps")
glib_result_from_gboolean!(
gst_gl_sys::gst_gl_color_convert_set_caps(
self.to_glib_none().0,
in_caps.to_glib_none().0,
out_caps.to_glib_none().0
),
"Failed to set caps"
)
}
}
pub fn transform_caps<P: IsA<GLContext>>(context: &P, direction: gst::PadDirection, caps: &gst::Caps, filter: &gst::Caps) -> Option<gst::Caps> {
pub fn transform_caps<P: IsA<GLContext>>(
context: &P,
direction: gst::PadDirection,
caps: &gst::Caps,
filter: &gst::Caps,
) -> Option<gst::Caps> {
skip_assert_initialized!();
unsafe {
from_glib_full(gst_gl_sys::gst_gl_color_convert_transform_caps(context.as_ref().to_glib_none().0, direction.to_glib(), caps.to_glib_none().0, filter.to_glib_none().0))
from_glib_full(gst_gl_sys::gst_gl_color_convert_transform_caps(
context.as_ref().to_glib_none().0,
direction.to_glib(),
caps.to_glib_none().0,
filter.to_glib_none().0,
))
}
}
}

View file

@ -2,13 +2,6 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use Error;
use GLAPI;
use GLDisplay;
use GLPlatform;
use GLSLProfile;
use GLSLVersion;
use GLWindow;
use glib;
use glib::object::IsA;
use glib::translate::*;
@ -16,6 +9,13 @@ use gst;
use gst_gl_sys;
use std::mem;
use std::ptr;
use Error;
use GLDisplay;
use GLPlatform;
use GLSLProfile;
use GLSLVersion;
use GLWindow;
use GLAPI;
glib_wrapper! {
pub struct GLContext(Object<gst_gl_sys::GstGLContext, gst_gl_sys::GstGLContextClass, GLContextClass>) @extends gst::Object;
@ -29,15 +29,15 @@ impl GLContext {
pub fn new<P: IsA<GLDisplay>>(display: &P) -> GLContext {
skip_assert_initialized!();
unsafe {
from_glib_none(gst_gl_sys::gst_gl_context_new(display.as_ref().to_glib_none().0))
from_glib_none(gst_gl_sys::gst_gl_context_new(
display.as_ref().to_glib_none().0,
))
}
}
pub fn get_current() -> Option<GLContext> {
assert_initialized_main_thread!();
unsafe {
from_glib_none(gst_gl_sys::gst_gl_context_get_current())
}
unsafe { from_glib_none(gst_gl_sys::gst_gl_context_get_current()) }
}
pub fn get_current_gl_api(platform: GLPlatform) -> (GLAPI, u32, u32) {
@ -45,7 +45,11 @@ impl GLContext {
unsafe {
let mut major = mem::uninitialized();
let mut minor = mem::uninitialized();
let ret = from_glib(gst_gl_sys::gst_gl_context_get_current_gl_api(platform.to_glib(), &mut major, &mut minor));
let ret = from_glib(gst_gl_sys::gst_gl_context_get_current_gl_api(
platform.to_glib(),
&mut major,
&mut minor,
));
(ret, major, minor)
}
}
@ -109,31 +113,51 @@ pub trait GLContextExt: 'static {
impl<O: IsA<GLContext>> GLContextExt for O {
fn activate(&self, activate: bool) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(gst_gl_sys::gst_gl_context_activate(self.as_ref().to_glib_none().0, activate.to_glib()), "Failed to activate OpenGL context")
glib_result_from_gboolean!(
gst_gl_sys::gst_gl_context_activate(
self.as_ref().to_glib_none().0,
activate.to_glib()
),
"Failed to activate OpenGL context"
)
}
}
fn can_share<P: IsA<GLContext>>(&self, other_context: &P) -> bool {
unsafe {
from_glib(gst_gl_sys::gst_gl_context_can_share(self.as_ref().to_glib_none().0, other_context.as_ref().to_glib_none().0))
from_glib(gst_gl_sys::gst_gl_context_can_share(
self.as_ref().to_glib_none().0,
other_context.as_ref().to_glib_none().0,
))
}
}
fn check_feature(&self, feature: &str) -> bool {
unsafe {
from_glib(gst_gl_sys::gst_gl_context_check_feature(self.as_ref().to_glib_none().0, feature.to_glib_none().0))
from_glib(gst_gl_sys::gst_gl_context_check_feature(
self.as_ref().to_glib_none().0,
feature.to_glib_none().0,
))
}
}
fn check_framebuffer_status(&self, fbo_target: u32) -> bool {
unsafe {
from_glib(gst_gl_sys::gst_gl_context_check_framebuffer_status(self.as_ref().to_glib_none().0, fbo_target))
from_glib(gst_gl_sys::gst_gl_context_check_framebuffer_status(
self.as_ref().to_glib_none().0,
fbo_target,
))
}
}
fn check_gl_version(&self, api: GLAPI, maj: i32, min: i32) -> bool {
unsafe {
from_glib(gst_gl_sys::gst_gl_context_check_gl_version(self.as_ref().to_glib_none().0, api.to_glib(), maj, min))
from_glib(gst_gl_sys::gst_gl_context_check_gl_version(
self.as_ref().to_glib_none().0,
api.to_glib(),
maj,
min,
))
}
}
@ -152,8 +176,16 @@ impl<O: IsA<GLContext>> GLContextExt for O {
fn create<P: IsA<GLContext>>(&self, other_context: Option<&P>) -> Result<(), Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = gst_gl_sys::gst_gl_context_create(self.as_ref().to_glib_none().0, other_context.map(|p| p.as_ref()).to_glib_none().0, &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
let _ = gst_gl_sys::gst_gl_context_create(
self.as_ref().to_glib_none().0,
other_context.map(|p| p.as_ref()).to_glib_none().0,
&mut error,
);
if error.is_null() {
Ok(())
} else {
Err(from_glib_full(error))
}
}
}
@ -166,26 +198,37 @@ impl<O: IsA<GLContext>> GLContextExt for O {
fn fill_info(&self) -> Result<(), Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = gst_gl_sys::gst_gl_context_fill_info(self.as_ref().to_glib_none().0, &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
let _ =
gst_gl_sys::gst_gl_context_fill_info(self.as_ref().to_glib_none().0, &mut error);
if error.is_null() {
Ok(())
} else {
Err(from_glib_full(error))
}
}
}
fn get_display(&self) -> GLDisplay {
unsafe {
from_glib_full(gst_gl_sys::gst_gl_context_get_display(self.as_ref().to_glib_none().0))
from_glib_full(gst_gl_sys::gst_gl_context_get_display(
self.as_ref().to_glib_none().0,
))
}
}
fn get_gl_api(&self) -> GLAPI {
unsafe {
from_glib(gst_gl_sys::gst_gl_context_get_gl_api(self.as_ref().to_glib_none().0))
from_glib(gst_gl_sys::gst_gl_context_get_gl_api(
self.as_ref().to_glib_none().0,
))
}
}
fn get_gl_platform(&self) -> GLPlatform {
unsafe {
from_glib(gst_gl_sys::gst_gl_context_get_gl_platform(self.as_ref().to_glib_none().0))
from_glib(gst_gl_sys::gst_gl_context_get_gl_platform(
self.as_ref().to_glib_none().0,
))
}
}
@ -193,7 +236,11 @@ impl<O: IsA<GLContext>> GLContextExt for O {
unsafe {
let mut major = mem::uninitialized();
let mut minor = mem::uninitialized();
gst_gl_sys::gst_gl_context_get_gl_platform_version(self.as_ref().to_glib_none().0, &mut major, &mut minor);
gst_gl_sys::gst_gl_context_get_gl_platform_version(
self.as_ref().to_glib_none().0,
&mut major,
&mut minor,
);
(major, minor)
}
}
@ -202,52 +249,81 @@ impl<O: IsA<GLContext>> GLContextExt for O {
unsafe {
let mut maj = mem::uninitialized();
let mut min = mem::uninitialized();
gst_gl_sys::gst_gl_context_get_gl_version(self.as_ref().to_glib_none().0, &mut maj, &mut min);
gst_gl_sys::gst_gl_context_get_gl_version(
self.as_ref().to_glib_none().0,
&mut maj,
&mut min,
);
(maj, min)
}
}
fn get_window(&self) -> Option<GLWindow> {
unsafe {
from_glib_full(gst_gl_sys::gst_gl_context_get_window(self.as_ref().to_glib_none().0))
from_glib_full(gst_gl_sys::gst_gl_context_get_window(
self.as_ref().to_glib_none().0,
))
}
}
fn is_shared(&self) -> bool {
unsafe {
from_glib(gst_gl_sys::gst_gl_context_is_shared(self.as_ref().to_glib_none().0))
from_glib(gst_gl_sys::gst_gl_context_is_shared(
self.as_ref().to_glib_none().0,
))
}
}
fn set_shared_with<P: IsA<GLContext>>(&self, share: &P) {
unsafe {
gst_gl_sys::gst_gl_context_set_shared_with(self.as_ref().to_glib_none().0, share.as_ref().to_glib_none().0);
gst_gl_sys::gst_gl_context_set_shared_with(
self.as_ref().to_glib_none().0,
share.as_ref().to_glib_none().0,
);
}
}
fn set_window<P: IsA<GLWindow>>(&self, window: &P) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(gst_gl_sys::gst_gl_context_set_window(self.as_ref().to_glib_none().0, window.as_ref().to_glib_full()), "Failed to set window")
glib_result_from_gboolean!(
gst_gl_sys::gst_gl_context_set_window(
self.as_ref().to_glib_none().0,
window.as_ref().to_glib_full()
),
"Failed to set window"
)
}
}
fn supports_glsl_profile_version(&self, version: GLSLVersion, profile: GLSLProfile) -> bool {
unsafe {
from_glib(gst_gl_sys::gst_gl_context_supports_glsl_profile_version(self.as_ref().to_glib_none().0, version.to_glib(), profile.to_glib()))
from_glib(gst_gl_sys::gst_gl_context_supports_glsl_profile_version(
self.as_ref().to_glib_none().0,
version.to_glib(),
profile.to_glib(),
))
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
fn supports_precision(&self, version: GLSLVersion, profile: GLSLProfile) -> bool {
unsafe {
from_glib(gst_gl_sys::gst_gl_context_supports_precision(self.as_ref().to_glib_none().0, version.to_glib(), profile.to_glib()))
from_glib(gst_gl_sys::gst_gl_context_supports_precision(
self.as_ref().to_glib_none().0,
version.to_glib(),
profile.to_glib(),
))
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
fn supports_precision_highp(&self, version: GLSLVersion, profile: GLSLProfile) -> bool {
unsafe {
from_glib(gst_gl_sys::gst_gl_context_supports_precision_highp(self.as_ref().to_glib_none().0, version.to_glib(), profile.to_glib()))
from_glib(gst_gl_sys::gst_gl_context_supports_precision_highp(
self.as_ref().to_glib_none().0,
version.to_glib(),
profile.to_glib(),
))
}
}

View file

@ -2,16 +2,11 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use Error;
use GLAPI;
use GLContext;
use GLDisplayType;
use GLWindow;
use glib;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib_sys;
use gst;
@ -19,6 +14,11 @@ use gst_gl_sys;
use std::boxed::Box as Box_;
use std::mem::transmute;
use std::ptr;
use Error;
use GLContext;
use GLDisplayType;
use GLWindow;
use GLAPI;
glib_wrapper! {
pub struct GLDisplay(Object<gst_gl_sys::GstGLDisplay, gst_gl_sys::GstGLDisplayClass, GLDisplayClass>) @extends gst::Object;
@ -31,9 +31,7 @@ glib_wrapper! {
impl GLDisplay {
pub fn new() -> GLDisplay {
assert_initialized_main_thread!();
unsafe {
from_glib_full(gst_gl_sys::gst_gl_display_new())
}
unsafe { from_glib_full(gst_gl_sys::gst_gl_display_new()) }
}
}
@ -65,13 +63,22 @@ pub trait GLDisplayExt: 'static {
fn remove_window<P: IsA<GLWindow>>(&self, window: &P) -> Result<(), glib::error::BoolError>;
fn connect_create_context<F: Fn(&Self, &GLContext) -> GLContext + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_create_context<F: Fn(&Self, &GLContext) -> GLContext + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
}
impl<O: IsA<GLDisplay>> GLDisplayExt for O {
fn add_context<P: IsA<GLContext>>(&self, context: &P) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(gst_gl_sys::gst_gl_display_add_context(self.as_ref().to_glib_none().0, context.as_ref().to_glib_none().0), "Failed to add OpenGL context")
glib_result_from_gboolean!(
gst_gl_sys::gst_gl_display_add_context(
self.as_ref().to_glib_none().0,
context.as_ref().to_glib_none().0
),
"Failed to add OpenGL context"
)
}
}
@ -79,58 +86,103 @@ impl<O: IsA<GLDisplay>> GLDisplayExt for O {
unsafe {
let mut p_context = ptr::null_mut();
let mut error = ptr::null_mut();
let _ = gst_gl_sys::gst_gl_display_create_context(self.as_ref().to_glib_none().0, other_context.as_ref().to_glib_none().0, &mut p_context, &mut error);
if error.is_null() { Ok(from_glib_full(p_context)) } else { Err(from_glib_full(error)) }
let _ = gst_gl_sys::gst_gl_display_create_context(
self.as_ref().to_glib_none().0,
other_context.as_ref().to_glib_none().0,
&mut p_context,
&mut error,
);
if error.is_null() {
Ok(from_glib_full(p_context))
} else {
Err(from_glib_full(error))
}
}
}
fn create_window(&self) -> Option<GLWindow> {
unsafe {
from_glib_full(gst_gl_sys::gst_gl_display_create_window(self.as_ref().to_glib_none().0))
from_glib_full(gst_gl_sys::gst_gl_display_create_window(
self.as_ref().to_glib_none().0,
))
}
}
fn filter_gl_api(&self, gl_api: GLAPI) {
unsafe {
gst_gl_sys::gst_gl_display_filter_gl_api(self.as_ref().to_glib_none().0, gl_api.to_glib());
gst_gl_sys::gst_gl_display_filter_gl_api(
self.as_ref().to_glib_none().0,
gl_api.to_glib(),
);
}
}
fn get_gl_api(&self) -> GLAPI {
unsafe {
from_glib(gst_gl_sys::gst_gl_display_get_gl_api(self.as_ref().to_glib_none().0))
from_glib(gst_gl_sys::gst_gl_display_get_gl_api(
self.as_ref().to_glib_none().0,
))
}
}
fn get_gl_api_unlocked(&self) -> GLAPI {
unsafe {
from_glib(gst_gl_sys::gst_gl_display_get_gl_api_unlocked(self.as_ref().to_glib_none().0))
from_glib(gst_gl_sys::gst_gl_display_get_gl_api_unlocked(
self.as_ref().to_glib_none().0,
))
}
}
fn get_handle_type(&self) -> GLDisplayType {
unsafe {
from_glib(gst_gl_sys::gst_gl_display_get_handle_type(self.as_ref().to_glib_none().0))
from_glib(gst_gl_sys::gst_gl_display_get_handle_type(
self.as_ref().to_glib_none().0,
))
}
}
fn remove_window<P: IsA<GLWindow>>(&self, window: &P) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(gst_gl_sys::gst_gl_display_remove_window(self.as_ref().to_glib_none().0, window.as_ref().to_glib_none().0), "Failed to remove window")
glib_result_from_gboolean!(
gst_gl_sys::gst_gl_display_remove_window(
self.as_ref().to_glib_none().0,
window.as_ref().to_glib_none().0
),
"Failed to remove window"
)
}
}
fn connect_create_context<F: Fn(&Self, &GLContext) -> GLContext + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn create_context_trampoline<P, F: Fn(&P, &GLContext) -> GLContext + Send + Sync + 'static>(this: *mut gst_gl_sys::GstGLDisplay, context: *mut gst_gl_sys::GstGLContext, f: glib_sys::gpointer) -> *mut gst_gl_sys::GstGLContext
where P: IsA<GLDisplay>
fn connect_create_context<F: Fn(&Self, &GLContext) -> GLContext + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn create_context_trampoline<
P,
F: Fn(&P, &GLContext) -> GLContext + Send + Sync + 'static,
>(
this: *mut gst_gl_sys::GstGLDisplay,
context: *mut gst_gl_sys::GstGLContext,
f: glib_sys::gpointer,
) -> *mut gst_gl_sys::GstGLContext
where
P: IsA<GLDisplay>,
{
let f: &F = &*(f as *const F);
f(&GLDisplay::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(context)).to_glib_full()
f(
&GLDisplay::from_glib_borrow(this).unsafe_cast(),
&from_glib_borrow(context),
)
.to_glib_full()
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"create-context\0".as_ptr() as *const _,
Some(transmute(create_context_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"create-context\0".as_ptr() as *const _,
Some(transmute(create_context_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
}

View file

@ -2,10 +2,10 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use GLDisplay;
use glib::translate::*;
use gst;
use gst_gl_sys;
use GLDisplay;
glib_wrapper! {
pub struct GLDisplayEGL(Object<gst_gl_sys::GstGLDisplayEGL, gst_gl_sys::GstGLDisplayEGLClass, GLDisplayEGLClass>) @extends GLDisplay, gst::Object;
@ -18,9 +18,7 @@ glib_wrapper! {
impl GLDisplayEGL {
pub fn new() -> GLDisplayEGL {
assert_initialized_main_thread!();
unsafe {
from_glib_full(gst_gl_sys::gst_gl_display_egl_new())
}
unsafe { from_glib_full(gst_gl_sys::gst_gl_display_egl_new()) }
}
//pub fn new_with_egl_display(display: /*Unimplemented*/Option<Fundamental: Pointer>) -> GLDisplayEGL {

View file

@ -2,10 +2,10 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use GLDisplay;
use glib::translate::*;
use gst;
use gst_gl_sys;
use GLDisplay;
glib_wrapper! {
pub struct GLDisplayWayland(Object<gst_gl_sys::GstGLDisplayWayland, gst_gl_sys::GstGLDisplayWaylandClass, GLDisplayWaylandClass>) @extends GLDisplay, gst::Object;
@ -19,7 +19,9 @@ impl GLDisplayWayland {
pub fn new(name: Option<&str>) -> GLDisplayWayland {
assert_initialized_main_thread!();
unsafe {
from_glib_full(gst_gl_sys::gst_gl_display_wayland_new(name.to_glib_none().0))
from_glib_full(gst_gl_sys::gst_gl_display_wayland_new(
name.to_glib_none().0,
))
}
}

View file

@ -2,10 +2,10 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use GLDisplay;
use glib::translate::*;
use gst;
use gst_gl_sys;
use GLDisplay;
glib_wrapper! {
pub struct GLDisplayX11(Object<gst_gl_sys::GstGLDisplayX11, gst_gl_sys::GstGLDisplayX11Class, GLDisplayX11Class>) @extends GLDisplay, gst::Object;
@ -18,9 +18,7 @@ glib_wrapper! {
impl GLDisplayX11 {
pub fn new(name: Option<&str>) -> GLDisplayX11 {
assert_initialized_main_thread!();
unsafe {
from_glib_full(gst_gl_sys::gst_gl_display_x11_new(name.to_glib_none().0))
}
unsafe { from_glib_full(gst_gl_sys::gst_gl_display_x11_new(name.to_glib_none().0)) }
}
//pub fn new_with_display(display: /*Unimplemented*/Fundamental: Pointer) -> GLDisplayX11 {

View file

@ -2,12 +2,12 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use GLContext;
use glib::object::IsA;
use glib::translate::*;
use gst;
use gst_gl_sys;
use std::mem;
use GLContext;
glib_wrapper! {
pub struct GLFramebuffer(Object<gst_gl_sys::GstGLFramebuffer, gst_gl_sys::GstGLFramebufferClass, GLFramebufferClass>) @extends gst::Object;
@ -21,14 +21,24 @@ impl GLFramebuffer {
pub fn new<P: IsA<GLContext>>(context: &P) -> GLFramebuffer {
skip_assert_initialized!();
unsafe {
from_glib_full(gst_gl_sys::gst_gl_framebuffer_new(context.as_ref().to_glib_none().0))
from_glib_full(gst_gl_sys::gst_gl_framebuffer_new(
context.as_ref().to_glib_none().0,
))
}
}
pub fn new_with_default_depth<P: IsA<GLContext>>(context: &P, width: u32, height: u32) -> GLFramebuffer {
pub fn new_with_default_depth<P: IsA<GLContext>>(
context: &P,
width: u32,
height: u32,
) -> GLFramebuffer {
skip_assert_initialized!();
unsafe {
from_glib_none(gst_gl_sys::gst_gl_framebuffer_new_with_default_depth(context.as_ref().to_glib_none().0, width, height))
from_glib_none(gst_gl_sys::gst_gl_framebuffer_new_with_default_depth(
context.as_ref().to_glib_none().0,
width,
height,
))
}
}
}
@ -69,14 +79,16 @@ impl<O: IsA<GLFramebuffer>> GLFramebufferExt for O {
unsafe {
let mut width = mem::uninitialized();
let mut height = mem::uninitialized();
gst_gl_sys::gst_gl_framebuffer_get_effective_dimensions(self.as_ref().to_glib_none().0, &mut width, &mut height);
gst_gl_sys::gst_gl_framebuffer_get_effective_dimensions(
self.as_ref().to_glib_none().0,
&mut width,
&mut height,
);
(width, height)
}
}
fn get_id(&self) -> u32 {
unsafe {
gst_gl_sys::gst_gl_framebuffer_get_id(self.as_ref().to_glib_none().0)
}
unsafe { gst_gl_sys::gst_gl_framebuffer_get_id(self.as_ref().to_glib_none().0) }
}
}

View file

@ -2,20 +2,19 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use GLContext;
#[cfg(any(feature = "v1_16", feature = "dox"))]
use glib::StaticType;
#[cfg(any(feature = "v1_16", feature = "dox"))]
use glib::Value;
use glib::object::IsA;
#[cfg(any(feature = "v1_16", feature = "dox"))]
use glib::object::ObjectType as ObjectType_;
#[cfg(any(feature = "v1_16", feature = "dox"))]
use glib::signal::SignalHandlerId;
#[cfg(any(feature = "v1_16", feature = "dox"))]
use glib::signal::connect_raw;
#[cfg(any(feature = "v1_16", feature = "dox"))]
use glib::signal::SignalHandlerId;
use glib::translate::*;
#[cfg(any(feature = "v1_16", feature = "dox"))]
use glib::StaticType;
#[cfg(any(feature = "v1_16", feature = "dox"))]
use glib::Value;
#[cfg(any(feature = "v1_16", feature = "dox"))]
use glib_sys;
#[cfg(any(feature = "v1_16", feature = "dox"))]
use gobject_sys;
@ -25,6 +24,7 @@ use gst_gl_sys;
use std::boxed::Box as Box_;
#[cfg(any(feature = "v1_16", feature = "dox"))]
use std::mem::transmute;
use GLContext;
glib_wrapper! {
pub struct GLOverlayCompositor(Object<gst_gl_sys::GstGLOverlayCompositor, gst_gl_sys::GstGLOverlayCompositorClass, GLOverlayCompositorClass>) @extends gst::Object;
@ -38,7 +38,9 @@ impl GLOverlayCompositor {
pub fn new<P: IsA<GLContext>>(context: &P) -> GLOverlayCompositor {
skip_assert_initialized!();
unsafe {
from_glib_none(gst_gl_sys::gst_gl_overlay_compositor_new(context.as_ref().to_glib_none().0))
from_glib_none(gst_gl_sys::gst_gl_overlay_compositor_new(
context.as_ref().to_glib_none().0,
))
}
}
@ -58,7 +60,11 @@ impl GLOverlayCompositor {
pub fn get_property_yinvert(&self) -> bool {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"yinvert\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"yinvert\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
@ -66,27 +72,46 @@ impl GLOverlayCompositor {
#[cfg(any(feature = "v1_16", feature = "dox"))]
pub fn set_property_yinvert(&self, yinvert: bool) {
unsafe {
gobject_sys::g_object_set_property(self.as_ptr() as *mut gobject_sys::GObject, b"yinvert\0".as_ptr() as *const _, Value::from(&yinvert).to_glib_none().0);
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"yinvert\0".as_ptr() as *const _,
Value::from(&yinvert).to_glib_none().0,
);
}
}
pub fn add_caps(caps: &gst::Caps) -> Option<gst::Caps> {
assert_initialized_main_thread!();
unsafe {
from_glib_full(gst_gl_sys::gst_gl_overlay_compositor_add_caps(caps.to_glib_none().0))
from_glib_full(gst_gl_sys::gst_gl_overlay_compositor_add_caps(
caps.to_glib_none().0,
))
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
pub fn connect_property_yinvert_notify<F: Fn(&GLOverlayCompositor) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_yinvert_trampoline<F: Fn(&GLOverlayCompositor) + Send + Sync + 'static>(this: *mut gst_gl_sys::GstGLOverlayCompositor, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_yinvert_notify<F: Fn(&GLOverlayCompositor) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_yinvert_trampoline<
F: Fn(&GLOverlayCompositor) + Send + Sync + 'static,
>(
this: *mut gst_gl_sys::GstGLOverlayCompositor,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::yinvert\0".as_ptr() as *const _,
Some(transmute(notify_yinvert_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::yinvert\0".as_ptr() as *const _,
Some(transmute(notify_yinvert_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
}

View file

@ -2,23 +2,16 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use Error;
use GLContext;
#[cfg(any(feature = "v1_16", feature = "dox"))]
use GLSLProfile;
use GLSLStage;
#[cfg(any(feature = "v1_16", feature = "dox"))]
use GLSLVersion;
use glib;
use glib::object::IsA;
use glib::object::ObjectType as ObjectType_;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
#[cfg(any(feature = "v1_16", feature = "dox"))]
use glib::GString;
use glib::StaticType;
use glib::Value;
use glib::object::IsA;
use glib::object::ObjectType as ObjectType_;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::translate::*;
use glib_sys;
use gobject_sys;
use gst;
@ -26,6 +19,13 @@ use gst_gl_sys;
use std::boxed::Box as Box_;
use std::mem::transmute;
use std::ptr;
use Error;
use GLContext;
#[cfg(any(feature = "v1_16", feature = "dox"))]
use GLSLProfile;
use GLSLStage;
#[cfg(any(feature = "v1_16", feature = "dox"))]
use GLSLVersion;
glib_wrapper! {
pub struct GLShader(Object<gst_gl_sys::GstGLShader, gst_gl_sys::GstGLShaderClass, GLShaderClass>) @extends gst::Object;
@ -39,7 +39,9 @@ impl GLShader {
pub fn new<P: IsA<GLContext>>(context: &P) -> GLShader {
skip_assert_initialized!();
unsafe {
from_glib_full(gst_gl_sys::gst_gl_shader_new(context.as_ref().to_glib_none().0))
from_glib_full(gst_gl_sys::gst_gl_shader_new(
context.as_ref().to_glib_none().0,
))
}
}
@ -47,8 +49,15 @@ impl GLShader {
skip_assert_initialized!();
unsafe {
let mut error = ptr::null_mut();
let ret = gst_gl_sys::gst_gl_shader_new_default(context.as_ref().to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
let ret = gst_gl_sys::gst_gl_shader_new_default(
context.as_ref().to_glib_none().0,
&mut error,
);
if error.is_null() {
Ok(from_glib_full(ret))
} else {
Err(from_glib_full(error))
}
}
}
@ -62,33 +71,58 @@ impl GLShader {
pub fn attach(&self, stage: &GLSLStage) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(gst_gl_sys::gst_gl_shader_attach(self.to_glib_none().0, stage.to_glib_none().0), "Failed to attach stage to shader")
glib_result_from_gboolean!(
gst_gl_sys::gst_gl_shader_attach(self.to_glib_none().0, stage.to_glib_none().0),
"Failed to attach stage to shader"
)
}
}
pub fn attach_unlocked(&self, stage: &GLSLStage) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(gst_gl_sys::gst_gl_shader_attach_unlocked(self.to_glib_none().0, stage.to_glib_none().0), "Failed to attach stage to shader")
glib_result_from_gboolean!(
gst_gl_sys::gst_gl_shader_attach_unlocked(
self.to_glib_none().0,
stage.to_glib_none().0
),
"Failed to attach stage to shader"
)
}
}
pub fn bind_attribute_location(&self, index: u32, name: &str) {
unsafe {
gst_gl_sys::gst_gl_shader_bind_attribute_location(self.to_glib_none().0, index, name.to_glib_none().0);
gst_gl_sys::gst_gl_shader_bind_attribute_location(
self.to_glib_none().0,
index,
name.to_glib_none().0,
);
}
}
pub fn bind_frag_data_location(&self, index: u32, name: &str) {
unsafe {
gst_gl_sys::gst_gl_shader_bind_frag_data_location(self.to_glib_none().0, index, name.to_glib_none().0);
gst_gl_sys::gst_gl_shader_bind_frag_data_location(
self.to_glib_none().0,
index,
name.to_glib_none().0,
);
}
}
pub fn compile_attach_stage(&self, stage: &GLSLStage) -> Result<(), Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = gst_gl_sys::gst_gl_shader_compile_attach_stage(self.to_glib_none().0, stage.to_glib_none().0, &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
let _ = gst_gl_sys::gst_gl_shader_compile_attach_stage(
self.to_glib_none().0,
stage.to_glib_none().0,
&mut error,
);
if error.is_null() {
Ok(())
} else {
Err(from_glib_full(error))
}
}
}
@ -100,33 +134,39 @@ impl GLShader {
pub fn detach_unlocked(&self, stage: &GLSLStage) {
unsafe {
gst_gl_sys::gst_gl_shader_detach_unlocked(self.to_glib_none().0, stage.to_glib_none().0);
gst_gl_sys::gst_gl_shader_detach_unlocked(
self.to_glib_none().0,
stage.to_glib_none().0,
);
}
}
pub fn get_attribute_location(&self, name: &str) -> i32 {
unsafe {
gst_gl_sys::gst_gl_shader_get_attribute_location(self.to_glib_none().0, name.to_glib_none().0)
gst_gl_sys::gst_gl_shader_get_attribute_location(
self.to_glib_none().0,
name.to_glib_none().0,
)
}
}
pub fn get_program_handle(&self) -> i32 {
unsafe {
gst_gl_sys::gst_gl_shader_get_program_handle(self.to_glib_none().0)
}
unsafe { gst_gl_sys::gst_gl_shader_get_program_handle(self.to_glib_none().0) }
}
pub fn is_linked(&self) -> bool {
unsafe {
from_glib(gst_gl_sys::gst_gl_shader_is_linked(self.to_glib_none().0))
}
unsafe { from_glib(gst_gl_sys::gst_gl_shader_is_linked(self.to_glib_none().0)) }
}
pub fn link(&self) -> Result<(), Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = gst_gl_sys::gst_gl_shader_link(self.to_glib_none().0, &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
if error.is_null() {
Ok(())
} else {
Err(from_glib_full(error))
}
}
}
@ -144,105 +184,189 @@ impl GLShader {
pub fn set_uniform_1f(&self, name: &str, value: f32) {
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_1f(self.to_glib_none().0, name.to_glib_none().0, value);
gst_gl_sys::gst_gl_shader_set_uniform_1f(
self.to_glib_none().0,
name.to_glib_none().0,
value,
);
}
}
pub fn set_uniform_1fv(&self, name: &str, value: &[f32]) {
let count = value.len() as u32;
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_1fv(self.to_glib_none().0, name.to_glib_none().0, count, value.to_glib_none().0);
gst_gl_sys::gst_gl_shader_set_uniform_1fv(
self.to_glib_none().0,
name.to_glib_none().0,
count,
value.to_glib_none().0,
);
}
}
pub fn set_uniform_1i(&self, name: &str, value: i32) {
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_1i(self.to_glib_none().0, name.to_glib_none().0, value);
gst_gl_sys::gst_gl_shader_set_uniform_1i(
self.to_glib_none().0,
name.to_glib_none().0,
value,
);
}
}
pub fn set_uniform_1iv(&self, name: &str, value: &[i32]) {
let count = value.len() as u32;
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_1iv(self.to_glib_none().0, name.to_glib_none().0, count, value.to_glib_none().0);
gst_gl_sys::gst_gl_shader_set_uniform_1iv(
self.to_glib_none().0,
name.to_glib_none().0,
count,
value.to_glib_none().0,
);
}
}
pub fn set_uniform_2f(&self, name: &str, v0: f32, v1: f32) {
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_2f(self.to_glib_none().0, name.to_glib_none().0, v0, v1);
gst_gl_sys::gst_gl_shader_set_uniform_2f(
self.to_glib_none().0,
name.to_glib_none().0,
v0,
v1,
);
}
}
pub fn set_uniform_2fv(&self, name: &str, value: &[f32]) {
let count = value.len() as u32;
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_2fv(self.to_glib_none().0, name.to_glib_none().0, count, value.to_glib_none().0);
gst_gl_sys::gst_gl_shader_set_uniform_2fv(
self.to_glib_none().0,
name.to_glib_none().0,
count,
value.to_glib_none().0,
);
}
}
pub fn set_uniform_2i(&self, name: &str, v0: i32, v1: i32) {
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_2i(self.to_glib_none().0, name.to_glib_none().0, v0, v1);
gst_gl_sys::gst_gl_shader_set_uniform_2i(
self.to_glib_none().0,
name.to_glib_none().0,
v0,
v1,
);
}
}
pub fn set_uniform_2iv(&self, name: &str, value: &[i32]) {
let count = value.len() as u32;
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_2iv(self.to_glib_none().0, name.to_glib_none().0, count, value.to_glib_none().0);
gst_gl_sys::gst_gl_shader_set_uniform_2iv(
self.to_glib_none().0,
name.to_glib_none().0,
count,
value.to_glib_none().0,
);
}
}
pub fn set_uniform_3f(&self, name: &str, v0: f32, v1: f32, v2: f32) {
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_3f(self.to_glib_none().0, name.to_glib_none().0, v0, v1, v2);
gst_gl_sys::gst_gl_shader_set_uniform_3f(
self.to_glib_none().0,
name.to_glib_none().0,
v0,
v1,
v2,
);
}
}
pub fn set_uniform_3fv(&self, name: &str, value: &[f32]) {
let count = value.len() as u32;
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_3fv(self.to_glib_none().0, name.to_glib_none().0, count, value.to_glib_none().0);
gst_gl_sys::gst_gl_shader_set_uniform_3fv(
self.to_glib_none().0,
name.to_glib_none().0,
count,
value.to_glib_none().0,
);
}
}
pub fn set_uniform_3i(&self, name: &str, v0: i32, v1: i32, v2: i32) {
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_3i(self.to_glib_none().0, name.to_glib_none().0, v0, v1, v2);
gst_gl_sys::gst_gl_shader_set_uniform_3i(
self.to_glib_none().0,
name.to_glib_none().0,
v0,
v1,
v2,
);
}
}
pub fn set_uniform_3iv(&self, name: &str, value: &[i32]) {
let count = value.len() as u32;
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_3iv(self.to_glib_none().0, name.to_glib_none().0, count, value.to_glib_none().0);
gst_gl_sys::gst_gl_shader_set_uniform_3iv(
self.to_glib_none().0,
name.to_glib_none().0,
count,
value.to_glib_none().0,
);
}
}
pub fn set_uniform_4f(&self, name: &str, v0: f32, v1: f32, v2: f32, v3: f32) {
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_4f(self.to_glib_none().0, name.to_glib_none().0, v0, v1, v2, v3);
gst_gl_sys::gst_gl_shader_set_uniform_4f(
self.to_glib_none().0,
name.to_glib_none().0,
v0,
v1,
v2,
v3,
);
}
}
pub fn set_uniform_4fv(&self, name: &str, value: &[f32]) {
let count = value.len() as u32;
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_4fv(self.to_glib_none().0, name.to_glib_none().0, count, value.to_glib_none().0);
gst_gl_sys::gst_gl_shader_set_uniform_4fv(
self.to_glib_none().0,
name.to_glib_none().0,
count,
value.to_glib_none().0,
);
}
}
pub fn set_uniform_4i(&self, name: &str, v0: i32, v1: i32, v2: i32, v3: i32) {
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_4i(self.to_glib_none().0, name.to_glib_none().0, v0, v1, v2, v3);
gst_gl_sys::gst_gl_shader_set_uniform_4i(
self.to_glib_none().0,
name.to_glib_none().0,
v0,
v1,
v2,
v3,
);
}
}
pub fn set_uniform_4iv(&self, name: &str, value: &[i32]) {
let count = value.len() as u32;
unsafe {
gst_gl_sys::gst_gl_shader_set_uniform_4iv(self.to_glib_none().0, name.to_glib_none().0, count, value.to_glib_none().0);
gst_gl_sys::gst_gl_shader_set_uniform_4iv(
self.to_glib_none().0,
name.to_glib_none().0,
count,
value.to_glib_none().0,
);
}
}
@ -255,44 +379,85 @@ impl GLShader {
pub fn get_property_linked(&self) -> bool {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"linked\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"linked\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
pub fn string_fragment_external_oes_get_default<P: IsA<GLContext>>(context: &P, version: GLSLVersion, profile: GLSLProfile) -> Option<GString> {
pub fn string_fragment_external_oes_get_default<P: IsA<GLContext>>(
context: &P,
version: GLSLVersion,
profile: GLSLProfile,
) -> Option<GString> {
skip_assert_initialized!();
unsafe {
from_glib_full(gst_gl_sys::gst_gl_shader_string_fragment_external_oes_get_default(context.as_ref().to_glib_none().0, version.to_glib(), profile.to_glib()))
from_glib_full(
gst_gl_sys::gst_gl_shader_string_fragment_external_oes_get_default(
context.as_ref().to_glib_none().0,
version.to_glib(),
profile.to_glib(),
),
)
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
pub fn string_fragment_get_default<P: IsA<GLContext>>(context: &P, version: GLSLVersion, profile: GLSLProfile) -> Option<GString> {
pub fn string_fragment_get_default<P: IsA<GLContext>>(
context: &P,
version: GLSLVersion,
profile: GLSLProfile,
) -> Option<GString> {
skip_assert_initialized!();
unsafe {
from_glib_full(gst_gl_sys::gst_gl_shader_string_fragment_get_default(context.as_ref().to_glib_none().0, version.to_glib(), profile.to_glib()))
from_glib_full(gst_gl_sys::gst_gl_shader_string_fragment_get_default(
context.as_ref().to_glib_none().0,
version.to_glib(),
profile.to_glib(),
))
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
pub fn string_get_highest_precision<P: IsA<GLContext>>(context: &P, version: GLSLVersion, profile: GLSLProfile) -> Option<GString> {
pub fn string_get_highest_precision<P: IsA<GLContext>>(
context: &P,
version: GLSLVersion,
profile: GLSLProfile,
) -> Option<GString> {
skip_assert_initialized!();
unsafe {
from_glib_none(gst_gl_sys::gst_gl_shader_string_get_highest_precision(context.as_ref().to_glib_none().0, version.to_glib(), profile.to_glib()))
from_glib_none(gst_gl_sys::gst_gl_shader_string_get_highest_precision(
context.as_ref().to_glib_none().0,
version.to_glib(),
profile.to_glib(),
))
}
}
pub fn connect_property_linked_notify<F: Fn(&GLShader) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_linked_trampoline<F: Fn(&GLShader) + Send + Sync + 'static>(this: *mut gst_gl_sys::GstGLShader, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_linked_notify<F: Fn(&GLShader) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_linked_trampoline<F: Fn(&GLShader) + Send + Sync + 'static>(
this: *mut gst_gl_sys::GstGLShader,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::linked\0".as_ptr() as *const _,
Some(transmute(notify_linked_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::linked\0".as_ptr() as *const _,
Some(transmute(notify_linked_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
}

View file

@ -2,13 +2,13 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use GLContext;
use glib;
use glib::object::IsA;
use glib::translate::*;
use gst;
use gst_gl_sys;
use std::ptr;
use GLContext;
glib_wrapper! {
pub struct GLUpload(Object<gst_gl_sys::GstGLUpload, gst_gl_sys::GstGLUploadClass, GLUploadClass>) @extends gst::Object;
@ -22,7 +22,9 @@ impl GLUpload {
pub fn new<P: IsA<GLContext>>(context: &P) -> GLUpload {
skip_assert_initialized!();
unsafe {
from_glib_full(gst_gl_sys::gst_gl_upload_new(context.as_ref().to_glib_none().0))
from_glib_full(gst_gl_sys::gst_gl_upload_new(
context.as_ref().to_glib_none().0,
))
}
}
@ -35,29 +37,53 @@ impl GLUpload {
}
}
pub fn set_caps(&self, in_caps: &gst::Caps, out_caps: &gst::Caps) -> Result<(), glib::error::BoolError> {
pub fn set_caps(
&self,
in_caps: &gst::Caps,
out_caps: &gst::Caps,
) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(gst_gl_sys::gst_gl_upload_set_caps(self.to_glib_none().0, in_caps.to_glib_none().0, out_caps.to_glib_none().0), "Failed to set caps")
glib_result_from_gboolean!(
gst_gl_sys::gst_gl_upload_set_caps(
self.to_glib_none().0,
in_caps.to_glib_none().0,
out_caps.to_glib_none().0
),
"Failed to set caps"
)
}
}
pub fn set_context<P: IsA<GLContext>>(&self, context: &P) {
unsafe {
gst_gl_sys::gst_gl_upload_set_context(self.to_glib_none().0, context.as_ref().to_glib_none().0);
gst_gl_sys::gst_gl_upload_set_context(
self.to_glib_none().0,
context.as_ref().to_glib_none().0,
);
}
}
pub fn transform_caps<P: IsA<GLContext>>(&self, context: &P, direction: gst::PadDirection, caps: &gst::Caps, filter: &gst::Caps) -> Option<gst::Caps> {
pub fn transform_caps<P: IsA<GLContext>>(
&self,
context: &P,
direction: gst::PadDirection,
caps: &gst::Caps,
filter: &gst::Caps,
) -> Option<gst::Caps> {
unsafe {
from_glib_full(gst_gl_sys::gst_gl_upload_transform_caps(self.to_glib_none().0, context.as_ref().to_glib_none().0, direction.to_glib(), caps.to_glib_none().0, filter.to_glib_none().0))
from_glib_full(gst_gl_sys::gst_gl_upload_transform_caps(
self.to_glib_none().0,
context.as_ref().to_glib_none().0,
direction.to_glib(),
caps.to_glib_none().0,
filter.to_glib_none().0,
))
}
}
pub fn get_input_template_caps() -> gst::Caps {
assert_initialized_main_thread!();
unsafe {
from_glib_full(gst_gl_sys::gst_gl_upload_get_input_template_caps())
}
unsafe { from_glib_full(gst_gl_sys::gst_gl_upload_get_input_template_caps()) }
}
}

View file

@ -2,16 +2,14 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use GLContext;
use GLStereoDownmix;
use glib;
use glib::StaticType;
use glib::Value;
use glib::object::IsA;
use glib::object::ObjectType as ObjectType_;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::Value;
use glib_sys;
use gobject_sys;
use gst;
@ -19,6 +17,8 @@ use gst_gl_sys;
use gst_video;
use std::boxed::Box as Box_;
use std::mem::transmute;
use GLContext;
use GLStereoDownmix;
glib_wrapper! {
pub struct GLViewConvert(Object<gst_gl_sys::GstGLViewConvert, gst_gl_sys::GstGLViewConvertClass, GLViewConvertClass>) @extends gst::Object;
@ -31,14 +31,15 @@ glib_wrapper! {
impl GLViewConvert {
pub fn new() -> GLViewConvert {
assert_initialized_main_thread!();
unsafe {
from_glib_full(gst_gl_sys::gst_gl_view_convert_new())
}
unsafe { from_glib_full(gst_gl_sys::gst_gl_view_convert_new()) }
}
pub fn perform(&self, inbuf: &gst::Buffer) -> Option<gst::Buffer> {
unsafe {
from_glib_full(gst_gl_sys::gst_gl_view_convert_perform(self.to_glib_none().0, inbuf.to_glib_none().0))
from_glib_full(gst_gl_sys::gst_gl_view_convert_perform(
self.to_glib_none().0,
inbuf.to_glib_none().0,
))
}
}
@ -48,151 +49,312 @@ impl GLViewConvert {
}
}
pub fn set_caps(&self, in_caps: &gst::Caps, out_caps: &gst::Caps) -> Result<(), glib::error::BoolError> {
pub fn set_caps(
&self,
in_caps: &gst::Caps,
out_caps: &gst::Caps,
) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(gst_gl_sys::gst_gl_view_convert_set_caps(self.to_glib_none().0, in_caps.to_glib_none().0, out_caps.to_glib_none().0), "Failed to set caps")
glib_result_from_gboolean!(
gst_gl_sys::gst_gl_view_convert_set_caps(
self.to_glib_none().0,
in_caps.to_glib_none().0,
out_caps.to_glib_none().0
),
"Failed to set caps"
)
}
}
pub fn set_context<P: IsA<GLContext>>(&self, context: &P) {
unsafe {
gst_gl_sys::gst_gl_view_convert_set_context(self.to_glib_none().0, context.as_ref().to_glib_none().0);
gst_gl_sys::gst_gl_view_convert_set_context(
self.to_glib_none().0,
context.as_ref().to_glib_none().0,
);
}
}
pub fn transform_caps(&self, direction: gst::PadDirection, caps: &gst::Caps, filter: &gst::Caps) -> Option<gst::Caps> {
pub fn transform_caps(
&self,
direction: gst::PadDirection,
caps: &gst::Caps,
filter: &gst::Caps,
) -> Option<gst::Caps> {
unsafe {
from_glib_full(gst_gl_sys::gst_gl_view_convert_transform_caps(self.to_glib_none().0, direction.to_glib(), caps.to_glib_none().0, filter.to_glib_none().0))
from_glib_full(gst_gl_sys::gst_gl_view_convert_transform_caps(
self.to_glib_none().0,
direction.to_glib(),
caps.to_glib_none().0,
filter.to_glib_none().0,
))
}
}
pub fn get_property_downmix_mode(&self) -> GLStereoDownmix {
unsafe {
let mut value = Value::from_type(<GLStereoDownmix as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"downmix-mode\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"downmix-mode\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
pub fn set_property_downmix_mode(&self, downmix_mode: GLStereoDownmix) {
unsafe {
gobject_sys::g_object_set_property(self.as_ptr() as *mut gobject_sys::GObject, b"downmix-mode\0".as_ptr() as *const _, Value::from(&downmix_mode).to_glib_none().0);
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"downmix-mode\0".as_ptr() as *const _,
Value::from(&downmix_mode).to_glib_none().0,
);
}
}
pub fn get_property_input_flags_override(&self) -> gst_video::VideoMultiviewFlags {
unsafe {
let mut value = Value::from_type(<gst_video::VideoMultiviewFlags as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"input-flags-override\0".as_ptr() as *const _, value.to_glib_none_mut().0);
let mut value =
Value::from_type(<gst_video::VideoMultiviewFlags as StaticType>::static_type());
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"input-flags-override\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
pub fn set_property_input_flags_override(&self, input_flags_override: gst_video::VideoMultiviewFlags) {
pub fn set_property_input_flags_override(
&self,
input_flags_override: gst_video::VideoMultiviewFlags,
) {
unsafe {
gobject_sys::g_object_set_property(self.as_ptr() as *mut gobject_sys::GObject, b"input-flags-override\0".as_ptr() as *const _, Value::from(&input_flags_override).to_glib_none().0);
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"input-flags-override\0".as_ptr() as *const _,
Value::from(&input_flags_override).to_glib_none().0,
);
}
}
pub fn get_property_input_mode_override(&self) -> gst_video::VideoMultiviewMode {
unsafe {
let mut value = Value::from_type(<gst_video::VideoMultiviewMode as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"input-mode-override\0".as_ptr() as *const _, value.to_glib_none_mut().0);
let mut value =
Value::from_type(<gst_video::VideoMultiviewMode as StaticType>::static_type());
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"input-mode-override\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
pub fn set_property_input_mode_override(&self, input_mode_override: gst_video::VideoMultiviewMode) {
pub fn set_property_input_mode_override(
&self,
input_mode_override: gst_video::VideoMultiviewMode,
) {
unsafe {
gobject_sys::g_object_set_property(self.as_ptr() as *mut gobject_sys::GObject, b"input-mode-override\0".as_ptr() as *const _, Value::from(&input_mode_override).to_glib_none().0);
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"input-mode-override\0".as_ptr() as *const _,
Value::from(&input_mode_override).to_glib_none().0,
);
}
}
pub fn get_property_output_flags_override(&self) -> gst_video::VideoMultiviewFlags {
unsafe {
let mut value = Value::from_type(<gst_video::VideoMultiviewFlags as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"output-flags-override\0".as_ptr() as *const _, value.to_glib_none_mut().0);
let mut value =
Value::from_type(<gst_video::VideoMultiviewFlags as StaticType>::static_type());
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"output-flags-override\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
pub fn set_property_output_flags_override(&self, output_flags_override: gst_video::VideoMultiviewFlags) {
pub fn set_property_output_flags_override(
&self,
output_flags_override: gst_video::VideoMultiviewFlags,
) {
unsafe {
gobject_sys::g_object_set_property(self.as_ptr() as *mut gobject_sys::GObject, b"output-flags-override\0".as_ptr() as *const _, Value::from(&output_flags_override).to_glib_none().0);
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"output-flags-override\0".as_ptr() as *const _,
Value::from(&output_flags_override).to_glib_none().0,
);
}
}
pub fn get_property_output_mode_override(&self) -> gst_video::VideoMultiviewMode {
unsafe {
let mut value = Value::from_type(<gst_video::VideoMultiviewMode as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"output-mode-override\0".as_ptr() as *const _, value.to_glib_none_mut().0);
let mut value =
Value::from_type(<gst_video::VideoMultiviewMode as StaticType>::static_type());
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"output-mode-override\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
pub fn set_property_output_mode_override(&self, output_mode_override: gst_video::VideoMultiviewMode) {
pub fn set_property_output_mode_override(
&self,
output_mode_override: gst_video::VideoMultiviewMode,
) {
unsafe {
gobject_sys::g_object_set_property(self.as_ptr() as *mut gobject_sys::GObject, b"output-mode-override\0".as_ptr() as *const _, Value::from(&output_mode_override).to_glib_none().0);
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"output-mode-override\0".as_ptr() as *const _,
Value::from(&output_mode_override).to_glib_none().0,
);
}
}
pub fn connect_property_downmix_mode_notify<F: Fn(&GLViewConvert) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_downmix_mode_trampoline<F: Fn(&GLViewConvert) + Send + Sync + 'static>(this: *mut gst_gl_sys::GstGLViewConvert, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_downmix_mode_notify<F: Fn(&GLViewConvert) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_downmix_mode_trampoline<
F: Fn(&GLViewConvert) + Send + Sync + 'static,
>(
this: *mut gst_gl_sys::GstGLViewConvert,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::downmix-mode\0".as_ptr() as *const _,
Some(transmute(notify_downmix_mode_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::downmix-mode\0".as_ptr() as *const _,
Some(transmute(notify_downmix_mode_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_input_flags_override_notify<F: Fn(&GLViewConvert) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_input_flags_override_trampoline<F: Fn(&GLViewConvert) + Send + Sync + 'static>(this: *mut gst_gl_sys::GstGLViewConvert, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_input_flags_override_notify<
F: Fn(&GLViewConvert) + Send + Sync + 'static,
>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_input_flags_override_trampoline<
F: Fn(&GLViewConvert) + Send + Sync + 'static,
>(
this: *mut gst_gl_sys::GstGLViewConvert,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::input-flags-override\0".as_ptr() as *const _,
Some(transmute(notify_input_flags_override_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::input-flags-override\0".as_ptr() as *const _,
Some(transmute(
notify_input_flags_override_trampoline::<F> as usize,
)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_input_mode_override_notify<F: Fn(&GLViewConvert) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_input_mode_override_trampoline<F: Fn(&GLViewConvert) + Send + Sync + 'static>(this: *mut gst_gl_sys::GstGLViewConvert, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_input_mode_override_notify<
F: Fn(&GLViewConvert) + Send + Sync + 'static,
>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_input_mode_override_trampoline<
F: Fn(&GLViewConvert) + Send + Sync + 'static,
>(
this: *mut gst_gl_sys::GstGLViewConvert,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::input-mode-override\0".as_ptr() as *const _,
Some(transmute(notify_input_mode_override_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::input-mode-override\0".as_ptr() as *const _,
Some(transmute(
notify_input_mode_override_trampoline::<F> as usize,
)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_output_flags_override_notify<F: Fn(&GLViewConvert) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_output_flags_override_trampoline<F: Fn(&GLViewConvert) + Send + Sync + 'static>(this: *mut gst_gl_sys::GstGLViewConvert, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_output_flags_override_notify<
F: Fn(&GLViewConvert) + Send + Sync + 'static,
>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_output_flags_override_trampoline<
F: Fn(&GLViewConvert) + Send + Sync + 'static,
>(
this: *mut gst_gl_sys::GstGLViewConvert,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::output-flags-override\0".as_ptr() as *const _,
Some(transmute(notify_output_flags_override_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::output-flags-override\0".as_ptr() as *const _,
Some(transmute(
notify_output_flags_override_trampoline::<F> as usize,
)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_output_mode_override_notify<F: Fn(&GLViewConvert) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_output_mode_override_trampoline<F: Fn(&GLViewConvert) + Send + Sync + 'static>(this: *mut gst_gl_sys::GstGLViewConvert, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_output_mode_override_notify<
F: Fn(&GLViewConvert) + Send + Sync + 'static,
>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_output_mode_override_trampoline<
F: Fn(&GLViewConvert) + Send + Sync + 'static,
>(
this: *mut gst_gl_sys::GstGLViewConvert,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::output-mode-override\0".as_ptr() as *const _,
Some(transmute(notify_output_mode_override_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::output-mode-override\0".as_ptr() as *const _,
Some(transmute(
notify_output_mode_override_trampoline::<F> as usize,
)),
Box_::into_raw(f),
)
}
}
}

View file

@ -2,15 +2,13 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use GLContext;
use GLDisplay;
use glib;
use glib::GString;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::GString;
use glib_sys;
use gst;
use gst_gl_sys;
@ -18,6 +16,8 @@ use libc;
use std::boxed::Box as Box_;
use std::mem;
use std::mem::transmute;
use GLContext;
use GLDisplay;
glib_wrapper! {
pub struct GLWindow(Object<gst_gl_sys::GstGLWindow, gst_gl_sys::GstGLWindowClass, GLWindowClass>) @extends gst::Object;
@ -31,7 +31,9 @@ impl GLWindow {
pub fn new<P: IsA<GLDisplay>>(display: &P) -> GLWindow {
skip_assert_initialized!();
unsafe {
from_glib_full(gst_gl_sys::gst_gl_window_new(display.as_ref().to_glib_none().0))
from_glib_full(gst_gl_sys::gst_gl_window_new(
display.as_ref().to_glib_none().0,
))
}
}
}
@ -67,20 +69,34 @@ pub trait GLWindowExt: 'static {
fn set_preferred_size(&self, width: i32, height: i32);
fn set_render_rectangle(&self, x: i32, y: i32, width: i32, height: i32) -> Result<(), glib::error::BoolError>;
fn set_render_rectangle(
&self,
x: i32,
y: i32,
width: i32,
height: i32,
) -> Result<(), glib::error::BoolError>;
fn show(&self);
fn connect_key_event<F: Fn(&Self, &str, &str) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_key_event<F: Fn(&Self, &str, &str) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
fn connect_mouse_event<F: Fn(&Self, &str, i32, f64, f64) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_mouse_event<F: Fn(&Self, &str, i32, f64, f64) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId;
}
impl<O: IsA<GLWindow>> GLWindowExt for O {
#[cfg(any(feature = "v1_16", feature = "dox"))]
fn controls_viewport(&self) -> bool {
unsafe {
from_glib(gst_gl_sys::gst_gl_window_controls_viewport(self.as_ref().to_glib_none().0))
from_glib(gst_gl_sys::gst_gl_window_controls_viewport(
self.as_ref().to_glib_none().0,
))
}
}
@ -92,7 +108,9 @@ impl<O: IsA<GLWindow>> GLWindowExt for O {
fn get_context(&self) -> Option<GLContext> {
unsafe {
from_glib_full(gst_gl_sys::gst_gl_window_get_context(self.as_ref().to_glib_none().0))
from_glib_full(gst_gl_sys::gst_gl_window_get_context(
self.as_ref().to_glib_none().0,
))
}
}
@ -100,14 +118,21 @@ impl<O: IsA<GLWindow>> GLWindowExt for O {
unsafe {
let mut width = mem::uninitialized();
let mut height = mem::uninitialized();
gst_gl_sys::gst_gl_window_get_surface_dimensions(self.as_ref().to_glib_none().0, &mut width, &mut height);
gst_gl_sys::gst_gl_window_get_surface_dimensions(
self.as_ref().to_glib_none().0,
&mut width,
&mut height,
);
(width, height)
}
}
fn handle_events(&self, handle_events: bool) {
unsafe {
gst_gl_sys::gst_gl_window_handle_events(self.as_ref().to_glib_none().0, handle_events.to_glib());
gst_gl_sys::gst_gl_window_handle_events(
self.as_ref().to_glib_none().0,
handle_events.to_glib(),
);
}
}
@ -137,25 +162,54 @@ impl<O: IsA<GLWindow>> GLWindowExt for O {
fn send_key_event(&self, event_type: &str, key_str: &str) {
unsafe {
gst_gl_sys::gst_gl_window_send_key_event(self.as_ref().to_glib_none().0, event_type.to_glib_none().0, key_str.to_glib_none().0);
gst_gl_sys::gst_gl_window_send_key_event(
self.as_ref().to_glib_none().0,
event_type.to_glib_none().0,
key_str.to_glib_none().0,
);
}
}
fn send_mouse_event(&self, event_type: &str, button: i32, posx: f64, posy: f64) {
unsafe {
gst_gl_sys::gst_gl_window_send_mouse_event(self.as_ref().to_glib_none().0, event_type.to_glib_none().0, button, posx, posy);
gst_gl_sys::gst_gl_window_send_mouse_event(
self.as_ref().to_glib_none().0,
event_type.to_glib_none().0,
button,
posx,
posy,
);
}
}
fn set_preferred_size(&self, width: i32, height: i32) {
unsafe {
gst_gl_sys::gst_gl_window_set_preferred_size(self.as_ref().to_glib_none().0, width, height);
gst_gl_sys::gst_gl_window_set_preferred_size(
self.as_ref().to_glib_none().0,
width,
height,
);
}
}
fn set_render_rectangle(&self, x: i32, y: i32, width: i32, height: i32) -> Result<(), glib::error::BoolError> {
fn set_render_rectangle(
&self,
x: i32,
y: i32,
width: i32,
height: i32,
) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(gst_gl_sys::gst_gl_window_set_render_rectangle(self.as_ref().to_glib_none().0, x, y, width, height), "Failed to set the specified region")
glib_result_from_gboolean!(
gst_gl_sys::gst_gl_window_set_render_rectangle(
self.as_ref().to_glib_none().0,
x,
y,
width,
height
),
"Failed to set the specified region"
)
}
}
@ -165,31 +219,73 @@ impl<O: IsA<GLWindow>> GLWindowExt for O {
}
}
fn connect_key_event<F: Fn(&Self, &str, &str) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn key_event_trampoline<P, F: Fn(&P, &str, &str) + Send + Sync + 'static>(this: *mut gst_gl_sys::GstGLWindow, id: *mut libc::c_char, key: *mut libc::c_char, f: glib_sys::gpointer)
where P: IsA<GLWindow>
fn connect_key_event<F: Fn(&Self, &str, &str) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn key_event_trampoline<
P,
F: Fn(&P, &str, &str) + Send + Sync + 'static,
>(
this: *mut gst_gl_sys::GstGLWindow,
id: *mut libc::c_char,
key: *mut libc::c_char,
f: glib_sys::gpointer,
) where
P: IsA<GLWindow>,
{
let f: &F = &*(f as *const F);
f(&GLWindow::from_glib_borrow(this).unsafe_cast(), &GString::from_glib_borrow(id), &GString::from_glib_borrow(key))
f(
&GLWindow::from_glib_borrow(this).unsafe_cast(),
&GString::from_glib_borrow(id),
&GString::from_glib_borrow(key),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"key-event\0".as_ptr() as *const _,
Some(transmute(key_event_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"key-event\0".as_ptr() as *const _,
Some(transmute(key_event_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
fn connect_mouse_event<F: Fn(&Self, &str, i32, f64, f64) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn mouse_event_trampoline<P, F: Fn(&P, &str, i32, f64, f64) + Send + Sync + 'static>(this: *mut gst_gl_sys::GstGLWindow, id: *mut libc::c_char, button: libc::c_int, x: libc::c_double, y: libc::c_double, f: glib_sys::gpointer)
where P: IsA<GLWindow>
fn connect_mouse_event<F: Fn(&Self, &str, i32, f64, f64) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn mouse_event_trampoline<
P,
F: Fn(&P, &str, i32, f64, f64) + Send + Sync + 'static,
>(
this: *mut gst_gl_sys::GstGLWindow,
id: *mut libc::c_char,
button: libc::c_int,
x: libc::c_double,
y: libc::c_double,
f: glib_sys::gpointer,
) where
P: IsA<GLWindow>,
{
let f: &F = &*(f as *const F);
f(&GLWindow::from_glib_borrow(this).unsafe_cast(), &GString::from_glib_borrow(id), button, x, y)
f(
&GLWindow::from_glib_borrow(this).unsafe_cast(),
&GString::from_glib_borrow(id),
button,
x,
y,
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"mouse-event\0".as_ptr() as *const _,
Some(transmute(mouse_event_trampoline::<Self, F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"mouse-event\0".as_ptr() as *const _,
Some(transmute(mouse_event_trampoline::<Self, F> as usize)),
Box_::into_raw(f),
)
}
}
}

View file

@ -2,17 +2,17 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib;
use glib::object::IsA;
use glib::translate::*;
use glib::GString;
use gst;
use gst_gl_sys;
use std::ptr;
use Error;
use GLContext;
use GLSLProfile;
use GLSLVersion;
use glib;
use glib::GString;
use glib::object::IsA;
use glib::translate::*;
use gst;
use gst_gl_sys;
use std::ptr;
glib_wrapper! {
pub struct GLSLStage(Object<gst_gl_sys::GstGLSLStage, gst_gl_sys::GstGLSLStageClass, GLSLStageClass>) @extends gst::Object;
@ -26,36 +26,68 @@ impl GLSLStage {
pub fn new<P: IsA<GLContext>>(context: &P, type_: u32) -> GLSLStage {
skip_assert_initialized!();
unsafe {
from_glib_none(gst_gl_sys::gst_glsl_stage_new(context.as_ref().to_glib_none().0, type_))
from_glib_none(gst_gl_sys::gst_glsl_stage_new(
context.as_ref().to_glib_none().0,
type_,
))
}
}
pub fn new_default_fragment<P: IsA<GLContext>>(context: &P) -> GLSLStage {
skip_assert_initialized!();
unsafe {
from_glib_none(gst_gl_sys::gst_glsl_stage_new_default_fragment(context.as_ref().to_glib_none().0))
from_glib_none(gst_gl_sys::gst_glsl_stage_new_default_fragment(
context.as_ref().to_glib_none().0,
))
}
}
pub fn new_default_vertex<P: IsA<GLContext>>(context: &P) -> GLSLStage {
skip_assert_initialized!();
unsafe {
from_glib_none(gst_gl_sys::gst_glsl_stage_new_default_vertex(context.as_ref().to_glib_none().0))
from_glib_none(gst_gl_sys::gst_glsl_stage_new_default_vertex(
context.as_ref().to_glib_none().0,
))
}
}
pub fn new_with_string<P: IsA<GLContext>>(context: &P, type_: u32, version: GLSLVersion, profile: GLSLProfile, str: &str) -> GLSLStage {
pub fn new_with_string<P: IsA<GLContext>>(
context: &P,
type_: u32,
version: GLSLVersion,
profile: GLSLProfile,
str: &str,
) -> GLSLStage {
skip_assert_initialized!();
unsafe {
from_glib_none(gst_gl_sys::gst_glsl_stage_new_with_string(context.as_ref().to_glib_none().0, type_, version.to_glib(), profile.to_glib(), str.to_glib_none().0))
from_glib_none(gst_gl_sys::gst_glsl_stage_new_with_string(
context.as_ref().to_glib_none().0,
type_,
version.to_glib(),
profile.to_glib(),
str.to_glib_none().0,
))
}
}
pub fn new_with_strings<P: IsA<GLContext>>(context: &P, type_: u32, version: GLSLVersion, profile: GLSLProfile, str: &[&str]) -> GLSLStage {
pub fn new_with_strings<P: IsA<GLContext>>(
context: &P,
type_: u32,
version: GLSLVersion,
profile: GLSLProfile,
str: &[&str],
) -> GLSLStage {
skip_assert_initialized!();
let n_strings = str.len() as i32;
unsafe {
from_glib_none(gst_gl_sys::gst_glsl_stage_new_with_strings(context.as_ref().to_glib_none().0, type_, version.to_glib(), profile.to_glib(), n_strings, str.to_glib_none().0))
from_glib_none(gst_gl_sys::gst_glsl_stage_new_with_strings(
context.as_ref().to_glib_none().0,
type_,
version.to_glib(),
profile.to_glib(),
n_strings,
str.to_glib_none().0,
))
}
}
@ -63,38 +95,56 @@ impl GLSLStage {
unsafe {
let mut error = ptr::null_mut();
let _ = gst_gl_sys::gst_glsl_stage_compile(self.to_glib_none().0, &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
if error.is_null() {
Ok(())
} else {
Err(from_glib_full(error))
}
}
}
pub fn get_handle(&self) -> u32 {
unsafe {
gst_gl_sys::gst_glsl_stage_get_handle(self.to_glib_none().0)
}
unsafe { gst_gl_sys::gst_glsl_stage_get_handle(self.to_glib_none().0) }
}
pub fn get_profile(&self) -> GLSLProfile {
unsafe {
from_glib(gst_gl_sys::gst_glsl_stage_get_profile(self.to_glib_none().0))
from_glib(gst_gl_sys::gst_glsl_stage_get_profile(
self.to_glib_none().0,
))
}
}
pub fn get_shader_type(&self) -> u32 {
unsafe {
gst_gl_sys::gst_glsl_stage_get_shader_type(self.to_glib_none().0)
}
unsafe { gst_gl_sys::gst_glsl_stage_get_shader_type(self.to_glib_none().0) }
}
pub fn get_version(&self) -> GLSLVersion {
unsafe {
from_glib(gst_gl_sys::gst_glsl_stage_get_version(self.to_glib_none().0))
from_glib(gst_gl_sys::gst_glsl_stage_get_version(
self.to_glib_none().0,
))
}
}
pub fn set_strings(&self, version: GLSLVersion, profile: GLSLProfile, str: &[&str]) -> Result<(), glib::error::BoolError> {
pub fn set_strings(
&self,
version: GLSLVersion,
profile: GLSLProfile,
str: &[&str],
) -> Result<(), glib::error::BoolError> {
let n_strings = str.len() as i32;
unsafe {
glib_result_from_gboolean!(gst_gl_sys::gst_glsl_stage_set_strings(self.to_glib_none().0, version.to_glib(), profile.to_glib(), n_strings, str.to_glib_none().0), "Failed to attach stage to set strings")
glib_result_from_gboolean!(
gst_gl_sys::gst_glsl_stage_set_strings(
self.to_glib_none().0,
version.to_glib(),
profile.to_glib(),
n_strings,
str.to_glib_none().0
),
"Failed to attach stage to set strings"
)
}
}
}

View file

@ -5,20 +5,20 @@
#[cfg(any(feature = "v1_16", feature = "dox"))]
mod gl_base_filter;
#[cfg(any(feature = "v1_16", feature = "dox"))]
pub use self::gl_base_filter::{GLBaseFilter, GLBaseFilterClass, NONE_GL_BASE_FILTER};
#[cfg(any(feature = "v1_16", feature = "dox"))]
pub use self::gl_base_filter::GLBaseFilterExt;
#[cfg(any(feature = "v1_16", feature = "dox"))]
pub use self::gl_base_filter::{GLBaseFilter, GLBaseFilterClass, NONE_GL_BASE_FILTER};
mod gl_color_convert;
pub use self::gl_color_convert::{GLColorConvert, GLColorConvertClass};
mod gl_context;
pub use self::gl_context::{GLContext, GLContextClass, NONE_GL_CONTEXT};
pub use self::gl_context::GLContextExt;
pub use self::gl_context::{GLContext, GLContextClass, NONE_GL_CONTEXT};
mod gl_display;
pub use self::gl_display::{GLDisplay, GLDisplayClass, NONE_GL_DISPLAY};
pub use self::gl_display::GLDisplayExt;
pub use self::gl_display::{GLDisplay, GLDisplayClass, NONE_GL_DISPLAY};
#[cfg(any(feature = "egl", feature = "dox"))]
mod gl_display_egl;
@ -36,8 +36,8 @@ mod gl_display_x11;
pub use self::gl_display_x11::{GLDisplayX11, GLDisplayX11Class};
mod gl_framebuffer;
pub use self::gl_framebuffer::{GLFramebuffer, GLFramebufferClass, NONE_GL_FRAMEBUFFER};
pub use self::gl_framebuffer::GLFramebufferExt;
pub use self::gl_framebuffer::{GLFramebuffer, GLFramebufferClass, NONE_GL_FRAMEBUFFER};
mod gl_overlay_compositor;
pub use self::gl_overlay_compositor::{GLOverlayCompositor, GLOverlayCompositorClass};
@ -55,8 +55,8 @@ mod gl_view_convert;
pub use self::gl_view_convert::{GLViewConvert, GLViewConvertClass};
mod gl_window;
pub use self::gl_window::{GLWindow, GLWindowClass, NONE_GL_WINDOW};
pub use self::gl_window::GLWindowExt;
pub use self::gl_window::{GLWindow, GLWindowClass, NONE_GL_WINDOW};
mod enums;
pub use self::enums::GLContextError;
@ -70,10 +70,10 @@ pub use self::enums::GLUploadReturn;
pub use self::enums::GLWindowError;
mod flags;
pub use self::flags::GLAPI;
pub use self::flags::GLDisplayType;
pub use self::flags::GLPlatform;
pub use self::flags::GLSLProfile;
pub use self::flags::GLAPI;
#[doc(hidden)]
pub mod traits {

View file

@ -40,7 +40,6 @@ pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue
#[allow(clippy::unreadable_literal)]
#[allow(clippy::too_many_arguments)]
#[allow(clippy::match_same_arms)]
#[rustfmt::skip]
mod auto;
pub use auto::*;

View file

@ -15,5 +15,4 @@ mod ptp_clock;
pub use self::ptp_clock::{PtpClock, PtpClockClass};
#[doc(hidden)]
pub mod traits {
}
pub mod traits {}

View file

@ -2,13 +2,13 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib::object::ObjectType as ObjectType_;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::GString;
use glib::StaticType;
use glib::Value;
use glib::object::ObjectType as ObjectType_;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::translate::*;
use glib_sys;
use gobject_sys;
use gst;
@ -28,21 +28,33 @@ impl NetClientClock {
pub fn get_property_address(&self) -> Option<GString> {
unsafe {
let mut value = Value::from_type(<GString as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"address\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"address\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get()
}
}
pub fn set_property_address(&self, address: Option<&str>) {
unsafe {
gobject_sys::g_object_set_property(self.as_ptr() as *mut gobject_sys::GObject, b"address\0".as_ptr() as *const _, Value::from(address).to_glib_none().0);
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"address\0".as_ptr() as *const _,
Value::from(address).to_glib_none().0,
);
}
}
pub fn get_property_base_time(&self) -> u64 {
unsafe {
let mut value = Value::from_type(<u64 as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"base-time\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"base-time\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
@ -50,21 +62,33 @@ impl NetClientClock {
pub fn get_property_bus(&self) -> Option<gst::Bus> {
unsafe {
let mut value = Value::from_type(<gst::Bus as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"bus\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"bus\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get()
}
}
pub fn set_property_bus(&self, bus: Option<&gst::Bus>) {
unsafe {
gobject_sys::g_object_set_property(self.as_ptr() as *mut gobject_sys::GObject, b"bus\0".as_ptr() as *const _, Value::from(bus).to_glib_none().0);
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"bus\0".as_ptr() as *const _,
Value::from(bus).to_glib_none().0,
);
}
}
pub fn get_property_internal_clock(&self) -> Option<gst::Clock> {
unsafe {
let mut value = Value::from_type(<gst::Clock as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"internal-clock\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"internal-clock\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get()
}
}
@ -72,140 +96,271 @@ impl NetClientClock {
pub fn get_property_minimum_update_interval(&self) -> u64 {
unsafe {
let mut value = Value::from_type(<u64 as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"minimum-update-interval\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"minimum-update-interval\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
pub fn set_property_minimum_update_interval(&self, minimum_update_interval: u64) {
unsafe {
gobject_sys::g_object_set_property(self.as_ptr() as *mut gobject_sys::GObject, b"minimum-update-interval\0".as_ptr() as *const _, Value::from(&minimum_update_interval).to_glib_none().0);
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"minimum-update-interval\0".as_ptr() as *const _,
Value::from(&minimum_update_interval).to_glib_none().0,
);
}
}
pub fn get_property_port(&self) -> i32 {
unsafe {
let mut value = Value::from_type(<i32 as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"port\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"port\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
pub fn set_property_port(&self, port: i32) {
unsafe {
gobject_sys::g_object_set_property(self.as_ptr() as *mut gobject_sys::GObject, b"port\0".as_ptr() as *const _, Value::from(&port).to_glib_none().0);
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"port\0".as_ptr() as *const _,
Value::from(&port).to_glib_none().0,
);
}
}
pub fn get_property_qos_dscp(&self) -> i32 {
unsafe {
let mut value = Value::from_type(<i32 as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"qos-dscp\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"qos-dscp\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
pub fn set_property_qos_dscp(&self, qos_dscp: i32) {
unsafe {
gobject_sys::g_object_set_property(self.as_ptr() as *mut gobject_sys::GObject, b"qos-dscp\0".as_ptr() as *const _, Value::from(&qos_dscp).to_glib_none().0);
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"qos-dscp\0".as_ptr() as *const _,
Value::from(&qos_dscp).to_glib_none().0,
);
}
}
pub fn get_property_round_trip_limit(&self) -> u64 {
unsafe {
let mut value = Value::from_type(<u64 as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"round-trip-limit\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"round-trip-limit\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
pub fn set_property_round_trip_limit(&self, round_trip_limit: u64) {
unsafe {
gobject_sys::g_object_set_property(self.as_ptr() as *mut gobject_sys::GObject, b"round-trip-limit\0".as_ptr() as *const _, Value::from(&round_trip_limit).to_glib_none().0);
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"round-trip-limit\0".as_ptr() as *const _,
Value::from(&round_trip_limit).to_glib_none().0,
);
}
}
pub fn connect_property_address_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_address_trampoline<F: Fn(&NetClientClock) + Send + Sync + 'static>(this: *mut gst_net_sys::GstNetClientClock, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_address_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_address_trampoline<
F: Fn(&NetClientClock) + Send + Sync + 'static,
>(
this: *mut gst_net_sys::GstNetClientClock,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::address\0".as_ptr() as *const _,
Some(transmute(notify_address_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::address\0".as_ptr() as *const _,
Some(transmute(notify_address_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_bus_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_bus_trampoline<F: Fn(&NetClientClock) + Send + Sync + 'static>(this: *mut gst_net_sys::GstNetClientClock, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_bus_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_bus_trampoline<
F: Fn(&NetClientClock) + Send + Sync + 'static,
>(
this: *mut gst_net_sys::GstNetClientClock,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::bus\0".as_ptr() as *const _,
Some(transmute(notify_bus_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::bus\0".as_ptr() as *const _,
Some(transmute(notify_bus_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_internal_clock_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_internal_clock_trampoline<F: Fn(&NetClientClock) + Send + Sync + 'static>(this: *mut gst_net_sys::GstNetClientClock, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_internal_clock_notify<
F: Fn(&NetClientClock) + Send + Sync + 'static,
>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_internal_clock_trampoline<
F: Fn(&NetClientClock) + Send + Sync + 'static,
>(
this: *mut gst_net_sys::GstNetClientClock,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::internal-clock\0".as_ptr() as *const _,
Some(transmute(notify_internal_clock_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::internal-clock\0".as_ptr() as *const _,
Some(transmute(notify_internal_clock_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_minimum_update_interval_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_minimum_update_interval_trampoline<F: Fn(&NetClientClock) + Send + Sync + 'static>(this: *mut gst_net_sys::GstNetClientClock, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_minimum_update_interval_notify<
F: Fn(&NetClientClock) + Send + Sync + 'static,
>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_minimum_update_interval_trampoline<
F: Fn(&NetClientClock) + Send + Sync + 'static,
>(
this: *mut gst_net_sys::GstNetClientClock,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::minimum-update-interval\0".as_ptr() as *const _,
Some(transmute(notify_minimum_update_interval_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::minimum-update-interval\0".as_ptr() as *const _,
Some(transmute(
notify_minimum_update_interval_trampoline::<F> as usize,
)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_port_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_port_trampoline<F: Fn(&NetClientClock) + Send + Sync + 'static>(this: *mut gst_net_sys::GstNetClientClock, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_port_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_port_trampoline<
F: Fn(&NetClientClock) + Send + Sync + 'static,
>(
this: *mut gst_net_sys::GstNetClientClock,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::port\0".as_ptr() as *const _,
Some(transmute(notify_port_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::port\0".as_ptr() as *const _,
Some(transmute(notify_port_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_qos_dscp_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_qos_dscp_trampoline<F: Fn(&NetClientClock) + Send + Sync + 'static>(this: *mut gst_net_sys::GstNetClientClock, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_qos_dscp_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_qos_dscp_trampoline<
F: Fn(&NetClientClock) + Send + Sync + 'static,
>(
this: *mut gst_net_sys::GstNetClientClock,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::qos-dscp\0".as_ptr() as *const _,
Some(transmute(notify_qos_dscp_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::qos-dscp\0".as_ptr() as *const _,
Some(transmute(notify_qos_dscp_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_round_trip_limit_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_round_trip_limit_trampoline<F: Fn(&NetClientClock) + Send + Sync + 'static>(this: *mut gst_net_sys::GstNetClientClock, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_round_trip_limit_notify<
F: Fn(&NetClientClock) + Send + Sync + 'static,
>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_round_trip_limit_trampoline<
F: Fn(&NetClientClock) + Send + Sync + 'static,
>(
this: *mut gst_net_sys::GstNetClientClock,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::round-trip-limit\0".as_ptr() as *const _,
Some(transmute(notify_round_trip_limit_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::round-trip-limit\0".as_ptr() as *const _,
Some(transmute(notify_round_trip_limit_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
}

View file

@ -2,13 +2,13 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib::object::ObjectType as ObjectType_;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::GString;
use glib::StaticType;
use glib::Value;
use glib::object::ObjectType as ObjectType_;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::translate::*;
use glib_sys;
use gobject_sys;
use gst;
@ -28,21 +28,33 @@ impl NetTimeProvider {
pub fn get_property_active(&self) -> bool {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"active\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"active\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
pub fn set_property_active(&self, active: bool) {
unsafe {
gobject_sys::g_object_set_property(self.as_ptr() as *mut gobject_sys::GObject, b"active\0".as_ptr() as *const _, Value::from(&active).to_glib_none().0);
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"active\0".as_ptr() as *const _,
Value::from(&active).to_glib_none().0,
);
}
}
pub fn get_property_address(&self) -> Option<GString> {
unsafe {
let mut value = Value::from_type(<GString as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"address\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"address\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get()
}
}
@ -50,7 +62,11 @@ impl NetTimeProvider {
pub fn get_property_clock(&self) -> Option<gst::Clock> {
unsafe {
let mut value = Value::from_type(<gst::Clock as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"clock\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"clock\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get()
}
}
@ -58,7 +74,11 @@ impl NetTimeProvider {
pub fn get_property_port(&self) -> i32 {
unsafe {
let mut value = Value::from_type(<i32 as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"port\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"port\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
@ -66,38 +86,72 @@ impl NetTimeProvider {
pub fn get_property_qos_dscp(&self) -> i32 {
unsafe {
let mut value = Value::from_type(<i32 as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"qos-dscp\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"qos-dscp\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
pub fn set_property_qos_dscp(&self, qos_dscp: i32) {
unsafe {
gobject_sys::g_object_set_property(self.as_ptr() as *mut gobject_sys::GObject, b"qos-dscp\0".as_ptr() as *const _, Value::from(&qos_dscp).to_glib_none().0);
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"qos-dscp\0".as_ptr() as *const _,
Value::from(&qos_dscp).to_glib_none().0,
);
}
}
pub fn connect_property_active_notify<F: Fn(&NetTimeProvider) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_active_trampoline<F: Fn(&NetTimeProvider) + Send + Sync + 'static>(this: *mut gst_net_sys::GstNetTimeProvider, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_active_notify<F: Fn(&NetTimeProvider) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_active_trampoline<
F: Fn(&NetTimeProvider) + Send + Sync + 'static,
>(
this: *mut gst_net_sys::GstNetTimeProvider,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::active\0".as_ptr() as *const _,
Some(transmute(notify_active_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::active\0".as_ptr() as *const _,
Some(transmute(notify_active_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_qos_dscp_notify<F: Fn(&NetTimeProvider) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_qos_dscp_trampoline<F: Fn(&NetTimeProvider) + Send + Sync + 'static>(this: *mut gst_net_sys::GstNetTimeProvider, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_qos_dscp_notify<F: Fn(&NetTimeProvider) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_qos_dscp_trampoline<
F: Fn(&NetTimeProvider) + Send + Sync + 'static,
>(
this: *mut gst_net_sys::GstNetTimeProvider,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::qos-dscp\0".as_ptr() as *const _,
Some(transmute(notify_qos_dscp_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::qos-dscp\0".as_ptr() as *const _,
Some(transmute(notify_qos_dscp_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
}

View file

@ -2,10 +2,10 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use NetClientClock;
use glib::translate::*;
use gst;
use gst_net_sys;
use NetClientClock;
glib_wrapper! {
pub struct NtpClock(Object<gst_net_sys::GstNtpClock, gst_net_sys::GstNtpClockClass, NtpClockClass>) @extends NetClientClock, gst::Clock, gst::Object;

View file

@ -2,12 +2,12 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib::object::ObjectType as ObjectType_;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::Value;
use glib::object::ObjectType as ObjectType_;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::translate::*;
use glib_sys;
use gobject_sys;
use gst;
@ -27,7 +27,11 @@ impl PtpClock {
pub fn get_property_domain(&self) -> u32 {
unsafe {
let mut value = Value::from_type(<u32 as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"domain\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"domain\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
@ -35,7 +39,11 @@ impl PtpClock {
pub fn get_property_grandmaster_clock_id(&self) -> u64 {
unsafe {
let mut value = Value::from_type(<u64 as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"grandmaster-clock-id\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"grandmaster-clock-id\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
@ -43,7 +51,11 @@ impl PtpClock {
pub fn get_property_internal_clock(&self) -> Option<gst::Clock> {
unsafe {
let mut value = Value::from_type(<gst::Clock as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"internal-clock\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"internal-clock\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get()
}
}
@ -51,44 +63,91 @@ impl PtpClock {
pub fn get_property_master_clock_id(&self) -> u64 {
unsafe {
let mut value = Value::from_type(<u64 as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"master-clock-id\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"master-clock-id\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
pub fn connect_property_grandmaster_clock_id_notify<F: Fn(&PtpClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_grandmaster_clock_id_trampoline<F: Fn(&PtpClock) + Send + Sync + 'static>(this: *mut gst_net_sys::GstPtpClock, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_grandmaster_clock_id_notify<
F: Fn(&PtpClock) + Send + Sync + 'static,
>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_grandmaster_clock_id_trampoline<
F: Fn(&PtpClock) + Send + Sync + 'static,
>(
this: *mut gst_net_sys::GstPtpClock,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::grandmaster-clock-id\0".as_ptr() as *const _,
Some(transmute(notify_grandmaster_clock_id_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::grandmaster-clock-id\0".as_ptr() as *const _,
Some(transmute(
notify_grandmaster_clock_id_trampoline::<F> as usize,
)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_internal_clock_notify<F: Fn(&PtpClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_internal_clock_trampoline<F: Fn(&PtpClock) + Send + Sync + 'static>(this: *mut gst_net_sys::GstPtpClock, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_internal_clock_notify<F: Fn(&PtpClock) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_internal_clock_trampoline<
F: Fn(&PtpClock) + Send + Sync + 'static,
>(
this: *mut gst_net_sys::GstPtpClock,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::internal-clock\0".as_ptr() as *const _,
Some(transmute(notify_internal_clock_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::internal-clock\0".as_ptr() as *const _,
Some(transmute(notify_internal_clock_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_master_clock_id_notify<F: Fn(&PtpClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_master_clock_id_trampoline<F: Fn(&PtpClock) + Send + Sync + 'static>(this: *mut gst_net_sys::GstPtpClock, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_master_clock_id_notify<F: Fn(&PtpClock) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_master_clock_id_trampoline<
F: Fn(&PtpClock) + Send + Sync + 'static,
>(
this: *mut gst_net_sys::GstPtpClock,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::master-clock-id\0".as_ptr() as *const _,
Some(transmute(notify_master_clock_id_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::master-clock-id\0".as_ptr() as *const _,
Some(transmute(notify_master_clock_id_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
}

View file

@ -29,7 +29,6 @@ pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue
#[allow(clippy::unreadable_literal)]
#[allow(clippy::too_many_arguments)]
#[allow(clippy::match_same_arms)]
#[rustfmt::skip]
mod auto;
pub use auto::*;
mod net_client_clock;

View file

@ -2,17 +2,15 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use DiscovererInfo;
use Error;
use glib;
use glib::object::ObjectType as ObjectType_;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
#[cfg(any(feature = "v1_16", feature = "dox"))]
use glib::StaticType;
#[cfg(any(feature = "v1_16", feature = "dox"))]
use glib::Value;
use glib::object::ObjectType as ObjectType_;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::translate::*;
use glib_sys;
#[cfg(any(feature = "v1_16", feature = "dox"))]
use gobject_sys;
@ -22,6 +20,8 @@ use gst_sys;
use std::boxed::Box as Box_;
use std::mem::transmute;
use std::ptr;
use DiscovererInfo;
use Error;
glib_wrapper! {
pub struct Discoverer(Object<gst_pbutils_sys::GstDiscoverer, gst_pbutils_sys::GstDiscovererClass, DiscovererClass>);
@ -37,21 +37,39 @@ impl Discoverer {
unsafe {
let mut error = ptr::null_mut();
let ret = gst_pbutils_sys::gst_discoverer_new(timeout.to_glib(), &mut error);
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
if error.is_null() {
Ok(from_glib_full(ret))
} else {
Err(from_glib_full(error))
}
}
}
pub fn discover_uri(&self, uri: &str) -> Result<DiscovererInfo, Error> {
unsafe {
let mut error = ptr::null_mut();
let ret = gst_pbutils_sys::gst_discoverer_discover_uri(self.to_glib_none().0, uri.to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
let ret = gst_pbutils_sys::gst_discoverer_discover_uri(
self.to_glib_none().0,
uri.to_glib_none().0,
&mut error,
);
if error.is_null() {
Ok(from_glib_full(ret))
} else {
Err(from_glib_full(error))
}
}
}
pub fn discover_uri_async(&self, uri: &str) -> Result<(), glib::error::BoolError> {
unsafe {
glib_result_from_gboolean!(gst_pbutils_sys::gst_discoverer_discover_uri_async(self.to_glib_none().0, uri.to_glib_none().0), "Failed to add URI to list of discovers")
glib_result_from_gboolean!(
gst_pbutils_sys::gst_discoverer_discover_uri_async(
self.to_glib_none().0,
uri.to_glib_none().0
),
"Failed to add URI to list of discovers"
)
}
}
@ -71,7 +89,11 @@ impl Discoverer {
pub fn get_property_use_cache(&self) -> bool {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"use-cache\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"use-cache\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().unwrap()
}
}
@ -79,68 +101,138 @@ impl Discoverer {
#[cfg(any(feature = "v1_16", feature = "dox"))]
pub fn set_property_use_cache(&self, use_cache: bool) {
unsafe {
gobject_sys::g_object_set_property(self.as_ptr() as *mut gobject_sys::GObject, b"use-cache\0".as_ptr() as *const _, Value::from(&use_cache).to_glib_none().0);
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"use-cache\0".as_ptr() as *const _,
Value::from(&use_cache).to_glib_none().0,
);
}
}
pub fn connect_discovered<F: Fn(&Discoverer, &DiscovererInfo, Option<&Error>) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn discovered_trampoline<F: Fn(&Discoverer, &DiscovererInfo, Option<&Error>) + Send + Sync + 'static>(this: *mut gst_pbutils_sys::GstDiscoverer, info: *mut gst_pbutils_sys::GstDiscovererInfo, error: *mut glib_sys::GError, f: glib_sys::gpointer) {
pub fn connect_discovered<
F: Fn(&Discoverer, &DiscovererInfo, Option<&Error>) + Send + Sync + 'static,
>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn discovered_trampoline<
F: Fn(&Discoverer, &DiscovererInfo, Option<&Error>) + Send + Sync + 'static,
>(
this: *mut gst_pbutils_sys::GstDiscoverer,
info: *mut gst_pbutils_sys::GstDiscovererInfo,
error: *mut glib_sys::GError,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this), &from_glib_borrow(info), Option::<Error>::from_glib_borrow(error).as_ref())
f(
&from_glib_borrow(this),
&from_glib_borrow(info),
Option::<Error>::from_glib_borrow(error).as_ref(),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"discovered\0".as_ptr() as *const _,
Some(transmute(discovered_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"discovered\0".as_ptr() as *const _,
Some(transmute(discovered_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_finished<F: Fn(&Discoverer) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn finished_trampoline<F: Fn(&Discoverer) + Send + Sync + 'static>(this: *mut gst_pbutils_sys::GstDiscoverer, f: glib_sys::gpointer) {
pub fn connect_finished<F: Fn(&Discoverer) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn finished_trampoline<F: Fn(&Discoverer) + Send + Sync + 'static>(
this: *mut gst_pbutils_sys::GstDiscoverer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"finished\0".as_ptr() as *const _,
Some(transmute(finished_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"finished\0".as_ptr() as *const _,
Some(transmute(finished_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_source_setup<F: Fn(&Discoverer, &gst::Element) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn source_setup_trampoline<F: Fn(&Discoverer, &gst::Element) + Send + Sync + 'static>(this: *mut gst_pbutils_sys::GstDiscoverer, source: *mut gst_sys::GstElement, f: glib_sys::gpointer) {
pub fn connect_source_setup<F: Fn(&Discoverer, &gst::Element) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn source_setup_trampoline<
F: Fn(&Discoverer, &gst::Element) + Send + Sync + 'static,
>(
this: *mut gst_pbutils_sys::GstDiscoverer,
source: *mut gst_sys::GstElement,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this), &from_glib_borrow(source))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"source-setup\0".as_ptr() as *const _,
Some(transmute(source_setup_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"source-setup\0".as_ptr() as *const _,
Some(transmute(source_setup_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_starting<F: Fn(&Discoverer) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn starting_trampoline<F: Fn(&Discoverer) + Send + Sync + 'static>(this: *mut gst_pbutils_sys::GstDiscoverer, f: glib_sys::gpointer) {
pub fn connect_starting<F: Fn(&Discoverer) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn starting_trampoline<F: Fn(&Discoverer) + Send + Sync + 'static>(
this: *mut gst_pbutils_sys::GstDiscoverer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"starting\0".as_ptr() as *const _,
Some(transmute(starting_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"starting\0".as_ptr() as *const _,
Some(transmute(starting_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
#[cfg(any(feature = "v1_16", feature = "dox"))]
pub fn connect_property_use_cache_notify<F: Fn(&Discoverer) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_use_cache_trampoline<F: Fn(&Discoverer) + Send + Sync + 'static>(this: *mut gst_pbutils_sys::GstDiscoverer, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_use_cache_notify<F: Fn(&Discoverer) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_use_cache_trampoline<
F: Fn(&Discoverer) + Send + Sync + 'static,
>(
this: *mut gst_pbutils_sys::GstDiscoverer,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::use-cache\0".as_ptr() as *const _,
Some(transmute(notify_use_cache_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::use-cache\0".as_ptr() as *const _,
Some(transmute(notify_use_cache_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
}

View file

@ -2,10 +2,10 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use DiscovererStreamInfo;
use glib::GString;
use glib::translate::*;
use glib::GString;
use gst_pbutils_sys;
use DiscovererStreamInfo;
glib_wrapper! {
pub struct DiscovererAudioInfo(Object<gst_pbutils_sys::GstDiscovererAudioInfo, DiscovererAudioInfoClass>) @extends DiscovererStreamInfo;
@ -17,9 +17,7 @@ glib_wrapper! {
impl DiscovererAudioInfo {
pub fn get_bitrate(&self) -> u32 {
unsafe {
gst_pbutils_sys::gst_discoverer_audio_info_get_bitrate(self.to_glib_none().0)
}
unsafe { gst_pbutils_sys::gst_discoverer_audio_info_get_bitrate(self.to_glib_none().0) }
}
#[cfg(any(feature = "v1_14", feature = "dox"))]
@ -30,33 +28,27 @@ impl DiscovererAudioInfo {
}
pub fn get_channels(&self) -> u32 {
unsafe {
gst_pbutils_sys::gst_discoverer_audio_info_get_channels(self.to_glib_none().0)
}
unsafe { gst_pbutils_sys::gst_discoverer_audio_info_get_channels(self.to_glib_none().0) }
}
pub fn get_depth(&self) -> u32 {
unsafe {
gst_pbutils_sys::gst_discoverer_audio_info_get_depth(self.to_glib_none().0)
}
unsafe { gst_pbutils_sys::gst_discoverer_audio_info_get_depth(self.to_glib_none().0) }
}
pub fn get_language(&self) -> Option<GString> {
unsafe {
from_glib_none(gst_pbutils_sys::gst_discoverer_audio_info_get_language(self.to_glib_none().0))
from_glib_none(gst_pbutils_sys::gst_discoverer_audio_info_get_language(
self.to_glib_none().0,
))
}
}
pub fn get_max_bitrate(&self) -> u32 {
unsafe {
gst_pbutils_sys::gst_discoverer_audio_info_get_max_bitrate(self.to_glib_none().0)
}
unsafe { gst_pbutils_sys::gst_discoverer_audio_info_get_max_bitrate(self.to_glib_none().0) }
}
pub fn get_sample_rate(&self) -> u32 {
unsafe {
gst_pbutils_sys::gst_discoverer_audio_info_get_sample_rate(self.to_glib_none().0)
}
unsafe { gst_pbutils_sys::gst_discoverer_audio_info_get_sample_rate(self.to_glib_none().0) }
}
}

View file

@ -2,9 +2,9 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use DiscovererStreamInfo;
use glib::translate::*;
use gst_pbutils_sys;
use DiscovererStreamInfo;
glib_wrapper! {
pub struct DiscovererContainerInfo(Object<gst_pbutils_sys::GstDiscovererContainerInfo, DiscovererContainerInfoClass>) @extends DiscovererStreamInfo;
@ -17,7 +17,9 @@ glib_wrapper! {
impl DiscovererContainerInfo {
pub fn get_streams(&self) -> Vec<DiscovererStreamInfo> {
unsafe {
FromGlibPtrContainer::from_glib_full(gst_pbutils_sys::gst_discoverer_container_info_get_streams(self.to_glib_none().0))
FromGlibPtrContainer::from_glib_full(
gst_pbutils_sys::gst_discoverer_container_info_get_streams(self.to_glib_none().0),
)
}
}
}

View file

@ -2,14 +2,14 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib;
use glib::translate::*;
use glib::GString;
use gst;
use gst_pbutils_sys;
use DiscovererResult;
use DiscovererSerializeFlags;
use DiscovererStreamInfo;
use glib;
use glib::GString;
use glib::translate::*;
use gst;
use gst_pbutils_sys;
glib_wrapper! {
pub struct DiscovererInfo(Object<gst_pbutils_sys::GstDiscovererInfo, DiscovererInfoClass>);
@ -22,117 +22,159 @@ glib_wrapper! {
impl DiscovererInfo {
pub fn copy(&self) -> DiscovererInfo {
unsafe {
from_glib_full(gst_pbutils_sys::gst_discoverer_info_copy(self.to_glib_none().0))
from_glib_full(gst_pbutils_sys::gst_discoverer_info_copy(
self.to_glib_none().0,
))
}
}
pub fn get_audio_streams(&self) -> Vec<DiscovererStreamInfo> {
unsafe {
FromGlibPtrContainer::from_glib_full(gst_pbutils_sys::gst_discoverer_info_get_audio_streams(self.to_glib_none().0))
FromGlibPtrContainer::from_glib_full(
gst_pbutils_sys::gst_discoverer_info_get_audio_streams(self.to_glib_none().0),
)
}
}
pub fn get_container_streams(&self) -> Vec<DiscovererStreamInfo> {
unsafe {
FromGlibPtrContainer::from_glib_full(gst_pbutils_sys::gst_discoverer_info_get_container_streams(self.to_glib_none().0))
FromGlibPtrContainer::from_glib_full(
gst_pbutils_sys::gst_discoverer_info_get_container_streams(self.to_glib_none().0),
)
}
}
pub fn get_duration(&self) -> gst::ClockTime {
unsafe {
from_glib(gst_pbutils_sys::gst_discoverer_info_get_duration(self.to_glib_none().0))
from_glib(gst_pbutils_sys::gst_discoverer_info_get_duration(
self.to_glib_none().0,
))
}
}
#[cfg(any(feature = "v1_14", feature = "dox"))]
pub fn get_live(&self) -> bool {
unsafe {
from_glib(gst_pbutils_sys::gst_discoverer_info_get_live(self.to_glib_none().0))
from_glib(gst_pbutils_sys::gst_discoverer_info_get_live(
self.to_glib_none().0,
))
}
}
pub fn get_misc(&self) -> Option<gst::Structure> {
unsafe {
from_glib_none(gst_pbutils_sys::gst_discoverer_info_get_misc(self.to_glib_none().0))
from_glib_none(gst_pbutils_sys::gst_discoverer_info_get_misc(
self.to_glib_none().0,
))
}
}
pub fn get_missing_elements_installer_details(&self) -> Vec<GString> {
unsafe {
FromGlibPtrContainer::from_glib_none(gst_pbutils_sys::gst_discoverer_info_get_missing_elements_installer_details(self.to_glib_none().0))
FromGlibPtrContainer::from_glib_none(
gst_pbutils_sys::gst_discoverer_info_get_missing_elements_installer_details(
self.to_glib_none().0,
),
)
}
}
pub fn get_result(&self) -> DiscovererResult {
unsafe {
from_glib(gst_pbutils_sys::gst_discoverer_info_get_result(self.to_glib_none().0))
from_glib(gst_pbutils_sys::gst_discoverer_info_get_result(
self.to_glib_none().0,
))
}
}
pub fn get_seekable(&self) -> bool {
unsafe {
from_glib(gst_pbutils_sys::gst_discoverer_info_get_seekable(self.to_glib_none().0))
from_glib(gst_pbutils_sys::gst_discoverer_info_get_seekable(
self.to_glib_none().0,
))
}
}
pub fn get_stream_info(&self) -> Option<DiscovererStreamInfo> {
unsafe {
from_glib_full(gst_pbutils_sys::gst_discoverer_info_get_stream_info(self.to_glib_none().0))
from_glib_full(gst_pbutils_sys::gst_discoverer_info_get_stream_info(
self.to_glib_none().0,
))
}
}
pub fn get_stream_list(&self) -> Vec<DiscovererStreamInfo> {
unsafe {
FromGlibPtrContainer::from_glib_full(gst_pbutils_sys::gst_discoverer_info_get_stream_list(self.to_glib_none().0))
FromGlibPtrContainer::from_glib_full(
gst_pbutils_sys::gst_discoverer_info_get_stream_list(self.to_glib_none().0),
)
}
}
pub fn get_streams(&self, streamtype: glib::types::Type) -> Vec<DiscovererStreamInfo> {
unsafe {
FromGlibPtrContainer::from_glib_full(gst_pbutils_sys::gst_discoverer_info_get_streams(self.to_glib_none().0, streamtype.to_glib()))
FromGlibPtrContainer::from_glib_full(gst_pbutils_sys::gst_discoverer_info_get_streams(
self.to_glib_none().0,
streamtype.to_glib(),
))
}
}
pub fn get_subtitle_streams(&self) -> Vec<DiscovererStreamInfo> {
unsafe {
FromGlibPtrContainer::from_glib_full(gst_pbutils_sys::gst_discoverer_info_get_subtitle_streams(self.to_glib_none().0))
FromGlibPtrContainer::from_glib_full(
gst_pbutils_sys::gst_discoverer_info_get_subtitle_streams(self.to_glib_none().0),
)
}
}
pub fn get_tags(&self) -> Option<gst::TagList> {
unsafe {
from_glib_none(gst_pbutils_sys::gst_discoverer_info_get_tags(self.to_glib_none().0))
from_glib_none(gst_pbutils_sys::gst_discoverer_info_get_tags(
self.to_glib_none().0,
))
}
}
pub fn get_toc(&self) -> Option<gst::Toc> {
unsafe {
from_glib_none(gst_pbutils_sys::gst_discoverer_info_get_toc(self.to_glib_none().0))
from_glib_none(gst_pbutils_sys::gst_discoverer_info_get_toc(
self.to_glib_none().0,
))
}
}
pub fn get_uri(&self) -> Option<GString> {
unsafe {
from_glib_none(gst_pbutils_sys::gst_discoverer_info_get_uri(self.to_glib_none().0))
from_glib_none(gst_pbutils_sys::gst_discoverer_info_get_uri(
self.to_glib_none().0,
))
}
}
pub fn get_video_streams(&self) -> Vec<DiscovererStreamInfo> {
unsafe {
FromGlibPtrContainer::from_glib_full(gst_pbutils_sys::gst_discoverer_info_get_video_streams(self.to_glib_none().0))
FromGlibPtrContainer::from_glib_full(
gst_pbutils_sys::gst_discoverer_info_get_video_streams(self.to_glib_none().0),
)
}
}
pub fn to_variant(&self, flags: DiscovererSerializeFlags) -> Option<glib::Variant> {
unsafe {
from_glib_full(gst_pbutils_sys::gst_discoverer_info_to_variant(self.to_glib_none().0, flags.to_glib()))
from_glib_full(gst_pbutils_sys::gst_discoverer_info_to_variant(
self.to_glib_none().0,
flags.to_glib(),
))
}
}
pub fn from_variant(variant: &glib::Variant) -> Option<DiscovererInfo> {
assert_initialized_main_thread!();
unsafe {
from_glib_full(gst_pbutils_sys::gst_discoverer_info_from_variant(variant.to_glib_none().0))
from_glib_full(gst_pbutils_sys::gst_discoverer_info_from_variant(
variant.to_glib_none().0,
))
}
}
}

View file

@ -2,9 +2,9 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib::GString;
use glib::object::IsA;
use glib::translate::*;
use glib::GString;
use gst;
use gst_pbutils_sys;
@ -42,49 +42,67 @@ pub trait DiscovererStreamInfoExt: 'static {
impl<O: IsA<DiscovererStreamInfo>> DiscovererStreamInfoExt for O {
fn get_caps(&self) -> Option<gst::Caps> {
unsafe {
from_glib_full(gst_pbutils_sys::gst_discoverer_stream_info_get_caps(self.as_ref().to_glib_none().0))
from_glib_full(gst_pbutils_sys::gst_discoverer_stream_info_get_caps(
self.as_ref().to_glib_none().0,
))
}
}
fn get_misc(&self) -> Option<gst::Structure> {
unsafe {
from_glib_none(gst_pbutils_sys::gst_discoverer_stream_info_get_misc(self.as_ref().to_glib_none().0))
from_glib_none(gst_pbutils_sys::gst_discoverer_stream_info_get_misc(
self.as_ref().to_glib_none().0,
))
}
}
fn get_next(&self) -> Option<DiscovererStreamInfo> {
unsafe {
from_glib_full(gst_pbutils_sys::gst_discoverer_stream_info_get_next(self.as_ref().to_glib_none().0))
from_glib_full(gst_pbutils_sys::gst_discoverer_stream_info_get_next(
self.as_ref().to_glib_none().0,
))
}
}
fn get_previous(&self) -> Option<DiscovererStreamInfo> {
unsafe {
from_glib_full(gst_pbutils_sys::gst_discoverer_stream_info_get_previous(self.as_ref().to_glib_none().0))
from_glib_full(gst_pbutils_sys::gst_discoverer_stream_info_get_previous(
self.as_ref().to_glib_none().0,
))
}
}
fn get_stream_id(&self) -> Option<GString> {
unsafe {
from_glib_none(gst_pbutils_sys::gst_discoverer_stream_info_get_stream_id(self.as_ref().to_glib_none().0))
from_glib_none(gst_pbutils_sys::gst_discoverer_stream_info_get_stream_id(
self.as_ref().to_glib_none().0,
))
}
}
fn get_stream_type_nick(&self) -> GString {
unsafe {
from_glib_none(gst_pbutils_sys::gst_discoverer_stream_info_get_stream_type_nick(self.as_ref().to_glib_none().0))
from_glib_none(
gst_pbutils_sys::gst_discoverer_stream_info_get_stream_type_nick(
self.as_ref().to_glib_none().0,
),
)
}
}
fn get_tags(&self) -> Option<gst::TagList> {
unsafe {
from_glib_none(gst_pbutils_sys::gst_discoverer_stream_info_get_tags(self.as_ref().to_glib_none().0))
from_glib_none(gst_pbutils_sys::gst_discoverer_stream_info_get_tags(
self.as_ref().to_glib_none().0,
))
}
}
fn get_toc(&self) -> Option<gst::Toc> {
unsafe {
from_glib_none(gst_pbutils_sys::gst_discoverer_stream_info_get_toc(self.as_ref().to_glib_none().0))
from_glib_none(gst_pbutils_sys::gst_discoverer_stream_info_get_toc(
self.as_ref().to_glib_none().0,
))
}
}
}

View file

@ -2,10 +2,10 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use DiscovererStreamInfo;
use glib::GString;
use glib::translate::*;
use glib::GString;
use gst_pbutils_sys;
use DiscovererStreamInfo;
glib_wrapper! {
pub struct DiscovererSubtitleInfo(Object<gst_pbutils_sys::GstDiscovererSubtitleInfo, DiscovererSubtitleInfoClass>) @extends DiscovererStreamInfo;
@ -18,7 +18,9 @@ glib_wrapper! {
impl DiscovererSubtitleInfo {
pub fn get_language(&self) -> Option<GString> {
unsafe {
from_glib_none(gst_pbutils_sys::gst_discoverer_subtitle_info_get_language(self.to_glib_none().0))
from_glib_none(gst_pbutils_sys::gst_discoverer_subtitle_info_get_language(
self.to_glib_none().0,
))
}
}
}

View file

@ -2,9 +2,9 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use DiscovererStreamInfo;
use glib::translate::*;
use gst_pbutils_sys;
use DiscovererStreamInfo;
glib_wrapper! {
pub struct DiscovererVideoInfo(Object<gst_pbutils_sys::GstDiscovererVideoInfo, DiscovererVideoInfoClass>) @extends DiscovererStreamInfo;
@ -16,44 +16,38 @@ glib_wrapper! {
impl DiscovererVideoInfo {
pub fn get_bitrate(&self) -> u32 {
unsafe {
gst_pbutils_sys::gst_discoverer_video_info_get_bitrate(self.to_glib_none().0)
}
unsafe { gst_pbutils_sys::gst_discoverer_video_info_get_bitrate(self.to_glib_none().0) }
}
pub fn get_depth(&self) -> u32 {
unsafe {
gst_pbutils_sys::gst_discoverer_video_info_get_depth(self.to_glib_none().0)
}
unsafe { gst_pbutils_sys::gst_discoverer_video_info_get_depth(self.to_glib_none().0) }
}
pub fn get_height(&self) -> u32 {
unsafe {
gst_pbutils_sys::gst_discoverer_video_info_get_height(self.to_glib_none().0)
}
unsafe { gst_pbutils_sys::gst_discoverer_video_info_get_height(self.to_glib_none().0) }
}
pub fn get_max_bitrate(&self) -> u32 {
unsafe {
gst_pbutils_sys::gst_discoverer_video_info_get_max_bitrate(self.to_glib_none().0)
}
unsafe { gst_pbutils_sys::gst_discoverer_video_info_get_max_bitrate(self.to_glib_none().0) }
}
pub fn get_width(&self) -> u32 {
unsafe {
gst_pbutils_sys::gst_discoverer_video_info_get_width(self.to_glib_none().0)
}
unsafe { gst_pbutils_sys::gst_discoverer_video_info_get_width(self.to_glib_none().0) }
}
pub fn is_image(&self) -> bool {
unsafe {
from_glib(gst_pbutils_sys::gst_discoverer_video_info_is_image(self.to_glib_none().0))
from_glib(gst_pbutils_sys::gst_discoverer_video_info_is_image(
self.to_glib_none().0,
))
}
}
pub fn is_interlaced(&self) -> bool {
unsafe {
from_glib(gst_pbutils_sys::gst_discoverer_video_info_is_interlaced(self.to_glib_none().0))
from_glib(gst_pbutils_sys::gst_discoverer_video_info_is_interlaced(
self.to_glib_none().0,
))
}
}
}

View file

@ -2,9 +2,9 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use EncodingProfile;
use glib::translate::*;
use gst_pbutils_sys;
use EncodingProfile;
glib_wrapper! {
pub struct EncodingAudioProfile(Object<gst_pbutils_sys::GstEncodingAudioProfile, gst_pbutils_sys::GstEncodingAudioProfileClass, EncodingAudioProfileClass>) @extends EncodingProfile;

View file

@ -2,10 +2,10 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use EncodingProfile;
use glib::object::IsA;
use glib::translate::*;
use gst_pbutils_sys;
use EncodingProfile;
glib_wrapper! {
pub struct EncodingContainerProfile(Object<gst_pbutils_sys::GstEncodingContainerProfile, gst_pbutils_sys::GstEncodingContainerProfileClass, EncodingContainerProfileClass>) @extends EncodingProfile;
@ -18,13 +18,20 @@ glib_wrapper! {
impl EncodingContainerProfile {
pub fn contains_profile<P: IsA<EncodingProfile>>(&self, profile: &P) -> bool {
unsafe {
from_glib(gst_pbutils_sys::gst_encoding_container_profile_contains_profile(self.to_glib_none().0, profile.as_ref().to_glib_none().0))
from_glib(
gst_pbutils_sys::gst_encoding_container_profile_contains_profile(
self.to_glib_none().0,
profile.as_ref().to_glib_none().0,
),
)
}
}
pub fn get_profiles(&self) -> Vec<EncodingProfile> {
unsafe {
FromGlibPtrContainer::from_glib_none(gst_pbutils_sys::gst_encoding_container_profile_get_profiles(self.to_glib_none().0))
FromGlibPtrContainer::from_glib_none(
gst_pbutils_sys::gst_encoding_container_profile_get_profiles(self.to_glib_none().0),
)
}
}
}

View file

@ -2,12 +2,12 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use DiscovererInfo;
use glib::GString;
use glib::object::IsA;
use glib::translate::*;
use glib::GString;
use gst;
use gst_pbutils_sys;
use DiscovererInfo;
glib_wrapper! {
pub struct EncodingProfile(Object<gst_pbutils_sys::GstEncodingProfile, gst_pbutils_sys::GstEncodingProfileClass, EncodingProfileClass>);
@ -18,17 +18,27 @@ glib_wrapper! {
}
impl EncodingProfile {
pub fn find(targetname: &str, profilename: Option<&str>, category: Option<&str>) -> Option<EncodingProfile> {
pub fn find(
targetname: &str,
profilename: Option<&str>,
category: Option<&str>,
) -> Option<EncodingProfile> {
assert_initialized_main_thread!();
unsafe {
from_glib_full(gst_pbutils_sys::gst_encoding_profile_find(targetname.to_glib_none().0, profilename.to_glib_none().0, category.to_glib_none().0))
from_glib_full(gst_pbutils_sys::gst_encoding_profile_find(
targetname.to_glib_none().0,
profilename.to_glib_none().0,
category.to_glib_none().0,
))
}
}
pub fn from_discoverer(info: &DiscovererInfo) -> Option<EncodingProfile> {
skip_assert_initialized!();
unsafe {
from_glib_full(gst_pbutils_sys::gst_encoding_profile_from_discoverer(info.to_glib_none().0))
from_glib_full(gst_pbutils_sys::gst_encoding_profile_from_discoverer(
info.to_glib_none().0,
))
}
}
}
@ -73,43 +83,59 @@ impl<O: IsA<EncodingProfile>> EncodingProfileExt for O {
#[cfg(any(feature = "v1_12", feature = "dox"))]
fn copy(&self) -> EncodingProfile {
unsafe {
from_glib_full(gst_pbutils_sys::gst_encoding_profile_copy(self.as_ref().to_glib_none().0))
from_glib_full(gst_pbutils_sys::gst_encoding_profile_copy(
self.as_ref().to_glib_none().0,
))
}
}
fn get_allow_dynamic_output(&self) -> bool {
unsafe {
from_glib(gst_pbutils_sys::gst_encoding_profile_get_allow_dynamic_output(self.as_ref().to_glib_none().0))
from_glib(
gst_pbutils_sys::gst_encoding_profile_get_allow_dynamic_output(
self.as_ref().to_glib_none().0,
),
)
}
}
fn get_description(&self) -> Option<GString> {
unsafe {
from_glib_none(gst_pbutils_sys::gst_encoding_profile_get_description(self.as_ref().to_glib_none().0))
from_glib_none(gst_pbutils_sys::gst_encoding_profile_get_description(
self.as_ref().to_glib_none().0,
))
}
}
fn get_file_extension(&self) -> Option<GString> {
unsafe {
from_glib_none(gst_pbutils_sys::gst_encoding_profile_get_file_extension(self.as_ref().to_glib_none().0))
from_glib_none(gst_pbutils_sys::gst_encoding_profile_get_file_extension(
self.as_ref().to_glib_none().0,
))
}
}
fn get_format(&self) -> gst::Caps {
unsafe {
from_glib_full(gst_pbutils_sys::gst_encoding_profile_get_format(self.as_ref().to_glib_none().0))
from_glib_full(gst_pbutils_sys::gst_encoding_profile_get_format(
self.as_ref().to_glib_none().0,
))
}
}
fn get_input_caps(&self) -> gst::Caps {
unsafe {
from_glib_full(gst_pbutils_sys::gst_encoding_profile_get_input_caps(self.as_ref().to_glib_none().0))
from_glib_full(gst_pbutils_sys::gst_encoding_profile_get_input_caps(
self.as_ref().to_glib_none().0,
))
}
}
fn get_name(&self) -> Option<GString> {
unsafe {
from_glib_none(gst_pbutils_sys::gst_encoding_profile_get_name(self.as_ref().to_glib_none().0))
from_glib_none(gst_pbutils_sys::gst_encoding_profile_get_name(
self.as_ref().to_glib_none().0,
))
}
}
@ -121,37 +147,50 @@ impl<O: IsA<EncodingProfile>> EncodingProfileExt for O {
fn get_preset(&self) -> Option<GString> {
unsafe {
from_glib_none(gst_pbutils_sys::gst_encoding_profile_get_preset(self.as_ref().to_glib_none().0))
from_glib_none(gst_pbutils_sys::gst_encoding_profile_get_preset(
self.as_ref().to_glib_none().0,
))
}
}
fn get_preset_name(&self) -> Option<GString> {
unsafe {
from_glib_none(gst_pbutils_sys::gst_encoding_profile_get_preset_name(self.as_ref().to_glib_none().0))
from_glib_none(gst_pbutils_sys::gst_encoding_profile_get_preset_name(
self.as_ref().to_glib_none().0,
))
}
}
fn get_restriction(&self) -> Option<gst::Caps> {
unsafe {
from_glib_full(gst_pbutils_sys::gst_encoding_profile_get_restriction(self.as_ref().to_glib_none().0))
from_glib_full(gst_pbutils_sys::gst_encoding_profile_get_restriction(
self.as_ref().to_glib_none().0,
))
}
}
fn get_type_nick(&self) -> Option<GString> {
unsafe {
from_glib_none(gst_pbutils_sys::gst_encoding_profile_get_type_nick(self.as_ref().to_glib_none().0))
from_glib_none(gst_pbutils_sys::gst_encoding_profile_get_type_nick(
self.as_ref().to_glib_none().0,
))
}
}
fn is_enabled(&self) -> bool {
unsafe {
from_glib(gst_pbutils_sys::gst_encoding_profile_is_enabled(self.as_ref().to_glib_none().0))
from_glib(gst_pbutils_sys::gst_encoding_profile_is_enabled(
self.as_ref().to_glib_none().0,
))
}
}
fn is_equal<P: IsA<EncodingProfile>>(&self, b: &P) -> bool {
unsafe {
from_glib(gst_pbutils_sys::gst_encoding_profile_is_equal(self.as_ref().to_glib_none().0, b.as_ref().to_glib_none().0))
from_glib(gst_pbutils_sys::gst_encoding_profile_is_equal(
self.as_ref().to_glib_none().0,
b.as_ref().to_glib_none().0,
))
}
}
}

View file

@ -2,13 +2,13 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use EncodingProfile;
use Error;
use glib::GString;
use glib::translate::*;
use glib::GString;
use gst_pbutils_sys;
use std;
use std::ptr;
use EncodingProfile;
use Error;
glib_wrapper! {
pub struct EncodingTarget(Object<gst_pbutils_sys::GstEncodingTarget, EncodingTargetClass>);
@ -19,40 +19,61 @@ glib_wrapper! {
}
impl EncodingTarget {
pub fn new(name: &str, category: &str, description: &str, profiles: &[EncodingProfile]) -> EncodingTarget {
pub fn new(
name: &str,
category: &str,
description: &str,
profiles: &[EncodingProfile],
) -> EncodingTarget {
assert_initialized_main_thread!();
unsafe {
from_glib_full(gst_pbutils_sys::gst_encoding_target_new(name.to_glib_none().0, category.to_glib_none().0, description.to_glib_none().0, profiles.to_glib_none().0))
from_glib_full(gst_pbutils_sys::gst_encoding_target_new(
name.to_glib_none().0,
category.to_glib_none().0,
description.to_glib_none().0,
profiles.to_glib_none().0,
))
}
}
pub fn get_category(&self) -> GString {
unsafe {
from_glib_none(gst_pbutils_sys::gst_encoding_target_get_category(self.to_glib_none().0))
from_glib_none(gst_pbutils_sys::gst_encoding_target_get_category(
self.to_glib_none().0,
))
}
}
pub fn get_description(&self) -> GString {
unsafe {
from_glib_none(gst_pbutils_sys::gst_encoding_target_get_description(self.to_glib_none().0))
from_glib_none(gst_pbutils_sys::gst_encoding_target_get_description(
self.to_glib_none().0,
))
}
}
pub fn get_name(&self) -> GString {
unsafe {
from_glib_none(gst_pbutils_sys::gst_encoding_target_get_name(self.to_glib_none().0))
from_glib_none(gst_pbutils_sys::gst_encoding_target_get_name(
self.to_glib_none().0,
))
}
}
pub fn get_profile(&self, name: &str) -> Option<EncodingProfile> {
unsafe {
from_glib_full(gst_pbutils_sys::gst_encoding_target_get_profile(self.to_glib_none().0, name.to_glib_none().0))
from_glib_full(gst_pbutils_sys::gst_encoding_target_get_profile(
self.to_glib_none().0,
name.to_glib_none().0,
))
}
}
pub fn get_profiles(&self) -> Vec<EncodingProfile> {
unsafe {
FromGlibPtrContainer::from_glib_none(gst_pbutils_sys::gst_encoding_target_get_profiles(self.to_glib_none().0))
FromGlibPtrContainer::from_glib_none(gst_pbutils_sys::gst_encoding_target_get_profiles(
self.to_glib_none().0,
))
}
}
@ -60,15 +81,27 @@ impl EncodingTarget {
unsafe {
let mut error = ptr::null_mut();
let _ = gst_pbutils_sys::gst_encoding_target_save(self.to_glib_none().0, &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
if error.is_null() {
Ok(())
} else {
Err(from_glib_full(error))
}
}
}
pub fn save_to_file<P: AsRef<std::path::Path>>(&self, filepath: P) -> Result<(), Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = gst_pbutils_sys::gst_encoding_target_save_to_file(self.to_glib_none().0, filepath.as_ref().to_glib_none().0, &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
let _ = gst_pbutils_sys::gst_encoding_target_save_to_file(
self.to_glib_none().0,
filepath.as_ref().to_glib_none().0,
&mut error,
);
if error.is_null() {
Ok(())
} else {
Err(from_glib_full(error))
}
}
}
@ -76,8 +109,16 @@ impl EncodingTarget {
assert_initialized_main_thread!();
unsafe {
let mut error = ptr::null_mut();
let ret = gst_pbutils_sys::gst_encoding_target_load(name.to_glib_none().0, category.to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
let ret = gst_pbutils_sys::gst_encoding_target_load(
name.to_glib_none().0,
category.to_glib_none().0,
&mut error,
);
if error.is_null() {
Ok(from_glib_full(ret))
} else {
Err(from_glib_full(error))
}
}
}
@ -85,8 +126,15 @@ impl EncodingTarget {
assert_initialized_main_thread!();
unsafe {
let mut error = ptr::null_mut();
let ret = gst_pbutils_sys::gst_encoding_target_load_from_file(filepath.as_ref().to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
let ret = gst_pbutils_sys::gst_encoding_target_load_from_file(
filepath.as_ref().to_glib_none().0,
&mut error,
);
if error.is_null() {
Ok(from_glib_full(ret))
} else {
Err(from_glib_full(error))
}
}
}
}

View file

@ -2,9 +2,9 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use EncodingProfile;
use glib::translate::*;
use gst_pbutils_sys;
use EncodingProfile;
glib_wrapper! {
pub struct EncodingVideoProfile(Object<gst_pbutils_sys::GstEncodingVideoProfile, gst_pbutils_sys::GstEncodingVideoProfileClass, EncodingVideoProfileClass>) @extends EncodingProfile;
@ -16,14 +16,16 @@ glib_wrapper! {
impl EncodingVideoProfile {
pub fn get_pass(&self) -> u32 {
unsafe {
gst_pbutils_sys::gst_encoding_video_profile_get_pass(self.to_glib_none().0)
}
unsafe { gst_pbutils_sys::gst_encoding_video_profile_get_pass(self.to_glib_none().0) }
}
pub fn get_variableframerate(&self) -> bool {
unsafe {
from_glib(gst_pbutils_sys::gst_encoding_video_profile_get_variableframerate(self.to_glib_none().0))
from_glib(
gst_pbutils_sys::gst_encoding_video_profile_get_variableframerate(
self.to_glib_none().0,
),
)
}
}
}

View file

@ -2,18 +2,17 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib::StaticType;
use glib::Type;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::FromValueOptional;
use glib::value::SetValue;
use glib::value::Value;
use glib::StaticType;
use glib::Type;
use gobject_sys;
use gst_pbutils_sys;
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum DiscovererResult {
Ok,
UriInvalid,
@ -37,7 +36,7 @@ impl ToGlib for DiscovererResult {
DiscovererResult::Timeout => gst_pbutils_sys::GST_DISCOVERER_TIMEOUT,
DiscovererResult::Busy => gst_pbutils_sys::GST_DISCOVERER_BUSY,
DiscovererResult::MissingPlugins => gst_pbutils_sys::GST_DISCOVERER_MISSING_PLUGINS,
DiscovererResult::__Unknown(value) => value
DiscovererResult::__Unknown(value) => value,
}
}
}
@ -81,4 +80,3 @@ impl SetValue for DiscovererResult {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}

View file

@ -2,13 +2,13 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib::StaticType;
use glib::Type;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::FromValueOptional;
use glib::value::SetValue;
use glib::value::Value;
use glib::StaticType;
use glib::Type;
use gobject_sys;
use gst_pbutils_sys;
@ -62,4 +62,3 @@ impl SetValue for DiscovererSerializeFlags {
gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
}
}

View file

@ -2,45 +2,54 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use EncodingTarget;
use glib::GString;
use glib::translate::*;
use glib::GString;
use gst_pbutils_sys;
use std::mem;
use EncodingTarget;
pub fn encoding_list_all_targets(categoryname: Option<&str>) -> Vec<EncodingTarget> {
assert_initialized_main_thread!();
unsafe {
FromGlibPtrContainer::from_glib_full(gst_pbutils_sys::gst_encoding_list_all_targets(categoryname.to_glib_none().0))
FromGlibPtrContainer::from_glib_full(gst_pbutils_sys::gst_encoding_list_all_targets(
categoryname.to_glib_none().0,
))
}
}
pub fn encoding_list_available_categories() -> Vec<GString> {
assert_initialized_main_thread!();
unsafe {
FromGlibPtrContainer::from_glib_full(gst_pbutils_sys::gst_encoding_list_available_categories())
FromGlibPtrContainer::from_glib_full(
gst_pbutils_sys::gst_encoding_list_available_categories(),
)
}
}
pub fn pb_utils_get_element_description(factory_name: &str) -> Option<GString> {
assert_initialized_main_thread!();
unsafe {
from_glib_full(gst_pbutils_sys::gst_pb_utils_get_element_description(factory_name.to_glib_none().0))
from_glib_full(gst_pbutils_sys::gst_pb_utils_get_element_description(
factory_name.to_glib_none().0,
))
}
}
pub fn pb_utils_get_sink_description(protocol: &str) -> Option<GString> {
assert_initialized_main_thread!();
unsafe {
from_glib_full(gst_pbutils_sys::gst_pb_utils_get_sink_description(protocol.to_glib_none().0))
from_glib_full(gst_pbutils_sys::gst_pb_utils_get_sink_description(
protocol.to_glib_none().0,
))
}
}
pub fn pb_utils_get_source_description(protocol: &str) -> Option<GString> {
assert_initialized_main_thread!();
unsafe {
from_glib_full(gst_pbutils_sys::gst_pb_utils_get_source_description(protocol.to_glib_none().0))
from_glib_full(gst_pbutils_sys::gst_pb_utils_get_source_description(
protocol.to_glib_none().0,
))
}
}
@ -58,7 +67,5 @@ pub fn plugins_base_version() -> (u32, u32, u32, u32) {
pub fn plugins_base_version_string() -> Option<GString> {
assert_initialized_main_thread!();
unsafe {
from_glib_full(gst_pbutils_sys::gst_plugins_base_version_string())
}
unsafe { from_glib_full(gst_pbutils_sys::gst_plugins_base_version_string()) }
}

View file

@ -15,8 +15,10 @@ mod discoverer_info;
pub use self::discoverer_info::{DiscovererInfo, DiscovererInfoClass};
mod discoverer_stream_info;
pub use self::discoverer_stream_info::{DiscovererStreamInfo, DiscovererStreamInfoClass, NONE_DISCOVERER_STREAM_INFO};
pub use self::discoverer_stream_info::DiscovererStreamInfoExt;
pub use self::discoverer_stream_info::{
DiscovererStreamInfo, DiscovererStreamInfoClass, NONE_DISCOVERER_STREAM_INFO,
};
mod discoverer_subtitle_info;
pub use self::discoverer_subtitle_info::{DiscovererSubtitleInfo, DiscovererSubtitleInfoClass};
@ -28,11 +30,13 @@ mod encoding_audio_profile;
pub use self::encoding_audio_profile::{EncodingAudioProfile, EncodingAudioProfileClass};
mod encoding_container_profile;
pub use self::encoding_container_profile::{EncodingContainerProfile, EncodingContainerProfileClass};
pub use self::encoding_container_profile::{
EncodingContainerProfile, EncodingContainerProfileClass,
};
mod encoding_profile;
pub use self::encoding_profile::{EncodingProfile, EncodingProfileClass, NONE_ENCODING_PROFILE};
pub use self::encoding_profile::EncodingProfileExt;
pub use self::encoding_profile::{EncodingProfile, EncodingProfileClass, NONE_ENCODING_PROFILE};
mod encoding_target;
pub use self::encoding_target::{EncodingTarget, EncodingTargetClass};

View file

@ -43,7 +43,6 @@ pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue
#[allow(clippy::too_many_arguments)]
#[allow(clippy::match_same_arms)]
#[allow(clippy::type_complexity)]
#[rustfmt::skip]
mod auto;
pub use auto::functions::*;
pub use auto::*;

View file

@ -2,20 +2,19 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib::Quark;
use glib::StaticType;
use glib::Type;
use glib::error::ErrorDomain;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::FromValueOptional;
use glib::value::SetValue;
use glib::value::Value;
use glib::Quark;
use glib::StaticType;
use glib::Type;
use gobject_sys;
use gst_player_sys;
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum PlayerColorBalanceType {
Hue,
Brightness,
@ -32,10 +31,14 @@ impl ToGlib for PlayerColorBalanceType {
fn to_glib(&self) -> gst_player_sys::GstPlayerColorBalanceType {
match *self {
PlayerColorBalanceType::Hue => gst_player_sys::GST_PLAYER_COLOR_BALANCE_HUE,
PlayerColorBalanceType::Brightness => gst_player_sys::GST_PLAYER_COLOR_BALANCE_BRIGHTNESS,
PlayerColorBalanceType::Saturation => gst_player_sys::GST_PLAYER_COLOR_BALANCE_SATURATION,
PlayerColorBalanceType::Brightness => {
gst_player_sys::GST_PLAYER_COLOR_BALANCE_BRIGHTNESS
}
PlayerColorBalanceType::Saturation => {
gst_player_sys::GST_PLAYER_COLOR_BALANCE_SATURATION
}
PlayerColorBalanceType::Contrast => gst_player_sys::GST_PLAYER_COLOR_BALANCE_CONTRAST,
PlayerColorBalanceType::__Unknown(value) => value
PlayerColorBalanceType::__Unknown(value) => value,
}
}
}
@ -78,8 +81,7 @@ impl SetValue for PlayerColorBalanceType {
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum PlayerError {
Failed,
#[doc(hidden)]
@ -93,7 +95,7 @@ impl ToGlib for PlayerError {
fn to_glib(&self) -> gst_player_sys::GstPlayerError {
match *self {
PlayerError::Failed => gst_player_sys::GST_PLAYER_ERROR_FAILED,
PlayerError::__Unknown(value) => value
PlayerError::__Unknown(value) => value,
}
}
}
@ -152,8 +154,7 @@ impl SetValue for PlayerError {
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum PlayerSnapshotFormat {
RawNative,
RawXrgb,
@ -175,7 +176,7 @@ impl ToGlib for PlayerSnapshotFormat {
PlayerSnapshotFormat::RawBgrx => gst_player_sys::GST_PLAYER_THUMBNAIL_RAW_BGRx,
PlayerSnapshotFormat::Jpg => gst_player_sys::GST_PLAYER_THUMBNAIL_JPG,
PlayerSnapshotFormat::Png => gst_player_sys::GST_PLAYER_THUMBNAIL_PNG,
PlayerSnapshotFormat::__Unknown(value) => value
PlayerSnapshotFormat::__Unknown(value) => value,
}
}
}
@ -195,8 +196,7 @@ impl FromGlib<gst_player_sys::GstPlayerSnapshotFormat> for PlayerSnapshotFormat
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum PlayerState {
Stopped,
Buffering,
@ -216,7 +216,7 @@ impl ToGlib for PlayerState {
PlayerState::Buffering => gst_player_sys::GST_PLAYER_STATE_BUFFERING,
PlayerState::Paused => gst_player_sys::GST_PLAYER_STATE_PAUSED,
PlayerState::Playing => gst_player_sys::GST_PLAYER_STATE_PLAYING,
PlayerState::__Unknown(value) => value
PlayerState::__Unknown(value) => value,
}
}
}
@ -258,4 +258,3 @@ impl SetValue for PlayerState {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}

View file

@ -9,18 +9,22 @@ mod player_audio_info;
pub use self::player_audio_info::{PlayerAudioInfo, PlayerAudioInfoClass};
mod player_gmain_context_signal_dispatcher;
pub use self::player_gmain_context_signal_dispatcher::{PlayerGMainContextSignalDispatcher, PlayerGMainContextSignalDispatcherClass};
pub use self::player_gmain_context_signal_dispatcher::{
PlayerGMainContextSignalDispatcher, PlayerGMainContextSignalDispatcherClass,
};
mod player_media_info;
pub use self::player_media_info::{PlayerMediaInfo, PlayerMediaInfoClass};
mod player_signal_dispatcher;
pub use self::player_signal_dispatcher::{PlayerSignalDispatcher, NONE_PLAYER_SIGNAL_DISPATCHER};
pub use self::player_signal_dispatcher::PlayerSignalDispatcherExt;
pub use self::player_signal_dispatcher::{PlayerSignalDispatcher, NONE_PLAYER_SIGNAL_DISPATCHER};
mod player_stream_info;
pub use self::player_stream_info::{PlayerStreamInfo, PlayerStreamInfoClass, NONE_PLAYER_STREAM_INFO};
pub use self::player_stream_info::PlayerStreamInfoExt;
pub use self::player_stream_info::{
PlayerStreamInfo, PlayerStreamInfoClass, NONE_PLAYER_STREAM_INFO,
};
mod player_subtitle_info;
pub use self::player_subtitle_info::{PlayerSubtitleInfo, PlayerSubtitleInfoClass};
@ -29,11 +33,13 @@ mod player_video_info;
pub use self::player_video_info::{PlayerVideoInfo, PlayerVideoInfoClass};
mod player_video_overlay_video_renderer;
pub use self::player_video_overlay_video_renderer::{PlayerVideoOverlayVideoRenderer, PlayerVideoOverlayVideoRendererClass};
pub use self::player_video_overlay_video_renderer::{
PlayerVideoOverlayVideoRenderer, PlayerVideoOverlayVideoRendererClass,
};
mod player_video_renderer;
pub use self::player_video_renderer::{PlayerVideoRenderer, NONE_PLAYER_VIDEO_RENDERER};
pub use self::player_video_renderer::PlayerVideoRendererExt;
pub use self::player_video_renderer::{PlayerVideoRenderer, NONE_PLAYER_VIDEO_RENDERER};
mod player_visualization;
pub use self::player_visualization::PlayerVisualization;

File diff suppressed because it is too large Load diff

View file

@ -2,10 +2,10 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use PlayerStreamInfo;
use glib::GString;
use glib::translate::*;
use glib::GString;
use gst_player_sys;
use PlayerStreamInfo;
glib_wrapper! {
pub struct PlayerAudioInfo(Object<gst_player_sys::GstPlayerAudioInfo, gst_player_sys::GstPlayerAudioInfoClass, PlayerAudioInfoClass>) @extends PlayerStreamInfo;
@ -17,33 +17,27 @@ glib_wrapper! {
impl PlayerAudioInfo {
pub fn get_bitrate(&self) -> i32 {
unsafe {
gst_player_sys::gst_player_audio_info_get_bitrate(self.to_glib_none().0)
}
unsafe { gst_player_sys::gst_player_audio_info_get_bitrate(self.to_glib_none().0) }
}
pub fn get_channels(&self) -> i32 {
unsafe {
gst_player_sys::gst_player_audio_info_get_channels(self.to_glib_none().0)
}
unsafe { gst_player_sys::gst_player_audio_info_get_channels(self.to_glib_none().0) }
}
pub fn get_language(&self) -> Option<GString> {
unsafe {
from_glib_none(gst_player_sys::gst_player_audio_info_get_language(self.to_glib_none().0))
from_glib_none(gst_player_sys::gst_player_audio_info_get_language(
self.to_glib_none().0,
))
}
}
pub fn get_max_bitrate(&self) -> i32 {
unsafe {
gst_player_sys::gst_player_audio_info_get_max_bitrate(self.to_glib_none().0)
}
unsafe { gst_player_sys::gst_player_audio_info_get_max_bitrate(self.to_glib_none().0) }
}
pub fn get_sample_rate(&self) -> i32 {
unsafe {
gst_player_sys::gst_player_audio_info_get_sample_rate(self.to_glib_none().0)
}
unsafe { gst_player_sys::gst_player_audio_info_get_sample_rate(self.to_glib_none().0) }
}
}

View file

@ -2,14 +2,14 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use PlayerSignalDispatcher;
use glib;
use glib::StaticType;
use glib::Value;
use glib::object::ObjectType as ObjectType_;
use glib::translate::*;
use glib::StaticType;
use glib::Value;
use gobject_sys;
use gst_player_sys;
use PlayerSignalDispatcher;
glib_wrapper! {
pub struct PlayerGMainContextSignalDispatcher(Object<gst_player_sys::GstPlayerGMainContextSignalDispatcher, gst_player_sys::GstPlayerGMainContextSignalDispatcherClass, PlayerGMainContextSignalDispatcherClass>) @implements PlayerSignalDispatcher;
@ -23,7 +23,11 @@ impl PlayerGMainContextSignalDispatcher {
pub fn get_property_application_context(&self) -> Option<glib::MainContext> {
unsafe {
let mut value = Value::from_type(<glib::MainContext as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"application-context\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"application-context\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get()
}
}

View file

@ -2,14 +2,14 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib::translate::*;
use glib::GString;
use gst;
use gst_player_sys;
use PlayerAudioInfo;
use PlayerStreamInfo;
use PlayerSubtitleInfo;
use PlayerVideoInfo;
use glib::GString;
use glib::translate::*;
use gst;
use gst_player_sys;
glib_wrapper! {
pub struct PlayerMediaInfo(Object<gst_player_sys::GstPlayerMediaInfo, gst_player_sys::GstPlayerMediaInfoClass, PlayerMediaInfoClass>);
@ -22,25 +22,33 @@ glib_wrapper! {
impl PlayerMediaInfo {
pub fn get_audio_streams(&self) -> Vec<PlayerAudioInfo> {
unsafe {
FromGlibPtrContainer::from_glib_none(gst_player_sys::gst_player_media_info_get_audio_streams(self.to_glib_none().0))
FromGlibPtrContainer::from_glib_none(
gst_player_sys::gst_player_media_info_get_audio_streams(self.to_glib_none().0),
)
}
}
pub fn get_container_format(&self) -> Option<GString> {
unsafe {
from_glib_none(gst_player_sys::gst_player_media_info_get_container_format(self.to_glib_none().0))
from_glib_none(gst_player_sys::gst_player_media_info_get_container_format(
self.to_glib_none().0,
))
}
}
pub fn get_duration(&self) -> gst::ClockTime {
unsafe {
from_glib(gst_player_sys::gst_player_media_info_get_duration(self.to_glib_none().0))
from_glib(gst_player_sys::gst_player_media_info_get_duration(
self.to_glib_none().0,
))
}
}
pub fn get_image_sample(&self) -> Option<gst::Sample> {
unsafe {
from_glib_none(gst_player_sys::gst_player_media_info_get_image_sample(self.to_glib_none().0))
from_glib_none(gst_player_sys::gst_player_media_info_get_image_sample(
self.to_glib_none().0,
))
}
}
@ -58,7 +66,9 @@ impl PlayerMediaInfo {
pub fn get_number_of_subtitle_streams(&self) -> u32 {
unsafe {
gst_player_sys::gst_player_media_info_get_number_of_subtitle_streams(self.to_glib_none().0)
gst_player_sys::gst_player_media_info_get_number_of_subtitle_streams(
self.to_glib_none().0,
)
}
}
@ -70,49 +80,65 @@ impl PlayerMediaInfo {
pub fn get_stream_list(&self) -> Vec<PlayerStreamInfo> {
unsafe {
FromGlibPtrContainer::from_glib_none(gst_player_sys::gst_player_media_info_get_stream_list(self.to_glib_none().0))
FromGlibPtrContainer::from_glib_none(
gst_player_sys::gst_player_media_info_get_stream_list(self.to_glib_none().0),
)
}
}
pub fn get_subtitle_streams(&self) -> Vec<PlayerSubtitleInfo> {
unsafe {
FromGlibPtrContainer::from_glib_none(gst_player_sys::gst_player_media_info_get_subtitle_streams(self.to_glib_none().0))
FromGlibPtrContainer::from_glib_none(
gst_player_sys::gst_player_media_info_get_subtitle_streams(self.to_glib_none().0),
)
}
}
pub fn get_tags(&self) -> Option<gst::TagList> {
unsafe {
from_glib_none(gst_player_sys::gst_player_media_info_get_tags(self.to_glib_none().0))
from_glib_none(gst_player_sys::gst_player_media_info_get_tags(
self.to_glib_none().0,
))
}
}
pub fn get_title(&self) -> Option<GString> {
unsafe {
from_glib_none(gst_player_sys::gst_player_media_info_get_title(self.to_glib_none().0))
from_glib_none(gst_player_sys::gst_player_media_info_get_title(
self.to_glib_none().0,
))
}
}
pub fn get_uri(&self) -> GString {
unsafe {
from_glib_none(gst_player_sys::gst_player_media_info_get_uri(self.to_glib_none().0))
from_glib_none(gst_player_sys::gst_player_media_info_get_uri(
self.to_glib_none().0,
))
}
}
pub fn get_video_streams(&self) -> Vec<PlayerVideoInfo> {
unsafe {
FromGlibPtrContainer::from_glib_none(gst_player_sys::gst_player_media_info_get_video_streams(self.to_glib_none().0))
FromGlibPtrContainer::from_glib_none(
gst_player_sys::gst_player_media_info_get_video_streams(self.to_glib_none().0),
)
}
}
pub fn is_live(&self) -> bool {
unsafe {
from_glib(gst_player_sys::gst_player_media_info_is_live(self.to_glib_none().0))
from_glib(gst_player_sys::gst_player_media_info_is_live(
self.to_glib_none().0,
))
}
}
pub fn is_seekable(&self) -> bool {
unsafe {
from_glib(gst_player_sys::gst_player_media_info_is_seekable(self.to_glib_none().0))
from_glib(gst_player_sys::gst_player_media_info_is_seekable(
self.to_glib_none().0,
))
}
}
}

View file

@ -2,9 +2,9 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib::GString;
use glib::object::IsA;
use glib::translate::*;
use glib::GString;
use gst;
use gst_player_sys;
@ -36,31 +36,41 @@ pub trait PlayerStreamInfoExt: 'static {
impl<O: IsA<PlayerStreamInfo>> PlayerStreamInfoExt for O {
fn get_caps(&self) -> Option<gst::Caps> {
unsafe {
from_glib_none(gst_player_sys::gst_player_stream_info_get_caps(const_override(self.as_ref().to_glib_none().0)))
from_glib_none(gst_player_sys::gst_player_stream_info_get_caps(
const_override(self.as_ref().to_glib_none().0),
))
}
}
fn get_codec(&self) -> Option<GString> {
unsafe {
from_glib_none(gst_player_sys::gst_player_stream_info_get_codec(const_override(self.as_ref().to_glib_none().0)))
from_glib_none(gst_player_sys::gst_player_stream_info_get_codec(
const_override(self.as_ref().to_glib_none().0),
))
}
}
fn get_index(&self) -> i32 {
unsafe {
gst_player_sys::gst_player_stream_info_get_index(const_override(self.as_ref().to_glib_none().0))
gst_player_sys::gst_player_stream_info_get_index(const_override(
self.as_ref().to_glib_none().0,
))
}
}
fn get_stream_type(&self) -> GString {
unsafe {
from_glib_none(gst_player_sys::gst_player_stream_info_get_stream_type(const_override(self.as_ref().to_glib_none().0)))
from_glib_none(gst_player_sys::gst_player_stream_info_get_stream_type(
const_override(self.as_ref().to_glib_none().0),
))
}
}
fn get_tags(&self) -> Option<gst::TagList> {
unsafe {
from_glib_none(gst_player_sys::gst_player_stream_info_get_tags(const_override(self.as_ref().to_glib_none().0)))
from_glib_none(gst_player_sys::gst_player_stream_info_get_tags(
const_override(self.as_ref().to_glib_none().0),
))
}
}
}

View file

@ -2,10 +2,10 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use PlayerStreamInfo;
use glib::GString;
use glib::translate::*;
use glib::GString;
use gst_player_sys;
use PlayerStreamInfo;
glib_wrapper! {
pub struct PlayerSubtitleInfo(Object<gst_player_sys::GstPlayerSubtitleInfo, gst_player_sys::GstPlayerSubtitleInfoClass, PlayerSubtitleInfoClass>) @extends PlayerStreamInfo;
@ -18,7 +18,9 @@ glib_wrapper! {
impl PlayerSubtitleInfo {
pub fn get_language(&self) -> Option<GString> {
unsafe {
from_glib_none(gst_player_sys::gst_player_subtitle_info_get_language(self.to_glib_none().0))
from_glib_none(gst_player_sys::gst_player_subtitle_info_get_language(
self.to_glib_none().0,
))
}
}
}

View file

@ -2,9 +2,9 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use PlayerStreamInfo;
use glib::translate::*;
use gst_player_sys;
use PlayerStreamInfo;
glib_wrapper! {
pub struct PlayerVideoInfo(Object<gst_player_sys::GstPlayerVideoInfo, gst_player_sys::GstPlayerVideoInfoClass, PlayerVideoInfoClass>) @extends PlayerStreamInfo;
@ -16,27 +16,19 @@ glib_wrapper! {
impl PlayerVideoInfo {
pub fn get_bitrate(&self) -> i32 {
unsafe {
gst_player_sys::gst_player_video_info_get_bitrate(self.to_glib_none().0)
}
unsafe { gst_player_sys::gst_player_video_info_get_bitrate(self.to_glib_none().0) }
}
pub fn get_height(&self) -> i32 {
unsafe {
gst_player_sys::gst_player_video_info_get_height(self.to_glib_none().0)
}
unsafe { gst_player_sys::gst_player_video_info_get_height(self.to_glib_none().0) }
}
pub fn get_max_bitrate(&self) -> i32 {
unsafe {
gst_player_sys::gst_player_video_info_get_max_bitrate(self.to_glib_none().0)
}
unsafe { gst_player_sys::gst_player_video_info_get_max_bitrate(self.to_glib_none().0) }
}
pub fn get_width(&self) -> i32 {
unsafe {
gst_player_sys::gst_player_video_info_get_width(self.to_glib_none().0)
}
unsafe { gst_player_sys::gst_player_video_info_get_width(self.to_glib_none().0) }
}
}

View file

@ -2,13 +2,12 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use PlayerVideoRenderer;
use glib::object::ObjectType as ObjectType_;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::Value;
use glib::object::ObjectType as ObjectType_;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::translate::*;
use glib_sys;
use gobject_sys;
use gst;
@ -16,6 +15,7 @@ use gst_player_sys;
use std::boxed::Box as Box_;
use std::mem;
use std::mem::transmute;
use PlayerVideoRenderer;
glib_wrapper! {
pub struct PlayerVideoOverlayVideoRenderer(Object<gst_player_sys::GstPlayerVideoOverlayVideoRenderer, gst_player_sys::GstPlayerVideoOverlayVideoRendererClass, PlayerVideoOverlayVideoRendererClass>) @implements PlayerVideoRenderer;
@ -38,7 +38,13 @@ impl PlayerVideoOverlayVideoRenderer {
let mut y = mem::uninitialized();
let mut width = mem::uninitialized();
let mut height = mem::uninitialized();
gst_player_sys::gst_player_video_overlay_video_renderer_get_render_rectangle(self.to_glib_none().0, &mut x, &mut y, &mut width, &mut height);
gst_player_sys::gst_player_video_overlay_video_renderer_get_render_rectangle(
self.to_glib_none().0,
&mut x,
&mut y,
&mut width,
&mut height,
);
(x, y, width, height)
}
}
@ -49,7 +55,13 @@ impl PlayerVideoOverlayVideoRenderer {
pub fn set_render_rectangle(&self, x: i32, y: i32, width: i32, height: i32) {
unsafe {
gst_player_sys::gst_player_video_overlay_video_renderer_set_render_rectangle(self.to_glib_none().0, x, y, width, height);
gst_player_sys::gst_player_video_overlay_video_renderer_set_render_rectangle(
self.to_glib_none().0,
x,
y,
width,
height,
);
}
}
@ -60,14 +72,22 @@ impl PlayerVideoOverlayVideoRenderer {
pub fn get_property_video_sink(&self) -> Option<gst::Element> {
unsafe {
let mut value = Value::from_type(<gst::Element as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"video-sink\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_sys::g_object_get_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"video-sink\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get()
}
}
pub fn set_property_video_sink(&self, video_sink: Option<&gst::Element>) {
unsafe {
gobject_sys::g_object_set_property(self.as_ptr() as *mut gobject_sys::GObject, b"video-sink\0".as_ptr() as *const _, Value::from(video_sink).to_glib_none().0);
gobject_sys::g_object_set_property(
self.as_ptr() as *mut gobject_sys::GObject,
b"video-sink\0".as_ptr() as *const _,
Value::from(video_sink).to_glib_none().0,
);
}
}
@ -79,27 +99,57 @@ impl PlayerVideoOverlayVideoRenderer {
// unsafe { TODO: call gst_player_sys:gst_player_video_overlay_video_renderer_new_with_sink() }
//}
pub fn connect_property_video_sink_notify<F: Fn(&PlayerVideoOverlayVideoRenderer) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_video_sink_trampoline<F: Fn(&PlayerVideoOverlayVideoRenderer) + Send + Sync + 'static>(this: *mut gst_player_sys::GstPlayerVideoOverlayVideoRenderer, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_video_sink_notify<
F: Fn(&PlayerVideoOverlayVideoRenderer) + Send + Sync + 'static,
>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_video_sink_trampoline<
F: Fn(&PlayerVideoOverlayVideoRenderer) + Send + Sync + 'static,
>(
this: *mut gst_player_sys::GstPlayerVideoOverlayVideoRenderer,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::video-sink\0".as_ptr() as *const _,
Some(transmute(notify_video_sink_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::video-sink\0".as_ptr() as *const _,
Some(transmute(notify_video_sink_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
pub fn connect_property_window_handle_notify<F: Fn(&PlayerVideoOverlayVideoRenderer) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_window_handle_trampoline<F: Fn(&PlayerVideoOverlayVideoRenderer) + Send + Sync + 'static>(this: *mut gst_player_sys::GstPlayerVideoOverlayVideoRenderer, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer) {
pub fn connect_property_window_handle_notify<
F: Fn(&PlayerVideoOverlayVideoRenderer) + Send + Sync + 'static,
>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_window_handle_trampoline<
F: Fn(&PlayerVideoOverlayVideoRenderer) + Send + Sync + 'static,
>(
this: *mut gst_player_sys::GstPlayerVideoOverlayVideoRenderer,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"notify::window-handle\0".as_ptr() as *const _,
Some(transmute(notify_window_handle_trampoline::<F> as usize)), Box_::into_raw(f))
connect_raw(
self.as_ptr() as *mut _,
b"notify::window-handle\0".as_ptr() as *const _,
Some(transmute(notify_window_handle_trampoline::<F> as usize)),
Box_::into_raw(f),
)
}
}
}

View file

@ -33,7 +33,6 @@ pub use glib::{Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue
#[allow(clippy::match_same_arms)]
#[allow(clippy::type_complexity)]
#[allow(clippy::cast_ptr_alignment)]
#[rustfmt::skip]
mod auto;
pub use auto::*;

View file

@ -2,18 +2,17 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib::StaticType;
use glib::Type;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::FromValueOptional;
use glib::value::SetValue;
use glib::value::Value;
use glib::StaticType;
use glib::Type;
use gobject_sys;
use gst_rtsp_server_sys;
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum RTSPAddressPoolResult {
Ok,
Einval,
@ -32,10 +31,12 @@ impl ToGlib for RTSPAddressPoolResult {
match *self {
RTSPAddressPoolResult::Ok => gst_rtsp_server_sys::GST_RTSP_ADDRESS_POOL_OK,
RTSPAddressPoolResult::Einval => gst_rtsp_server_sys::GST_RTSP_ADDRESS_POOL_EINVAL,
RTSPAddressPoolResult::Ereserved => gst_rtsp_server_sys::GST_RTSP_ADDRESS_POOL_ERESERVED,
RTSPAddressPoolResult::Ereserved => {
gst_rtsp_server_sys::GST_RTSP_ADDRESS_POOL_ERESERVED
}
RTSPAddressPoolResult::Erange => gst_rtsp_server_sys::GST_RTSP_ADDRESS_POOL_ERANGE,
RTSPAddressPoolResult::Elast => gst_rtsp_server_sys::GST_RTSP_ADDRESS_POOL_ELAST,
RTSPAddressPoolResult::__Unknown(value) => value
RTSPAddressPoolResult::__Unknown(value) => value,
}
}
}
@ -55,8 +56,7 @@ impl FromGlib<gst_rtsp_server_sys::GstRTSPAddressPoolResult> for RTSPAddressPool
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum RTSPFilterResult {
Remove,
Keep,
@ -74,7 +74,7 @@ impl ToGlib for RTSPFilterResult {
RTSPFilterResult::Remove => gst_rtsp_server_sys::GST_RTSP_FILTER_REMOVE,
RTSPFilterResult::Keep => gst_rtsp_server_sys::GST_RTSP_FILTER_KEEP,
RTSPFilterResult::Ref => gst_rtsp_server_sys::GST_RTSP_FILTER_REF,
RTSPFilterResult::__Unknown(value) => value
RTSPFilterResult::__Unknown(value) => value,
}
}
}
@ -92,8 +92,7 @@ impl FromGlib<gst_rtsp_server_sys::GstRTSPFilterResult> for RTSPFilterResult {
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum RTSPMediaStatus {
Unprepared,
Unpreparing,
@ -117,7 +116,7 @@ impl ToGlib for RTSPMediaStatus {
RTSPMediaStatus::Prepared => gst_rtsp_server_sys::GST_RTSP_MEDIA_STATUS_PREPARED,
RTSPMediaStatus::Suspended => gst_rtsp_server_sys::GST_RTSP_MEDIA_STATUS_SUSPENDED,
RTSPMediaStatus::Error => gst_rtsp_server_sys::GST_RTSP_MEDIA_STATUS_ERROR,
RTSPMediaStatus::__Unknown(value) => value
RTSPMediaStatus::__Unknown(value) => value,
}
}
}
@ -138,8 +137,7 @@ impl FromGlib<gst_rtsp_server_sys::GstRTSPMediaStatus> for RTSPMediaStatus {
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum RTSPPublishClockMode {
None,
Clock,
@ -156,8 +154,10 @@ impl ToGlib for RTSPPublishClockMode {
match *self {
RTSPPublishClockMode::None => gst_rtsp_server_sys::GST_RTSP_PUBLISH_CLOCK_MODE_NONE,
RTSPPublishClockMode::Clock => gst_rtsp_server_sys::GST_RTSP_PUBLISH_CLOCK_MODE_CLOCK,
RTSPPublishClockMode::ClockAndOffset => gst_rtsp_server_sys::GST_RTSP_PUBLISH_CLOCK_MODE_CLOCK_AND_OFFSET,
RTSPPublishClockMode::__Unknown(value) => value
RTSPPublishClockMode::ClockAndOffset => {
gst_rtsp_server_sys::GST_RTSP_PUBLISH_CLOCK_MODE_CLOCK_AND_OFFSET
}
RTSPPublishClockMode::__Unknown(value) => value,
}
}
}
@ -199,8 +199,7 @@ impl SetValue for RTSPPublishClockMode {
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum RTSPSuspendMode {
None,
Pause,
@ -218,7 +217,7 @@ impl ToGlib for RTSPSuspendMode {
RTSPSuspendMode::None => gst_rtsp_server_sys::GST_RTSP_SUSPEND_MODE_NONE,
RTSPSuspendMode::Pause => gst_rtsp_server_sys::GST_RTSP_SUSPEND_MODE_PAUSE,
RTSPSuspendMode::Reset => gst_rtsp_server_sys::GST_RTSP_SUSPEND_MODE_RESET,
RTSPSuspendMode::__Unknown(value) => value
RTSPSuspendMode::__Unknown(value) => value,
}
}
}
@ -260,8 +259,7 @@ impl SetValue for RTSPSuspendMode {
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Clone, Copy)]
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
pub enum RTSPThreadType {
Client,
Media,
@ -277,7 +275,7 @@ impl ToGlib for RTSPThreadType {
match *self {
RTSPThreadType::Client => gst_rtsp_server_sys::GST_RTSP_THREAD_TYPE_CLIENT,
RTSPThreadType::Media => gst_rtsp_server_sys::GST_RTSP_THREAD_TYPE_MEDIA,
RTSPThreadType::__Unknown(value) => value
RTSPThreadType::__Unknown(value) => value,
}
}
}
@ -293,4 +291,3 @@ impl FromGlib<gst_rtsp_server_sys::GstRTSPThreadType> for RTSPThreadType {
}
}
}

Some files were not shown because too many files have changed in this diff Show more