From 96782e8a8ebc113501ba6862945e5b2e96d7cdef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 22 Nov 2020 12:12:36 +0200 Subject: [PATCH] ges: Regenerate --- gstreamer-editing-services/src/auto/alias.rs | 2 +- gstreamer-editing-services/src/auto/asset.rs | 72 +++--- .../src/auto/base_effect.rs | 19 +- gstreamer-editing-services/src/auto/clip.rs | 110 ++++----- .../src/auto/container.rs | 60 +++-- gstreamer-editing-services/src/auto/effect.rs | 32 ++- gstreamer-editing-services/src/auto/enums.rs | 46 ++-- .../src/auto/extractable.rs | 27 +-- gstreamer-editing-services/src/auto/flags.rs | 31 ++- gstreamer-editing-services/src/auto/group.rs | 87 ++++--- gstreamer-editing-services/src/auto/layer.rs | 100 ++++---- .../src/auto/pipeline.rs | 122 +++++----- .../src/auto/project.rs | 116 +++++---- .../src/auto/timeline.rs | 186 +++++++-------- .../src/auto/timeline_element.rs | 223 ++++++++---------- gstreamer-editing-services/src/auto/track.rs | 130 +++++----- .../src/auto/track_element.rs | 112 ++++----- .../src/auto/uri_clip.rs | 75 +++--- .../src/auto/uri_clip_asset.rs | 52 ++-- .../src/auto/uri_source_asset.rs | 25 +- .../src/auto/versions.txt | 4 +- 21 files changed, 747 insertions(+), 884 deletions(-) diff --git a/gstreamer-editing-services/src/auto/alias.rs b/gstreamer-editing-services/src/auto/alias.rs index 4cf744a7e..2281581fd 100644 --- a/gstreamer-editing-services/src/auto/alias.rs +++ b/gstreamer-editing-services/src/auto/alias.rs @@ -3,6 +3,6 @@ // DO NOT EDIT #[allow(unused_imports)] -use auto::*; +use crate::auto::*; pub type FrameNumber = i64; diff --git a/gstreamer-editing-services/src/auto/asset.rs b/gstreamer-editing-services/src/auto/asset.rs index 1434479df..5b503790a 100644 --- a/gstreamer-editing-services/src/auto/asset.rs +++ b/gstreamer-editing-services/src/auto/asset.rs @@ -2,29 +2,22 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT -use ges_sys; -use gio; -use gio_sys; -use glib; +use crate::Extractable; 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_sys; -use gobject_sys; use std::boxed::Box as Box_; use std::mem::transmute; use std::pin::Pin; use std::ptr; -use Extractable; -glib_wrapper! { - pub struct Asset(Object); +glib::glib_wrapper! { + pub struct Asset(Object); match fn { - get_type => || ges_sys::ges_asset_get_type(), + get_type => || ffi::ges_asset_get_type(), } } @@ -32,7 +25,7 @@ impl Asset { pub fn needs_reload(extractable_type: glib::types::Type, id: Option<&str>) -> bool { assert_initialized_main_thread!(); unsafe { - from_glib(ges_sys::ges_asset_needs_reload( + from_glib(ffi::ges_asset_needs_reload( extractable_type.to_glib(), id.to_glib_none().0, )) @@ -46,11 +39,8 @@ impl Asset { 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, - ); + let ret = + ffi::ges_asset_request(extractable_type.to_glib(), id.to_glib_none().0, &mut error); if error.is_null() { Ok(from_glib_full(ret)) } else { @@ -73,12 +63,12 @@ impl Asset { unsafe extern "C" fn request_async_trampoline< Q: FnOnce(Result) + Send + 'static, >( - _source_object: *mut gobject_sys::GObject, - res: *mut gio_sys::GAsyncResult, - user_data: glib_sys::gpointer, + _source_object: *mut glib::gobject_ffi::GObject, + res: *mut gio::ffi::GAsyncResult, + user_data: glib::ffi::gpointer, ) { let mut error = ptr::null_mut(); - let ret = ges_sys::ges_asset_request_finish(res, &mut error); + let ret = ffi::ges_asset_request_finish(res, &mut error); let result = if error.is_null() { Ok(from_glib_full(ret)) } else { @@ -89,7 +79,7 @@ impl Asset { } let callback = request_async_trampoline::; unsafe { - ges_sys::ges_asset_request_async( + ffi::ges_asset_request_async( extractable_type.to_glib(), id.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, @@ -130,7 +120,7 @@ pub trait AssetExt: 'static { fn get_extractable_type(&self) -> glib::types::Type; - fn get_id(&self) -> Option; + fn get_id(&self) -> Option; fn get_proxy(&self) -> Option; @@ -152,7 +142,7 @@ impl> AssetExt for O { fn extract(&self) -> Result { unsafe { let mut error = ptr::null_mut(); - let ret = ges_sys::ges_asset_extract(self.as_ref().to_glib_none().0, &mut error); + let ret = ffi::ges_asset_extract(self.as_ref().to_glib_none().0, &mut error); if error.is_null() { Ok(from_glib_none(ret)) } else { @@ -162,28 +152,28 @@ impl> AssetExt for O { } fn get_error(&self) -> Option { - unsafe { from_glib_none(ges_sys::ges_asset_get_error(self.as_ref().to_glib_none().0)) } + unsafe { from_glib_none(ffi::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( + from_glib(ffi::ges_asset_get_extractable_type( self.as_ref().to_glib_none().0, )) } } - fn get_id(&self) -> Option { - unsafe { from_glib_none(ges_sys::ges_asset_get_id(self.as_ref().to_glib_none().0)) } + fn get_id(&self) -> Option { + unsafe { from_glib_none(ffi::ges_asset_get_id(self.as_ref().to_glib_none().0)) } } fn get_proxy(&self) -> Option { - unsafe { from_glib_none(ges_sys::ges_asset_get_proxy(self.as_ref().to_glib_none().0)) } + unsafe { from_glib_none(ffi::ges_asset_get_proxy(self.as_ref().to_glib_none().0)) } } fn get_proxy_target(&self) -> Option { unsafe { - from_glib_none(ges_sys::ges_asset_get_proxy_target( + from_glib_none(ffi::ges_asset_get_proxy_target( self.as_ref().to_glib_none().0, )) } @@ -191,7 +181,7 @@ impl> AssetExt for O { fn list_proxies(&self) -> Vec { unsafe { - FromGlibPtrContainer::from_glib_none(ges_sys::ges_asset_list_proxies( + FromGlibPtrContainer::from_glib_none(ffi::ges_asset_list_proxies( self.as_ref().to_glib_none().0, )) } @@ -199,8 +189,8 @@ impl> AssetExt for O { fn set_proxy>(&self, proxy: Option<&P>) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_asset_set_proxy( + glib::glib_result_from_gboolean!( + ffi::ges_asset_set_proxy( self.as_ref().to_glib_none().0, proxy.map(|p| p.as_ref()).to_glib_none().0 ), @@ -211,8 +201,8 @@ impl> AssetExt for O { fn unproxy>(&self, proxy: &P) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_asset_unproxy( + glib::glib_result_from_gboolean!( + ffi::ges_asset_unproxy( self.as_ref().to_glib_none().0, proxy.as_ref().to_glib_none().0 ), @@ -223,9 +213,9 @@ impl> AssetExt for O { fn connect_property_proxy_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_proxy_trampoline( - this: *mut ges_sys::GESAsset, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESAsset, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -250,9 +240,9 @@ impl> AssetExt for O { f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_proxy_target_trampoline( - this: *mut ges_sys::GESAsset, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESAsset, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { diff --git a/gstreamer-editing-services/src/auto/base_effect.rs b/gstreamer-editing-services/src/auto/base_effect.rs index 661bde824..9629febe1 100644 --- a/gstreamer-editing-services/src/auto/base_effect.rs +++ b/gstreamer-editing-services/src/auto/base_effect.rs @@ -2,18 +2,17 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT -use ges_sys; +use crate::Extractable; +use crate::TimelineElement; +use crate::TrackElement; use glib::object::IsA; use glib::translate::*; -use Extractable; -use TimelineElement; -use TrackElement; -glib_wrapper! { - pub struct BaseEffect(Object) @extends TrackElement, TimelineElement, @implements Extractable; +glib::glib_wrapper! { + pub struct BaseEffect(Object) @extends TrackElement, TimelineElement, @implements Extractable; match fn { - get_type => || ges_sys::ges_base_effect_get_type(), + get_type => || ffi::ges_base_effect_get_type(), } } @@ -38,7 +37,7 @@ impl> BaseEffectExt for O { #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn is_time_effect(&self) -> bool { unsafe { - from_glib(ges_sys::ges_base_effect_is_time_effect( + from_glib(ffi::ges_base_effect_is_time_effect( self.as_ref().to_glib_none().0, )) } @@ -48,7 +47,7 @@ impl> BaseEffectExt for O { #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn register_time_property(&self, child_property_name: &str) -> bool { unsafe { - from_glib(ges_sys::ges_base_effect_register_time_property( + from_glib(ffi::ges_base_effect_register_time_property( self.as_ref().to_glib_none().0, child_property_name.to_glib_none().0, )) @@ -58,6 +57,6 @@ impl> BaseEffectExt for O { //#[cfg(any(feature = "v1_18", feature = "dox"))] //#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] //fn set_time_translation_funcs(&self, source_to_sink_func: /*Unimplemented*/Fn(&BaseEffect, gst::ClockTime, /*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 3, id: 11 }) -> gst::ClockTime, sink_to_source_func: /*Unimplemented*/Fn(&BaseEffect, gst::ClockTime, /*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 3, id: 11 }) -> gst::ClockTime, user_data: /*Unimplemented*/Option) -> bool { - // unsafe { TODO: call ges_sys:ges_base_effect_set_time_translation_funcs() } + // unsafe { TODO: call ffi:ges_base_effect_set_time_translation_funcs() } //} } diff --git a/gstreamer-editing-services/src/auto/clip.rs b/gstreamer-editing-services/src/auto/clip.rs index e276045b4..9f7403819 100644 --- a/gstreamer-editing-services/src/auto/clip.rs +++ b/gstreamer-editing-services/src/auto/clip.rs @@ -2,40 +2,34 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT -use ges_sys; -use glib; +use crate::Asset; +use crate::BaseEffect; +use crate::Container; +use crate::Extractable; +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +use crate::FrameNumber; +use crate::Layer; +use crate::TimelineElement; +use crate::Track; +use crate::TrackElement; +use crate::TrackType; use glib::object::Cast; use glib::object::IsA; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; -use glib_sys; -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] -use gst; use std::boxed::Box as Box_; use std::mem::transmute; #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] use std::ptr; -use Asset; -use BaseEffect; -use Container; -use Extractable; -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] -use FrameNumber; -use Layer; -use TimelineElement; -use Track; -use TrackElement; -use TrackType; -glib_wrapper! { - pub struct Clip(Object) @extends Container, TimelineElement, @implements Extractable; +glib::glib_wrapper! { + pub struct Clip(Object) @extends Container, TimelineElement, @implements Extractable; match fn { - get_type => || ges_sys::ges_clip_get_type(), + get_type => || ffi::ges_clip_get_type(), } } @@ -163,11 +157,11 @@ pub trait ClipExt: 'static { impl> ClipExt for O { fn add_asset>(&self, asset: &P) -> Result { unsafe { - Option::<_>::from_glib_none(ges_sys::ges_clip_add_asset( + Option::<_>::from_glib_none(ffi::ges_clip_add_asset( self.as_ref().to_glib_none().0, asset.as_ref().to_glib_none().0, )) - .ok_or_else(|| glib_bool_error!("Failed to add asset")) + .ok_or_else(|| glib::glib_bool_error!("Failed to add asset")) } } @@ -180,7 +174,7 @@ impl> ClipExt for O { ) -> Result { unsafe { let mut error = ptr::null_mut(); - let ret = ges_sys::ges_clip_add_child_to_track( + let ret = ffi::ges_clip_add_child_to_track( self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0, track.as_ref().to_glib_none().0, @@ -203,7 +197,7 @@ impl> ClipExt for O { ) -> Result<(), glib::Error> { unsafe { let mut error = ptr::null_mut(); - let _ = ges_sys::ges_clip_add_top_effect( + let _ = ffi::ges_clip_add_top_effect( self.as_ref().to_glib_none().0, effect.as_ref().to_glib_none().0, index, @@ -223,7 +217,7 @@ impl> ClipExt for O { type_: glib::types::Type, ) -> Option { unsafe { - from_glib_full(ges_sys::ges_clip_find_track_element( + from_glib_full(ffi::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(), @@ -238,7 +232,7 @@ impl> ClipExt for O { type_: glib::types::Type, ) -> Vec { unsafe { - FromGlibPtrContainer::from_glib_full(ges_sys::ges_clip_find_track_elements( + FromGlibPtrContainer::from_glib_full(ffi::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(), @@ -251,7 +245,7 @@ impl> ClipExt for O { #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn get_duration_limit(&self) -> gst::ClockTime { unsafe { - from_glib(ges_sys::ges_clip_get_duration_limit( + from_glib(ffi::ges_clip_get_duration_limit( self.as_ref().to_glib_none().0, )) } @@ -266,7 +260,7 @@ impl> ClipExt for O { ) -> Result { unsafe { let mut error = ptr::null_mut(); - let ret = ges_sys::ges_clip_get_internal_time_from_timeline_time( + let ret = ffi::ges_clip_get_internal_time_from_timeline_time( self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0, timeline_time.to_glib(), @@ -281,12 +275,12 @@ impl> ClipExt for O { } fn get_layer(&self) -> Option { - unsafe { from_glib_full(ges_sys::ges_clip_get_layer(self.as_ref().to_glib_none().0)) } + unsafe { from_glib_full(ffi::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( + from_glib(ffi::ges_clip_get_supported_formats( self.as_ref().to_glib_none().0, )) } @@ -301,7 +295,7 @@ impl> ClipExt for O { ) -> Result { unsafe { let mut error = ptr::null_mut(); - let ret = ges_sys::ges_clip_get_timeline_time_from_internal_time( + let ret = ffi::ges_clip_get_timeline_time_from_internal_time( self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0, internal_time.to_glib(), @@ -323,7 +317,7 @@ impl> ClipExt for O { ) -> Result { unsafe { let mut error = ptr::null_mut(); - let ret = ges_sys::ges_clip_get_timeline_time_from_source_frame( + let ret = ffi::ges_clip_get_timeline_time_from_source_frame( self.as_ref().to_glib_none().0, frame_number, &mut error, @@ -338,7 +332,7 @@ impl> ClipExt for O { fn get_top_effect_index>(&self, effect: &P) -> i32 { unsafe { - ges_sys::ges_clip_get_top_effect_index( + ffi::ges_clip_get_top_effect_index( self.as_ref().to_glib_none().0, effect.as_ref().to_glib_none().0, ) @@ -347,7 +341,7 @@ impl> ClipExt for O { fn get_top_effect_position>(&self, effect: &P) -> i32 { unsafe { - ges_sys::ges_clip_get_top_effect_position( + ffi::ges_clip_get_top_effect_position( self.as_ref().to_glib_none().0, effect.as_ref().to_glib_none().0, ) @@ -356,7 +350,7 @@ impl> ClipExt for O { fn get_top_effects(&self) -> Vec { unsafe { - FromGlibPtrContainer::from_glib_full(ges_sys::ges_clip_get_top_effects( + FromGlibPtrContainer::from_glib_full(ffi::ges_clip_get_top_effects( self.as_ref().to_glib_none().0, )) } @@ -364,8 +358,8 @@ impl> ClipExt for O { fn move_to_layer>(&self, layer: &P) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_clip_move_to_layer( + glib::glib_result_from_gboolean!( + ffi::ges_clip_move_to_layer( self.as_ref().to_glib_none().0, layer.as_ref().to_glib_none().0 ), @@ -379,7 +373,7 @@ impl> ClipExt for O { fn move_to_layer_full>(&self, layer: &P) -> Result<(), glib::Error> { unsafe { let mut error = ptr::null_mut(); - let _ = ges_sys::ges_clip_move_to_layer_full( + let _ = ffi::ges_clip_move_to_layer_full( self.as_ref().to_glib_none().0, layer.as_ref().to_glib_none().0, &mut error, @@ -397,7 +391,7 @@ impl> ClipExt for O { fn remove_top_effect>(&self, effect: &P) -> Result<(), glib::Error> { unsafe { let mut error = ptr::null_mut(); - let _ = ges_sys::ges_clip_remove_top_effect( + let _ = ffi::ges_clip_remove_top_effect( self.as_ref().to_glib_none().0, effect.as_ref().to_glib_none().0, &mut error, @@ -412,7 +406,7 @@ impl> ClipExt for O { fn set_supported_formats(&self, supportedformats: TrackType) { unsafe { - ges_sys::ges_clip_set_supported_formats( + ffi::ges_clip_set_supported_formats( self.as_ref().to_glib_none().0, supportedformats.to_glib(), ); @@ -425,8 +419,8 @@ impl> ClipExt for O { newindex: u32, ) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_clip_set_top_effect_index( + glib::glib_result_from_gboolean!( + ffi::ges_clip_set_top_effect_index( self.as_ref().to_glib_none().0, effect.as_ref().to_glib_none().0, newindex @@ -445,7 +439,7 @@ impl> ClipExt for O { ) -> Result<(), glib::Error> { unsafe { let mut error = ptr::null_mut(); - let _ = ges_sys::ges_clip_set_top_effect_index_full( + let _ = ffi::ges_clip_set_top_effect_index_full( self.as_ref().to_glib_none().0, effect.as_ref().to_glib_none().0, newindex, @@ -465,8 +459,8 @@ impl> ClipExt for O { newpriority: u32, ) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_clip_set_top_effect_priority( + glib::glib_result_from_gboolean!( + ffi::ges_clip_set_top_effect_priority( self.as_ref().to_glib_none().0, effect.as_ref().to_glib_none().0, newpriority @@ -478,11 +472,11 @@ impl> ClipExt for O { fn split(&self, position: u64) -> Result { unsafe { - Option::<_>::from_glib_none(ges_sys::ges_clip_split( + Option::<_>::from_glib_none(ffi::ges_clip_split( self.as_ref().to_glib_none().0, position, )) - .ok_or_else(|| glib_bool_error!("Failed to split clip")) + .ok_or_else(|| glib::glib_bool_error!("Failed to split clip")) } } @@ -492,7 +486,7 @@ impl> ClipExt for O { unsafe { let mut error = ptr::null_mut(); let ret = - ges_sys::ges_clip_split_full(self.as_ref().to_glib_none().0, position, &mut error); + ffi::ges_clip_split_full(self.as_ref().to_glib_none().0, position, &mut error); if error.is_null() { Ok(from_glib_none(ret)) } else { @@ -508,9 +502,9 @@ impl> ClipExt for O { f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_duration_limit_trampoline( - this: *mut ges_sys::GESClip, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESClip, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -532,9 +526,9 @@ impl> ClipExt for O { fn connect_property_layer_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_layer_trampoline( - this: *mut ges_sys::GESClip, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESClip, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -559,9 +553,9 @@ impl> ClipExt for O { f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_supported_formats_trampoline( - this: *mut ges_sys::GESClip, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESClip, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { diff --git a/gstreamer-editing-services/src/auto/container.rs b/gstreamer-editing-services/src/auto/container.rs index f075d0328..b119aeae7 100644 --- a/gstreamer-editing-services/src/auto/container.rs +++ b/gstreamer-editing-services/src/auto/container.rs @@ -2,8 +2,11 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT -use ges_sys; -use glib; +use crate::Edge; +use crate::EditMode; +use crate::Extractable; +use crate::Layer; +use crate::TimelineElement; use glib::object::Cast; use glib::object::IsA; use glib::signal::connect_raw; @@ -11,28 +14,21 @@ 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; -glib_wrapper! { - pub struct Container(Object) @extends TimelineElement, @implements Extractable; +glib::glib_wrapper! { + pub struct Container(Object) @extends TimelineElement, @implements Extractable; match fn { - get_type => || ges_sys::ges_container_get_type(), + get_type => || ffi::ges_container_get_type(), } } impl Container { pub fn group(containers: &[Container]) -> Option { assert_initialized_main_thread!(); - unsafe { from_glib_none(ges_sys::ges_container_group(containers.to_glib_none().0)) } + unsafe { from_glib_none(ffi::ges_container_group(containers.to_glib_none().0)) } } } @@ -75,8 +71,8 @@ pub trait GESContainerExt: 'static { impl> GESContainerExt for O { fn add>(&self, child: &P) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_container_add( + glib::glib_result_from_gboolean!( + ffi::ges_container_add( self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0 ), @@ -94,8 +90,8 @@ impl> GESContainerExt for O { position: u64, ) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_container_edit( + glib::glib_result_from_gboolean!( + ffi::ges_container_edit( self.as_ref().to_glib_none().0, layers.to_glib_none().0, new_layer_priority, @@ -110,7 +106,7 @@ impl> GESContainerExt for O { fn get_children(&self, recursive: bool) -> Vec { unsafe { - FromGlibPtrContainer::from_glib_full(ges_sys::ges_container_get_children( + FromGlibPtrContainer::from_glib_full(ffi::ges_container_get_children( self.as_ref().to_glib_none().0, recursive.to_glib(), )) @@ -119,8 +115,8 @@ impl> GESContainerExt for O { fn remove>(&self, child: &P) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_container_remove( + glib::glib_result_from_gboolean!( + ffi::ges_container_remove( self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0 ), @@ -131,7 +127,7 @@ impl> GESContainerExt for O { fn ungroup(&self, recursive: bool) -> Vec { unsafe { - FromGlibPtrContainer::from_glib_full(ges_sys::ges_container_ungroup( + FromGlibPtrContainer::from_glib_full(ffi::ges_container_ungroup( self.as_ref().to_glib_full(), recursive.to_glib(), )) @@ -141,8 +137,8 @@ impl> GESContainerExt for O { fn get_property_height(&self) -> u32 { unsafe { let mut value = Value::from_type(::static_type()); - gobject_sys::g_object_get_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"height\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); @@ -158,9 +154,9 @@ impl> GESContainerExt for O { f: F, ) -> SignalHandlerId { unsafe extern "C" fn child_added_trampoline( - this: *mut ges_sys::GESContainer, - element: *mut ges_sys::GESTimelineElement, - f: glib_sys::gpointer, + this: *mut ffi::GESContainer, + element: *mut ffi::GESTimelineElement, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -188,9 +184,9 @@ impl> GESContainerExt for O { f: F, ) -> SignalHandlerId { unsafe extern "C" fn child_removed_trampoline( - this: *mut ges_sys::GESContainer, - element: *mut ges_sys::GESTimelineElement, - f: glib_sys::gpointer, + this: *mut ffi::GESContainer, + element: *mut ffi::GESTimelineElement, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -215,9 +211,9 @@ impl> GESContainerExt for O { fn connect_property_height_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_height_trampoline( - this: *mut ges_sys::GESContainer, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESContainer, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { diff --git a/gstreamer-editing-services/src/auto/effect.rs b/gstreamer-editing-services/src/auto/effect.rs index 168fbc833..b683755fe 100644 --- a/gstreamer-editing-services/src/auto/effect.rs +++ b/gstreamer-editing-services/src/auto/effect.rs @@ -2,24 +2,20 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT -use ges_sys; -use glib; +use crate::BaseEffect; +use crate::Extractable; +use crate::TimelineElement; +use crate::TrackElement; 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; -glib_wrapper! { - pub struct Effect(Object) @extends BaseEffect, TrackElement, TimelineElement, @implements Extractable; +glib::glib_wrapper! { + pub struct Effect(Object) @extends BaseEffect, TrackElement, TimelineElement, @implements Extractable; match fn { - get_type => || ges_sys::ges_effect_get_type(), + get_type => || ffi::ges_effect_get_type(), } } @@ -27,8 +23,8 @@ impl Effect { pub fn new(bin_description: &str) -> Result { assert_initialized_main_thread!(); unsafe { - Option::<_>::from_glib_none(ges_sys::ges_effect_new(bin_description.to_glib_none().0)) - .ok_or_else(|| glib_bool_error!("Failed to create effect from description")) + Option::<_>::from_glib_none(ffi::ges_effect_new(bin_description.to_glib_none().0)) + .ok_or_else(|| glib::glib_bool_error!("Failed to create effect from description")) } } } @@ -36,15 +32,15 @@ impl Effect { pub const NONE_EFFECT: Option<&Effect> = None; pub trait EffectExt: 'static { - fn get_property_bin_description(&self) -> Option; + fn get_property_bin_description(&self) -> Option; } impl> EffectExt for O { - fn get_property_bin_description(&self) -> Option { + fn get_property_bin_description(&self) -> Option { unsafe { - let mut value = Value::from_type(::static_type()); - gobject_sys::g_object_get_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + let mut value = Value::from_type(::static_type()); + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"bin-description\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); diff --git a/gstreamer-editing-services/src/auto/enums.rs b/gstreamer-editing-services/src/auto/enums.rs index cffb2fd03..a5bdded31 100644 --- a/gstreamer-editing-services/src/auto/enums.rs +++ b/gstreamer-editing-services/src/auto/enums.rs @@ -2,7 +2,6 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT -use ges_sys; use glib::translate::*; use glib::value::FromValue; use glib::value::FromValueOptional; @@ -10,7 +9,6 @@ use glib::value::SetValue; use glib::value::Value; use glib::StaticType; use glib::Type; -use gobject_sys; #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] @@ -24,21 +22,21 @@ pub enum Edge { #[doc(hidden)] impl ToGlib for Edge { - type GlibType = ges_sys::GESEdge; + type GlibType = ffi::GESEdge; - fn to_glib(&self) -> ges_sys::GESEdge { + fn to_glib(&self) -> ffi::GESEdge { match *self { - Edge::Start => ges_sys::GES_EDGE_START, - Edge::End => ges_sys::GES_EDGE_END, - Edge::None => ges_sys::GES_EDGE_NONE, + Edge::Start => ffi::GES_EDGE_START, + Edge::End => ffi::GES_EDGE_END, + Edge::None => ffi::GES_EDGE_NONE, Edge::__Unknown(value) => value, } } } #[doc(hidden)] -impl FromGlib for Edge { - fn from_glib(value: ges_sys::GESEdge) -> Self { +impl FromGlib for Edge { + fn from_glib(value: ffi::GESEdge) -> Self { skip_assert_initialized!(); match value { 0 => Edge::Start, @@ -51,7 +49,7 @@ impl FromGlib for Edge { impl StaticType for Edge { fn static_type() -> Type { - unsafe { from_glib(ges_sys::ges_edge_get_type()) } + unsafe { from_glib(ffi::ges_edge_get_type()) } } } @@ -63,13 +61,13 @@ impl<'a> FromValueOptional<'a> for Edge { impl<'a> FromValue<'a> for Edge { unsafe fn from_value(value: &Value) -> Self { - from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) + from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl SetValue for Edge { unsafe fn set_value(value: &mut Value, this: &Self) { - gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) } } @@ -87,23 +85,23 @@ pub enum EditMode { #[doc(hidden)] impl ToGlib for EditMode { - type GlibType = ges_sys::GESEditMode; + type GlibType = ffi::GESEditMode; - fn to_glib(&self) -> ges_sys::GESEditMode { + fn to_glib(&self) -> ffi::GESEditMode { match *self { - EditMode::Normal => ges_sys::GES_EDIT_MODE_NORMAL, - EditMode::Ripple => ges_sys::GES_EDIT_MODE_RIPPLE, - EditMode::Roll => ges_sys::GES_EDIT_MODE_ROLL, - EditMode::Trim => ges_sys::GES_EDIT_MODE_TRIM, - EditMode::Slide => ges_sys::GES_EDIT_MODE_SLIDE, + EditMode::Normal => ffi::GES_EDIT_MODE_NORMAL, + EditMode::Ripple => ffi::GES_EDIT_MODE_RIPPLE, + EditMode::Roll => ffi::GES_EDIT_MODE_ROLL, + EditMode::Trim => ffi::GES_EDIT_MODE_TRIM, + EditMode::Slide => ffi::GES_EDIT_MODE_SLIDE, EditMode::__Unknown(value) => value, } } } #[doc(hidden)] -impl FromGlib for EditMode { - fn from_glib(value: ges_sys::GESEditMode) -> Self { +impl FromGlib for EditMode { + fn from_glib(value: ffi::GESEditMode) -> Self { skip_assert_initialized!(); match value { 0 => EditMode::Normal, @@ -118,7 +116,7 @@ impl FromGlib for EditMode { impl StaticType for EditMode { fn static_type() -> Type { - unsafe { from_glib(ges_sys::ges_edit_mode_get_type()) } + unsafe { from_glib(ffi::ges_edit_mode_get_type()) } } } @@ -130,12 +128,12 @@ impl<'a> FromValueOptional<'a> for EditMode { impl<'a> FromValue<'a> for EditMode { unsafe fn from_value(value: &Value) -> Self { - from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) + from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl SetValue for EditMode { unsafe fn set_value(value: &mut Value, this: &Self) { - gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) } } diff --git a/gstreamer-editing-services/src/auto/extractable.rs b/gstreamer-editing-services/src/auto/extractable.rs index 154a4d29f..9138b2283 100644 --- a/gstreamer-editing-services/src/auto/extractable.rs +++ b/gstreamer-editing-services/src/auto/extractable.rs @@ -2,18 +2,15 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT -use ges_sys; -use glib; +use crate::Asset; use glib::object::IsA; use glib::translate::*; -use glib::GString; -use Asset; -glib_wrapper! { - pub struct Extractable(Interface); +glib::glib_wrapper! { + pub struct Extractable(Interface); match fn { - get_type => || ges_sys::ges_extractable_get_type(), + get_type => || ffi::ges_extractable_get_type(), } } @@ -22,7 +19,7 @@ pub const NONE_EXTRACTABLE: Option<&Extractable> = None; pub trait ExtractableExt: 'static { fn get_asset(&self) -> Option; - fn get_id(&self) -> Option; + fn get_id(&self) -> Option; fn set_asset>(&self, asset: &P) -> Result<(), glib::error::BoolError>; } @@ -30,24 +27,20 @@ pub trait ExtractableExt: 'static { impl> ExtractableExt for O { fn get_asset(&self) -> Option { unsafe { - from_glib_none(ges_sys::ges_extractable_get_asset( + from_glib_none(ffi::ges_extractable_get_asset( self.as_ref().to_glib_none().0, )) } } - fn get_id(&self) -> Option { - unsafe { - from_glib_full(ges_sys::ges_extractable_get_id( - self.as_ref().to_glib_none().0, - )) - } + fn get_id(&self) -> Option { + unsafe { from_glib_full(ffi::ges_extractable_get_id(self.as_ref().to_glib_none().0)) } } fn set_asset>(&self, asset: &P) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_extractable_set_asset( + glib::glib_result_from_gboolean!( + ffi::ges_extractable_set_asset( self.as_ref().to_glib_none().0, asset.as_ref().to_glib_none().0 ), diff --git a/gstreamer-editing-services/src/auto/flags.rs b/gstreamer-editing-services/src/auto/flags.rs index 6b3ec3e4d..e45f218e5 100644 --- a/gstreamer-editing-services/src/auto/flags.rs +++ b/gstreamer-editing-services/src/auto/flags.rs @@ -2,7 +2,7 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT -use ges_sys; +use bitflags::bitflags; use glib::translate::*; use glib::value::FromValue; use glib::value::FromValueOptional; @@ -10,7 +10,6 @@ use glib::value::SetValue; use glib::value::Value; use glib::StaticType; use glib::Type; -use gobject_sys; bitflags! { pub struct PipelineFlags: u32 { @@ -24,16 +23,16 @@ bitflags! { #[doc(hidden)] impl ToGlib for PipelineFlags { - type GlibType = ges_sys::GESPipelineFlags; + type GlibType = ffi::GESPipelineFlags; - fn to_glib(&self) -> ges_sys::GESPipelineFlags { + fn to_glib(&self) -> ffi::GESPipelineFlags { self.bits() } } #[doc(hidden)] -impl FromGlib for PipelineFlags { - fn from_glib(value: ges_sys::GESPipelineFlags) -> PipelineFlags { +impl FromGlib for PipelineFlags { + fn from_glib(value: ffi::GESPipelineFlags) -> PipelineFlags { skip_assert_initialized!(); PipelineFlags::from_bits_truncate(value) } @@ -41,7 +40,7 @@ impl FromGlib for PipelineFlags { impl StaticType for PipelineFlags { fn static_type() -> Type { - unsafe { from_glib(ges_sys::ges_pipeline_flags_get_type()) } + unsafe { from_glib(ffi::ges_pipeline_flags_get_type()) } } } @@ -53,13 +52,13 @@ impl<'a> FromValueOptional<'a> for PipelineFlags { impl<'a> FromValue<'a> for PipelineFlags { unsafe fn from_value(value: &Value) -> Self { - from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0)) + from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) } } impl SetValue for PipelineFlags { unsafe fn set_value(value: &mut Value, this: &Self) { - gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) } } @@ -75,16 +74,16 @@ bitflags! { #[doc(hidden)] impl ToGlib for TrackType { - type GlibType = ges_sys::GESTrackType; + type GlibType = ffi::GESTrackType; - fn to_glib(&self) -> ges_sys::GESTrackType { + fn to_glib(&self) -> ffi::GESTrackType { self.bits() } } #[doc(hidden)] -impl FromGlib for TrackType { - fn from_glib(value: ges_sys::GESTrackType) -> TrackType { +impl FromGlib for TrackType { + fn from_glib(value: ffi::GESTrackType) -> TrackType { skip_assert_initialized!(); TrackType::from_bits_truncate(value) } @@ -92,7 +91,7 @@ impl FromGlib for TrackType { impl StaticType for TrackType { fn static_type() -> Type { - unsafe { from_glib(ges_sys::ges_track_type_get_type()) } + unsafe { from_glib(ffi::ges_track_type_get_type()) } } } @@ -104,12 +103,12 @@ impl<'a> FromValueOptional<'a> for TrackType { impl<'a> FromValue<'a> for TrackType { unsafe fn from_value(value: &Value) -> Self { - from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0)) + from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) } } impl SetValue for TrackType { unsafe fn set_value(value: &mut Value, this: &Self) { - gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) } } diff --git a/gstreamer-editing-services/src/auto/group.rs b/gstreamer-editing-services/src/auto/group.rs index f9487c471..2c19627d7 100644 --- a/gstreamer-editing-services/src/auto/group.rs +++ b/gstreamer-editing-services/src/auto/group.rs @@ -2,7 +2,9 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT -use ges_sys; +use crate::Container; +use crate::Extractable; +use crate::TimelineElement; use glib::object::Cast; use glib::object::IsA; use glib::signal::connect_raw; @@ -10,26 +12,21 @@ 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) @extends Container, TimelineElement, @implements Extractable; +glib::glib_wrapper! { + pub struct Group(Object) @extends Container, TimelineElement, @implements Extractable; match fn { - get_type => || ges_sys::ges_group_get_type(), + get_type => || ffi::ges_group_get_type(), } } impl Group { pub fn new() -> Group { assert_initialized_main_thread!(); - unsafe { from_glib_none(ges_sys::ges_group_new()) } + unsafe { from_glib_none(ffi::ges_group_new()) } } } @@ -78,8 +75,8 @@ impl> GroupExt for O { fn get_property_duration(&self) -> u64 { unsafe { let mut value = Value::from_type(::static_type()); - gobject_sys::g_object_get_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"duration\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); @@ -92,8 +89,8 @@ impl> GroupExt for O { fn set_property_duration(&self, duration: u64) { unsafe { - gobject_sys::g_object_set_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_set_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"duration\0".as_ptr() as *const _, Value::from(&duration).to_glib_none().0, ); @@ -103,8 +100,8 @@ impl> GroupExt for O { fn get_property_in_point(&self) -> u64 { unsafe { let mut value = Value::from_type(::static_type()); - gobject_sys::g_object_get_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"in-point\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); @@ -117,8 +114,8 @@ impl> GroupExt for O { 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, + glib::gobject_ffi::g_object_set_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"in-point\0".as_ptr() as *const _, Value::from(&in_point).to_glib_none().0, ); @@ -128,8 +125,8 @@ impl> GroupExt for O { fn get_property_max_duration(&self) -> u64 { unsafe { let mut value = Value::from_type(::static_type()); - gobject_sys::g_object_get_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"max-duration\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); @@ -142,8 +139,8 @@ impl> GroupExt for O { 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, + glib::gobject_ffi::g_object_set_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"max-duration\0".as_ptr() as *const _, Value::from(&max_duration).to_glib_none().0, ); @@ -153,8 +150,8 @@ impl> GroupExt for O { fn get_property_priority(&self) -> u32 { unsafe { let mut value = Value::from_type(::static_type()); - gobject_sys::g_object_get_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"priority\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); @@ -167,8 +164,8 @@ impl> GroupExt for O { fn set_property_priority(&self, priority: u32) { unsafe { - gobject_sys::g_object_set_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_set_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"priority\0".as_ptr() as *const _, Value::from(&priority).to_glib_none().0, ); @@ -178,8 +175,8 @@ impl> GroupExt for O { fn get_property_start(&self) -> u64 { unsafe { let mut value = Value::from_type(::static_type()); - gobject_sys::g_object_get_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"start\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); @@ -192,8 +189,8 @@ impl> GroupExt for O { fn set_property_start(&self, start: u64) { unsafe { - gobject_sys::g_object_set_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_set_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"start\0".as_ptr() as *const _, Value::from(&start).to_glib_none().0, ); @@ -202,9 +199,9 @@ impl> GroupExt for O { fn connect_property_duration_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_duration_trampoline( - this: *mut ges_sys::GESGroup, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESGroup, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -226,9 +223,9 @@ impl> GroupExt for O { fn connect_property_in_point_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_in_point_trampoline( - this: *mut ges_sys::GESGroup, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESGroup, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -253,9 +250,9 @@ impl> GroupExt for O { f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_max_duration_trampoline( - this: *mut ges_sys::GESGroup, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESGroup, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -277,9 +274,9 @@ impl> GroupExt for O { fn connect_property_priority_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_priority_trampoline( - this: *mut ges_sys::GESGroup, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESGroup, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -301,9 +298,9 @@ impl> GroupExt for O { fn connect_property_start_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_start_trampoline( - this: *mut ges_sys::GESGroup, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESGroup, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { diff --git a/gstreamer-editing-services/src/auto/layer.rs b/gstreamer-editing-services/src/auto/layer.rs index 8cd6ff2b7..f906ad937 100644 --- a/gstreamer-editing-services/src/auto/layer.rs +++ b/gstreamer-editing-services/src/auto/layer.rs @@ -2,41 +2,37 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT -use ges_sys; -use glib; +use crate::Asset; +use crate::Clip; +use crate::Extractable; +use crate::Timeline; +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +use crate::Track; +use crate::TrackType; 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; #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] use std::ptr; -use Asset; -use Clip; -use Extractable; -use Timeline; -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] -use Track; -use TrackType; -glib_wrapper! { - pub struct Layer(Object) @implements Extractable; +glib::glib_wrapper! { + pub struct Layer(Object) @implements Extractable; match fn { - get_type => || ges_sys::ges_layer_get_type(), + get_type => || ffi::ges_layer_get_type(), } } impl Layer { pub fn new() -> Layer { assert_initialized_main_thread!(); - unsafe { from_glib_none(ges_sys::ges_layer_new()) } + unsafe { from_glib_none(ffi::ges_layer_new()) } } } @@ -133,7 +129,7 @@ impl> LayerExt for O { track_types: TrackType, ) -> Result { unsafe { - Option::<_>::from_glib_none(ges_sys::ges_layer_add_asset( + Option::<_>::from_glib_none(ffi::ges_layer_add_asset( self.as_ref().to_glib_none().0, asset.as_ref().to_glib_none().0, start.to_glib(), @@ -141,7 +137,7 @@ impl> LayerExt for O { duration.to_glib(), track_types.to_glib(), )) - .ok_or_else(|| glib_bool_error!("Failed to add asset")) + .ok_or_else(|| glib::glib_bool_error!("Failed to add asset")) } } @@ -157,7 +153,7 @@ impl> LayerExt for O { ) -> Result { unsafe { let mut error = ptr::null_mut(); - let ret = ges_sys::ges_layer_add_asset_full( + let ret = ffi::ges_layer_add_asset_full( self.as_ref().to_glib_none().0, asset.as_ref().to_glib_none().0, start.to_glib(), @@ -176,8 +172,8 @@ impl> LayerExt for O { fn add_clip>(&self, clip: &P) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_layer_add_clip( + glib::glib_result_from_gboolean!( + ffi::ges_layer_add_clip( self.as_ref().to_glib_none().0, clip.as_ref().to_glib_none().0 ), @@ -191,7 +187,7 @@ impl> LayerExt for O { fn add_clip_full>(&self, clip: &P) -> Result<(), glib::Error> { unsafe { let mut error = ptr::null_mut(); - let _ = ges_sys::ges_layer_add_clip_full( + let _ = ffi::ges_layer_add_clip_full( self.as_ref().to_glib_none().0, clip.as_ref().to_glib_none().0, &mut error, @@ -208,7 +204,7 @@ impl> LayerExt for O { #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn get_active_for_track>(&self, track: &P) -> bool { unsafe { - from_glib(ges_sys::ges_layer_get_active_for_track( + from_glib(ffi::ges_layer_get_active_for_track( self.as_ref().to_glib_none().0, track.as_ref().to_glib_none().0, )) @@ -217,7 +213,7 @@ impl> LayerExt for O { fn get_auto_transition(&self) -> bool { unsafe { - from_glib(ges_sys::ges_layer_get_auto_transition( + from_glib(ffi::ges_layer_get_auto_transition( self.as_ref().to_glib_none().0, )) } @@ -225,7 +221,7 @@ impl> LayerExt for O { fn get_clips(&self) -> Vec { unsafe { - FromGlibPtrContainer::from_glib_full(ges_sys::ges_layer_get_clips( + FromGlibPtrContainer::from_glib_full(ffi::ges_layer_get_clips( self.as_ref().to_glib_none().0, )) } @@ -233,7 +229,7 @@ impl> LayerExt for O { fn get_clips_in_interval(&self, start: gst::ClockTime, end: gst::ClockTime) -> Vec { unsafe { - FromGlibPtrContainer::from_glib_full(ges_sys::ges_layer_get_clips_in_interval( + FromGlibPtrContainer::from_glib_full(ffi::ges_layer_get_clips_in_interval( self.as_ref().to_glib_none().0, start.to_glib(), end.to_glib(), @@ -242,33 +238,25 @@ impl> LayerExt for O { } fn get_duration(&self) -> gst::ClockTime { - unsafe { - from_glib(ges_sys::ges_layer_get_duration( - self.as_ref().to_glib_none().0, - )) - } + unsafe { from_glib(ffi::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 { ffi::ges_layer_get_priority(self.as_ref().to_glib_none().0) } } fn get_timeline(&self) -> Option { - unsafe { - from_glib_none(ges_sys::ges_layer_get_timeline( - self.as_ref().to_glib_none().0, - )) - } + unsafe { from_glib_none(ffi::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(ffi::ges_layer_is_empty(self.as_ref().to_glib_none().0)) } } fn remove_clip>(&self, clip: &P) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_layer_remove_clip( + glib::glib_result_from_gboolean!( + ffi::ges_layer_remove_clip( self.as_ref().to_glib_none().0, clip.as_ref().to_glib_none().0 ), @@ -281,7 +269,7 @@ impl> LayerExt for O { #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn set_active_for_tracks(&self, active: bool, tracks: &[Track]) -> bool { unsafe { - from_glib(ges_sys::ges_layer_set_active_for_tracks( + from_glib(ffi::ges_layer_set_active_for_tracks( self.as_ref().to_glib_none().0, active.to_glib(), tracks.to_glib_none().0, @@ -291,7 +279,7 @@ impl> LayerExt for O { fn set_auto_transition(&self, auto_transition: bool) { unsafe { - ges_sys::ges_layer_set_auto_transition( + ffi::ges_layer_set_auto_transition( self.as_ref().to_glib_none().0, auto_transition.to_glib(), ); @@ -300,13 +288,13 @@ impl> LayerExt for O { fn set_priority(&self, priority: u32) { unsafe { - ges_sys::ges_layer_set_priority(self.as_ref().to_glib_none().0, priority); + ffi::ges_layer_set_priority(self.as_ref().to_glib_none().0, priority); } } fn set_timeline>(&self, timeline: &P) { unsafe { - ges_sys::ges_layer_set_timeline( + ffi::ges_layer_set_timeline( self.as_ref().to_glib_none().0, timeline.as_ref().to_glib_none().0, ); @@ -321,9 +309,9 @@ impl> LayerExt for O { fn connect_clip_added(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn clip_added_trampoline( - this: *mut ges_sys::GESLayer, - clip: *mut ges_sys::GESClip, - f: glib_sys::gpointer, + this: *mut ffi::GESLayer, + clip: *mut ffi::GESClip, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -348,9 +336,9 @@ impl> LayerExt for O { fn connect_clip_removed(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn clip_removed_trampoline( - this: *mut ges_sys::GESLayer, - clip: *mut ges_sys::GESClip, - f: glib_sys::gpointer, + this: *mut ffi::GESLayer, + clip: *mut ffi::GESClip, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -378,9 +366,9 @@ impl> LayerExt for O { f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_auto_transition_trampoline( - this: *mut ges_sys::GESLayer, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESLayer, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -402,9 +390,9 @@ impl> LayerExt for O { fn connect_property_priority_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_priority_trampoline( - this: *mut ges_sys::GESLayer, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESLayer, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { diff --git a/gstreamer-editing-services/src/auto/pipeline.rs b/gstreamer-editing-services/src/auto/pipeline.rs index 9756a1ecd..50c3d38e7 100644 --- a/gstreamer-editing-services/src/auto/pipeline.rs +++ b/gstreamer-editing-services/src/auto/pipeline.rs @@ -2,8 +2,8 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT -use ges_sys; -use glib; +use crate::PipelineFlags; +use crate::Timeline; use glib::object::Cast; use glib::object::IsA; use glib::signal::connect_raw; @@ -11,28 +11,22 @@ use glib::signal::SignalHandlerId; use glib::translate::*; use glib::StaticType; use glib::Value; -use glib_sys; -use gobject_sys; -use gst; -use gst_pbutils; use std::boxed::Box as Box_; use std::mem::transmute; use std::ptr; -use PipelineFlags; -use Timeline; -glib_wrapper! { - pub struct Pipeline(Object) @extends gst::Pipeline, gst::Element, gst::Object; +glib::glib_wrapper! { + pub struct Pipeline(Object) @extends gst::Pipeline, gst::Element, gst::Object; match fn { - get_type => || ges_sys::ges_pipeline_get_type(), + get_type => || ffi::ges_pipeline_get_type(), } } impl Pipeline { pub fn new() -> Pipeline { assert_initialized_main_thread!(); - unsafe { from_glib_none(ges_sys::ges_pipeline_new()) } + unsafe { from_glib_none(ffi::ges_pipeline_new()) } } } @@ -112,16 +106,12 @@ pub trait GESPipelineExt: 'static { impl> GESPipelineExt for O { fn get_mode(&self) -> PipelineFlags { - unsafe { - from_glib(ges_sys::ges_pipeline_get_mode( - self.as_ref().to_glib_none().0, - )) - } + unsafe { from_glib(ffi::ges_pipeline_get_mode(self.as_ref().to_glib_none().0)) } } fn get_thumbnail(&self, caps: &gst::Caps) -> Option { unsafe { - from_glib_full(ges_sys::ges_pipeline_get_thumbnail( + from_glib_full(ffi::ges_pipeline_get_thumbnail( self.as_ref().to_glib_none().0, caps.to_glib_none().0, )) @@ -130,7 +120,7 @@ impl> GESPipelineExt for O { fn get_thumbnail_rgb24(&self, width: i32, height: i32) -> Option { unsafe { - from_glib_full(ges_sys::ges_pipeline_get_thumbnail_rgb24( + from_glib_full(ffi::ges_pipeline_get_thumbnail_rgb24( self.as_ref().to_glib_none().0, width, height, @@ -140,7 +130,7 @@ impl> GESPipelineExt for O { fn preview_get_audio_sink(&self) -> Option { unsafe { - from_glib_full(ges_sys::ges_pipeline_preview_get_audio_sink( + from_glib_full(ffi::ges_pipeline_preview_get_audio_sink( self.as_ref().to_glib_none().0, )) } @@ -148,7 +138,7 @@ impl> GESPipelineExt for O { fn preview_get_video_sink(&self) -> Option { unsafe { - from_glib_full(ges_sys::ges_pipeline_preview_get_video_sink( + from_glib_full(ffi::ges_pipeline_preview_get_video_sink( self.as_ref().to_glib_none().0, )) } @@ -156,7 +146,7 @@ impl> GESPipelineExt for O { fn preview_set_audio_sink>(&self, sink: &P) { unsafe { - ges_sys::ges_pipeline_preview_set_audio_sink( + ffi::ges_pipeline_preview_set_audio_sink( self.as_ref().to_glib_none().0, sink.as_ref().to_glib_none().0, ); @@ -165,7 +155,7 @@ impl> GESPipelineExt for O { fn preview_set_video_sink>(&self, sink: &P) { unsafe { - ges_sys::ges_pipeline_preview_set_video_sink( + ffi::ges_pipeline_preview_set_video_sink( self.as_ref().to_glib_none().0, sink.as_ref().to_glib_none().0, ); @@ -181,7 +171,7 @@ impl> GESPipelineExt for O { ) -> Result<(), glib::Error> { unsafe { let mut error = ptr::null_mut(); - let _ = ges_sys::ges_pipeline_save_thumbnail( + let _ = ffi::ges_pipeline_save_thumbnail( self.as_ref().to_glib_none().0, width, height, @@ -199,8 +189,8 @@ impl> GESPipelineExt for O { 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()), + glib::glib_result_from_gboolean!( + ffi::ges_pipeline_set_mode(self.as_ref().to_glib_none().0, mode.to_glib()), "Failed to set mode" ) } @@ -212,8 +202,8 @@ impl> GESPipelineExt for O { profile: &P, ) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_pipeline_set_render_settings( + glib::glib_result_from_gboolean!( + ffi::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 @@ -225,8 +215,8 @@ impl> GESPipelineExt for O { fn set_timeline>(&self, timeline: &P) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_pipeline_set_timeline( + glib::glib_result_from_gboolean!( + ffi::ges_pipeline_set_timeline( self.as_ref().to_glib_none().0, timeline.as_ref().to_glib_full() ), @@ -238,8 +228,8 @@ impl> GESPipelineExt for O { fn get_property_audio_filter(&self) -> Option { unsafe { let mut value = Value::from_type(::static_type()); - gobject_sys::g_object_get_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"audio-filter\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); @@ -251,8 +241,8 @@ impl> GESPipelineExt for O { fn set_property_audio_filter>(&self, audio_filter: Option<&P>) { unsafe { - gobject_sys::g_object_set_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_set_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"audio-filter\0".as_ptr() as *const _, Value::from(audio_filter).to_glib_none().0, ); @@ -262,8 +252,8 @@ impl> GESPipelineExt for O { fn get_property_audio_sink(&self) -> Option { unsafe { let mut value = Value::from_type(::static_type()); - gobject_sys::g_object_get_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"audio-sink\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); @@ -275,8 +265,8 @@ impl> GESPipelineExt for O { fn set_property_audio_sink>(&self, audio_sink: Option<&P>) { unsafe { - gobject_sys::g_object_set_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_set_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"audio-sink\0".as_ptr() as *const _, Value::from(audio_sink).to_glib_none().0, ); @@ -286,8 +276,8 @@ impl> GESPipelineExt for O { fn get_property_timeline(&self) -> Option { unsafe { let mut value = Value::from_type(::static_type()); - gobject_sys::g_object_get_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"timeline\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); @@ -300,8 +290,8 @@ impl> GESPipelineExt for O { fn get_property_video_filter(&self) -> Option { unsafe { let mut value = Value::from_type(::static_type()); - gobject_sys::g_object_get_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"video-filter\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); @@ -313,8 +303,8 @@ impl> GESPipelineExt for O { fn set_property_video_filter>(&self, video_filter: Option<&P>) { unsafe { - gobject_sys::g_object_set_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_set_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"video-filter\0".as_ptr() as *const _, Value::from(video_filter).to_glib_none().0, ); @@ -324,8 +314,8 @@ impl> GESPipelineExt for O { fn get_property_video_sink(&self) -> Option { unsafe { let mut value = Value::from_type(::static_type()); - gobject_sys::g_object_get_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"video-sink\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); @@ -337,8 +327,8 @@ impl> GESPipelineExt for O { fn set_property_video_sink>(&self, video_sink: Option<&P>) { unsafe { - gobject_sys::g_object_set_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_set_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"video-sink\0".as_ptr() as *const _, Value::from(video_sink).to_glib_none().0, ); @@ -350,9 +340,9 @@ impl> GESPipelineExt for O { f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_audio_filter_trampoline( - this: *mut ges_sys::GESPipeline, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESPipeline, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -374,9 +364,9 @@ impl> GESPipelineExt for O { fn connect_property_audio_sink_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_audio_sink_trampoline( - this: *mut ges_sys::GESPipeline, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESPipeline, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -398,9 +388,9 @@ impl> GESPipelineExt for O { fn connect_property_mode_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_mode_trampoline( - this: *mut ges_sys::GESPipeline, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESPipeline, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -422,9 +412,9 @@ impl> GESPipelineExt for O { fn connect_property_timeline_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_timeline_trampoline( - this: *mut ges_sys::GESPipeline, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESPipeline, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -449,9 +439,9 @@ impl> GESPipelineExt for O { f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_video_filter_trampoline( - this: *mut ges_sys::GESPipeline, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESPipeline, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -473,9 +463,9 @@ impl> GESPipelineExt for O { fn connect_property_video_sink_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_video_sink_trampoline( - this: *mut ges_sys::GESPipeline, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESPipeline, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { diff --git a/gstreamer-editing-services/src/auto/project.rs b/gstreamer-editing-services/src/auto/project.rs index 3be7cc429..6fc145f2a 100644 --- a/gstreamer-editing-services/src/auto/project.rs +++ b/gstreamer-editing-services/src/auto/project.rs @@ -2,35 +2,29 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT -use ges_sys; -use glib; +use crate::Asset; +use crate::Timeline; 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_sys; -use gst_pbutils; -use libc; use std::boxed::Box as Box_; use std::mem::transmute; use std::ptr; -use Asset; -use Timeline; -glib_wrapper! { - pub struct Project(Object) @extends Asset; +glib::glib_wrapper! { + pub struct Project(Object) @extends Asset; match fn { - get_type => || ges_sys::ges_project_get_type(), + get_type => || ffi::ges_project_get_type(), } } 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(ffi::ges_project_new(uri.to_glib_none().0)) } } } @@ -60,7 +54,7 @@ pub trait ProjectExt: 'static { fn get_loading_assets(&self) -> Vec; - fn get_uri(&self) -> Option; + fn get_uri(&self) -> Option; fn list_assets(&self, filter: glib::types::Type) -> Vec; @@ -102,7 +96,7 @@ pub trait ProjectExt: 'static { #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn connect_loading(&self, f: F) -> SignalHandlerId; - fn connect_missing_uri Option + 'static>( + fn connect_missing_uri Option + 'static>( &self, f: F, ) -> SignalHandlerId; @@ -111,7 +105,7 @@ pub trait ProjectExt: 'static { impl> ProjectExt for O { fn add_asset>(&self, asset: &P) -> bool { unsafe { - from_glib(ges_sys::ges_project_add_asset( + from_glib(ffi::ges_project_add_asset( self.as_ref().to_glib_none().0, asset.as_ref().to_glib_none().0, )) @@ -123,8 +117,8 @@ impl> ProjectExt for O { profile: &P, ) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_project_add_encoding_profile( + glib::glib_result_from_gboolean!( + ffi::ges_project_add_encoding_profile( self.as_ref().to_glib_none().0, profile.as_ref().to_glib_none().0 ), @@ -136,12 +130,12 @@ impl> ProjectExt for O { //#[cfg(any(feature = "v1_18", feature = "dox"))] //#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] //fn add_formatter(&self, formatter: /*Ignored*/&Formatter) { - // unsafe { TODO: call ges_sys:ges_project_add_formatter() } + // unsafe { TODO: call ffi:ges_project_add_formatter() } //} fn create_asset(&self, id: Option<&str>, extractable_type: glib::types::Type) -> bool { unsafe { - from_glib(ges_sys::ges_project_create_asset( + from_glib(ffi::ges_project_create_asset( self.as_ref().to_glib_none().0, id.to_glib_none().0, extractable_type.to_glib(), @@ -156,7 +150,7 @@ impl> ProjectExt for O { ) -> Result, glib::Error> { unsafe { let mut error = ptr::null_mut(); - let ret = ges_sys::ges_project_create_asset_sync( + let ret = ffi::ges_project_create_asset_sync( self.as_ref().to_glib_none().0, id.to_glib_none().0, extractable_type.to_glib(), @@ -172,7 +166,7 @@ impl> ProjectExt for O { fn get_asset(&self, id: &str, extractable_type: glib::types::Type) -> Option { unsafe { - from_glib_full(ges_sys::ges_project_get_asset( + from_glib_full(ffi::ges_project_get_asset( self.as_ref().to_glib_none().0, id.to_glib_none().0, extractable_type.to_glib(), @@ -182,19 +176,19 @@ impl> ProjectExt for O { fn get_loading_assets(&self) -> Vec { unsafe { - FromGlibPtrContainer::from_glib_full(ges_sys::ges_project_get_loading_assets( + FromGlibPtrContainer::from_glib_full(ffi::ges_project_get_loading_assets( self.as_ref().to_glib_none().0, )) } } - fn get_uri(&self) -> Option { - unsafe { from_glib_full(ges_sys::ges_project_get_uri(self.as_ref().to_glib_none().0)) } + fn get_uri(&self) -> Option { + unsafe { from_glib_full(ffi::ges_project_get_uri(self.as_ref().to_glib_none().0)) } } fn list_assets(&self, filter: glib::types::Type) -> Vec { unsafe { - FromGlibPtrContainer::from_glib_full(ges_sys::ges_project_list_assets( + FromGlibPtrContainer::from_glib_full(ffi::ges_project_list_assets( self.as_ref().to_glib_none().0, filter.to_glib(), )) @@ -203,7 +197,7 @@ impl> ProjectExt for O { fn list_encoding_profiles(&self) -> Vec { unsafe { - FromGlibPtrContainer::from_glib_none(ges_sys::ges_project_list_encoding_profiles( + FromGlibPtrContainer::from_glib_none(ffi::ges_project_list_encoding_profiles( self.as_ref().to_glib_none().0, )) } @@ -212,7 +206,7 @@ impl> ProjectExt for O { fn load>(&self, timeline: &P) -> Result<(), glib::Error> { unsafe { let mut error = ptr::null_mut(); - let _ = ges_sys::ges_project_load( + let _ = ffi::ges_project_load( self.as_ref().to_glib_none().0, timeline.as_ref().to_glib_none().0, &mut error, @@ -227,8 +221,8 @@ impl> ProjectExt for O { fn remove_asset>(&self, asset: &P) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_project_remove_asset( + glib::glib_result_from_gboolean!( + ffi::ges_project_remove_asset( self.as_ref().to_glib_none().0, asset.as_ref().to_glib_none().0 ), @@ -246,7 +240,7 @@ impl> ProjectExt for O { ) -> Result<(), glib::Error> { unsafe { let mut error = ptr::null_mut(); - let _ = ges_sys::ges_project_save( + let _ = ffi::ges_project_save( self.as_ref().to_glib_none().0, timeline.as_ref().to_glib_none().0, uri.to_glib_none().0, @@ -264,9 +258,9 @@ impl> ProjectExt for O { fn connect_asset_added(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn asset_added_trampoline( - this: *mut ges_sys::GESProject, - asset: *mut ges_sys::GESAsset, - f: glib_sys::gpointer, + this: *mut ffi::GESProject, + asset: *mut ffi::GESAsset, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -291,9 +285,9 @@ impl> ProjectExt for O { fn connect_asset_loading(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn asset_loading_trampoline( - this: *mut ges_sys::GESProject, - asset: *mut ges_sys::GESAsset, - f: glib_sys::gpointer, + this: *mut ffi::GESProject, + asset: *mut ffi::GESAsset, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -318,9 +312,9 @@ impl> ProjectExt for O { fn connect_asset_removed(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn asset_removed_trampoline( - this: *mut ges_sys::GESProject, - asset: *mut ges_sys::GESAsset, - f: glib_sys::gpointer, + this: *mut ffi::GESProject, + asset: *mut ffi::GESAsset, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -353,10 +347,10 @@ impl> ProjectExt for O { P, F: Fn(&P, &Timeline, &glib::Error) + 'static, >( - this: *mut ges_sys::GESProject, - timeline: *mut ges_sys::GESTimeline, - error: *mut glib_sys::GError, - f: glib_sys::gpointer, + this: *mut ffi::GESProject, + timeline: *mut ffi::GESTimeline, + error: *mut glib::ffi::GError, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -390,11 +384,11 @@ impl> ProjectExt for O { P, F: Fn(&P, &glib::Error, &str, glib::types::Type) + 'static, >( - this: *mut ges_sys::GESProject, - error: *mut glib_sys::GError, + this: *mut ffi::GESProject, + error: *mut glib::ffi::GError, id: *mut libc::c_char, - extractable_type: glib_sys::GType, - f: glib_sys::gpointer, + extractable_type: glib::ffi::GType, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -402,7 +396,7 @@ impl> ProjectExt for O { f( &Project::from_glib_borrow(this).unsafe_cast_ref(), &from_glib_borrow(error), - &GString::from_glib_borrow(id), + &glib::GString::from_glib_borrow(id), from_glib(extractable_type), ) } @@ -421,9 +415,9 @@ impl> ProjectExt for O { fn connect_loaded(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn loaded_trampoline( - this: *mut ges_sys::GESProject, - timeline: *mut ges_sys::GESTimeline, - f: glib_sys::gpointer, + this: *mut ffi::GESProject, + timeline: *mut ffi::GESTimeline, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -450,9 +444,9 @@ impl> ProjectExt for O { #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn connect_loading(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn loading_trampoline( - this: *mut ges_sys::GESProject, - timeline: *mut ges_sys::GESTimeline, - f: glib_sys::gpointer, + this: *mut ffi::GESProject, + timeline: *mut ffi::GESTimeline, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -475,18 +469,20 @@ impl> ProjectExt for O { } } - fn connect_missing_uri Option + 'static>( + fn connect_missing_uri< + F: Fn(&Self, &glib::Error, &Asset) -> Option + 'static, + >( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn missing_uri_trampoline< P, - F: Fn(&P, &glib::Error, &Asset) -> Option + 'static, + F: Fn(&P, &glib::Error, &Asset) -> Option + 'static, >( - this: *mut ges_sys::GESProject, - error: *mut glib_sys::GError, - wrong_asset: *mut ges_sys::GESAsset, - f: glib_sys::gpointer, + this: *mut ffi::GESProject, + error: *mut glib::ffi::GError, + wrong_asset: *mut ffi::GESAsset, + f: glib::ffi::gpointer, ) -> *mut libc::c_char where P: IsA, diff --git a/gstreamer-editing-services/src/auto/timeline.rs b/gstreamer-editing-services/src/auto/timeline.rs index 6f5222560..1b373bf03 100644 --- a/gstreamer-editing-services/src/auto/timeline.rs +++ b/gstreamer-editing-services/src/auto/timeline.rs @@ -2,56 +2,52 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT -use ges_sys; -use glib; +use crate::Asset; +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +use crate::Clip; +use crate::Extractable; +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +use crate::FrameNumber; +use crate::Group; +use crate::Layer; +use crate::TimelineElement; +use crate::Track; +use crate::TrackElement; 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; -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] -use Clip; -use Extractable; -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] -use FrameNumber; -use Group; -use Layer; -use TimelineElement; -use Track; -use TrackElement; -glib_wrapper! { - pub struct Timeline(Object) @extends gst::Element, gst::Object, @implements Extractable; +glib::glib_wrapper! { + pub struct Timeline(Object) @extends gst::Element, gst::Object, @implements Extractable; match fn { - get_type => || ges_sys::ges_timeline_get_type(), + get_type => || ffi::ges_timeline_get_type(), } } impl Timeline { pub fn new() -> Timeline { assert_initialized_main_thread!(); - unsafe { from_glib_none(ges_sys::ges_timeline_new()) } + unsafe { from_glib_none(ffi::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(ffi::ges_timeline_new_audio_video()) } } pub fn from_uri(uri: &str) -> Result, glib::Error> { assert_initialized_main_thread!(); unsafe { let mut error = ptr::null_mut(); - let ret = ges_sys::ges_timeline_new_from_uri(uri.to_glib_none().0, &mut error); + let ret = ffi::ges_timeline_new_from_uri(uri.to_glib_none().0, &mut error); if error.is_null() { Ok(from_glib_none(ret)) } else { @@ -192,8 +188,8 @@ pub trait TimelineExt: 'static { impl> TimelineExt for O { fn add_layer>(&self, layer: &P) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_timeline_add_layer( + glib::glib_result_from_gboolean!( + ffi::ges_timeline_add_layer( self.as_ref().to_glib_none().0, layer.as_ref().to_glib_none().0 ), @@ -204,8 +200,8 @@ impl> TimelineExt for O { fn add_track>(&self, track: &P) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_timeline_add_track( + glib::glib_result_from_gboolean!( + ffi::ges_timeline_add_track( self.as_ref().to_glib_none().0, track.as_ref().to_glib_full() ), @@ -216,19 +212,19 @@ impl> TimelineExt for O { fn append_layer(&self) -> Layer { unsafe { - from_glib_none(ges_sys::ges_timeline_append_layer( + from_glib_none(ffi::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(ffi::ges_timeline_commit(self.as_ref().to_glib_none().0)) } } fn commit_sync(&self) -> bool { unsafe { - from_glib(ges_sys::ges_timeline_commit_sync( + from_glib(ffi::ges_timeline_commit_sync( self.as_ref().to_glib_none().0, )) } @@ -236,7 +232,7 @@ impl> TimelineExt for O { fn get_auto_transition(&self) -> bool { unsafe { - from_glib(ges_sys::ges_timeline_get_auto_transition( + from_glib(ffi::ges_timeline_get_auto_transition( self.as_ref().to_glib_none().0, )) } @@ -244,7 +240,7 @@ impl> TimelineExt for O { fn get_duration(&self) -> gst::ClockTime { unsafe { - from_glib(ges_sys::ges_timeline_get_duration( + from_glib(ffi::ges_timeline_get_duration( self.as_ref().to_glib_none().0, )) } @@ -252,7 +248,7 @@ impl> TimelineExt for O { fn get_element(&self, name: &str) -> Option { unsafe { - from_glib_full(ges_sys::ges_timeline_get_element( + from_glib_full(ffi::ges_timeline_get_element( self.as_ref().to_glib_none().0, name.to_glib_none().0, )) @@ -263,7 +259,7 @@ impl> TimelineExt for O { #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn get_frame_at(&self, timestamp: gst::ClockTime) -> FrameNumber { unsafe { - ges_sys::ges_timeline_get_frame_at(self.as_ref().to_glib_none().0, timestamp.to_glib()) + ffi::ges_timeline_get_frame_at(self.as_ref().to_glib_none().0, timestamp.to_glib()) } } @@ -271,7 +267,7 @@ impl> TimelineExt for O { #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn get_frame_time(&self, frame_number: FrameNumber) -> gst::ClockTime { unsafe { - from_glib(ges_sys::ges_timeline_get_frame_time( + from_glib(ffi::ges_timeline_get_frame_time( self.as_ref().to_glib_none().0, frame_number, )) @@ -280,7 +276,7 @@ impl> TimelineExt for O { fn get_groups(&self) -> Vec { unsafe { - FromGlibPtrContainer::from_glib_none(ges_sys::ges_timeline_get_groups( + FromGlibPtrContainer::from_glib_none(ffi::ges_timeline_get_groups( self.as_ref().to_glib_none().0, )) } @@ -288,7 +284,7 @@ impl> TimelineExt for O { fn get_layer(&self, priority: u32) -> Option { unsafe { - from_glib_full(ges_sys::ges_timeline_get_layer( + from_glib_full(ffi::ges_timeline_get_layer( self.as_ref().to_glib_none().0, priority, )) @@ -297,7 +293,7 @@ impl> TimelineExt for O { fn get_layers(&self) -> Vec { unsafe { - FromGlibPtrContainer::from_glib_full(ges_sys::ges_timeline_get_layers( + FromGlibPtrContainer::from_glib_full(ffi::ges_timeline_get_layers( self.as_ref().to_glib_none().0, )) } @@ -305,7 +301,7 @@ impl> TimelineExt for O { fn get_pad_for_track>(&self, track: &P) -> Option { unsafe { - from_glib_none(ges_sys::ges_timeline_get_pad_for_track( + from_glib_none(ffi::ges_timeline_get_pad_for_track( self.as_ref().to_glib_none().0, track.as_ref().to_glib_none().0, )) @@ -314,7 +310,7 @@ impl> TimelineExt for O { fn get_snapping_distance(&self) -> gst::ClockTime { unsafe { - from_glib(ges_sys::ges_timeline_get_snapping_distance( + from_glib(ffi::ges_timeline_get_snapping_distance( self.as_ref().to_glib_none().0, )) } @@ -322,7 +318,7 @@ impl> TimelineExt for O { fn get_track_for_pad>(&self, pad: &P) -> Option { unsafe { - from_glib_none(ges_sys::ges_timeline_get_track_for_pad( + from_glib_none(ffi::ges_timeline_get_track_for_pad( self.as_ref().to_glib_none().0, pad.as_ref().to_glib_none().0, )) @@ -331,24 +327,20 @@ impl> TimelineExt for O { fn get_tracks(&self) -> Vec { unsafe { - FromGlibPtrContainer::from_glib_full(ges_sys::ges_timeline_get_tracks( + FromGlibPtrContainer::from_glib_full(ffi::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, - )) - } + unsafe { from_glib(ffi::ges_timeline_is_empty(self.as_ref().to_glib_none().0)) } } fn load_from_uri(&self, uri: &str) -> Result<(), glib::Error> { unsafe { let mut error = ptr::null_mut(); - let _ = ges_sys::ges_timeline_load_from_uri( + let _ = ffi::ges_timeline_load_from_uri( self.as_ref().to_glib_none().0, uri.to_glib_none().0, &mut error, @@ -369,8 +361,8 @@ impl> TimelineExt for O { new_layer_priority: u32, ) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_timeline_move_layer( + glib::glib_result_from_gboolean!( + ffi::ges_timeline_move_layer( self.as_ref().to_glib_none().0, layer.as_ref().to_glib_none().0, new_layer_priority @@ -387,7 +379,7 @@ impl> TimelineExt for O { layer_priority: i32, ) -> Option { unsafe { - from_glib_full(ges_sys::ges_timeline_paste_element( + from_glib_full(ffi::ges_timeline_paste_element( self.as_ref().to_glib_none().0, element.as_ref().to_glib_none().0, position.to_glib(), @@ -398,8 +390,8 @@ impl> TimelineExt for O { fn remove_layer>(&self, layer: &P) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_timeline_remove_layer( + glib::glib_result_from_gboolean!( + ffi::ges_timeline_remove_layer( self.as_ref().to_glib_none().0, layer.as_ref().to_glib_none().0 ), @@ -410,8 +402,8 @@ impl> TimelineExt for O { fn remove_track>(&self, track: &P) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_timeline_remove_track( + glib::glib_result_from_gboolean!( + ffi::ges_timeline_remove_track( self.as_ref().to_glib_none().0, track.as_ref().to_glib_none().0 ), @@ -428,7 +420,7 @@ impl> TimelineExt for O { ) -> Result<(), glib::Error> { unsafe { let mut error = ptr::null_mut(); - let _ = ges_sys::ges_timeline_save_to_uri( + let _ = ffi::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, @@ -445,7 +437,7 @@ impl> TimelineExt for O { fn set_auto_transition(&self, auto_transition: bool) { unsafe { - ges_sys::ges_timeline_set_auto_transition( + ffi::ges_timeline_set_auto_transition( self.as_ref().to_glib_none().0, auto_transition.to_glib(), ); @@ -454,7 +446,7 @@ impl> TimelineExt for O { fn set_snapping_distance(&self, snapping_distance: gst::ClockTime) { unsafe { - ges_sys::ges_timeline_set_snapping_distance( + ffi::ges_timeline_set_snapping_distance( self.as_ref().to_glib_none().0, snapping_distance.to_glib(), ); @@ -463,8 +455,8 @@ impl> TimelineExt for O { fn connect_commited(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn commited_trampoline( - this: *mut ges_sys::GESTimeline, - f: glib_sys::gpointer, + this: *mut ffi::GESTimeline, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -486,9 +478,9 @@ impl> TimelineExt for O { fn connect_group_added(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn group_added_trampoline( - this: *mut ges_sys::GESTimeline, - group: *mut ges_sys::GESGroup, - f: glib_sys::gpointer, + this: *mut ffi::GESTimeline, + group: *mut ffi::GESGroup, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -517,9 +509,9 @@ impl> TimelineExt for O { fn connect_layer_added(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn layer_added_trampoline( - this: *mut ges_sys::GESTimeline, - layer: *mut ges_sys::GESLayer, - f: glib_sys::gpointer, + this: *mut ffi::GESTimeline, + layer: *mut ffi::GESLayer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -544,9 +536,9 @@ impl> TimelineExt for O { fn connect_layer_removed(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn layer_removed_trampoline( - this: *mut ges_sys::GESTimeline, - layer: *mut ges_sys::GESLayer, - f: glib_sys::gpointer, + this: *mut ffi::GESTimeline, + layer: *mut ffi::GESLayer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -579,11 +571,11 @@ impl> TimelineExt for O { P, F: Fn(&P, &Clip, &TrackElement) -> Track + 'static, >( - this: *mut ges_sys::GESTimeline, - clip: *mut ges_sys::GESClip, - track_element: *mut ges_sys::GESTrackElement, - f: glib_sys::gpointer, - ) -> *mut ges_sys::GESTrack + this: *mut ffi::GESTimeline, + clip: *mut ffi::GESClip, + track_element: *mut ffi::GESTrackElement, + f: glib::ffi::gpointer, + ) -> *mut ffi::GESTrack where P: IsA, { @@ -620,11 +612,11 @@ impl> TimelineExt for O { P, F: Fn(&P, &TrackElement, &TrackElement, u64) + 'static, >( - this: *mut ges_sys::GESTimeline, - obj1: *mut ges_sys::GESTrackElement, - obj2: *mut ges_sys::GESTrackElement, + this: *mut ffi::GESTimeline, + obj1: *mut ffi::GESTrackElement, + obj2: *mut ffi::GESTrackElement, position: u64, - f: glib_sys::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -657,11 +649,11 @@ impl> TimelineExt for O { P, F: Fn(&P, &TrackElement, &TrackElement, u64) + 'static, >( - this: *mut ges_sys::GESTimeline, - obj1: *mut ges_sys::GESTrackElement, - obj2: *mut ges_sys::GESTrackElement, + this: *mut ffi::GESTimeline, + obj1: *mut ffi::GESTrackElement, + obj2: *mut ffi::GESTrackElement, position: u64, - f: glib_sys::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -688,9 +680,9 @@ impl> TimelineExt for O { fn connect_track_added(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn track_added_trampoline( - this: *mut ges_sys::GESTimeline, - track: *mut ges_sys::GESTrack, - f: glib_sys::gpointer, + this: *mut ffi::GESTimeline, + track: *mut ffi::GESTrack, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -715,9 +707,9 @@ impl> TimelineExt for O { fn connect_track_removed(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn track_removed_trampoline( - this: *mut ges_sys::GESTimeline, - track: *mut ges_sys::GESTrack, - f: glib_sys::gpointer, + this: *mut ffi::GESTimeline, + track: *mut ffi::GESTrack, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -745,9 +737,9 @@ impl> TimelineExt for O { f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_auto_transition_trampoline( - this: *mut ges_sys::GESTimeline, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESTimeline, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -769,9 +761,9 @@ impl> TimelineExt for O { fn connect_property_duration_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_duration_trampoline( - this: *mut ges_sys::GESTimeline, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESTimeline, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -796,9 +788,9 @@ impl> TimelineExt for O { f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_snapping_distance_trampoline( - this: *mut ges_sys::GESTimeline, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESTimeline, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { diff --git a/gstreamer-editing-services/src/auto/timeline_element.rs b/gstreamer-editing-services/src/auto/timeline_element.rs index 6fdd36077..5b322cb03 100644 --- a/gstreamer-editing-services/src/auto/timeline_element.rs +++ b/gstreamer-editing-services/src/auto/timeline_element.rs @@ -2,19 +2,25 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT -use ges_sys; -use glib; +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +use crate::Edge; +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +use crate::EditMode; +use crate::Extractable; +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +use crate::Layer; +use crate::Timeline; +use crate::TrackType; 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_; #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] @@ -23,24 +29,12 @@ use std::mem::transmute; #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] use std::ptr; -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] -use Edge; -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] -use EditMode; -use Extractable; -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] -use Layer; -use Timeline; -use TrackType; -glib_wrapper! { - pub struct TimelineElement(Object) @implements Extractable; +glib::glib_wrapper! { + pub struct TimelineElement(Object) @implements Extractable; match fn { - get_type => || ges_sys::ges_timeline_element_get_type(), + get_type => || ffi::ges_timeline_element_get_type(), } } @@ -90,7 +84,7 @@ pub trait TimelineElementExt: 'static { fn get_max_duration(&self) -> gst::ClockTime; - fn get_name(&self) -> Option; + fn get_name(&self) -> Option; #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] @@ -197,16 +191,16 @@ pub trait TimelineElementExt: 'static { impl> TimelineElementExt for O { //fn add_child_property>(&self, pspec: /*Ignored*/&glib::ParamSpec, child: &P) -> bool { - // unsafe { TODO: call ges_sys:ges_timeline_element_add_child_property() } + // unsafe { TODO: call ffi:ges_timeline_element_add_child_property() } //} fn copy(&self, deep: bool) -> Result { unsafe { - Option::<_>::from_glib_none(ges_sys::ges_timeline_element_copy( + Option::<_>::from_glib_none(ffi::ges_timeline_element_copy( self.as_ref().to_glib_none().0, deep.to_glib(), )) - .ok_or_else(|| glib_bool_error!("Failed to copy timeline element")) + .ok_or_else(|| glib::glib_bool_error!("Failed to copy timeline element")) } } @@ -221,7 +215,7 @@ impl> TimelineElementExt for O { position: u64, ) -> bool { unsafe { - from_glib(ges_sys::ges_timeline_element_edit( + from_glib(ffi::ges_timeline_element_edit( self.as_ref().to_glib_none().0, layers.to_glib_none().0, new_layer_priority, @@ -243,7 +237,7 @@ impl> TimelineElementExt for O { ) -> Result<(), glib::Error> { unsafe { let mut error = ptr::null_mut(); - let _ = ges_sys::ges_timeline_element_edit_full( + let _ = ffi::ges_timeline_element_edit_full( self.as_ref().to_glib_none().0, new_layer_priority, mode.to_glib(), @@ -260,24 +254,24 @@ impl> TimelineElementExt for O { } //fn get_child_properties(&self, first_property_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) { - // unsafe { TODO: call ges_sys:ges_timeline_element_get_child_properties() } + // unsafe { TODO: call ffi:ges_timeline_element_get_child_properties() } //} //fn get_child_property(&self, property_name: &str, value: /*Ignored*/glib::Value) -> bool { - // unsafe { TODO: call ges_sys:ges_timeline_element_get_child_property() } + // unsafe { TODO: call ffi:ges_timeline_element_get_child_property() } //} //fn get_child_property_by_pspec(&self, pspec: /*Ignored*/&glib::ParamSpec, value: /*Ignored*/glib::Value) { - // unsafe { TODO: call ges_sys:ges_timeline_element_get_child_property_by_pspec() } + // unsafe { TODO: call ffi:ges_timeline_element_get_child_property_by_pspec() } //} //fn get_child_property_valist(&self, first_property_name: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) { - // unsafe { TODO: call ges_sys:ges_timeline_element_get_child_property_valist() } + // unsafe { TODO: call ffi:ges_timeline_element_get_child_property_valist() } //} fn get_duration(&self) -> gst::ClockTime { unsafe { - from_glib(ges_sys::ges_timeline_element_get_duration( + from_glib(ffi::ges_timeline_element_get_duration( self.as_ref().to_glib_none().0, )) } @@ -285,7 +279,7 @@ impl> TimelineElementExt for O { fn get_inpoint(&self) -> gst::ClockTime { unsafe { - from_glib(ges_sys::ges_timeline_element_get_inpoint( + from_glib(ffi::ges_timeline_element_get_inpoint( self.as_ref().to_glib_none().0, )) } @@ -294,20 +288,20 @@ impl> TimelineElementExt for O { #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] fn get_layer_priority(&self) -> u32 { - unsafe { ges_sys::ges_timeline_element_get_layer_priority(self.as_ref().to_glib_none().0) } + unsafe { ffi::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( + from_glib(ffi::ges_timeline_element_get_max_duration( self.as_ref().to_glib_none().0, )) } } - fn get_name(&self) -> Option { + fn get_name(&self) -> Option { unsafe { - from_glib_full(ges_sys::ges_timeline_element_get_name( + from_glib_full(ffi::ges_timeline_element_get_name( self.as_ref().to_glib_none().0, )) } @@ -319,7 +313,7 @@ impl> TimelineElementExt for O { unsafe { let mut framerate_n = mem::MaybeUninit::uninit(); let mut framerate_d = mem::MaybeUninit::uninit(); - let ret = from_glib(ges_sys::ges_timeline_element_get_natural_framerate( + let ret = from_glib(ffi::ges_timeline_element_get_natural_framerate( self.as_ref().to_glib_none().0, framerate_n.as_mut_ptr(), framerate_d.as_mut_ptr(), @@ -336,19 +330,19 @@ impl> TimelineElementExt for O { fn get_parent(&self) -> Option { unsafe { - from_glib_full(ges_sys::ges_timeline_element_get_parent( + from_glib_full(ffi::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 { ffi::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( + from_glib(ffi::ges_timeline_element_get_start( self.as_ref().to_glib_none().0, )) } @@ -356,7 +350,7 @@ impl> TimelineElementExt for O { fn get_timeline(&self) -> Option { unsafe { - from_glib_full(ges_sys::ges_timeline_element_get_timeline( + from_glib_full(ffi::ges_timeline_element_get_timeline( self.as_ref().to_glib_none().0, )) } @@ -364,7 +358,7 @@ impl> TimelineElementExt for O { fn get_toplevel_parent(&self) -> Option { unsafe { - from_glib_full(ges_sys::ges_timeline_element_get_toplevel_parent( + from_glib_full(ffi::ges_timeline_element_get_toplevel_parent( self.as_ref().to_glib_none().0, )) } @@ -372,41 +366,38 @@ impl> TimelineElementExt for O { fn get_track_types(&self) -> TrackType { unsafe { - from_glib(ges_sys::ges_timeline_element_get_track_types( + from_glib(ffi::ges_timeline_element_get_track_types( self.as_ref().to_glib_none().0, )) } } //fn list_children_properties(&self) -> /*Ignored*/Vec { - // unsafe { TODO: call ges_sys:ges_timeline_element_list_children_properties() } + // unsafe { TODO: call ffi:ges_timeline_element_list_children_properties() } //} //fn lookup_child(&self, prop_name: &str, pspec: /*Ignored*/glib::ParamSpec) -> Option { - // unsafe { TODO: call ges_sys:ges_timeline_element_lookup_child() } + // unsafe { TODO: call ffi:ges_timeline_element_lookup_child() } //} fn paste(&self, paste_position: gst::ClockTime) -> Result { unsafe { - Option::<_>::from_glib_full(ges_sys::ges_timeline_element_paste( + Option::<_>::from_glib_full(ffi::ges_timeline_element_paste( self.as_ref().to_glib_none().0, paste_position.to_glib(), )) - .ok_or_else(|| glib_bool_error!("Failed to paste timeline element")) + .ok_or_else(|| glib::glib_bool_error!("Failed to paste timeline element")) } } //fn remove_child_property(&self, pspec: /*Ignored*/&glib::ParamSpec) -> bool { - // unsafe { TODO: call ges_sys:ges_timeline_element_remove_child_property() } + // unsafe { TODO: call ffi:ges_timeline_element_remove_child_property() } //} 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() - ), + glib::glib_result_from_gboolean!( + ffi::ges_timeline_element_ripple(self.as_ref().to_glib_none().0, start.to_glib()), "Failed to ripple" ) } @@ -414,11 +405,8 @@ impl> TimelineElementExt for O { 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() - ), + glib::glib_result_from_gboolean!( + ffi::ges_timeline_element_ripple_end(self.as_ref().to_glib_none().0, end.to_glib()), "Failed to ripple" ) } @@ -426,11 +414,8 @@ impl> TimelineElementExt for O { 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() - ), + glib::glib_result_from_gboolean!( + ffi::ges_timeline_element_roll_end(self.as_ref().to_glib_none().0, end.to_glib()), "Failed to roll" ) } @@ -438,8 +423,8 @@ impl> TimelineElementExt for O { fn roll_start(&self, start: gst::ClockTime) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_timeline_element_roll_start( + glib::glib_result_from_gboolean!( + ffi::ges_timeline_element_roll_start( self.as_ref().to_glib_none().0, start.to_glib() ), @@ -449,30 +434,30 @@ impl> TimelineElementExt for O { } //fn set_child_properties(&self, first_property_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) { - // unsafe { TODO: call ges_sys:ges_timeline_element_set_child_properties() } + // unsafe { TODO: call ffi:ges_timeline_element_set_child_properties() } //} //fn set_child_property(&self, property_name: &str, value: /*Ignored*/&glib::Value) -> bool { - // unsafe { TODO: call ges_sys:ges_timeline_element_set_child_property() } + // unsafe { TODO: call ffi:ges_timeline_element_set_child_property() } //} //fn set_child_property_by_pspec(&self, pspec: /*Ignored*/&glib::ParamSpec, value: /*Ignored*/&glib::Value) { - // unsafe { TODO: call ges_sys:ges_timeline_element_set_child_property_by_pspec() } + // unsafe { TODO: call ffi:ges_timeline_element_set_child_property_by_pspec() } //} //#[cfg(any(feature = "v1_18", feature = "dox"))] //#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] //fn set_child_property_full(&self, property_name: &str, value: /*Ignored*/&glib::Value) -> Result<(), glib::Error> { - // unsafe { TODO: call ges_sys:ges_timeline_element_set_child_property_full() } + // unsafe { TODO: call ffi:ges_timeline_element_set_child_property_full() } //} //fn set_child_property_valist(&self, first_property_name: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) { - // unsafe { TODO: call ges_sys:ges_timeline_element_set_child_property_valist() } + // unsafe { TODO: call ffi:ges_timeline_element_set_child_property_valist() } //} fn set_duration(&self, duration: gst::ClockTime) -> bool { unsafe { - from_glib(ges_sys::ges_timeline_element_set_duration( + from_glib(ffi::ges_timeline_element_set_duration( self.as_ref().to_glib_none().0, duration.to_glib(), )) @@ -481,7 +466,7 @@ impl> TimelineElementExt for O { fn set_inpoint(&self, inpoint: gst::ClockTime) -> bool { unsafe { - from_glib(ges_sys::ges_timeline_element_set_inpoint( + from_glib(ffi::ges_timeline_element_set_inpoint( self.as_ref().to_glib_none().0, inpoint.to_glib(), )) @@ -490,7 +475,7 @@ impl> TimelineElementExt for O { fn set_max_duration(&self, maxduration: gst::ClockTime) -> bool { unsafe { - from_glib(ges_sys::ges_timeline_element_set_max_duration( + from_glib(ffi::ges_timeline_element_set_max_duration( self.as_ref().to_glib_none().0, maxduration.to_glib(), )) @@ -499,8 +484,8 @@ impl> TimelineElementExt for O { fn set_name(&self, name: Option<&str>) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_timeline_element_set_name( + glib::glib_result_from_gboolean!( + ffi::ges_timeline_element_set_name( self.as_ref().to_glib_none().0, name.to_glib_none().0 ), @@ -514,8 +499,8 @@ impl> TimelineElementExt for O { parent: &P, ) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_timeline_element_set_parent( + glib::glib_result_from_gboolean!( + ffi::ges_timeline_element_set_parent( self.as_ref().to_glib_none().0, parent.as_ref().to_glib_none().0 ), @@ -526,7 +511,7 @@ impl> TimelineElementExt for O { fn set_priority(&self, priority: u32) -> bool { unsafe { - from_glib(ges_sys::ges_timeline_element_set_priority( + from_glib(ffi::ges_timeline_element_set_priority( self.as_ref().to_glib_none().0, priority, )) @@ -535,7 +520,7 @@ impl> TimelineElementExt for O { fn set_start(&self, start: gst::ClockTime) -> bool { unsafe { - from_glib(ges_sys::ges_timeline_element_set_start( + from_glib(ffi::ges_timeline_element_set_start( self.as_ref().to_glib_none().0, start.to_glib(), )) @@ -544,8 +529,8 @@ impl> TimelineElementExt for O { fn set_timeline>(&self, timeline: &P) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_timeline_element_set_timeline( + glib::glib_result_from_gboolean!( + ffi::ges_timeline_element_set_timeline( self.as_ref().to_glib_none().0, timeline.as_ref().to_glib_none().0 ), @@ -556,8 +541,8 @@ impl> TimelineElementExt for O { 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()), + glib::glib_result_from_gboolean!( + ffi::ges_timeline_element_trim(self.as_ref().to_glib_none().0, start.to_glib()), "Failed to trim" ) } @@ -566,8 +551,8 @@ impl> TimelineElementExt for O { fn get_property_in_point(&self) -> u64 { unsafe { let mut value = Value::from_type(::static_type()); - gobject_sys::g_object_get_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"in-point\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); @@ -580,8 +565,8 @@ impl> TimelineElementExt for O { 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, + glib::gobject_ffi::g_object_set_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"in-point\0".as_ptr() as *const _, Value::from(&in_point).to_glib_none().0, ); @@ -591,8 +576,8 @@ impl> TimelineElementExt for O { fn get_property_serialize(&self) -> bool { unsafe { let mut value = Value::from_type(::static_type()); - gobject_sys::g_object_get_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"serialize\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); @@ -605,8 +590,8 @@ impl> TimelineElementExt for O { fn set_property_serialize(&self, serialize: bool) { unsafe { - gobject_sys::g_object_set_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_set_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"serialize\0".as_ptr() as *const _, Value::from(&serialize).to_glib_none().0, ); @@ -631,9 +616,9 @@ impl> TimelineElementExt for O { fn connect_property_duration_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_duration_trampoline( - this: *mut ges_sys::GESTimelineElement, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESTimelineElement, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -655,9 +640,9 @@ impl> TimelineElementExt for O { fn connect_property_in_point_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_in_point_trampoline( - this: *mut ges_sys::GESTimelineElement, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESTimelineElement, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -682,9 +667,9 @@ impl> TimelineElementExt for O { f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_max_duration_trampoline( - this: *mut ges_sys::GESTimelineElement, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESTimelineElement, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -706,9 +691,9 @@ impl> TimelineElementExt for O { fn connect_property_name_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_name_trampoline( - this: *mut ges_sys::GESTimelineElement, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESTimelineElement, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -730,9 +715,9 @@ impl> TimelineElementExt for O { fn connect_property_parent_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_parent_trampoline( - this: *mut ges_sys::GESTimelineElement, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESTimelineElement, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -754,9 +739,9 @@ impl> TimelineElementExt for O { fn connect_property_priority_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_priority_trampoline( - this: *mut ges_sys::GESTimelineElement, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESTimelineElement, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -778,9 +763,9 @@ impl> TimelineElementExt for O { fn connect_property_serialize_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_serialize_trampoline( - this: *mut ges_sys::GESTimelineElement, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESTimelineElement, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -802,9 +787,9 @@ impl> TimelineElementExt for O { fn connect_property_start_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_start_trampoline( - this: *mut ges_sys::GESTimelineElement, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESTimelineElement, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -826,9 +811,9 @@ impl> TimelineElementExt for O { fn connect_property_timeline_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_timeline_trampoline( - this: *mut ges_sys::GESTimelineElement, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESTimelineElement, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { diff --git a/gstreamer-editing-services/src/auto/track.rs b/gstreamer-editing-services/src/auto/track.rs index 850547ffe..c32322606 100644 --- a/gstreamer-editing-services/src/auto/track.rs +++ b/gstreamer-editing-services/src/auto/track.rs @@ -2,42 +2,34 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT -use ges_sys; -use glib; +use crate::Timeline; +use crate::TrackElement; +use crate::TrackType; use glib::object::Cast; use glib::object::IsA; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] -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; #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] use std::ptr; -use Timeline; -use TrackElement; -use TrackType; -glib_wrapper! { - pub struct Track(Object) @extends gst::Element, gst::Object; +glib::glib_wrapper! { + pub struct Track(Object) @extends gst::Element, gst::Object; match fn { - get_type => || ges_sys::ges_track_get_type(), + get_type => || ffi::ges_track_get_type(), } } 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(ffi::ges_track_new(type_.to_glib(), caps.to_glib_full())) } } } @@ -87,7 +79,7 @@ pub trait GESTrackExt: 'static { #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] - fn get_property_id(&self) -> Option; + fn get_property_id(&self) -> Option; #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] @@ -126,8 +118,8 @@ pub trait GESTrackExt: 'static { impl> GESTrackExt for O { fn add_element>(&self, object: &P) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_track_add_element( + glib::glib_result_from_gboolean!( + ffi::ges_track_add_element( self.as_ref().to_glib_none().0, object.as_ref().to_glib_none().0 ), @@ -141,7 +133,7 @@ impl> GESTrackExt for O { fn add_element_full>(&self, object: &P) -> Result<(), glib::Error> { unsafe { let mut error = ptr::null_mut(); - let _ = ges_sys::ges_track_add_element_full( + let _ = ffi::ges_track_add_element_full( self.as_ref().to_glib_none().0, object.as_ref().to_glib_none().0, &mut error, @@ -155,45 +147,37 @@ impl> GESTrackExt for O { } fn commit(&self) -> bool { - unsafe { from_glib(ges_sys::ges_track_commit(self.as_ref().to_glib_none().0)) } + unsafe { from_glib(ffi::ges_track_commit(self.as_ref().to_glib_none().0)) } } fn get_caps(&self) -> Option { - unsafe { from_glib_none(ges_sys::ges_track_get_caps(self.as_ref().to_glib_none().0)) } + unsafe { from_glib_none(ffi::ges_track_get_caps(self.as_ref().to_glib_none().0)) } } fn get_elements(&self) -> Vec { unsafe { - FromGlibPtrContainer::from_glib_full(ges_sys::ges_track_get_elements( + FromGlibPtrContainer::from_glib_full(ffi::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, - )) - } + unsafe { from_glib(ffi::ges_track_get_mixing(self.as_ref().to_glib_none().0)) } } #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn get_restriction_caps(&self) -> Option { unsafe { - from_glib_full(ges_sys::ges_track_get_restriction_caps( + from_glib_full(ffi::ges_track_get_restriction_caps( self.as_ref().to_glib_none().0, )) } } fn get_timeline(&self) -> Option { - unsafe { - from_glib_none(ges_sys::ges_track_get_timeline( - self.as_ref().to_glib_none().0, - )) - } + unsafe { from_glib_none(ffi::ges_track_get_timeline(self.as_ref().to_glib_none().0)) } } fn remove_element>( @@ -201,8 +185,8 @@ impl> GESTrackExt for O { object: &P, ) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_track_remove_element( + glib::glib_result_from_gboolean!( + ffi::ges_track_remove_element( self.as_ref().to_glib_none().0, object.as_ref().to_glib_none().0 ), @@ -216,7 +200,7 @@ impl> GESTrackExt for O { fn remove_element_full>(&self, object: &P) -> Result<(), glib::Error> { unsafe { let mut error = ptr::null_mut(); - let _ = ges_sys::ges_track_remove_element_full( + let _ = ffi::ges_track_remove_element_full( self.as_ref().to_glib_none().0, object.as_ref().to_glib_none().0, &mut error, @@ -230,18 +214,18 @@ impl> GESTrackExt for O { } //fn set_create_element_for_gap_func gst::Element + 'static>(&self, func: P) { - // unsafe { TODO: call ges_sys:ges_track_set_create_element_for_gap_func() } + // unsafe { TODO: call ffi:ges_track_set_create_element_for_gap_func() } //} fn set_mixing(&self, mixing: bool) { unsafe { - ges_sys::ges_track_set_mixing(self.as_ref().to_glib_none().0, mixing.to_glib()); + ffi::ges_track_set_mixing(self.as_ref().to_glib_none().0, mixing.to_glib()); } } fn set_restriction_caps(&self, caps: &gst::Caps) { unsafe { - ges_sys::ges_track_set_restriction_caps( + ffi::ges_track_set_restriction_caps( self.as_ref().to_glib_none().0, caps.to_glib_none().0, ); @@ -250,7 +234,7 @@ impl> GESTrackExt for O { fn set_timeline>(&self, timeline: &P) { unsafe { - ges_sys::ges_track_set_timeline( + ffi::ges_track_set_timeline( self.as_ref().to_glib_none().0, timeline.as_ref().to_glib_none().0, ); @@ -259,7 +243,7 @@ impl> GESTrackExt for O { fn update_restriction_caps(&self, caps: &gst::Caps) { unsafe { - ges_sys::ges_track_update_restriction_caps( + ffi::ges_track_update_restriction_caps( self.as_ref().to_glib_none().0, caps.to_glib_none().0, ); @@ -269,8 +253,8 @@ impl> GESTrackExt for O { fn get_property_duration(&self) -> u64 { unsafe { let mut value = Value::from_type(::static_type()); - gobject_sys::g_object_get_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"duration\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); @@ -283,11 +267,11 @@ impl> GESTrackExt for O { #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] - fn get_property_id(&self) -> Option { + fn get_property_id(&self) -> Option { unsafe { - let mut value = Value::from_type(::static_type()); - gobject_sys::g_object_get_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + let mut value = Value::from_type(::static_type()); + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"id\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); @@ -299,8 +283,8 @@ impl> GESTrackExt for O { #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn set_property_id(&self, id: Option<&str>) { unsafe { - gobject_sys::g_object_set_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_set_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"id\0".as_ptr() as *const _, Value::from(id).to_glib_none().0, ); @@ -310,8 +294,8 @@ impl> GESTrackExt for O { fn get_property_restriction_caps(&self) -> Option { unsafe { let mut value = Value::from_type(::static_type()); - gobject_sys::g_object_get_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"restriction-caps\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); @@ -324,8 +308,8 @@ impl> GESTrackExt for O { fn get_property_track_type(&self) -> TrackType { unsafe { let mut value = Value::from_type(::static_type()); - gobject_sys::g_object_get_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"track-type\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); @@ -338,8 +322,8 @@ impl> GESTrackExt for O { fn connect_commited(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn commited_trampoline( - this: *mut ges_sys::GESTrack, - f: glib_sys::gpointer, + this: *mut ffi::GESTrack, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -364,9 +348,9 @@ impl> GESTrackExt for O { f: F, ) -> SignalHandlerId { unsafe extern "C" fn track_element_added_trampoline( - this: *mut ges_sys::GESTrack, - effect: *mut ges_sys::GESTrackElement, - f: glib_sys::gpointer, + this: *mut ffi::GESTrack, + effect: *mut ffi::GESTrackElement, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -397,9 +381,9 @@ impl> GESTrackExt for O { P, F: Fn(&P, &TrackElement) + 'static, >( - this: *mut ges_sys::GESTrack, - effect: *mut ges_sys::GESTrackElement, - f: glib_sys::gpointer, + this: *mut ffi::GESTrack, + effect: *mut ffi::GESTrackElement, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -424,9 +408,9 @@ impl> GESTrackExt for O { fn connect_property_duration_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_duration_trampoline( - this: *mut ges_sys::GESTrack, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESTrack, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -450,9 +434,9 @@ impl> GESTrackExt for O { #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn connect_property_id_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_id_trampoline( - this: *mut ges_sys::GESTrack, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESTrack, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -474,9 +458,9 @@ impl> GESTrackExt for O { fn connect_property_mixing_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_mixing_trampoline( - this: *mut ges_sys::GESTrack, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESTrack, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -501,9 +485,9 @@ impl> GESTrackExt for O { f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_restriction_caps_trampoline( - this: *mut ges_sys::GESTrack, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESTrack, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { diff --git a/gstreamer-editing-services/src/auto/track_element.rs b/gstreamer-editing-services/src/auto/track_element.rs index 0620decd4..4e988d41c 100644 --- a/gstreamer-editing-services/src/auto/track_element.rs +++ b/gstreamer-editing-services/src/auto/track_element.rs @@ -2,8 +2,13 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT -use ges_sys; -use glib; +use crate::Edge; +use crate::EditMode; +use crate::Extractable; +use crate::Layer; +use crate::TimelineElement; +use crate::Track; +use crate::TrackType; use glib::object::Cast; use glib::object::IsA; use glib::signal::connect_raw; @@ -11,24 +16,14 @@ 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 Edge; -use EditMode; -use Extractable; -use Layer; -use TimelineElement; -use Track; -use TrackType; -glib_wrapper! { - pub struct TrackElement(Object) @extends TimelineElement, @implements Extractable; +glib::glib_wrapper! { + pub struct TrackElement(Object) @extends TimelineElement, @implements Extractable; match fn { - get_type => || ges_sys::ges_track_element_get_type(), + get_type => || ffi::ges_track_element_get_type(), } } @@ -142,7 +137,7 @@ impl> TrackElementExt for O { whitelist: &[&str], ) { unsafe { - ges_sys::ges_track_element_add_children_props( + ffi::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, @@ -156,7 +151,7 @@ impl> TrackElementExt for O { #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn clamp_control_source(&self, property_name: &str) { unsafe { - ges_sys::ges_track_element_clamp_control_source( + ffi::ges_track_element_clamp_control_source( self.as_ref().to_glib_none().0, property_name.to_glib_none().0, ); @@ -171,8 +166,8 @@ impl> TrackElementExt for O { position: u64, ) -> Result<(), glib::error::BoolError> { unsafe { - glib_result_from_gboolean!( - ges_sys::ges_track_element_edit( + glib::glib_result_from_gboolean!( + ffi::ges_track_element_edit( self.as_ref().to_glib_none().0, layers.to_glib_none().0, mode.to_glib(), @@ -185,26 +180,26 @@ impl> TrackElementExt for O { } //fn get_all_control_bindings(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 6, id: 83 } { - // unsafe { TODO: call ges_sys:ges_track_element_get_all_control_bindings() } + // unsafe { TODO: call ffi:ges_track_element_get_all_control_bindings() } //} #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn get_auto_clamp_control_sources(&self) -> bool { unsafe { - from_glib(ges_sys::ges_track_element_get_auto_clamp_control_sources( + from_glib(ffi::ges_track_element_get_auto_clamp_control_sources( self.as_ref().to_glib_none().0, )) } } //fn get_control_binding(&self, property_name: &str) -> /*Ignored*/Option { - // unsafe { TODO: call ges_sys:ges_track_element_get_control_binding() } + // unsafe { TODO: call ffi:ges_track_element_get_control_binding() } //} fn get_element(&self) -> Option { unsafe { - from_glib_none(ges_sys::ges_track_element_get_element( + from_glib_none(ffi::ges_track_element_get_element( self.as_ref().to_glib_none().0, )) } @@ -212,7 +207,7 @@ impl> TrackElementExt for O { fn get_gnlobject(&self) -> Option { unsafe { - from_glib_none(ges_sys::ges_track_element_get_gnlobject( + from_glib_none(ffi::ges_track_element_get_gnlobject( self.as_ref().to_glib_none().0, )) } @@ -220,7 +215,7 @@ impl> TrackElementExt for O { fn get_nleobject(&self) -> Option { unsafe { - from_glib_none(ges_sys::ges_track_element_get_nleobject( + from_glib_none(ffi::ges_track_element_get_nleobject( self.as_ref().to_glib_none().0, )) } @@ -228,7 +223,7 @@ impl> TrackElementExt for O { fn get_track(&self) -> Option { unsafe { - from_glib_none(ges_sys::ges_track_element_get_track( + from_glib_none(ffi::ges_track_element_get_track( self.as_ref().to_glib_none().0, )) } @@ -236,7 +231,7 @@ impl> TrackElementExt for O { fn get_track_type(&self) -> TrackType { unsafe { - from_glib(ges_sys::ges_track_element_get_track_type( + from_glib(ffi::ges_track_element_get_track_type( self.as_ref().to_glib_none().0, )) } @@ -246,7 +241,7 @@ impl> TrackElementExt for O { #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn has_internal_source(&self) -> bool { unsafe { - from_glib(ges_sys::ges_track_element_has_internal_source( + from_glib(ffi::ges_track_element_has_internal_source( self.as_ref().to_glib_none().0, )) } @@ -254,7 +249,7 @@ impl> TrackElementExt for O { fn is_active(&self) -> bool { unsafe { - from_glib(ges_sys::ges_track_element_is_active( + from_glib(ffi::ges_track_element_is_active( self.as_ref().to_glib_none().0, )) } @@ -264,20 +259,20 @@ impl> TrackElementExt for O { #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn is_core(&self) -> bool { unsafe { - from_glib(ges_sys::ges_track_element_is_core( + from_glib(ffi::ges_track_element_is_core( self.as_ref().to_glib_none().0, )) } } //fn lookup_child(&self, prop_name: &str, pspec: /*Ignored*/glib::ParamSpec) -> Option { - // unsafe { TODO: call ges_sys:ges_track_element_lookup_child() } + // unsafe { TODO: call ffi:ges_track_element_lookup_child() } //} 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( + glib::glib_result_from_gboolean!( + ffi::ges_track_element_remove_control_binding( self.as_ref().to_glib_none().0, property_name.to_glib_none().0 ), @@ -288,7 +283,7 @@ impl> TrackElementExt for O { fn set_active(&self, active: bool) -> bool { unsafe { - from_glib(ges_sys::ges_track_element_set_active( + from_glib(ffi::ges_track_element_set_active( self.as_ref().to_glib_none().0, active.to_glib(), )) @@ -299,7 +294,7 @@ impl> TrackElementExt for O { #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn set_auto_clamp_control_sources(&self, auto_clamp: bool) { unsafe { - ges_sys::ges_track_element_set_auto_clamp_control_sources( + ffi::ges_track_element_set_auto_clamp_control_sources( self.as_ref().to_glib_none().0, auto_clamp.to_glib(), ); @@ -307,14 +302,14 @@ impl> TrackElementExt for O { } //fn set_control_source(&self, source: /*Ignored*/&gst::ControlSource, property_name: &str, binding_type: &str) -> bool { - // unsafe { TODO: call ges_sys:ges_track_element_set_control_source() } + // unsafe { TODO: call ffi:ges_track_element_set_control_source() } //} #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn set_has_internal_source(&self, has_internal_source: bool) -> bool { unsafe { - from_glib(ges_sys::ges_track_element_set_has_internal_source( + from_glib(ffi::ges_track_element_set_has_internal_source( self.as_ref().to_glib_none().0, has_internal_source.to_glib(), )) @@ -323,18 +318,15 @@ impl> 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(), - ); + ffi::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(::static_type()); - gobject_sys::g_object_get_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"active\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); @@ -350,8 +342,8 @@ impl> TrackElementExt for O { fn get_property_has_internal_source(&self) -> bool { unsafe { let mut value = Value::from_type(::static_type()); - gobject_sys::g_object_get_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"has-internal-source\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); @@ -372,9 +364,9 @@ impl> TrackElementExt for O { fn connect_property_active_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_active_trampoline( - this: *mut ges_sys::GESTrackElement, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESTrackElement, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -401,9 +393,9 @@ impl> TrackElementExt for O { f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_auto_clamp_control_sources_trampoline( - this: *mut ges_sys::GESTrackElement, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESTrackElement, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -430,9 +422,9 @@ impl> TrackElementExt for O { f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_has_internal_source_trampoline( - this: *mut ges_sys::GESTrackElement, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESTrackElement, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -454,9 +446,9 @@ impl> TrackElementExt for O { fn connect_property_track_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_track_trampoline( - this: *mut ges_sys::GESTrackElement, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESTrackElement, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -478,9 +470,9 @@ impl> TrackElementExt for O { fn connect_property_track_type_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_track_type_trampoline( - this: *mut ges_sys::GESTrackElement, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESTrackElement, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { diff --git a/gstreamer-editing-services/src/auto/uri_clip.rs b/gstreamer-editing-services/src/auto/uri_clip.rs index 52087d7aa..cd31ad18f 100644 --- a/gstreamer-editing-services/src/auto/uri_clip.rs +++ b/gstreamer-editing-services/src/auto/uri_clip.rs @@ -2,30 +2,25 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT -use ges_sys; -use glib; +use crate::Clip; +use crate::Container; +use crate::Extractable; +use crate::TimelineElement; 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 std::boxed::Box as Box_; use std::mem::transmute; -use Clip; -use Container; -use Extractable; -use TimelineElement; -glib_wrapper! { - pub struct UriClip(Object) @extends Clip, Container, TimelineElement, @implements Extractable; +glib::glib_wrapper! { + pub struct UriClip(Object) @extends Clip, Container, TimelineElement, @implements Extractable; match fn { - get_type => || ges_sys::ges_uri_clip_get_type(), + get_type => || ffi::ges_uri_clip_get_type(), } } @@ -33,8 +28,8 @@ impl UriClip { pub fn new(uri: &str) -> Result { assert_initialized_main_thread!(); unsafe { - Option::<_>::from_glib_none(ges_sys::ges_uri_clip_new(uri.to_glib_none().0)) - .ok_or_else(|| glib_bool_error!("Failed to create Uri clip from Uri")) + Option::<_>::from_glib_none(ffi::ges_uri_clip_new(uri.to_glib_none().0)) + .ok_or_else(|| glib::glib_bool_error!("Failed to create Uri clip from Uri")) } } } @@ -42,7 +37,7 @@ impl UriClip { pub const NONE_URI_CLIP: Option<&UriClip> = None; pub trait UriClipExt: 'static { - fn get_uri(&self) -> Option; + fn get_uri(&self) -> Option; fn is_image(&self) -> bool; @@ -67,47 +62,35 @@ pub trait UriClipExt: 'static { } impl> UriClipExt for O { - fn get_uri(&self) -> Option { - unsafe { - from_glib_none(ges_sys::ges_uri_clip_get_uri( - self.as_ref().to_glib_none().0, - )) - } + fn get_uri(&self) -> Option { + unsafe { from_glib_none(ffi::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, - )) - } + unsafe { from_glib(ffi::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, - )) - } + unsafe { from_glib(ffi::ges_uri_clip_is_muted(self.as_ref().to_glib_none().0)) } } fn set_is_image(&self, is_image: bool) { unsafe { - ges_sys::ges_uri_clip_set_is_image(self.as_ref().to_glib_none().0, is_image.to_glib()); + ffi::ges_uri_clip_set_is_image(self.as_ref().to_glib_none().0, is_image.to_glib()); } } fn set_mute(&self, mute: bool) { unsafe { - ges_sys::ges_uri_clip_set_mute(self.as_ref().to_glib_none().0, mute.to_glib()); + ffi::ges_uri_clip_set_mute(self.as_ref().to_glib_none().0, mute.to_glib()); } } fn get_property_is_image(&self) -> bool { unsafe { let mut value = Value::from_type(::static_type()); - gobject_sys::g_object_get_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"is-image\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); @@ -121,8 +104,8 @@ impl> UriClipExt for O { fn get_property_mute(&self) -> bool { unsafe { let mut value = Value::from_type(::static_type()); - gobject_sys::g_object_get_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"mute\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); @@ -135,9 +118,9 @@ impl> UriClipExt for O { fn connect_property_is_image_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_is_image_trampoline( - this: *mut ges_sys::GESUriClip, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESUriClip, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -159,9 +142,9 @@ impl> UriClipExt for O { fn connect_property_mute_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_mute_trampoline( - this: *mut ges_sys::GESUriClip, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESUriClip, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -186,9 +169,9 @@ impl> UriClipExt for O { f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_supported_formats_trampoline( - this: *mut ges_sys::GESUriClip, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESUriClip, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { diff --git a/gstreamer-editing-services/src/auto/uri_clip_asset.rs b/gstreamer-editing-services/src/auto/uri_clip_asset.rs index a5a8dadb5..351d1f28f 100644 --- a/gstreamer-editing-services/src/auto/uri_clip_asset.rs +++ b/gstreamer-editing-services/src/auto/uri_clip_asset.rs @@ -2,8 +2,8 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT -use ges_sys; -use glib; +use crate::Asset; +use crate::UriSourceAsset; use glib::object::Cast; use glib::object::IsA; use glib::signal::connect_raw; @@ -13,21 +13,15 @@ use glib::translate::*; #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] use glib::StaticType; use glib::Value; -use glib_sys; -use gobject_sys; -use gst; -use gst_pbutils; use std::boxed::Box as Box_; use std::mem::transmute; use std::ptr; -use Asset; -use UriSourceAsset; -glib_wrapper! { - pub struct UriClipAsset(Object) @extends Asset; +glib::glib_wrapper! { + pub struct UriClipAsset(Object) @extends Asset; match fn { - get_type => || ges_sys::ges_uri_clip_asset_get_type(), + get_type => || ffi::ges_uri_clip_asset_get_type(), } } @@ -35,18 +29,18 @@ impl UriClipAsset { //#[cfg(any(feature = "v1_16", feature = "dox"))] //#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] //pub fn finish(res: /*Ignored*/&gio::AsyncResult) -> Result { - // unsafe { TODO: call ges_sys:ges_uri_clip_asset_finish() } + // unsafe { TODO: call ffi:ges_uri_clip_asset_finish() } //} //pub fn new, Q: FnOnce(Result<(), glib::Error>) + 'static>(uri: &str, cancellable: Option<&P>, callback: Q) { - // unsafe { TODO: call ges_sys:ges_uri_clip_asset_new() } + // unsafe { TODO: call ffi:ges_uri_clip_asset_new() } //} pub fn request_sync(uri: &str) -> Result { assert_initialized_main_thread!(); unsafe { let mut error = ptr::null_mut(); - let ret = ges_sys::ges_uri_clip_asset_request_sync(uri.to_glib_none().0, &mut error); + let ret = ffi::ges_uri_clip_asset_request_sync(uri.to_glib_none().0, &mut error); if error.is_null() { Ok(from_glib_full(ret)) } else { @@ -92,7 +86,7 @@ pub trait UriClipAssetExt: 'static { impl> UriClipAssetExt for O { fn get_duration(&self) -> gst::ClockTime { unsafe { - from_glib(ges_sys::ges_uri_clip_asset_get_duration( + from_glib(ffi::ges_uri_clip_asset_get_duration( self.as_ref().to_glib_none().0, )) } @@ -100,7 +94,7 @@ impl> UriClipAssetExt for O { fn get_info(&self) -> Option { unsafe { - from_glib_none(ges_sys::ges_uri_clip_asset_get_info(const_override( + from_glib_none(ffi::ges_uri_clip_asset_get_info(const_override( self.as_ref().to_glib_none().0, ))) } @@ -110,7 +104,7 @@ impl> UriClipAssetExt for O { #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn get_max_duration(&self) -> gst::ClockTime { unsafe { - from_glib(ges_sys::ges_uri_clip_asset_get_max_duration( + from_glib(ffi::ges_uri_clip_asset_get_max_duration( self.as_ref().to_glib_none().0, )) } @@ -118,7 +112,7 @@ impl> UriClipAssetExt for O { fn get_stream_assets(&self) -> Vec { unsafe { - FromGlibPtrContainer::from_glib_none(ges_sys::ges_uri_clip_asset_get_stream_assets( + FromGlibPtrContainer::from_glib_none(ffi::ges_uri_clip_asset_get_stream_assets( self.as_ref().to_glib_none().0, )) } @@ -128,7 +122,7 @@ impl> UriClipAssetExt for O { #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn is_image(&self) -> bool { unsafe { - from_glib(ges_sys::ges_uri_clip_asset_is_image( + from_glib(ffi::ges_uri_clip_asset_is_image( self.as_ref().to_glib_none().0, )) } @@ -136,8 +130,8 @@ impl> UriClipAssetExt for O { fn set_property_duration(&self, duration: u64) { unsafe { - gobject_sys::g_object_set_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_set_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"duration\0".as_ptr() as *const _, Value::from(&duration).to_glib_none().0, ); @@ -149,8 +143,8 @@ impl> UriClipAssetExt for O { fn get_property_is_nested_timeline(&self) -> bool { unsafe { let mut value = Value::from_type(::static_type()); - gobject_sys::g_object_get_property( - self.to_glib_none().0 as *mut gobject_sys::GObject, + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, b"is-nested-timeline\0".as_ptr() as *const _, value.to_glib_none_mut().0, ); @@ -163,9 +157,9 @@ impl> UriClipAssetExt for O { fn connect_property_duration_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_duration_trampoline( - this: *mut ges_sys::GESUriClipAsset, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESUriClipAsset, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { @@ -192,9 +186,9 @@ impl> UriClipAssetExt for O { f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_is_nested_timeline_trampoline( - this: *mut ges_sys::GESUriClipAsset, - _param_spec: glib_sys::gpointer, - f: glib_sys::gpointer, + this: *mut ffi::GESUriClipAsset, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, ) where P: IsA, { diff --git a/gstreamer-editing-services/src/auto/uri_source_asset.rs b/gstreamer-editing-services/src/auto/uri_source_asset.rs index f47acefa3..b7401c679 100644 --- a/gstreamer-editing-services/src/auto/uri_source_asset.rs +++ b/gstreamer-editing-services/src/auto/uri_source_asset.rs @@ -2,19 +2,16 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT -use ges_sys; +use crate::Asset; +use crate::UriClipAsset; use glib::object::IsA; use glib::translate::*; -use glib::GString; -use gst_pbutils; -use Asset; -use UriClipAsset; -glib_wrapper! { - pub struct UriSourceAsset(Object) @extends Asset; +glib::glib_wrapper! { + pub struct UriSourceAsset(Object) @extends Asset; match fn { - get_type => || ges_sys::ges_uri_source_asset_get_type(), + get_type => || ffi::ges_uri_source_asset_get_type(), } } @@ -25,7 +22,7 @@ pub trait UriSourceAssetExt: 'static { fn get_stream_info(&self) -> Option; - fn get_stream_uri(&self) -> Option; + fn get_stream_uri(&self) -> Option; #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] @@ -35,7 +32,7 @@ pub trait UriSourceAssetExt: 'static { impl> UriSourceAssetExt for O { fn get_filesource_asset(&self) -> Option { unsafe { - from_glib_none(ges_sys::ges_uri_source_asset_get_filesource_asset( + from_glib_none(ffi::ges_uri_source_asset_get_filesource_asset( self.as_ref().to_glib_none().0, )) } @@ -43,15 +40,15 @@ impl> UriSourceAssetExt for O { fn get_stream_info(&self) -> Option { unsafe { - from_glib_none(ges_sys::ges_uri_source_asset_get_stream_info( + from_glib_none(ffi::ges_uri_source_asset_get_stream_info( self.as_ref().to_glib_none().0, )) } } - fn get_stream_uri(&self) -> Option { + fn get_stream_uri(&self) -> Option { unsafe { - from_glib_none(ges_sys::ges_uri_source_asset_get_stream_uri( + from_glib_none(ffi::ges_uri_source_asset_get_stream_uri( self.as_ref().to_glib_none().0, )) } @@ -61,7 +58,7 @@ impl> UriSourceAssetExt for O { #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] fn is_image(&self) -> bool { unsafe { - from_glib(ges_sys::ges_uri_source_asset_is_image( + from_glib(ffi::ges_uri_source_asset_is_image( self.as_ref().to_glib_none().0, )) } diff --git a/gstreamer-editing-services/src/auto/versions.txt b/gstreamer-editing-services/src/auto/versions.txt index bdfc6f381..ba8538677 100644 --- a/gstreamer-editing-services/src/auto/versions.txt +++ b/gstreamer-editing-services/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 062b3d6) -from gir-files (https://github.com/gtk-rs/gir-files @ b84cead5) +Generated by gir (https://github.com/gtk-rs/gir @ 694b4b8) +from gir-files (https://github.com/gtk-rs/gir-files @ 42578da2)