diff --git a/gstreamer-editing-services/Gir.toml b/gstreamer-editing-services/Gir.toml index 5c0000603..3081a3ef5 100644 --- a/gstreamer-editing-services/Gir.toml +++ b/gstreamer-editing-services/Gir.toml @@ -17,6 +17,7 @@ external_libraries = [ ] manual = [ + "GLib.Date", "GLib.DateTime", "GLib.Error", "GLib.Source", @@ -25,6 +26,8 @@ manual = [ "Gio.AsyncReadyCallback", "GObject.Object", "GObject.Value", + "Gst.DateTime", + "Gst.ChildProxy", "Gst.ControlBinding", "Gst.ControlSource", "Gst.CoreError", @@ -53,6 +56,49 @@ generate = [ "GES.TransitionClip", "GES.BaseTransitionClip", "GES.VideoStandardTransitionType", + "GES.Source", + "GES.AudioSource", + "GES.AudioTestSource", + "GES.AudioTrack", + "GES.AudioTransition", + "GES.Operation", + "GES.Transition", + "GES.AudioUriSource", + "GES.BaseEffectClip", + "GES.Formatter", + "GES.BaseXmlFormatter", + "GES.ChildrenControlMode", + "GES.ClipAsset", + "GES.TrackElementAsset", + "GES.EffectAsset", + "GES.EffectClip", + "GES.ExtractableCheckId", + "GES.VideoUriSource", + "GES.VideoSource", + "GES.ImageSource", + "GES.MultiFileSource", + "GES.OverlayClip", + "GES.MetaContainer", + "GES.MetaFlag", + "GES.Marker", + "GES.MarkerList", + "GES.MarkerFlags", + "GES.SourceClip", + "GES.SourceClipAsset", + "GES.TestClip", + "GES.VideoTestPattern", + "GES.VideoTestSource", + "GES.VideoTrack", + "GES.VideoTransition", + "GES.XmlFormatter", + "GES.TextHAlign", + "GES.TextVAlign", + "GES.TextOverlay", + "GES.TextOverlayClip", + "GES.TitleClip", + "GES.TitleSource", + "GES.AssetLoadingReturn", + "GES.Error", ] [[object]] @@ -120,6 +166,18 @@ status = "generate" [object.function.return] nullable_return_is_error = "Failed to create Uri clip from Uri" +[[object]] +name = "GES.CommandLineFormatter" +status = "generate" + [[object.function]] + name = "get_help" + [object.function.return] + nullable = false + [[object.function]] + name = "get_timeline_uri" + [object.function.return] + nullable = false + [[object]] name = "GES.Timeline" status = "generate" diff --git a/gstreamer-editing-services/src/auto/asset.rs b/gstreamer-editing-services/src/auto/asset.rs index bf070e733..8f5bed30e 100644 --- a/gstreamer-editing-services/src/auto/asset.rs +++ b/gstreamer-editing-services/src/auto/asset.rs @@ -4,6 +4,7 @@ // DO NOT EDIT use crate::Extractable; +use crate::MetaContainer; use glib::object::Cast; use glib::object::IsA; use glib::signal::connect_raw; @@ -16,7 +17,7 @@ use std::ptr; glib::wrapper! { #[doc(alias = "GESAsset")] - pub struct Asset(Object); + pub struct Asset(Object) @implements MetaContainer; match fn { type_ => || ffi::ges_asset_get_type(), diff --git a/gstreamer-editing-services/src/auto/audio_source.rs b/gstreamer-editing-services/src/auto/audio_source.rs new file mode 100644 index 000000000..638291f20 --- /dev/null +++ b/gstreamer-editing-services/src/auto/audio_source.rs @@ -0,0 +1,23 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Extractable; +use crate::MetaContainer; +use crate::Source; +use crate::TimelineElement; +use crate::TrackElement; + +glib::wrapper! { + #[doc(alias = "GESAudioSource")] + pub struct AudioSource(Object) @extends Source, TrackElement, TimelineElement, @implements Extractable, MetaContainer; + + match fn { + type_ => || ffi::ges_audio_source_get_type(), + } +} + +impl AudioSource {} + +pub const NONE_AUDIO_SOURCE: Option<&AudioSource> = None; diff --git a/gstreamer-editing-services/src/auto/audio_test_source.rs b/gstreamer-editing-services/src/auto/audio_test_source.rs new file mode 100644 index 000000000..01ca508fd --- /dev/null +++ b/gstreamer-editing-services/src/auto/audio_test_source.rs @@ -0,0 +1,62 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::AudioSource; +use crate::Extractable; +use crate::MetaContainer; +use crate::Source; +use crate::TimelineElement; +use crate::TrackElement; +use glib::object::IsA; +use glib::translate::*; + +glib::wrapper! { + #[doc(alias = "GESAudioTestSource")] + pub struct AudioTestSource(Object) @extends AudioSource, Source, TrackElement, TimelineElement, @implements Extractable, MetaContainer; + + match fn { + type_ => || ffi::ges_audio_test_source_get_type(), + } +} + +pub const NONE_AUDIO_TEST_SOURCE: Option<&AudioTestSource> = None; + +pub trait AudioTestSourceExt: 'static { + #[doc(alias = "ges_audio_test_source_get_freq")] + #[doc(alias = "get_freq")] + fn freq(&self) -> f64; + + #[doc(alias = "ges_audio_test_source_get_volume")] + #[doc(alias = "get_volume")] + fn volume(&self) -> f64; + + #[doc(alias = "ges_audio_test_source_set_freq")] + fn set_freq(&self, freq: f64); + + #[doc(alias = "ges_audio_test_source_set_volume")] + fn set_volume(&self, volume: f64); +} + +impl> AudioTestSourceExt for O { + fn freq(&self) -> f64 { + unsafe { ffi::ges_audio_test_source_get_freq(self.as_ref().to_glib_none().0) } + } + + fn volume(&self) -> f64 { + unsafe { ffi::ges_audio_test_source_get_volume(self.as_ref().to_glib_none().0) } + } + + fn set_freq(&self, freq: f64) { + unsafe { + ffi::ges_audio_test_source_set_freq(self.as_ref().to_glib_none().0, freq); + } + } + + fn set_volume(&self, volume: f64) { + unsafe { + ffi::ges_audio_test_source_set_volume(self.as_ref().to_glib_none().0, volume); + } + } +} diff --git a/gstreamer-editing-services/src/auto/audio_track.rs b/gstreamer-editing-services/src/auto/audio_track.rs new file mode 100644 index 000000000..237b202ab --- /dev/null +++ b/gstreamer-editing-services/src/auto/audio_track.rs @@ -0,0 +1,33 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::MetaContainer; +use crate::Track; +use glib::translate::*; + +glib::wrapper! { + #[doc(alias = "GESAudioTrack")] + pub struct AudioTrack(Object) @extends Track, gst::Bin, gst::Element, gst::Object, @implements gst::ChildProxy, MetaContainer; + + match fn { + type_ => || ffi::ges_audio_track_get_type(), + } +} + +impl AudioTrack { + #[doc(alias = "ges_audio_track_new")] + pub fn new() -> AudioTrack { + assert_initialized_main_thread!(); + unsafe { from_glib_none(ffi::ges_audio_track_new()) } + } +} + +impl Default for AudioTrack { + fn default() -> Self { + Self::new() + } +} + +pub const NONE_AUDIO_TRACK: Option<&AudioTrack> = None; diff --git a/gstreamer-editing-services/src/auto/audio_transition.rs b/gstreamer-editing-services/src/auto/audio_transition.rs new file mode 100644 index 000000000..2d2571788 --- /dev/null +++ b/gstreamer-editing-services/src/auto/audio_transition.rs @@ -0,0 +1,38 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Extractable; +use crate::MetaContainer; +use crate::Operation; +use crate::TimelineElement; +use crate::TrackElement; +use crate::Transition; +use glib::translate::*; + +glib::wrapper! { + #[doc(alias = "GESAudioTransition")] + pub struct AudioTransition(Object) @extends Transition, Operation, TrackElement, TimelineElement, @implements Extractable, MetaContainer; + + match fn { + type_ => || ffi::ges_audio_transition_get_type(), + } +} + +impl AudioTransition { + #[cfg_attr(feature = "v1_18", deprecated = "Since 1.18")] + #[doc(alias = "ges_audio_transition_new")] + pub fn new() -> AudioTransition { + assert_initialized_main_thread!(); + unsafe { from_glib_none(ffi::ges_audio_transition_new()) } + } +} + +impl Default for AudioTransition { + fn default() -> Self { + Self::new() + } +} + +pub const NONE_AUDIO_TRANSITION: Option<&AudioTransition> = None; diff --git a/gstreamer-editing-services/src/auto/audio_uri_source.rs b/gstreamer-editing-services/src/auto/audio_uri_source.rs new file mode 100644 index 000000000..b775ac903 --- /dev/null +++ b/gstreamer-editing-services/src/auto/audio_uri_source.rs @@ -0,0 +1,43 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::AudioSource; +use crate::Extractable; +use crate::MetaContainer; +use crate::Source; +use crate::TimelineElement; +use crate::TrackElement; +use glib::object::IsA; +use glib::translate::*; +use glib::StaticType; + +glib::wrapper! { + #[doc(alias = "GESAudioUriSource")] + pub struct AudioUriSource(Object) @extends AudioSource, Source, TrackElement, TimelineElement, @implements Extractable, MetaContainer; + + match fn { + type_ => || ffi::ges_audio_uri_source_get_type(), + } +} + +pub const NONE_AUDIO_URI_SOURCE: Option<&AudioUriSource> = None; + +pub trait AudioUriSourceExt: 'static { + fn uri(&self) -> Option; +} + +impl> AudioUriSourceExt for O { + fn uri(&self) -> Option { + unsafe { + let mut value = glib::Value::from_type(::static_type()); + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, + b"uri\0".as_ptr() as *const _, + value.to_glib_none_mut().0, + ); + value.get().expect("Return Value for property `uri` getter") + } + } +} diff --git a/gstreamer-editing-services/src/auto/base_effect.rs b/gstreamer-editing-services/src/auto/base_effect.rs index ad10b642d..bce864c3d 100644 --- a/gstreamer-editing-services/src/auto/base_effect.rs +++ b/gstreamer-editing-services/src/auto/base_effect.rs @@ -4,6 +4,8 @@ // DO NOT EDIT use crate::Extractable; +use crate::MetaContainer; +use crate::Operation; use crate::TimelineElement; use crate::TrackElement; use glib::object::IsA; @@ -13,7 +15,7 @@ use glib::translate::*; glib::wrapper! { #[doc(alias = "GESBaseEffect")] - pub struct BaseEffect(Object) @extends TrackElement, TimelineElement, @implements Extractable; + pub struct BaseEffect(Object) @extends Operation, TrackElement, TimelineElement, @implements Extractable, MetaContainer; match fn { type_ => || ffi::ges_base_effect_get_type(), diff --git a/gstreamer-editing-services/src/auto/base_effect_clip.rs b/gstreamer-editing-services/src/auto/base_effect_clip.rs new file mode 100644 index 000000000..b521f9228 --- /dev/null +++ b/gstreamer-editing-services/src/auto/base_effect_clip.rs @@ -0,0 +1,24 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Clip; +use crate::Container; +use crate::Extractable; +use crate::MetaContainer; +use crate::OperationClip; +use crate::TimelineElement; + +glib::wrapper! { + #[doc(alias = "GESBaseEffectClip")] + pub struct BaseEffectClip(Object) @extends OperationClip, Clip, Container, TimelineElement, @implements Extractable, MetaContainer; + + match fn { + type_ => || ffi::ges_base_effect_clip_get_type(), + } +} + +impl BaseEffectClip {} + +pub const NONE_BASE_EFFECT_CLIP: Option<&BaseEffectClip> = None; diff --git a/gstreamer-editing-services/src/auto/base_transition_clip.rs b/gstreamer-editing-services/src/auto/base_transition_clip.rs index a753719bd..d9ae31557 100644 --- a/gstreamer-editing-services/src/auto/base_transition_clip.rs +++ b/gstreamer-editing-services/src/auto/base_transition_clip.rs @@ -6,12 +6,13 @@ use crate::Clip; use crate::Container; use crate::Extractable; +use crate::MetaContainer; use crate::OperationClip; use crate::TimelineElement; glib::wrapper! { #[doc(alias = "GESBaseTransitionClip")] - pub struct BaseTransitionClip(Object) @extends OperationClip, Clip, Container, TimelineElement, @implements Extractable; + pub struct BaseTransitionClip(Object) @extends OperationClip, Clip, Container, TimelineElement, @implements Extractable, MetaContainer; match fn { type_ => || ffi::ges_base_transition_clip_get_type(), diff --git a/gstreamer-editing-services/src/auto/base_xml_formatter.rs b/gstreamer-editing-services/src/auto/base_xml_formatter.rs new file mode 100644 index 000000000..d42dddc2d --- /dev/null +++ b/gstreamer-editing-services/src/auto/base_xml_formatter.rs @@ -0,0 +1,20 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Extractable; +use crate::Formatter; + +glib::wrapper! { + #[doc(alias = "GESBaseXmlFormatter")] + pub struct BaseXmlFormatter(Object) @extends Formatter, @implements Extractable; + + match fn { + type_ => || ffi::ges_base_xml_formatter_get_type(), + } +} + +impl BaseXmlFormatter {} + +pub const NONE_BASE_XML_FORMATTER: Option<&BaseXmlFormatter> = None; diff --git a/gstreamer-editing-services/src/auto/clip.rs b/gstreamer-editing-services/src/auto/clip.rs index a05dccdde..9d8f0cf09 100644 --- a/gstreamer-editing-services/src/auto/clip.rs +++ b/gstreamer-editing-services/src/auto/clip.rs @@ -11,6 +11,7 @@ use crate::Extractable; #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] use crate::FrameNumber; use crate::Layer; +use crate::MetaContainer; use crate::TimelineElement; use crate::Track; use crate::TrackElement; @@ -28,7 +29,7 @@ use std::ptr; glib::wrapper! { #[doc(alias = "GESClip")] - pub struct Clip(Object) @extends Container, TimelineElement, @implements Extractable; + pub struct Clip(Object) @extends Container, TimelineElement, @implements Extractable, MetaContainer; match fn { type_ => || ffi::ges_clip_get_type(), diff --git a/gstreamer-editing-services/src/auto/clip_asset.rs b/gstreamer-editing-services/src/auto/clip_asset.rs new file mode 100644 index 000000000..b1abfaaac --- /dev/null +++ b/gstreamer-editing-services/src/auto/clip_asset.rs @@ -0,0 +1,132 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Asset; +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +use crate::FrameNumber; +use crate::MetaContainer; +use crate::TrackType; +use glib::object::Cast; +use glib::object::IsA; +use glib::signal::connect_raw; +use glib::signal::SignalHandlerId; +use glib::translate::*; +use std::boxed::Box as Box_; +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +use std::mem; +use std::mem::transmute; + +glib::wrapper! { + #[doc(alias = "GESClipAsset")] + pub struct ClipAsset(Object) @extends Asset, @implements MetaContainer; + + match fn { + type_ => || ffi::ges_clip_asset_get_type(), + } +} + +pub const NONE_CLIP_ASSET: Option<&ClipAsset> = None; + +pub trait ClipAssetExt: 'static { + #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[doc(alias = "ges_clip_asset_get_frame_time")] + #[doc(alias = "get_frame_time")] + fn frame_time(&self, frame_number: FrameNumber) -> Option; + + #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[doc(alias = "ges_clip_asset_get_natural_framerate")] + #[doc(alias = "get_natural_framerate")] + fn natural_framerate(&self) -> Option<(i32, i32)>; + + #[doc(alias = "ges_clip_asset_get_supported_formats")] + #[doc(alias = "get_supported_formats")] + fn supported_formats(&self) -> TrackType; + + #[doc(alias = "ges_clip_asset_set_supported_formats")] + fn set_supported_formats(&self, supportedformats: TrackType); + + #[doc(alias = "supported-formats")] + fn connect_supported_formats_notify(&self, f: F) -> SignalHandlerId; +} + +impl> ClipAssetExt for O { + #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + fn frame_time(&self, frame_number: FrameNumber) -> Option { + unsafe { + from_glib(ffi::ges_clip_asset_get_frame_time( + self.as_ref().to_glib_none().0, + frame_number, + )) + } + } + + #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + fn natural_framerate(&self) -> Option<(i32, i32)> { + unsafe { + let mut framerate_n = mem::MaybeUninit::uninit(); + let mut framerate_d = mem::MaybeUninit::uninit(); + let ret = from_glib(ffi::ges_clip_asset_get_natural_framerate( + self.as_ref().to_glib_none().0, + framerate_n.as_mut_ptr(), + framerate_d.as_mut_ptr(), + )); + let framerate_n = framerate_n.assume_init(); + let framerate_d = framerate_d.assume_init(); + if ret { + Some((framerate_n, framerate_d)) + } else { + None + } + } + } + + fn supported_formats(&self) -> TrackType { + unsafe { + from_glib(ffi::ges_clip_asset_get_supported_formats( + self.as_ref().to_glib_none().0, + )) + } + } + + fn set_supported_formats(&self, supportedformats: TrackType) { + unsafe { + ffi::ges_clip_asset_set_supported_formats( + self.as_ref().to_glib_none().0, + supportedformats.into_glib(), + ); + } + } + + fn connect_supported_formats_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_supported_formats_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::GESClipAsset, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(ClipAsset::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::supported-formats\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_supported_formats_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } +} diff --git a/gstreamer-editing-services/src/auto/command_line_formatter.rs b/gstreamer-editing-services/src/auto/command_line_formatter.rs new file mode 100644 index 000000000..077a9c62e --- /dev/null +++ b/gstreamer-editing-services/src/auto/command_line_formatter.rs @@ -0,0 +1,57 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Extractable; +use crate::Formatter; +#[cfg(any(feature = "v1_20", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))] +use crate::Timeline; +#[cfg(any(feature = "v1_20", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))] +use glib::object::IsA; +#[cfg(any(feature = "v1_10", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] +use glib::translate::*; + +glib::wrapper! { + #[doc(alias = "GESCommandLineFormatter")] + pub struct CommandLineFormatter(Object) @extends Formatter, @implements Extractable; + + match fn { + type_ => || ffi::ges_command_line_formatter_get_type(), + } +} + +impl CommandLineFormatter { + #[cfg(any(feature = "v1_10", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[doc(alias = "ges_command_line_formatter_get_help")] + #[doc(alias = "get_help")] + pub fn help(commands: &[&str]) -> glib::GString { + assert_initialized_main_thread!(); + let nargs = commands.len() as i32; + unsafe { + from_glib_full(ffi::ges_command_line_formatter_get_help( + nargs, + commands.to_glib_none().0, + )) + } + } + + #[cfg(any(feature = "v1_20", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))] + #[doc(alias = "ges_command_line_formatter_get_timeline_uri")] + #[doc(alias = "get_timeline_uri")] + pub fn timeline_uri(timeline: &impl IsA) -> glib::GString { + skip_assert_initialized!(); + unsafe { + from_glib_full(ffi::ges_command_line_formatter_get_timeline_uri( + timeline.as_ref().to_glib_none().0, + )) + } + } +} + +pub const NONE_COMMAND_LINE_FORMATTER: Option<&CommandLineFormatter> = None; diff --git a/gstreamer-editing-services/src/auto/container.rs b/gstreamer-editing-services/src/auto/container.rs index 8008e4374..74ed9faf6 100644 --- a/gstreamer-editing-services/src/auto/container.rs +++ b/gstreamer-editing-services/src/auto/container.rs @@ -7,6 +7,7 @@ use crate::Edge; use crate::EditMode; use crate::Extractable; use crate::Layer; +use crate::MetaContainer; use crate::TimelineElement; use glib::object::Cast; use glib::object::IsA; @@ -19,7 +20,7 @@ use std::mem::transmute; glib::wrapper! { #[doc(alias = "GESContainer")] - pub struct Container(Object) @extends TimelineElement, @implements Extractable; + pub struct Container(Object) @extends TimelineElement, @implements Extractable, MetaContainer; match fn { type_ => || ffi::ges_container_get_type(), diff --git a/gstreamer-editing-services/src/auto/effect.rs b/gstreamer-editing-services/src/auto/effect.rs index eca3c47f9..b58fd9392 100644 --- a/gstreamer-editing-services/src/auto/effect.rs +++ b/gstreamer-editing-services/src/auto/effect.rs @@ -5,6 +5,8 @@ use crate::BaseEffect; use crate::Extractable; +use crate::MetaContainer; +use crate::Operation; use crate::TimelineElement; use crate::TrackElement; use glib::object::IsA; @@ -13,7 +15,7 @@ use glib::StaticType; glib::wrapper! { #[doc(alias = "GESEffect")] - pub struct Effect(Object) @extends BaseEffect, TrackElement, TimelineElement, @implements Extractable; + pub struct Effect(Object) @extends BaseEffect, Operation, TrackElement, TimelineElement, @implements Extractable, MetaContainer; match fn { type_ => || ffi::ges_effect_get_type(), diff --git a/gstreamer-editing-services/src/auto/effect_asset.rs b/gstreamer-editing-services/src/auto/effect_asset.rs new file mode 100644 index 000000000..08b7fc26c --- /dev/null +++ b/gstreamer-editing-services/src/auto/effect_asset.rs @@ -0,0 +1,21 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Asset; +use crate::MetaContainer; +use crate::TrackElementAsset; + +glib::wrapper! { + #[doc(alias = "GESEffectAsset")] + pub struct EffectAsset(Object) @extends TrackElementAsset, Asset, @implements MetaContainer; + + match fn { + type_ => || ffi::ges_effect_asset_get_type(), + } +} + +impl EffectAsset {} + +pub const NONE_EFFECT_ASSET: Option<&EffectAsset> = None; diff --git a/gstreamer-editing-services/src/auto/effect_clip.rs b/gstreamer-editing-services/src/auto/effect_clip.rs new file mode 100644 index 000000000..d86e4ae4f --- /dev/null +++ b/gstreamer-editing-services/src/auto/effect_clip.rs @@ -0,0 +1,80 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::BaseEffectClip; +use crate::Clip; +use crate::Container; +use crate::Extractable; +use crate::MetaContainer; +use crate::OperationClip; +use crate::TimelineElement; +use glib::object::IsA; +use glib::translate::*; +use glib::StaticType; + +glib::wrapper! { + #[doc(alias = "GESEffectClip")] + pub struct EffectClip(Object) @extends BaseEffectClip, OperationClip, Clip, Container, TimelineElement, @implements Extractable, MetaContainer; + + match fn { + type_ => || ffi::ges_effect_clip_get_type(), + } +} + +impl EffectClip { + #[doc(alias = "ges_effect_clip_new")] + pub fn new( + video_bin_description: Option<&str>, + audio_bin_description: Option<&str>, + ) -> Option { + assert_initialized_main_thread!(); + unsafe { + from_glib_none(ffi::ges_effect_clip_new( + video_bin_description.to_glib_none().0, + audio_bin_description.to_glib_none().0, + )) + } + } +} + +pub const NONE_EFFECT_CLIP: Option<&EffectClip> = None; + +pub trait EffectClipExt: 'static { + #[doc(alias = "audio-bin-description")] + fn audio_bin_description(&self) -> Option; + + #[doc(alias = "video-bin-description")] + fn video_bin_description(&self) -> Option; +} + +impl> EffectClipExt for O { + fn audio_bin_description(&self) -> Option { + unsafe { + let mut value = glib::Value::from_type(::static_type()); + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, + b"audio-bin-description\0".as_ptr() as *const _, + value.to_glib_none_mut().0, + ); + value + .get() + .expect("Return Value for property `audio-bin-description` getter") + } + } + + fn video_bin_description(&self) -> Option { + unsafe { + let mut value = glib::Value::from_type(::static_type()); + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, + b"video-bin-description\0".as_ptr() as *const _, + value.to_glib_none_mut().0, + ); + value + .get() + .expect("Return Value for property `video-bin-description` getter") + } + } +} diff --git a/gstreamer-editing-services/src/auto/enums.rs b/gstreamer-editing-services/src/auto/enums.rs index 39b6277f2..253261be2 100644 --- a/gstreamer-editing-services/src/auto/enums.rs +++ b/gstreamer-editing-services/src/auto/enums.rs @@ -15,6 +15,96 @@ use std::ffi::CStr; #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] use std::fmt; +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] +#[non_exhaustive] +#[doc(alias = "GESAssetLoadingReturn")] +pub enum AssetLoadingReturn { + #[doc(alias = "GES_ASSET_LOADING_ERROR")] + Error, + #[doc(alias = "GES_ASSET_LOADING_ASYNC")] + Async, + #[doc(alias = "GES_ASSET_LOADING_OK")] + Ok, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl IntoGlib for AssetLoadingReturn { + type GlibType = ffi::GESAssetLoadingReturn; + + fn into_glib(self) -> ffi::GESAssetLoadingReturn { + match self { + Self::Error => ffi::GES_ASSET_LOADING_ERROR, + Self::Async => ffi::GES_ASSET_LOADING_ASYNC, + Self::Ok => ffi::GES_ASSET_LOADING_OK, + Self::__Unknown(value) => value, + } + } +} + +#[doc(hidden)] +impl FromGlib for AssetLoadingReturn { + unsafe fn from_glib(value: ffi::GESAssetLoadingReturn) -> Self { + skip_assert_initialized!(); + match value { + ffi::GES_ASSET_LOADING_ERROR => Self::Error, + ffi::GES_ASSET_LOADING_ASYNC => Self::Async, + ffi::GES_ASSET_LOADING_OK => Self::Ok, + value => Self::__Unknown(value), + } + } +} + +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] +#[non_exhaustive] +#[doc(alias = "GESChildrenControlMode")] +pub enum ChildrenControlMode { + #[doc(alias = "GES_CHILDREN_UPDATE")] + Update, + #[doc(alias = "GES_CHILDREN_IGNORE_NOTIFIES")] + IgnoreNotifies, + #[doc(alias = "GES_CHILDREN_UPDATE_OFFSETS")] + UpdateOffsets, + #[doc(alias = "GES_CHILDREN_UPDATE_ALL_VALUES")] + UpdateAllValues, + #[doc(alias = "GES_CHILDREN_LAST")] + Last, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl IntoGlib for ChildrenControlMode { + type GlibType = ffi::GESChildrenControlMode; + + fn into_glib(self) -> ffi::GESChildrenControlMode { + match self { + Self::Update => ffi::GES_CHILDREN_UPDATE, + Self::IgnoreNotifies => ffi::GES_CHILDREN_IGNORE_NOTIFIES, + Self::UpdateOffsets => ffi::GES_CHILDREN_UPDATE_OFFSETS, + Self::UpdateAllValues => ffi::GES_CHILDREN_UPDATE_ALL_VALUES, + Self::Last => ffi::GES_CHILDREN_LAST, + Self::__Unknown(value) => value, + } + } +} + +#[doc(hidden)] +impl FromGlib for ChildrenControlMode { + unsafe fn from_glib(value: ffi::GESChildrenControlMode) -> Self { + skip_assert_initialized!(); + match value { + ffi::GES_CHILDREN_UPDATE => Self::Update, + ffi::GES_CHILDREN_IGNORE_NOTIFIES => Self::IgnoreNotifies, + ffi::GES_CHILDREN_UPDATE_OFFSETS => Self::UpdateOffsets, + ffi::GES_CHILDREN_UPDATE_ALL_VALUES => Self::UpdateAllValues, + ffi::GES_CHILDREN_LAST => Self::Last, + value => Self::__Unknown(value), + } + } +} + #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GESEdge")] @@ -221,6 +311,239 @@ impl ToValue for EditMode { } } +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] +#[non_exhaustive] +#[doc(alias = "GESError")] +pub enum Error { + #[doc(alias = "GES_ERROR_ASSET_WRONG_ID")] + AssetWrongId, + #[doc(alias = "GES_ERROR_ASSET_LOADING")] + AssetLoading, + #[doc(alias = "GES_ERROR_FORMATTER_MALFORMED_INPUT_FILE")] + FormatterMalformedInputFile, + #[doc(alias = "GES_ERROR_INVALID_FRAME_NUMBER")] + InvalidFrameNumber, + #[doc(alias = "GES_ERROR_NEGATIVE_LAYER")] + NegativeLayer, + #[doc(alias = "GES_ERROR_NEGATIVE_TIME")] + NegativeTime, + #[doc(alias = "GES_ERROR_NOT_ENOUGH_INTERNAL_CONTENT")] + NotEnoughInternalContent, + #[doc(alias = "GES_ERROR_INVALID_OVERLAP_IN_TRACK")] + InvalidOverlapInTrack, + #[doc(alias = "GES_ERROR_INVALID_EFFECT_BIN_DESCRIPTION")] + InvalidEffectBinDescription, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl IntoGlib for Error { + type GlibType = ffi::GESError; + + fn into_glib(self) -> ffi::GESError { + match self { + Self::AssetWrongId => ffi::GES_ERROR_ASSET_WRONG_ID, + Self::AssetLoading => ffi::GES_ERROR_ASSET_LOADING, + Self::FormatterMalformedInputFile => ffi::GES_ERROR_FORMATTER_MALFORMED_INPUT_FILE, + Self::InvalidFrameNumber => ffi::GES_ERROR_INVALID_FRAME_NUMBER, + Self::NegativeLayer => ffi::GES_ERROR_NEGATIVE_LAYER, + Self::NegativeTime => ffi::GES_ERROR_NEGATIVE_TIME, + Self::NotEnoughInternalContent => ffi::GES_ERROR_NOT_ENOUGH_INTERNAL_CONTENT, + Self::InvalidOverlapInTrack => ffi::GES_ERROR_INVALID_OVERLAP_IN_TRACK, + Self::InvalidEffectBinDescription => ffi::GES_ERROR_INVALID_EFFECT_BIN_DESCRIPTION, + Self::__Unknown(value) => value, + } + } +} + +#[doc(hidden)] +impl FromGlib for Error { + unsafe fn from_glib(value: ffi::GESError) -> Self { + skip_assert_initialized!(); + match value { + ffi::GES_ERROR_ASSET_WRONG_ID => Self::AssetWrongId, + ffi::GES_ERROR_ASSET_LOADING => Self::AssetLoading, + ffi::GES_ERROR_FORMATTER_MALFORMED_INPUT_FILE => Self::FormatterMalformedInputFile, + ffi::GES_ERROR_INVALID_FRAME_NUMBER => Self::InvalidFrameNumber, + ffi::GES_ERROR_NEGATIVE_LAYER => Self::NegativeLayer, + ffi::GES_ERROR_NEGATIVE_TIME => Self::NegativeTime, + ffi::GES_ERROR_NOT_ENOUGH_INTERNAL_CONTENT => Self::NotEnoughInternalContent, + ffi::GES_ERROR_INVALID_OVERLAP_IN_TRACK => Self::InvalidOverlapInTrack, + ffi::GES_ERROR_INVALID_EFFECT_BIN_DESCRIPTION => Self::InvalidEffectBinDescription, + value => Self::__Unknown(value), + } + } +} + +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] +#[non_exhaustive] +#[doc(alias = "GESTextHAlign")] +pub enum TextHAlign { + #[doc(alias = "GES_TEXT_HALIGN_LEFT")] + Left, + #[doc(alias = "GES_TEXT_HALIGN_CENTER")] + Center, + #[doc(alias = "GES_TEXT_HALIGN_RIGHT")] + Right, + #[doc(alias = "GES_TEXT_HALIGN_POSITION")] + Position, + #[doc(alias = "GES_TEXT_HALIGN_ABSOLUTE")] + Absolute, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl IntoGlib for TextHAlign { + type GlibType = ffi::GESTextHAlign; + + fn into_glib(self) -> ffi::GESTextHAlign { + match self { + Self::Left => ffi::GES_TEXT_HALIGN_LEFT, + Self::Center => ffi::GES_TEXT_HALIGN_CENTER, + Self::Right => ffi::GES_TEXT_HALIGN_RIGHT, + Self::Position => ffi::GES_TEXT_HALIGN_POSITION, + Self::Absolute => ffi::GES_TEXT_HALIGN_ABSOLUTE, + Self::__Unknown(value) => value, + } + } +} + +#[doc(hidden)] +impl FromGlib for TextHAlign { + unsafe fn from_glib(value: ffi::GESTextHAlign) -> Self { + skip_assert_initialized!(); + match value { + ffi::GES_TEXT_HALIGN_LEFT => Self::Left, + ffi::GES_TEXT_HALIGN_CENTER => Self::Center, + ffi::GES_TEXT_HALIGN_RIGHT => Self::Right, + ffi::GES_TEXT_HALIGN_POSITION => Self::Position, + ffi::GES_TEXT_HALIGN_ABSOLUTE => Self::Absolute, + value => Self::__Unknown(value), + } + } +} + +impl StaticType for TextHAlign { + fn static_type() -> Type { + unsafe { from_glib(ffi::ges_text_halign_get_type()) } + } +} + +impl glib::value::ValueType for TextHAlign { + type Type = Self; +} + +unsafe impl<'a> FromValue<'a> for TextHAlign { + type Checker = glib::value::GenericValueTypeChecker; + + unsafe fn from_value(value: &'a glib::Value) -> Self { + skip_assert_initialized!(); + from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl ToValue for TextHAlign { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() + } +} + +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] +#[non_exhaustive] +#[doc(alias = "GESTextVAlign")] +pub enum TextVAlign { + #[doc(alias = "GES_TEXT_VALIGN_BASELINE")] + Baseline, + #[doc(alias = "GES_TEXT_VALIGN_BOTTOM")] + Bottom, + #[doc(alias = "GES_TEXT_VALIGN_TOP")] + Top, + #[doc(alias = "GES_TEXT_VALIGN_POSITION")] + Position, + #[doc(alias = "GES_TEXT_VALIGN_CENTER")] + Center, + #[doc(alias = "GES_TEXT_VALIGN_ABSOLUTE")] + Absolute, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl IntoGlib for TextVAlign { + type GlibType = ffi::GESTextVAlign; + + fn into_glib(self) -> ffi::GESTextVAlign { + match self { + Self::Baseline => ffi::GES_TEXT_VALIGN_BASELINE, + Self::Bottom => ffi::GES_TEXT_VALIGN_BOTTOM, + Self::Top => ffi::GES_TEXT_VALIGN_TOP, + Self::Position => ffi::GES_TEXT_VALIGN_POSITION, + Self::Center => ffi::GES_TEXT_VALIGN_CENTER, + Self::Absolute => ffi::GES_TEXT_VALIGN_ABSOLUTE, + Self::__Unknown(value) => value, + } + } +} + +#[doc(hidden)] +impl FromGlib for TextVAlign { + unsafe fn from_glib(value: ffi::GESTextVAlign) -> Self { + skip_assert_initialized!(); + match value { + ffi::GES_TEXT_VALIGN_BASELINE => Self::Baseline, + ffi::GES_TEXT_VALIGN_BOTTOM => Self::Bottom, + ffi::GES_TEXT_VALIGN_TOP => Self::Top, + ffi::GES_TEXT_VALIGN_POSITION => Self::Position, + ffi::GES_TEXT_VALIGN_CENTER => Self::Center, + ffi::GES_TEXT_VALIGN_ABSOLUTE => Self::Absolute, + value => Self::__Unknown(value), + } + } +} + +impl StaticType for TextVAlign { + fn static_type() -> Type { + unsafe { from_glib(ffi::ges_text_valign_get_type()) } + } +} + +impl glib::value::ValueType for TextVAlign { + type Type = Self; +} + +unsafe impl<'a> FromValue<'a> for TextVAlign { + type Checker = glib::value::GenericValueTypeChecker; + + unsafe fn from_value(value: &'a glib::Value) -> Self { + skip_assert_initialized!(); + from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl ToValue for TextVAlign { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() + } +} + #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GESVideoStandardTransitionType")] @@ -570,3 +893,137 @@ impl ToValue for VideoStandardTransitionType { Self::static_type() } } + +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] +#[non_exhaustive] +#[doc(alias = "GESVideoTestPattern")] +pub enum VideoTestPattern { + #[doc(alias = "GES_VIDEO_TEST_PATTERN_SMPTE")] + Smpte, + #[doc(alias = "GES_VIDEO_TEST_PATTERN_SNOW")] + Snow, + #[doc(alias = "GES_VIDEO_TEST_PATTERN_BLACK")] + Black, + #[doc(alias = "GES_VIDEO_TEST_PATTERN_WHITE")] + White, + #[doc(alias = "GES_VIDEO_TEST_PATTERN_RED")] + Red, + #[doc(alias = "GES_VIDEO_TEST_PATTERN_GREEN")] + Green, + #[doc(alias = "GES_VIDEO_TEST_PATTERN_BLUE")] + Blue, + #[doc(alias = "GES_VIDEO_TEST_PATTERN_CHECKERS1")] + Checkers1, + #[doc(alias = "GES_VIDEO_TEST_PATTERN_CHECKERS2")] + Checkers2, + #[doc(alias = "GES_VIDEO_TEST_PATTERN_CHECKERS4")] + Checkers4, + #[doc(alias = "GES_VIDEO_TEST_PATTERN_CHECKERS8")] + Checkers8, + #[doc(alias = "GES_VIDEO_TEST_PATTERN_CIRCULAR")] + Circular, + #[doc(alias = "GES_VIDEO_TEST_PATTERN_BLINK")] + Blink, + #[doc(alias = "GES_VIDEO_TEST_PATTERN_SMPTE75")] + Smpte75, + #[doc(alias = "GES_VIDEO_TEST_ZONE_PLATE")] + ZonePlate, + #[doc(alias = "GES_VIDEO_TEST_GAMUT")] + Gamut, + #[doc(alias = "GES_VIDEO_TEST_CHROMA_ZONE_PLATE")] + ChromaZonePlate, + #[doc(alias = "GES_VIDEO_TEST_PATTERN_SOLID")] + SolidColor, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl IntoGlib for VideoTestPattern { + type GlibType = ffi::GESVideoTestPattern; + + fn into_glib(self) -> ffi::GESVideoTestPattern { + match self { + Self::Smpte => ffi::GES_VIDEO_TEST_PATTERN_SMPTE, + Self::Snow => ffi::GES_VIDEO_TEST_PATTERN_SNOW, + Self::Black => ffi::GES_VIDEO_TEST_PATTERN_BLACK, + Self::White => ffi::GES_VIDEO_TEST_PATTERN_WHITE, + Self::Red => ffi::GES_VIDEO_TEST_PATTERN_RED, + Self::Green => ffi::GES_VIDEO_TEST_PATTERN_GREEN, + Self::Blue => ffi::GES_VIDEO_TEST_PATTERN_BLUE, + Self::Checkers1 => ffi::GES_VIDEO_TEST_PATTERN_CHECKERS1, + Self::Checkers2 => ffi::GES_VIDEO_TEST_PATTERN_CHECKERS2, + Self::Checkers4 => ffi::GES_VIDEO_TEST_PATTERN_CHECKERS4, + Self::Checkers8 => ffi::GES_VIDEO_TEST_PATTERN_CHECKERS8, + Self::Circular => ffi::GES_VIDEO_TEST_PATTERN_CIRCULAR, + Self::Blink => ffi::GES_VIDEO_TEST_PATTERN_BLINK, + Self::Smpte75 => ffi::GES_VIDEO_TEST_PATTERN_SMPTE75, + Self::ZonePlate => ffi::GES_VIDEO_TEST_ZONE_PLATE, + Self::Gamut => ffi::GES_VIDEO_TEST_GAMUT, + Self::ChromaZonePlate => ffi::GES_VIDEO_TEST_CHROMA_ZONE_PLATE, + Self::SolidColor => ffi::GES_VIDEO_TEST_PATTERN_SOLID, + Self::__Unknown(value) => value, + } + } +} + +#[doc(hidden)] +impl FromGlib for VideoTestPattern { + unsafe fn from_glib(value: ffi::GESVideoTestPattern) -> Self { + skip_assert_initialized!(); + match value { + ffi::GES_VIDEO_TEST_PATTERN_SMPTE => Self::Smpte, + ffi::GES_VIDEO_TEST_PATTERN_SNOW => Self::Snow, + ffi::GES_VIDEO_TEST_PATTERN_BLACK => Self::Black, + ffi::GES_VIDEO_TEST_PATTERN_WHITE => Self::White, + ffi::GES_VIDEO_TEST_PATTERN_RED => Self::Red, + ffi::GES_VIDEO_TEST_PATTERN_GREEN => Self::Green, + ffi::GES_VIDEO_TEST_PATTERN_BLUE => Self::Blue, + ffi::GES_VIDEO_TEST_PATTERN_CHECKERS1 => Self::Checkers1, + ffi::GES_VIDEO_TEST_PATTERN_CHECKERS2 => Self::Checkers2, + ffi::GES_VIDEO_TEST_PATTERN_CHECKERS4 => Self::Checkers4, + ffi::GES_VIDEO_TEST_PATTERN_CHECKERS8 => Self::Checkers8, + ffi::GES_VIDEO_TEST_PATTERN_CIRCULAR => Self::Circular, + ffi::GES_VIDEO_TEST_PATTERN_BLINK => Self::Blink, + ffi::GES_VIDEO_TEST_PATTERN_SMPTE75 => Self::Smpte75, + ffi::GES_VIDEO_TEST_ZONE_PLATE => Self::ZonePlate, + ffi::GES_VIDEO_TEST_GAMUT => Self::Gamut, + ffi::GES_VIDEO_TEST_CHROMA_ZONE_PLATE => Self::ChromaZonePlate, + ffi::GES_VIDEO_TEST_PATTERN_SOLID => Self::SolidColor, + value => Self::__Unknown(value), + } + } +} + +impl StaticType for VideoTestPattern { + fn static_type() -> Type { + unsafe { from_glib(ffi::ges_video_test_pattern_get_type()) } + } +} + +impl glib::value::ValueType for VideoTestPattern { + type Type = Self; +} + +unsafe impl<'a> FromValue<'a> for VideoTestPattern { + type Checker = glib::value::GenericValueTypeChecker; + + unsafe fn from_value(value: &'a glib::Value) -> Self { + skip_assert_initialized!(); + from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl ToValue for VideoTestPattern { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() + } +} diff --git a/gstreamer-editing-services/src/auto/flags.rs b/gstreamer-editing-services/src/auto/flags.rs index a1ef0ae49..68b7ade74 100644 --- a/gstreamer-editing-services/src/auto/flags.rs +++ b/gstreamer-editing-services/src/auto/flags.rs @@ -12,6 +12,142 @@ use glib::Type; use std::ffi::CStr; use std::fmt; +#[cfg(any(feature = "v1_20", feature = "dox"))] +bitflags! { + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))] + #[doc(alias = "GESMarkerFlags")] + pub struct MarkerFlags: u32 { + #[doc(alias = "GES_MARKER_FLAG_NONE")] + const NONE = ffi::GES_MARKER_FLAG_NONE as u32; + #[doc(alias = "GES_MARKER_FLAG_SNAPPABLE")] + const SNAPPABLE = ffi::GES_MARKER_FLAG_SNAPPABLE as u32; + } +} + +#[cfg(any(feature = "v1_20", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))] +#[doc(hidden)] +impl IntoGlib for MarkerFlags { + type GlibType = ffi::GESMarkerFlags; + + fn into_glib(self) -> ffi::GESMarkerFlags { + self.bits() + } +} + +#[cfg(any(feature = "v1_20", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))] +#[doc(hidden)] +impl FromGlib for MarkerFlags { + unsafe fn from_glib(value: ffi::GESMarkerFlags) -> Self { + skip_assert_initialized!(); + Self::from_bits_truncate(value) + } +} + +#[cfg(any(feature = "v1_20", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))] +impl StaticType for MarkerFlags { + fn static_type() -> Type { + unsafe { from_glib(ffi::ges_marker_flags_get_type()) } + } +} + +#[cfg(any(feature = "v1_20", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))] +impl glib::value::ValueType for MarkerFlags { + type Type = Self; +} + +#[cfg(any(feature = "v1_20", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))] +unsafe impl<'a> FromValue<'a> for MarkerFlags { + type Checker = glib::value::GenericValueTypeChecker; + + unsafe fn from_value(value: &'a glib::Value) -> Self { + skip_assert_initialized!(); + from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) + } +} + +#[cfg(any(feature = "v1_20", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))] +impl ToValue for MarkerFlags { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() + } +} + +bitflags! { + #[doc(alias = "GESMetaFlag")] + pub struct MetaFlag: u32 { + #[doc(alias = "GES_META_READABLE")] + const READABLE = ffi::GES_META_READABLE as u32; + #[doc(alias = "GES_META_WRITABLE")] + const WRITABLE = ffi::GES_META_WRITABLE as u32; + #[doc(alias = "GES_META_READ_WRITE")] + const READWRITE = ffi::GES_META_READ_WRITE as u32; + } +} + +#[doc(hidden)] +impl IntoGlib for MetaFlag { + type GlibType = ffi::GESMetaFlag; + + fn into_glib(self) -> ffi::GESMetaFlag { + self.bits() + } +} + +#[doc(hidden)] +impl FromGlib for MetaFlag { + unsafe fn from_glib(value: ffi::GESMetaFlag) -> Self { + skip_assert_initialized!(); + Self::from_bits_truncate(value) + } +} + +impl StaticType for MetaFlag { + fn static_type() -> Type { + unsafe { from_glib(ffi::ges_meta_flag_get_type()) } + } +} + +impl glib::value::ValueType for MetaFlag { + type Type = Self; +} + +unsafe impl<'a> FromValue<'a> for MetaFlag { + type Checker = glib::value::GenericValueTypeChecker; + + unsafe fn from_value(value: &'a glib::Value) -> Self { + skip_assert_initialized!(); + from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) + } +} + +impl ToValue for MetaFlag { + fn to_value(&self) -> glib::Value { + let mut value = glib::Value::for_value_type::(); + unsafe { + glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib()); + } + value + } + + fn value_type(&self) -> glib::Type { + Self::static_type() + } +} + bitflags! { #[doc(alias = "GESPipelineFlags")] pub struct PipelineFlags: u32 { diff --git a/gstreamer-editing-services/src/auto/formatter.rs b/gstreamer-editing-services/src/auto/formatter.rs new file mode 100644 index 000000000..b2086fac7 --- /dev/null +++ b/gstreamer-editing-services/src/auto/formatter.rs @@ -0,0 +1,116 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Asset; +use crate::Extractable; +use crate::Timeline; +use glib::object::IsA; +use glib::translate::*; +use std::ptr; + +glib::wrapper! { + #[doc(alias = "GESFormatter")] + pub struct Formatter(Object) @implements Extractable; + + match fn { + type_ => || ffi::ges_formatter_get_type(), + } +} + +impl Formatter { + #[doc(alias = "ges_formatter_can_load_uri")] + pub fn can_load_uri(uri: &str) -> Result<(), glib::Error> { + assert_initialized_main_thread!(); + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ges_formatter_can_load_uri(uri.to_glib_none().0, &mut error); + if error.is_null() { + Ok(()) + } else { + Err(from_glib_full(error)) + } + } + } + + #[doc(alias = "ges_formatter_can_save_uri")] + pub fn can_save_uri(uri: &str) -> Result<(), glib::Error> { + assert_initialized_main_thread!(); + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ges_formatter_can_save_uri(uri.to_glib_none().0, &mut error); + if error.is_null() { + Ok(()) + } else { + Err(from_glib_full(error)) + } + } + } + + #[doc(alias = "ges_formatter_get_default")] + #[doc(alias = "get_default")] + pub fn default() -> Option { + assert_initialized_main_thread!(); + unsafe { from_glib_none(ffi::ges_formatter_get_default()) } + } +} + +pub const NONE_FORMATTER: Option<&Formatter> = None; + +pub trait FormatterExt: 'static { + #[cfg_attr(feature = "v1_18", deprecated = "Since 1.18")] + #[doc(alias = "ges_formatter_load_from_uri")] + fn load_from_uri(&self, timeline: &impl IsA, uri: &str) -> Result<(), glib::Error>; + + #[cfg_attr(feature = "v1_18", deprecated = "Since 1.18")] + #[doc(alias = "ges_formatter_save_to_uri")] + fn save_to_uri( + &self, + timeline: &impl IsA, + uri: &str, + overwrite: bool, + ) -> Result<(), glib::Error>; +} + +impl> FormatterExt for O { + fn load_from_uri(&self, timeline: &impl IsA, uri: &str) -> Result<(), glib::Error> { + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ges_formatter_load_from_uri( + self.as_ref().to_glib_none().0, + timeline.as_ref().to_glib_none().0, + uri.to_glib_none().0, + &mut error, + ); + if error.is_null() { + Ok(()) + } else { + Err(from_glib_full(error)) + } + } + } + + fn save_to_uri( + &self, + timeline: &impl IsA, + uri: &str, + overwrite: bool, + ) -> Result<(), glib::Error> { + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ges_formatter_save_to_uri( + self.as_ref().to_glib_none().0, + timeline.as_ref().to_glib_none().0, + uri.to_glib_none().0, + overwrite.into_glib(), + &mut error, + ); + if error.is_null() { + Ok(()) + } else { + Err(from_glib_full(error)) + } + } + } +} diff --git a/gstreamer-editing-services/src/auto/group.rs b/gstreamer-editing-services/src/auto/group.rs index 6a4166493..7ff7fd4f3 100644 --- a/gstreamer-editing-services/src/auto/group.rs +++ b/gstreamer-editing-services/src/auto/group.rs @@ -5,6 +5,7 @@ use crate::Container; use crate::Extractable; +use crate::MetaContainer; use crate::TimelineElement; use glib::object::Cast; use glib::object::IsA; @@ -18,7 +19,7 @@ use std::mem::transmute; glib::wrapper! { #[doc(alias = "GESGroup")] - pub struct Group(Object) @extends Container, TimelineElement, @implements Extractable; + pub struct Group(Object) @extends Container, TimelineElement, @implements Extractable, MetaContainer; match fn { type_ => || ffi::ges_group_get_type(), diff --git a/gstreamer-editing-services/src/auto/image_source.rs b/gstreamer-editing-services/src/auto/image_source.rs new file mode 100644 index 000000000..470dc5f01 --- /dev/null +++ b/gstreamer-editing-services/src/auto/image_source.rs @@ -0,0 +1,43 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Extractable; +use crate::MetaContainer; +use crate::Source; +use crate::TimelineElement; +use crate::TrackElement; +use crate::VideoSource; +use glib::object::IsA; +use glib::translate::*; +use glib::StaticType; + +glib::wrapper! { + #[doc(alias = "GESImageSource")] + pub struct ImageSource(Object) @extends VideoSource, Source, TrackElement, TimelineElement, @implements Extractable, MetaContainer; + + match fn { + type_ => || ffi::ges_image_source_get_type(), + } +} + +pub const NONE_IMAGE_SOURCE: Option<&ImageSource> = None; + +pub trait ImageSourceExt: 'static { + fn uri(&self) -> Option; +} + +impl> ImageSourceExt for O { + fn uri(&self) -> Option { + unsafe { + let mut value = glib::Value::from_type(::static_type()); + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, + b"uri\0".as_ptr() as *const _, + value.to_glib_none_mut().0, + ); + value.get().expect("Return Value for property `uri` getter") + } + } +} diff --git a/gstreamer-editing-services/src/auto/layer.rs b/gstreamer-editing-services/src/auto/layer.rs index fdcbbdf6c..d2ff6f9f7 100644 --- a/gstreamer-editing-services/src/auto/layer.rs +++ b/gstreamer-editing-services/src/auto/layer.rs @@ -6,6 +6,7 @@ use crate::Asset; use crate::Clip; use crate::Extractable; +use crate::MetaContainer; use crate::Timeline; #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] @@ -24,7 +25,7 @@ use std::ptr; glib::wrapper! { #[doc(alias = "GESLayer")] - pub struct Layer(Object) @implements Extractable; + pub struct Layer(Object) @implements Extractable, MetaContainer; match fn { type_ => || ffi::ges_layer_get_type(), diff --git a/gstreamer-editing-services/src/auto/marker.rs b/gstreamer-editing-services/src/auto/marker.rs new file mode 100644 index 000000000..c0930c15a --- /dev/null +++ b/gstreamer-editing-services/src/auto/marker.rs @@ -0,0 +1,65 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::MetaContainer; +use glib::object::ObjectType as ObjectType_; +use glib::signal::connect_raw; +use glib::signal::SignalHandlerId; +use glib::translate::*; +use glib::StaticType; +use std::boxed::Box as Box_; +use std::mem::transmute; + +glib::wrapper! { + #[doc(alias = "GESMarker")] + pub struct Marker(Object) @implements MetaContainer; + + match fn { + type_ => || ffi::ges_marker_get_type(), + } +} + +impl Marker { + #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + pub fn position(&self) -> u64 { + unsafe { + let mut value = glib::Value::from_type(::static_type()); + glib::gobject_ffi::g_object_get_property( + self.as_ptr() as *mut glib::gobject_ffi::GObject, + b"position\0".as_ptr() as *const _, + value.to_glib_none_mut().0, + ); + value + .get() + .expect("Return Value for property `position` getter") + } + } + + #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[doc(alias = "position")] + pub fn connect_position_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_position_trampoline( + this: *mut ffi::GESMarker, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(&from_glib_borrow(this)) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::position\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_position_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } +} diff --git a/gstreamer-editing-services/src/auto/marker_list.rs b/gstreamer-editing-services/src/auto/marker_list.rs new file mode 100644 index 000000000..439b97071 --- /dev/null +++ b/gstreamer-editing-services/src/auto/marker_list.rs @@ -0,0 +1,237 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Marker; +#[cfg(any(feature = "v1_20", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))] +use crate::MarkerFlags; +use glib::object::ObjectType as ObjectType_; +use glib::signal::connect_raw; +use glib::signal::SignalHandlerId; +use glib::translate::*; +#[cfg(any(feature = "v1_20", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))] +use glib::StaticType; +#[cfg(any(feature = "v1_20", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))] +use glib::ToValue; +use std::boxed::Box as Box_; +use std::mem::transmute; + +glib::wrapper! { + #[doc(alias = "GESMarkerList")] + pub struct MarkerList(Object); + + match fn { + type_ => || ffi::ges_marker_list_get_type(), + } +} + +impl MarkerList { + #[doc(alias = "ges_marker_list_new")] + pub fn new() -> MarkerList { + assert_initialized_main_thread!(); + unsafe { from_glib_full(ffi::ges_marker_list_new()) } + } + + #[doc(alias = "ges_marker_list_add")] + pub fn add(&self, position: impl Into>) -> Option { + unsafe { + from_glib_none(ffi::ges_marker_list_add( + self.to_glib_none().0, + position.into().into_glib(), + )) + } + } + + #[doc(alias = "ges_marker_list_get_markers")] + #[doc(alias = "get_markers")] + pub fn markers(&self) -> Vec { + unsafe { + FromGlibPtrContainer::from_glib_full(ffi::ges_marker_list_get_markers( + self.to_glib_none().0, + )) + } + } + + #[doc(alias = "ges_marker_list_move")] + #[doc(alias = "move")] + pub fn move_(&self, marker: &Marker, position: impl Into>) -> bool { + unsafe { + from_glib(ffi::ges_marker_list_move( + self.to_glib_none().0, + marker.to_glib_none().0, + position.into().into_glib(), + )) + } + } + + #[doc(alias = "ges_marker_list_remove")] + pub fn remove(&self, marker: &Marker) -> bool { + unsafe { + from_glib(ffi::ges_marker_list_remove( + self.to_glib_none().0, + marker.to_glib_none().0, + )) + } + } + + #[doc(alias = "ges_marker_list_size")] + pub fn size(&self) -> u32 { + unsafe { ffi::ges_marker_list_size(self.to_glib_none().0) } + } + + #[cfg(any(feature = "v1_20", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))] + pub fn flags(&self) -> MarkerFlags { + unsafe { + let mut value = glib::Value::from_type(::static_type()); + glib::gobject_ffi::g_object_get_property( + self.as_ptr() as *mut glib::gobject_ffi::GObject, + b"flags\0".as_ptr() as *const _, + value.to_glib_none_mut().0, + ); + value + .get() + .expect("Return Value for property `flags` getter") + } + } + + #[cfg(any(feature = "v1_20", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))] + pub fn set_flags(&self, flags: MarkerFlags) { + unsafe { + glib::gobject_ffi::g_object_set_property( + self.as_ptr() as *mut glib::gobject_ffi::GObject, + b"flags\0".as_ptr() as *const _, + flags.to_value().to_glib_none().0, + ); + } + } + + #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[doc(alias = "marker-added")] + pub fn connect_marker_added( + &self, + f: F, + ) -> SignalHandlerId { + unsafe extern "C" fn marker_added_trampoline( + this: *mut ffi::GESMarkerList, + position: u64, + marker: *mut ffi::GESMarker, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(&from_glib_borrow(this), position, &from_glib_borrow(marker)) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"marker-added\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + marker_added_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + + #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[doc(alias = "marker-moved")] + pub fn connect_marker_moved( + &self, + f: F, + ) -> SignalHandlerId { + unsafe extern "C" fn marker_moved_trampoline< + F: Fn(&MarkerList, u64, u64, &Marker) + 'static, + >( + this: *mut ffi::GESMarkerList, + previous_position: u64, + new_position: u64, + marker: *mut ffi::GESMarker, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f( + &from_glib_borrow(this), + previous_position, + new_position, + &from_glib_borrow(marker), + ) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"marker-moved\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + marker_moved_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + + #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[doc(alias = "marker-removed")] + pub fn connect_marker_removed(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn marker_removed_trampoline( + this: *mut ffi::GESMarkerList, + marker: *mut ffi::GESMarker, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(&from_glib_borrow(this), &from_glib_borrow(marker)) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"marker-removed\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + marker_removed_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + + #[cfg(any(feature = "v1_20", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))] + #[doc(alias = "flags")] + pub fn connect_flags_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_flags_trampoline( + this: *mut ffi::GESMarkerList, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(&from_glib_borrow(this)) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::flags\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_flags_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } +} + +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +impl Default for MarkerList { + fn default() -> Self { + Self::new() + } +} diff --git a/gstreamer-editing-services/src/auto/meta_container.rs b/gstreamer-editing-services/src/auto/meta_container.rs new file mode 100644 index 000000000..7b0498448 --- /dev/null +++ b/gstreamer-editing-services/src/auto/meta_container.rs @@ -0,0 +1,736 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +use crate::MarkerList; +use crate::MetaFlag; +use glib::object::Cast; +use glib::object::IsA; +use glib::signal::connect_raw; +use glib::signal::SignalHandlerId; +use glib::translate::*; +use std::boxed::Box as Box_; +use std::mem; +use std::mem::transmute; +use std::ptr; + +glib::wrapper! { + #[doc(alias = "GESMetaContainer")] + pub struct MetaContainer(Interface); + + match fn { + type_ => || ffi::ges_meta_container_get_type(), + } +} + +pub const NONE_META_CONTAINER: Option<&MetaContainer> = None; + +pub trait MetaContainerExt: 'static { + #[doc(alias = "ges_meta_container_add_metas_from_string")] + fn add_metas_from_string(&self, str: &str) -> bool; + + #[doc(alias = "ges_meta_container_check_meta_registered")] + fn check_meta_registered(&self, meta_item: &str) -> Option<(MetaFlag, glib::types::Type)>; + + #[doc(alias = "ges_meta_container_foreach")] + fn foreach(&self, func: P); + + #[doc(alias = "ges_meta_container_get_boolean")] + #[doc(alias = "get_boolean")] + fn boolean(&self, meta_item: &str) -> Option; + + #[doc(alias = "ges_meta_container_get_date")] + #[doc(alias = "get_date")] + fn date(&self, meta_item: &str) -> Option; + + #[doc(alias = "ges_meta_container_get_date_time")] + #[doc(alias = "get_date_time")] + fn date_time(&self, meta_item: &str) -> Option; + + #[doc(alias = "ges_meta_container_get_double")] + #[doc(alias = "get_double")] + fn double(&self, meta_item: &str) -> Option; + + #[doc(alias = "ges_meta_container_get_float")] + #[doc(alias = "get_float")] + fn float(&self, meta_item: &str) -> Option; + + #[doc(alias = "ges_meta_container_get_int")] + #[doc(alias = "get_int")] + fn int(&self, meta_item: &str) -> Option; + + #[doc(alias = "ges_meta_container_get_int64")] + #[doc(alias = "get_int64")] + fn int64(&self, meta_item: &str) -> Option; + + #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[doc(alias = "ges_meta_container_get_marker_list")] + #[doc(alias = "get_marker_list")] + fn marker_list(&self, key: &str) -> Option; + + #[doc(alias = "ges_meta_container_get_meta")] + #[doc(alias = "get_meta")] + fn meta(&self, key: &str) -> Option; + + #[doc(alias = "ges_meta_container_get_string")] + #[doc(alias = "get_string")] + fn string(&self, meta_item: &str) -> Option; + + #[doc(alias = "ges_meta_container_get_uint")] + #[doc(alias = "get_uint")] + fn uint(&self, meta_item: &str) -> Option; + + #[doc(alias = "ges_meta_container_get_uint64")] + #[doc(alias = "get_uint64")] + fn uint64(&self, meta_item: &str) -> Option; + + #[doc(alias = "ges_meta_container_metas_to_string")] + fn metas_to_string(&self) -> Option; + + #[doc(alias = "ges_meta_container_register_meta")] + fn register_meta(&self, flags: MetaFlag, meta_item: &str, value: &glib::Value) -> bool; + + #[doc(alias = "ges_meta_container_register_meta_boolean")] + fn register_meta_boolean(&self, flags: MetaFlag, meta_item: &str, value: bool) -> bool; + + #[doc(alias = "ges_meta_container_register_meta_date")] + fn register_meta_date(&self, flags: MetaFlag, meta_item: &str, value: &glib::Date) -> bool; + + #[doc(alias = "ges_meta_container_register_meta_date_time")] + fn register_meta_date_time( + &self, + flags: MetaFlag, + meta_item: &str, + value: &gst::DateTime, + ) -> bool; + + #[doc(alias = "ges_meta_container_register_meta_double")] + fn register_meta_double(&self, flags: MetaFlag, meta_item: &str, value: f64) -> bool; + + #[doc(alias = "ges_meta_container_register_meta_float")] + fn register_meta_float(&self, flags: MetaFlag, meta_item: &str, value: f32) -> bool; + + #[doc(alias = "ges_meta_container_register_meta_int")] + fn register_meta_int(&self, flags: MetaFlag, meta_item: &str, value: i32) -> bool; + + #[doc(alias = "ges_meta_container_register_meta_int64")] + fn register_meta_int64(&self, flags: MetaFlag, meta_item: &str, value: i64) -> bool; + + #[doc(alias = "ges_meta_container_register_meta_string")] + fn register_meta_string(&self, flags: MetaFlag, meta_item: &str, value: &str) -> bool; + + #[doc(alias = "ges_meta_container_register_meta_uint")] + fn register_meta_uint(&self, flags: MetaFlag, meta_item: &str, value: u32) -> bool; + + #[doc(alias = "ges_meta_container_register_meta_uint64")] + fn register_meta_uint64(&self, flags: MetaFlag, meta_item: &str, value: u64) -> bool; + + #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[doc(alias = "ges_meta_container_register_static_meta")] + fn register_static_meta( + &self, + flags: MetaFlag, + meta_item: &str, + type_: glib::types::Type, + ) -> bool; + + #[doc(alias = "ges_meta_container_set_boolean")] + fn set_boolean(&self, meta_item: &str, value: bool) -> bool; + + #[doc(alias = "ges_meta_container_set_date")] + fn set_date(&self, meta_item: &str, value: &glib::Date) -> bool; + + #[doc(alias = "ges_meta_container_set_date_time")] + fn set_date_time(&self, meta_item: &str, value: &gst::DateTime) -> bool; + + #[doc(alias = "ges_meta_container_set_double")] + fn set_double(&self, meta_item: &str, value: f64) -> bool; + + #[doc(alias = "ges_meta_container_set_float")] + fn set_float(&self, meta_item: &str, value: f32) -> bool; + + #[doc(alias = "ges_meta_container_set_int")] + fn set_int(&self, meta_item: &str, value: i32) -> bool; + + #[doc(alias = "ges_meta_container_set_int64")] + fn set_int64(&self, meta_item: &str, value: i64) -> bool; + + #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[doc(alias = "ges_meta_container_set_marker_list")] + fn set_marker_list(&self, meta_item: &str, list: &MarkerList) -> bool; + + #[doc(alias = "ges_meta_container_set_meta")] + fn set_meta(&self, meta_item: &str, value: Option<&glib::Value>) -> bool; + + #[doc(alias = "ges_meta_container_set_string")] + fn set_string(&self, meta_item: &str, value: &str) -> bool; + + #[doc(alias = "ges_meta_container_set_uint")] + fn set_uint(&self, meta_item: &str, value: u32) -> bool; + + #[doc(alias = "ges_meta_container_set_uint64")] + fn set_uint64(&self, meta_item: &str, value: u64) -> bool; + + #[doc(alias = "notify-meta")] + fn connect_notify_meta) + 'static>( + &self, + detail: Option<&str>, + f: F, + ) -> SignalHandlerId; +} + +impl> MetaContainerExt for O { + fn add_metas_from_string(&self, str: &str) -> bool { + unsafe { + from_glib(ffi::ges_meta_container_add_metas_from_string( + self.as_ref().to_glib_none().0, + str.to_glib_none().0, + )) + } + } + + fn check_meta_registered(&self, meta_item: &str) -> Option<(MetaFlag, glib::types::Type)> { + unsafe { + let mut flags = mem::MaybeUninit::uninit(); + let mut type_ = mem::MaybeUninit::uninit(); + let ret = from_glib(ffi::ges_meta_container_check_meta_registered( + self.as_ref().to_glib_none().0, + meta_item.to_glib_none().0, + flags.as_mut_ptr(), + type_.as_mut_ptr(), + )); + let flags = flags.assume_init(); + let type_ = type_.assume_init(); + if ret { + Some((from_glib(flags), from_glib(type_))) + } else { + None + } + } + } + + fn foreach(&self, func: P) { + let func_data: P = func; + unsafe extern "C" fn func_func( + container: *const ffi::GESMetaContainer, + key: *const libc::c_char, + value: *const glib::gobject_ffi::GValue, + user_data: glib::ffi::gpointer, + ) { + let container = from_glib_borrow(container); + let key: Borrowed = from_glib_borrow(key); + let value = from_glib_borrow(value); + let callback: *mut P = user_data as *const _ as usize as *mut P; + (*callback)(&container, key.as_str(), &value); + } + let func = Some(func_func::

as _); + let super_callback0: &P = &func_data; + unsafe { + ffi::ges_meta_container_foreach( + self.as_ref().to_glib_none().0, + func, + super_callback0 as *const _ as usize as *mut _, + ); + } + } + + fn boolean(&self, meta_item: &str) -> Option { + unsafe { + let mut dest = mem::MaybeUninit::uninit(); + let ret = from_glib(ffi::ges_meta_container_get_boolean( + self.as_ref().to_glib_none().0, + meta_item.to_glib_none().0, + dest.as_mut_ptr(), + )); + let dest = dest.assume_init(); + if ret { + Some(from_glib(dest)) + } else { + None + } + } + } + + fn date(&self, meta_item: &str) -> Option { + unsafe { + let mut dest = ptr::null_mut(); + let ret = from_glib(ffi::ges_meta_container_get_date( + self.as_ref().to_glib_none().0, + meta_item.to_glib_none().0, + &mut dest, + )); + if ret { + Some(from_glib_full(dest)) + } else { + None + } + } + } + + fn date_time(&self, meta_item: &str) -> Option { + unsafe { + let mut dest = ptr::null_mut(); + let ret = from_glib(ffi::ges_meta_container_get_date_time( + self.as_ref().to_glib_none().0, + meta_item.to_glib_none().0, + &mut dest, + )); + if ret { + Some(from_glib_full(dest)) + } else { + None + } + } + } + + fn double(&self, meta_item: &str) -> Option { + unsafe { + let mut dest = mem::MaybeUninit::uninit(); + let ret = from_glib(ffi::ges_meta_container_get_double( + self.as_ref().to_glib_none().0, + meta_item.to_glib_none().0, + dest.as_mut_ptr(), + )); + let dest = dest.assume_init(); + if ret { + Some(dest) + } else { + None + } + } + } + + fn float(&self, meta_item: &str) -> Option { + unsafe { + let mut dest = mem::MaybeUninit::uninit(); + let ret = from_glib(ffi::ges_meta_container_get_float( + self.as_ref().to_glib_none().0, + meta_item.to_glib_none().0, + dest.as_mut_ptr(), + )); + let dest = dest.assume_init(); + if ret { + Some(dest) + } else { + None + } + } + } + + fn int(&self, meta_item: &str) -> Option { + unsafe { + let mut dest = mem::MaybeUninit::uninit(); + let ret = from_glib(ffi::ges_meta_container_get_int( + self.as_ref().to_glib_none().0, + meta_item.to_glib_none().0, + dest.as_mut_ptr(), + )); + let dest = dest.assume_init(); + if ret { + Some(dest) + } else { + None + } + } + } + + fn int64(&self, meta_item: &str) -> Option { + unsafe { + let mut dest = mem::MaybeUninit::uninit(); + let ret = from_glib(ffi::ges_meta_container_get_int64( + self.as_ref().to_glib_none().0, + meta_item.to_glib_none().0, + dest.as_mut_ptr(), + )); + let dest = dest.assume_init(); + if ret { + Some(dest) + } else { + None + } + } + } + + #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + fn marker_list(&self, key: &str) -> Option { + unsafe { + from_glib_full(ffi::ges_meta_container_get_marker_list( + self.as_ref().to_glib_none().0, + key.to_glib_none().0, + )) + } + } + + fn meta(&self, key: &str) -> Option { + unsafe { + from_glib_none(ffi::ges_meta_container_get_meta( + self.as_ref().to_glib_none().0, + key.to_glib_none().0, + )) + } + } + + fn string(&self, meta_item: &str) -> Option { + unsafe { + from_glib_none(ffi::ges_meta_container_get_string( + self.as_ref().to_glib_none().0, + meta_item.to_glib_none().0, + )) + } + } + + fn uint(&self, meta_item: &str) -> Option { + unsafe { + let mut dest = mem::MaybeUninit::uninit(); + let ret = from_glib(ffi::ges_meta_container_get_uint( + self.as_ref().to_glib_none().0, + meta_item.to_glib_none().0, + dest.as_mut_ptr(), + )); + let dest = dest.assume_init(); + if ret { + Some(dest) + } else { + None + } + } + } + + fn uint64(&self, meta_item: &str) -> Option { + unsafe { + let mut dest = mem::MaybeUninit::uninit(); + let ret = from_glib(ffi::ges_meta_container_get_uint64( + self.as_ref().to_glib_none().0, + meta_item.to_glib_none().0, + dest.as_mut_ptr(), + )); + let dest = dest.assume_init(); + if ret { + Some(dest) + } else { + None + } + } + } + + fn metas_to_string(&self) -> Option { + unsafe { + from_glib_full(ffi::ges_meta_container_metas_to_string( + self.as_ref().to_glib_none().0, + )) + } + } + + fn register_meta(&self, flags: MetaFlag, meta_item: &str, value: &glib::Value) -> bool { + unsafe { + from_glib(ffi::ges_meta_container_register_meta( + self.as_ref().to_glib_none().0, + flags.into_glib(), + meta_item.to_glib_none().0, + value.to_glib_none().0, + )) + } + } + + fn register_meta_boolean(&self, flags: MetaFlag, meta_item: &str, value: bool) -> bool { + unsafe { + from_glib(ffi::ges_meta_container_register_meta_boolean( + self.as_ref().to_glib_none().0, + flags.into_glib(), + meta_item.to_glib_none().0, + value.into_glib(), + )) + } + } + + fn register_meta_date(&self, flags: MetaFlag, meta_item: &str, value: &glib::Date) -> bool { + unsafe { + from_glib(ffi::ges_meta_container_register_meta_date( + self.as_ref().to_glib_none().0, + flags.into_glib(), + meta_item.to_glib_none().0, + value.to_glib_none().0, + )) + } + } + + fn register_meta_date_time( + &self, + flags: MetaFlag, + meta_item: &str, + value: &gst::DateTime, + ) -> bool { + unsafe { + from_glib(ffi::ges_meta_container_register_meta_date_time( + self.as_ref().to_glib_none().0, + flags.into_glib(), + meta_item.to_glib_none().0, + value.to_glib_none().0, + )) + } + } + + fn register_meta_double(&self, flags: MetaFlag, meta_item: &str, value: f64) -> bool { + unsafe { + from_glib(ffi::ges_meta_container_register_meta_double( + self.as_ref().to_glib_none().0, + flags.into_glib(), + meta_item.to_glib_none().0, + value, + )) + } + } + + fn register_meta_float(&self, flags: MetaFlag, meta_item: &str, value: f32) -> bool { + unsafe { + from_glib(ffi::ges_meta_container_register_meta_float( + self.as_ref().to_glib_none().0, + flags.into_glib(), + meta_item.to_glib_none().0, + value, + )) + } + } + + fn register_meta_int(&self, flags: MetaFlag, meta_item: &str, value: i32) -> bool { + unsafe { + from_glib(ffi::ges_meta_container_register_meta_int( + self.as_ref().to_glib_none().0, + flags.into_glib(), + meta_item.to_glib_none().0, + value, + )) + } + } + + fn register_meta_int64(&self, flags: MetaFlag, meta_item: &str, value: i64) -> bool { + unsafe { + from_glib(ffi::ges_meta_container_register_meta_int64( + self.as_ref().to_glib_none().0, + flags.into_glib(), + meta_item.to_glib_none().0, + value, + )) + } + } + + fn register_meta_string(&self, flags: MetaFlag, meta_item: &str, value: &str) -> bool { + unsafe { + from_glib(ffi::ges_meta_container_register_meta_string( + self.as_ref().to_glib_none().0, + flags.into_glib(), + meta_item.to_glib_none().0, + value.to_glib_none().0, + )) + } + } + + fn register_meta_uint(&self, flags: MetaFlag, meta_item: &str, value: u32) -> bool { + unsafe { + from_glib(ffi::ges_meta_container_register_meta_uint( + self.as_ref().to_glib_none().0, + flags.into_glib(), + meta_item.to_glib_none().0, + value, + )) + } + } + + fn register_meta_uint64(&self, flags: MetaFlag, meta_item: &str, value: u64) -> bool { + unsafe { + from_glib(ffi::ges_meta_container_register_meta_uint64( + self.as_ref().to_glib_none().0, + flags.into_glib(), + meta_item.to_glib_none().0, + value, + )) + } + } + + #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + fn register_static_meta( + &self, + flags: MetaFlag, + meta_item: &str, + type_: glib::types::Type, + ) -> bool { + unsafe { + from_glib(ffi::ges_meta_container_register_static_meta( + self.as_ref().to_glib_none().0, + flags.into_glib(), + meta_item.to_glib_none().0, + type_.into_glib(), + )) + } + } + + fn set_boolean(&self, meta_item: &str, value: bool) -> bool { + unsafe { + from_glib(ffi::ges_meta_container_set_boolean( + self.as_ref().to_glib_none().0, + meta_item.to_glib_none().0, + value.into_glib(), + )) + } + } + + fn set_date(&self, meta_item: &str, value: &glib::Date) -> bool { + unsafe { + from_glib(ffi::ges_meta_container_set_date( + self.as_ref().to_glib_none().0, + meta_item.to_glib_none().0, + value.to_glib_none().0, + )) + } + } + + fn set_date_time(&self, meta_item: &str, value: &gst::DateTime) -> bool { + unsafe { + from_glib(ffi::ges_meta_container_set_date_time( + self.as_ref().to_glib_none().0, + meta_item.to_glib_none().0, + value.to_glib_none().0, + )) + } + } + + fn set_double(&self, meta_item: &str, value: f64) -> bool { + unsafe { + from_glib(ffi::ges_meta_container_set_double( + self.as_ref().to_glib_none().0, + meta_item.to_glib_none().0, + value, + )) + } + } + + fn set_float(&self, meta_item: &str, value: f32) -> bool { + unsafe { + from_glib(ffi::ges_meta_container_set_float( + self.as_ref().to_glib_none().0, + meta_item.to_glib_none().0, + value, + )) + } + } + + fn set_int(&self, meta_item: &str, value: i32) -> bool { + unsafe { + from_glib(ffi::ges_meta_container_set_int( + self.as_ref().to_glib_none().0, + meta_item.to_glib_none().0, + value, + )) + } + } + + fn set_int64(&self, meta_item: &str, value: i64) -> bool { + unsafe { + from_glib(ffi::ges_meta_container_set_int64( + self.as_ref().to_glib_none().0, + meta_item.to_glib_none().0, + value, + )) + } + } + + #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + fn set_marker_list(&self, meta_item: &str, list: &MarkerList) -> bool { + unsafe { + from_glib(ffi::ges_meta_container_set_marker_list( + self.as_ref().to_glib_none().0, + meta_item.to_glib_none().0, + list.to_glib_none().0, + )) + } + } + + fn set_meta(&self, meta_item: &str, value: Option<&glib::Value>) -> bool { + unsafe { + from_glib(ffi::ges_meta_container_set_meta( + self.as_ref().to_glib_none().0, + meta_item.to_glib_none().0, + value.to_glib_none().0, + )) + } + } + + fn set_string(&self, meta_item: &str, value: &str) -> bool { + unsafe { + from_glib(ffi::ges_meta_container_set_string( + self.as_ref().to_glib_none().0, + meta_item.to_glib_none().0, + value.to_glib_none().0, + )) + } + } + + fn set_uint(&self, meta_item: &str, value: u32) -> bool { + unsafe { + from_glib(ffi::ges_meta_container_set_uint( + self.as_ref().to_glib_none().0, + meta_item.to_glib_none().0, + value, + )) + } + } + + fn set_uint64(&self, meta_item: &str, value: u64) -> bool { + unsafe { + from_glib(ffi::ges_meta_container_set_uint64( + self.as_ref().to_glib_none().0, + meta_item.to_glib_none().0, + value, + )) + } + } + + fn connect_notify_meta) + 'static>( + &self, + detail: Option<&str>, + f: F, + ) -> SignalHandlerId { + unsafe extern "C" fn notify_meta_trampoline< + P: IsA, + F: Fn(&P, &str, Option<&glib::Value>) + 'static, + >( + this: *mut ffi::GESMetaContainer, + key: *mut libc::c_char, + value: *mut glib::gobject_ffi::GValue, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f( + MetaContainer::from_glib_borrow(this).unsafe_cast_ref(), + &glib::GString::from_glib_borrow(key), + Option::::from_glib_borrow(value) + .as_ref() + .as_ref(), + ) + } + unsafe { + let f: Box_ = Box_::new(f); + let detailed_signal_name = detail.map(|name| format!("notify-meta::{}\0", name)); + let signal_name: &[u8] = detailed_signal_name + .as_ref() + .map_or(&b"notify-meta\0"[..], |n| n.as_bytes()); + connect_raw( + self.as_ptr() as *mut _, + signal_name.as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_meta_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } +} diff --git a/gstreamer-editing-services/src/auto/mod.rs b/gstreamer-editing-services/src/auto/mod.rs index f1659e8a8..3683f40c3 100644 --- a/gstreamer-editing-services/src/auto/mod.rs +++ b/gstreamer-editing-services/src/auto/mod.rs @@ -6,51 +6,154 @@ mod asset; pub use self::asset::{Asset, NONE_ASSET}; +mod audio_source; +pub use self::audio_source::{AudioSource, NONE_AUDIO_SOURCE}; + +mod audio_test_source; +pub use self::audio_test_source::{AudioTestSource, NONE_AUDIO_TEST_SOURCE}; + +mod audio_track; +pub use self::audio_track::{AudioTrack, NONE_AUDIO_TRACK}; + +mod audio_transition; +pub use self::audio_transition::{AudioTransition, NONE_AUDIO_TRANSITION}; + +mod audio_uri_source; +pub use self::audio_uri_source::{AudioUriSource, NONE_AUDIO_URI_SOURCE}; + mod base_effect; pub use self::base_effect::{BaseEffect, NONE_BASE_EFFECT}; +mod base_effect_clip; +pub use self::base_effect_clip::{BaseEffectClip, NONE_BASE_EFFECT_CLIP}; + mod base_transition_clip; pub use self::base_transition_clip::{BaseTransitionClip, NONE_BASE_TRANSITION_CLIP}; +mod base_xml_formatter; +pub use self::base_xml_formatter::{BaseXmlFormatter, NONE_BASE_XML_FORMATTER}; + mod clip; pub use self::clip::{Clip, NONE_CLIP}; +mod clip_asset; +pub use self::clip_asset::{ClipAsset, NONE_CLIP_ASSET}; + +mod command_line_formatter; +pub use self::command_line_formatter::{CommandLineFormatter, NONE_COMMAND_LINE_FORMATTER}; + mod container; pub use self::container::{Container, NONE_CONTAINER}; mod effect; pub use self::effect::{Effect, NONE_EFFECT}; +mod effect_asset; +pub use self::effect_asset::{EffectAsset, NONE_EFFECT_ASSET}; + +mod effect_clip; +pub use self::effect_clip::{EffectClip, NONE_EFFECT_CLIP}; + mod extractable; pub use self::extractable::{Extractable, NONE_EXTRACTABLE}; +mod formatter; +pub use self::formatter::{Formatter, NONE_FORMATTER}; + mod group; pub use self::group::{Group, NONE_GROUP}; +#[cfg_attr(feature = "v1_18", deprecated = "Since 1.18")] +mod image_source; +#[cfg_attr(feature = "v1_18", deprecated = "Since 1.18")] +pub use self::image_source::{ImageSource, NONE_IMAGE_SOURCE}; + mod layer; pub use self::layer::{Layer, NONE_LAYER}; +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +mod marker; +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +pub use self::marker::Marker; + +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +mod marker_list; +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +pub use self::marker_list::MarkerList; + +mod meta_container; +pub use self::meta_container::{MetaContainer, NONE_META_CONTAINER}; + +#[cfg_attr(feature = "v1_18", deprecated = "Since 1.18")] +mod multi_file_source; +#[cfg_attr(feature = "v1_18", deprecated = "Since 1.18")] +pub use self::multi_file_source::{MultiFileSource, NONE_MULTI_FILE_SOURCE}; + +mod operation; +pub use self::operation::{Operation, NONE_OPERATION}; + mod operation_clip; pub use self::operation_clip::{OperationClip, NONE_OPERATION_CLIP}; +mod overlay_clip; +pub use self::overlay_clip::{OverlayClip, NONE_OVERLAY_CLIP}; + mod pipeline; pub use self::pipeline::{Pipeline, NONE_PIPELINE}; mod project; pub use self::project::{Project, NONE_PROJECT}; +mod source; +pub use self::source::{Source, NONE_SOURCE}; + +mod source_clip; +pub use self::source_clip::{SourceClip, NONE_SOURCE_CLIP}; + +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +mod source_clip_asset; +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +pub use self::source_clip_asset::{SourceClipAsset, NONE_SOURCE_CLIP_ASSET}; + +mod test_clip; +pub use self::test_clip::{TestClip, NONE_TEST_CLIP}; + +mod text_overlay; +pub use self::text_overlay::{TextOverlay, NONE_TEXT_OVERLAY}; + +mod text_overlay_clip; +pub use self::text_overlay_clip::{TextOverlayClip, NONE_TEXT_OVERLAY_CLIP}; + mod timeline; pub use self::timeline::{Timeline, NONE_TIMELINE}; mod timeline_element; pub use self::timeline_element::{TimelineElement, NONE_TIMELINE_ELEMENT}; +mod title_clip; +pub use self::title_clip::{TitleClip, NONE_TITLE_CLIP}; + +mod title_source; +pub use self::title_source::{TitleSource, NONE_TITLE_SOURCE}; + mod track; pub use self::track::{Track, NONE_TRACK}; mod track_element; pub use self::track_element::{TrackElement, NONE_TRACK_ELEMENT}; +mod track_element_asset; +pub use self::track_element_asset::{TrackElementAsset, NONE_TRACK_ELEMENT_ASSET}; + +mod transition; +pub use self::transition::{Transition, NONE_TRANSITION}; + mod transition_clip; pub use self::transition_clip::{TransitionClip, NONE_TRANSITION_CLIP}; @@ -63,12 +166,40 @@ pub use self::uri_clip_asset::{UriClipAsset, NONE_URI_CLIP_ASSET}; mod uri_source_asset; pub use self::uri_source_asset::{UriSourceAsset, NONE_URI_SOURCE_ASSET}; +mod video_source; +pub use self::video_source::{VideoSource, NONE_VIDEO_SOURCE}; + +mod video_test_source; +pub use self::video_test_source::{VideoTestSource, NONE_VIDEO_TEST_SOURCE}; + +mod video_track; +pub use self::video_track::{VideoTrack, NONE_VIDEO_TRACK}; + +mod video_transition; +pub use self::video_transition::{VideoTransition, NONE_VIDEO_TRANSITION}; + +mod video_uri_source; +pub use self::video_uri_source::{VideoUriSource, NONE_VIDEO_URI_SOURCE}; + +mod xml_formatter; +pub use self::xml_formatter::{XmlFormatter, NONE_XML_FORMATTER}; + mod enums; +pub use self::enums::AssetLoadingReturn; +pub use self::enums::ChildrenControlMode; pub use self::enums::Edge; pub use self::enums::EditMode; +pub use self::enums::Error; +pub use self::enums::TextHAlign; +pub use self::enums::TextVAlign; pub use self::enums::VideoStandardTransitionType; +pub use self::enums::VideoTestPattern; mod flags; +#[cfg(any(feature = "v1_20", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))] +pub use self::flags::MarkerFlags; +pub use self::flags::MetaFlag; pub use self::flags::PipelineFlags; pub use self::flags::TrackType; @@ -78,21 +209,41 @@ pub use self::alias::FrameNumber; #[doc(hidden)] pub mod traits { pub use super::asset::AssetExt; + pub use super::audio_test_source::AudioTestSourceExt; + pub use super::audio_uri_source::AudioUriSourceExt; pub use super::base_effect::BaseEffectExt; pub use super::clip::ClipExt; + pub use super::clip_asset::ClipAssetExt; pub use super::container::GESContainerExt; pub use super::effect::EffectExt; + pub use super::effect_clip::EffectClipExt; pub use super::extractable::ExtractableExt; + pub use super::formatter::FormatterExt; pub use super::group::GroupExt; + #[cfg_attr(feature = "v1_18", deprecated = "Since 1.18")] + pub use super::image_source::ImageSourceExt; pub use super::layer::LayerExt; + pub use super::meta_container::MetaContainerExt; + #[cfg_attr(feature = "v1_18", deprecated = "Since 1.18")] + pub use super::multi_file_source::MultiFileSourceExt; pub use super::pipeline::GESPipelineExt; pub use super::project::ProjectExt; + pub use super::test_clip::TestClipExt; + pub use super::text_overlay::TextOverlayExt; + pub use super::text_overlay_clip::TextOverlayClipExt; pub use super::timeline::TimelineExt; pub use super::timeline_element::TimelineElementExt; + pub use super::title_clip::TitleClipExt; + pub use super::title_source::TitleSourceExt; pub use super::track::GESTrackExt; pub use super::track_element::TrackElementExt; + pub use super::track_element_asset::TrackElementAssetExt; pub use super::transition_clip::TransitionClipExt; pub use super::uri_clip::UriClipExt; pub use super::uri_clip_asset::UriClipAssetExt; pub use super::uri_source_asset::UriSourceAssetExt; + pub use super::video_source::VideoSourceExt; + pub use super::video_test_source::VideoTestSourceExt; + pub use super::video_transition::VideoTransitionExt; + pub use super::video_uri_source::VideoUriSourceExt; } diff --git a/gstreamer-editing-services/src/auto/multi_file_source.rs b/gstreamer-editing-services/src/auto/multi_file_source.rs new file mode 100644 index 000000000..4ce4f441d --- /dev/null +++ b/gstreamer-editing-services/src/auto/multi_file_source.rs @@ -0,0 +1,51 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Extractable; +use crate::MetaContainer; +use crate::Source; +use crate::TimelineElement; +use crate::TrackElement; +use crate::VideoSource; +use glib::object::IsA; +use glib::translate::*; +use glib::StaticType; + +glib::wrapper! { + #[doc(alias = "GESMultiFileSource")] + pub struct MultiFileSource(Object) @extends VideoSource, Source, TrackElement, TimelineElement, @implements Extractable, MetaContainer; + + match fn { + type_ => || ffi::ges_multi_file_source_get_type(), + } +} + +impl MultiFileSource { + #[doc(alias = "ges_multi_file_source_new")] + pub fn new(uri: &str) -> MultiFileSource { + assert_initialized_main_thread!(); + unsafe { from_glib_none(ffi::ges_multi_file_source_new(uri.to_glib_none().0)) } + } +} + +pub const NONE_MULTI_FILE_SOURCE: Option<&MultiFileSource> = None; + +pub trait MultiFileSourceExt: 'static { + fn uri(&self) -> Option; +} + +impl> MultiFileSourceExt for O { + fn uri(&self) -> Option { + unsafe { + let mut value = glib::Value::from_type(::static_type()); + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, + b"uri\0".as_ptr() as *const _, + value.to_glib_none_mut().0, + ); + value.get().expect("Return Value for property `uri` getter") + } + } +} diff --git a/gstreamer-editing-services/src/auto/operation.rs b/gstreamer-editing-services/src/auto/operation.rs new file mode 100644 index 000000000..24b440e3c --- /dev/null +++ b/gstreamer-editing-services/src/auto/operation.rs @@ -0,0 +1,22 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Extractable; +use crate::MetaContainer; +use crate::TimelineElement; +use crate::TrackElement; + +glib::wrapper! { + #[doc(alias = "GESOperation")] + pub struct Operation(Object) @extends TrackElement, TimelineElement, @implements Extractable, MetaContainer; + + match fn { + type_ => || ffi::ges_operation_get_type(), + } +} + +impl Operation {} + +pub const NONE_OPERATION: Option<&Operation> = None; diff --git a/gstreamer-editing-services/src/auto/operation_clip.rs b/gstreamer-editing-services/src/auto/operation_clip.rs index 762768680..630eecc17 100644 --- a/gstreamer-editing-services/src/auto/operation_clip.rs +++ b/gstreamer-editing-services/src/auto/operation_clip.rs @@ -6,11 +6,12 @@ use crate::Clip; use crate::Container; use crate::Extractable; +use crate::MetaContainer; use crate::TimelineElement; glib::wrapper! { #[doc(alias = "GESOperationClip")] - pub struct OperationClip(Object) @extends Clip, Container, TimelineElement, @implements Extractable; + pub struct OperationClip(Object) @extends Clip, Container, TimelineElement, @implements Extractable, MetaContainer; match fn { type_ => || ffi::ges_operation_clip_get_type(), diff --git a/gstreamer-editing-services/src/auto/overlay_clip.rs b/gstreamer-editing-services/src/auto/overlay_clip.rs new file mode 100644 index 000000000..912c4c74f --- /dev/null +++ b/gstreamer-editing-services/src/auto/overlay_clip.rs @@ -0,0 +1,24 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Clip; +use crate::Container; +use crate::Extractable; +use crate::MetaContainer; +use crate::OperationClip; +use crate::TimelineElement; + +glib::wrapper! { + #[doc(alias = "GESOverlayClip")] + pub struct OverlayClip(Object) @extends OperationClip, Clip, Container, TimelineElement, @implements Extractable, MetaContainer; + + match fn { + type_ => || ffi::ges_overlay_clip_get_type(), + } +} + +impl OverlayClip {} + +pub const NONE_OVERLAY_CLIP: Option<&OverlayClip> = None; diff --git a/gstreamer-editing-services/src/auto/pipeline.rs b/gstreamer-editing-services/src/auto/pipeline.rs index 34b20f9ac..f18be9112 100644 --- a/gstreamer-editing-services/src/auto/pipeline.rs +++ b/gstreamer-editing-services/src/auto/pipeline.rs @@ -18,7 +18,7 @@ use std::ptr; glib::wrapper! { #[doc(alias = "GESPipeline")] - pub struct Pipeline(Object) @extends gst::Pipeline, gst::Bin, gst::Element, gst::Object; + pub struct Pipeline(Object) @extends gst::Pipeline, gst::Bin, gst::Element, gst::Object, @implements gst::ChildProxy; match fn { type_ => || ffi::ges_pipeline_get_type(), diff --git a/gstreamer-editing-services/src/auto/project.rs b/gstreamer-editing-services/src/auto/project.rs index 3ee00658b..aaa7df827 100644 --- a/gstreamer-editing-services/src/auto/project.rs +++ b/gstreamer-editing-services/src/auto/project.rs @@ -4,6 +4,10 @@ // DO NOT EDIT use crate::Asset; +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +use crate::Formatter; +use crate::MetaContainer; use crate::Timeline; use glib::object::Cast; use glib::object::IsA; @@ -16,7 +20,7 @@ use std::ptr; glib::wrapper! { #[doc(alias = "GESProject")] - pub struct Project(Object) @extends Asset; + pub struct Project(Object) @extends Asset, @implements MetaContainer; match fn { type_ => || ffi::ges_project_get_type(), @@ -43,10 +47,10 @@ pub trait ProjectExt: 'static { profile: &impl IsA, ) -> Result<(), glib::error::BoolError>; - //#[cfg(any(feature = "v1_18", feature = "dox"))] - //#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] - //#[doc(alias = "ges_project_add_formatter")] - //fn add_formatter(&self, formatter: /*Ignored*/&Formatter); + #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[doc(alias = "ges_project_add_formatter")] + fn add_formatter(&self, formatter: &impl IsA); #[doc(alias = "ges_project_create_asset")] fn create_asset(&self, id: Option<&str>, extractable_type: glib::types::Type) -> bool; @@ -154,11 +158,16 @@ 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 ffi:ges_project_add_formatter() } - //} + #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + fn add_formatter(&self, formatter: &impl IsA) { + unsafe { + ffi::ges_project_add_formatter( + self.as_ref().to_glib_none().0, + formatter.as_ref().to_glib_none().0, + ); + } + } fn create_asset(&self, id: Option<&str>, extractable_type: glib::types::Type) -> bool { unsafe { diff --git a/gstreamer-editing-services/src/auto/source.rs b/gstreamer-editing-services/src/auto/source.rs new file mode 100644 index 000000000..f47f4de42 --- /dev/null +++ b/gstreamer-editing-services/src/auto/source.rs @@ -0,0 +1,22 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Extractable; +use crate::MetaContainer; +use crate::TimelineElement; +use crate::TrackElement; + +glib::wrapper! { + #[doc(alias = "GESSource")] + pub struct Source(Object) @extends TrackElement, TimelineElement, @implements Extractable, MetaContainer; + + match fn { + type_ => || ffi::ges_source_get_type(), + } +} + +impl Source {} + +pub const NONE_SOURCE: Option<&Source> = None; diff --git a/gstreamer-editing-services/src/auto/source_clip.rs b/gstreamer-editing-services/src/auto/source_clip.rs new file mode 100644 index 000000000..56cd5da9a --- /dev/null +++ b/gstreamer-editing-services/src/auto/source_clip.rs @@ -0,0 +1,34 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Clip; +use crate::Container; +use crate::Extractable; +use crate::MetaContainer; +use crate::TimelineElement; +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +use glib::translate::*; + +glib::wrapper! { + #[doc(alias = "GESSourceClip")] + pub struct SourceClip(Object) @extends Clip, Container, TimelineElement, @implements Extractable, MetaContainer; + + match fn { + type_ => || ffi::ges_source_clip_get_type(), + } +} + +impl SourceClip { + #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[doc(alias = "ges_source_clip_new_time_overlay")] + pub fn new_time_overlay() -> Option { + assert_initialized_main_thread!(); + unsafe { from_glib_none(ffi::ges_source_clip_new_time_overlay()) } + } +} + +pub const NONE_SOURCE_CLIP: Option<&SourceClip> = None; diff --git a/gstreamer-editing-services/src/auto/source_clip_asset.rs b/gstreamer-editing-services/src/auto/source_clip_asset.rs new file mode 100644 index 000000000..7ef4faee7 --- /dev/null +++ b/gstreamer-editing-services/src/auto/source_clip_asset.rs @@ -0,0 +1,21 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Asset; +use crate::ClipAsset; +use crate::MetaContainer; + +glib::wrapper! { + #[doc(alias = "GESSourceClipAsset")] + pub struct SourceClipAsset(Object) @extends ClipAsset, Asset, @implements MetaContainer; + + match fn { + type_ => || ffi::ges_source_clip_asset_get_type(), + } +} + +impl SourceClipAsset {} + +pub const NONE_SOURCE_CLIP_ASSET: Option<&SourceClipAsset> = None; diff --git a/gstreamer-editing-services/src/auto/test_clip.rs b/gstreamer-editing-services/src/auto/test_clip.rs new file mode 100644 index 000000000..8c5325750 --- /dev/null +++ b/gstreamer-editing-services/src/auto/test_clip.rs @@ -0,0 +1,250 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Clip; +use crate::Container; +use crate::Extractable; +use crate::MetaContainer; +use crate::SourceClip; +use crate::TimelineElement; +use crate::VideoTestPattern; +use glib::object::Cast; +use glib::object::IsA; +use glib::signal::connect_raw; +use glib::signal::SignalHandlerId; +use glib::translate::*; +use glib::StaticType; +use glib::ToValue; +use std::boxed::Box as Box_; +use std::mem::transmute; + +glib::wrapper! { + #[doc(alias = "GESTestClip")] + pub struct TestClip(Object) @extends SourceClip, Clip, Container, TimelineElement, @implements Extractable, MetaContainer; + + match fn { + type_ => || ffi::ges_test_clip_get_type(), + } +} + +impl TestClip { + #[doc(alias = "ges_test_clip_new")] + pub fn new() -> Option { + assert_initialized_main_thread!(); + unsafe { from_glib_none(ffi::ges_test_clip_new()) } + } + + #[doc(alias = "ges_test_clip_new_for_nick")] + #[doc(alias = "new_for_nick")] + pub fn for_nick(nick: &str) -> Option { + assert_initialized_main_thread!(); + unsafe { from_glib_none(ffi::ges_test_clip_new_for_nick(nick.to_glib_none().0)) } + } +} + +pub const NONE_TEST_CLIP: Option<&TestClip> = None; + +pub trait TestClipExt: 'static { + #[doc(alias = "ges_test_clip_get_frequency")] + #[doc(alias = "get_frequency")] + fn frequency(&self) -> f64; + + #[doc(alias = "ges_test_clip_get_volume")] + #[doc(alias = "get_volume")] + fn volume(&self) -> f64; + + #[doc(alias = "ges_test_clip_get_vpattern")] + #[doc(alias = "get_vpattern")] + fn vpattern(&self) -> VideoTestPattern; + + #[doc(alias = "ges_test_clip_is_muted")] + fn is_muted(&self) -> bool; + + #[doc(alias = "ges_test_clip_set_frequency")] + fn set_frequency(&self, freq: f64); + + #[doc(alias = "ges_test_clip_set_mute")] + fn set_mute(&self, mute: bool); + + #[doc(alias = "ges_test_clip_set_volume")] + fn set_volume(&self, volume: f64); + + #[doc(alias = "ges_test_clip_set_vpattern")] + fn set_vpattern(&self, vpattern: VideoTestPattern); + + fn freq(&self) -> f64; + + fn set_freq(&self, freq: f64); + + #[doc(alias = "freq")] + fn connect_freq_notify(&self, f: F) -> SignalHandlerId; + + #[doc(alias = "mute")] + fn connect_mute_notify(&self, f: F) -> SignalHandlerId; + + #[doc(alias = "volume")] + fn connect_volume_notify(&self, f: F) -> SignalHandlerId; + + #[doc(alias = "vpattern")] + fn connect_vpattern_notify(&self, f: F) -> SignalHandlerId; +} + +impl> TestClipExt for O { + fn frequency(&self) -> f64 { + unsafe { ffi::ges_test_clip_get_frequency(self.as_ref().to_glib_none().0) } + } + + fn volume(&self) -> f64 { + unsafe { ffi::ges_test_clip_get_volume(self.as_ref().to_glib_none().0) } + } + + fn vpattern(&self) -> VideoTestPattern { + unsafe { + from_glib(ffi::ges_test_clip_get_vpattern( + self.as_ref().to_glib_none().0, + )) + } + } + + fn is_muted(&self) -> bool { + unsafe { from_glib(ffi::ges_test_clip_is_muted(self.as_ref().to_glib_none().0)) } + } + + fn set_frequency(&self, freq: f64) { + unsafe { + ffi::ges_test_clip_set_frequency(self.as_ref().to_glib_none().0, freq); + } + } + + fn set_mute(&self, mute: bool) { + unsafe { + ffi::ges_test_clip_set_mute(self.as_ref().to_glib_none().0, mute.into_glib()); + } + } + + fn set_volume(&self, volume: f64) { + unsafe { + ffi::ges_test_clip_set_volume(self.as_ref().to_glib_none().0, volume); + } + } + + fn set_vpattern(&self, vpattern: VideoTestPattern) { + unsafe { + ffi::ges_test_clip_set_vpattern(self.as_ref().to_glib_none().0, vpattern.into_glib()); + } + } + + fn freq(&self) -> f64 { + unsafe { + let mut value = glib::Value::from_type(::static_type()); + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, + b"freq\0".as_ptr() as *const _, + value.to_glib_none_mut().0, + ); + value + .get() + .expect("Return Value for property `freq` getter") + } + } + + fn set_freq(&self, freq: f64) { + unsafe { + glib::gobject_ffi::g_object_set_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, + b"freq\0".as_ptr() as *const _, + freq.to_value().to_glib_none().0, + ); + } + } + + fn connect_freq_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_freq_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::GESTestClip, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(TestClip::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::freq\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_freq_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + + fn connect_mute_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_mute_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::GESTestClip, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(TestClip::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::mute\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_mute_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + + fn connect_volume_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_volume_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::GESTestClip, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(TestClip::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::volume\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_volume_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + + fn connect_vpattern_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_vpattern_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::GESTestClip, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(TestClip::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::vpattern\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_vpattern_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } +} diff --git a/gstreamer-editing-services/src/auto/text_overlay.rs b/gstreamer-editing-services/src/auto/text_overlay.rs new file mode 100644 index 000000000..0b18ce322 --- /dev/null +++ b/gstreamer-editing-services/src/auto/text_overlay.rs @@ -0,0 +1,182 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Extractable; +use crate::MetaContainer; +use crate::Operation; +use crate::TextHAlign; +use crate::TextVAlign; +use crate::TimelineElement; +use crate::TrackElement; +use glib::object::IsA; +use glib::translate::*; + +glib::wrapper! { + #[doc(alias = "GESTextOverlay")] + pub struct TextOverlay(Object) @extends Operation, TrackElement, TimelineElement, @implements Extractable, MetaContainer; + + match fn { + type_ => || ffi::ges_text_overlay_get_type(), + } +} + +impl TextOverlay { + #[cfg_attr(feature = "v1_18", deprecated = "Since 1.18")] + #[doc(alias = "ges_text_overlay_new")] + pub fn new() -> Option { + assert_initialized_main_thread!(); + unsafe { from_glib_none(ffi::ges_text_overlay_new()) } + } +} + +pub const NONE_TEXT_OVERLAY: Option<&TextOverlay> = None; + +pub trait TextOverlayExt: 'static { + #[doc(alias = "ges_text_overlay_get_color")] + #[doc(alias = "get_color")] + fn color(&self) -> u32; + + #[doc(alias = "ges_text_overlay_get_font_desc")] + #[doc(alias = "get_font_desc")] + fn font_desc(&self) -> Option; + + #[doc(alias = "ges_text_overlay_get_halignment")] + #[doc(alias = "get_halignment")] + fn halignment(&self) -> TextHAlign; + + #[doc(alias = "ges_text_overlay_get_text")] + #[doc(alias = "get_text")] + fn text(&self) -> Option; + + #[doc(alias = "ges_text_overlay_get_valignment")] + #[doc(alias = "get_valignment")] + fn valignment(&self) -> TextVAlign; + + #[doc(alias = "ges_text_overlay_get_xpos")] + #[doc(alias = "get_xpos")] + fn xpos(&self) -> f64; + + #[doc(alias = "ges_text_overlay_get_ypos")] + #[doc(alias = "get_ypos")] + fn ypos(&self) -> f64; + + #[doc(alias = "ges_text_overlay_set_color")] + fn set_color(&self, color: u32); + + #[doc(alias = "ges_text_overlay_set_font_desc")] + fn set_font_desc(&self, font_desc: &str); + + #[doc(alias = "ges_text_overlay_set_halignment")] + fn set_halignment(&self, halign: TextHAlign); + + #[doc(alias = "ges_text_overlay_set_text")] + fn set_text(&self, text: &str); + + #[doc(alias = "ges_text_overlay_set_valignment")] + fn set_valignment(&self, valign: TextVAlign); + + #[doc(alias = "ges_text_overlay_set_xpos")] + fn set_xpos(&self, position: f64); + + #[doc(alias = "ges_text_overlay_set_ypos")] + fn set_ypos(&self, position: f64); +} + +impl> TextOverlayExt for O { + fn color(&self) -> u32 { + unsafe { ffi::ges_text_overlay_get_color(self.as_ref().to_glib_none().0) } + } + + fn font_desc(&self) -> Option { + unsafe { + from_glib_none(ffi::ges_text_overlay_get_font_desc( + self.as_ref().to_glib_none().0, + )) + } + } + + fn halignment(&self) -> TextHAlign { + unsafe { + from_glib(ffi::ges_text_overlay_get_halignment( + self.as_ref().to_glib_none().0, + )) + } + } + + fn text(&self) -> Option { + unsafe { + from_glib_none(ffi::ges_text_overlay_get_text( + self.as_ref().to_glib_none().0, + )) + } + } + + fn valignment(&self) -> TextVAlign { + unsafe { + from_glib(ffi::ges_text_overlay_get_valignment( + self.as_ref().to_glib_none().0, + )) + } + } + + fn xpos(&self) -> f64 { + unsafe { ffi::ges_text_overlay_get_xpos(self.as_ref().to_glib_none().0) } + } + + fn ypos(&self) -> f64 { + unsafe { ffi::ges_text_overlay_get_ypos(self.as_ref().to_glib_none().0) } + } + + fn set_color(&self, color: u32) { + unsafe { + ffi::ges_text_overlay_set_color(self.as_ref().to_glib_none().0, color); + } + } + + fn set_font_desc(&self, font_desc: &str) { + unsafe { + ffi::ges_text_overlay_set_font_desc( + self.as_ref().to_glib_none().0, + font_desc.to_glib_none().0, + ); + } + } + + fn set_halignment(&self, halign: TextHAlign) { + unsafe { + ffi::ges_text_overlay_set_halignment( + self.as_ref().to_glib_none().0, + halign.into_glib(), + ); + } + } + + fn set_text(&self, text: &str) { + unsafe { + ffi::ges_text_overlay_set_text(self.as_ref().to_glib_none().0, text.to_glib_none().0); + } + } + + fn set_valignment(&self, valign: TextVAlign) { + unsafe { + ffi::ges_text_overlay_set_valignment( + self.as_ref().to_glib_none().0, + valign.into_glib(), + ); + } + } + + fn set_xpos(&self, position: f64) { + unsafe { + ffi::ges_text_overlay_set_xpos(self.as_ref().to_glib_none().0, position); + } + } + + fn set_ypos(&self, position: f64) { + unsafe { + ffi::ges_text_overlay_set_ypos(self.as_ref().to_glib_none().0, position); + } + } +} diff --git a/gstreamer-editing-services/src/auto/text_overlay_clip.rs b/gstreamer-editing-services/src/auto/text_overlay_clip.rs new file mode 100644 index 000000000..9d54bf344 --- /dev/null +++ b/gstreamer-editing-services/src/auto/text_overlay_clip.rs @@ -0,0 +1,412 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Clip; +use crate::Container; +use crate::Extractable; +use crate::MetaContainer; +use crate::OperationClip; +use crate::OverlayClip; +use crate::TextHAlign; +use crate::TextVAlign; +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::ToValue; +use std::boxed::Box as Box_; +use std::mem::transmute; + +glib::wrapper! { + #[doc(alias = "GESTextOverlayClip")] + pub struct TextOverlayClip(Object) @extends OverlayClip, OperationClip, Clip, Container, TimelineElement, @implements Extractable, MetaContainer; + + match fn { + type_ => || ffi::ges_text_overlay_clip_get_type(), + } +} + +impl TextOverlayClip { + #[doc(alias = "ges_text_overlay_clip_new")] + pub fn new() -> Option { + assert_initialized_main_thread!(); + unsafe { from_glib_none(ffi::ges_text_overlay_clip_new()) } + } +} + +pub const NONE_TEXT_OVERLAY_CLIP: Option<&TextOverlayClip> = None; + +pub trait TextOverlayClipExt: 'static { + #[doc(alias = "ges_text_overlay_clip_get_color")] + #[doc(alias = "get_color")] + fn color(&self) -> u32; + + #[doc(alias = "ges_text_overlay_clip_get_font_desc")] + #[doc(alias = "get_font_desc")] + fn font_desc(&self) -> Option; + + #[doc(alias = "ges_text_overlay_clip_get_halignment")] + #[doc(alias = "get_halignment")] + fn halignment(&self) -> TextHAlign; + + #[doc(alias = "ges_text_overlay_clip_get_text")] + #[doc(alias = "get_text")] + fn text(&self) -> Option; + + #[doc(alias = "ges_text_overlay_clip_get_valignment")] + #[doc(alias = "get_valignment")] + fn valignment(&self) -> TextVAlign; + + #[doc(alias = "ges_text_overlay_clip_get_xpos")] + #[doc(alias = "get_xpos")] + fn xpos(&self) -> f64; + + #[doc(alias = "ges_text_overlay_clip_get_ypos")] + #[doc(alias = "get_ypos")] + fn ypos(&self) -> f64; + + #[doc(alias = "ges_text_overlay_clip_set_color")] + fn set_color(&self, color: u32); + + #[doc(alias = "ges_text_overlay_clip_set_font_desc")] + fn set_font_desc(&self, font_desc: &str); + + #[doc(alias = "ges_text_overlay_clip_set_halign")] + fn set_halign(&self, halign: TextHAlign); + + #[doc(alias = "ges_text_overlay_clip_set_text")] + fn set_text(&self, text: &str); + + #[doc(alias = "ges_text_overlay_clip_set_valign")] + fn set_valign(&self, valign: TextVAlign); + + #[doc(alias = "ges_text_overlay_clip_set_xpos")] + fn set_xpos(&self, position: f64); + + #[doc(alias = "ges_text_overlay_clip_set_ypos")] + fn set_ypos(&self, position: f64); + + fn set_halignment(&self, halignment: TextHAlign); + + fn set_valignment(&self, valignment: TextVAlign); + + #[doc(alias = "color")] + fn connect_color_notify(&self, f: F) -> SignalHandlerId; + + #[doc(alias = "font-desc")] + fn connect_font_desc_notify(&self, f: F) -> SignalHandlerId; + + #[doc(alias = "halignment")] + fn connect_halignment_notify(&self, f: F) -> SignalHandlerId; + + #[doc(alias = "text")] + fn connect_text_notify(&self, f: F) -> SignalHandlerId; + + #[doc(alias = "valignment")] + fn connect_valignment_notify(&self, f: F) -> SignalHandlerId; + + #[doc(alias = "xpos")] + fn connect_xpos_notify(&self, f: F) -> SignalHandlerId; + + #[doc(alias = "ypos")] + fn connect_ypos_notify(&self, f: F) -> SignalHandlerId; +} + +impl> TextOverlayClipExt for O { + fn color(&self) -> u32 { + unsafe { ffi::ges_text_overlay_clip_get_color(self.as_ref().to_glib_none().0) } + } + + fn font_desc(&self) -> Option { + unsafe { + from_glib_none(ffi::ges_text_overlay_clip_get_font_desc( + self.as_ref().to_glib_none().0, + )) + } + } + + fn halignment(&self) -> TextHAlign { + unsafe { + from_glib(ffi::ges_text_overlay_clip_get_halignment( + self.as_ref().to_glib_none().0, + )) + } + } + + fn text(&self) -> Option { + unsafe { + from_glib_none(ffi::ges_text_overlay_clip_get_text( + self.as_ref().to_glib_none().0, + )) + } + } + + fn valignment(&self) -> TextVAlign { + unsafe { + from_glib(ffi::ges_text_overlay_clip_get_valignment( + self.as_ref().to_glib_none().0, + )) + } + } + + fn xpos(&self) -> f64 { + unsafe { ffi::ges_text_overlay_clip_get_xpos(self.as_ref().to_glib_none().0) } + } + + fn ypos(&self) -> f64 { + unsafe { ffi::ges_text_overlay_clip_get_ypos(self.as_ref().to_glib_none().0) } + } + + fn set_color(&self, color: u32) { + unsafe { + ffi::ges_text_overlay_clip_set_color(self.as_ref().to_glib_none().0, color); + } + } + + fn set_font_desc(&self, font_desc: &str) { + unsafe { + ffi::ges_text_overlay_clip_set_font_desc( + self.as_ref().to_glib_none().0, + font_desc.to_glib_none().0, + ); + } + } + + fn set_halign(&self, halign: TextHAlign) { + unsafe { + ffi::ges_text_overlay_clip_set_halign( + self.as_ref().to_glib_none().0, + halign.into_glib(), + ); + } + } + + fn set_text(&self, text: &str) { + unsafe { + ffi::ges_text_overlay_clip_set_text( + self.as_ref().to_glib_none().0, + text.to_glib_none().0, + ); + } + } + + fn set_valign(&self, valign: TextVAlign) { + unsafe { + ffi::ges_text_overlay_clip_set_valign( + self.as_ref().to_glib_none().0, + valign.into_glib(), + ); + } + } + + fn set_xpos(&self, position: f64) { + unsafe { + ffi::ges_text_overlay_clip_set_xpos(self.as_ref().to_glib_none().0, position); + } + } + + fn set_ypos(&self, position: f64) { + unsafe { + ffi::ges_text_overlay_clip_set_ypos(self.as_ref().to_glib_none().0, position); + } + } + + fn set_halignment(&self, halignment: TextHAlign) { + unsafe { + glib::gobject_ffi::g_object_set_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, + b"halignment\0".as_ptr() as *const _, + halignment.to_value().to_glib_none().0, + ); + } + } + + fn set_valignment(&self, valignment: TextVAlign) { + unsafe { + glib::gobject_ffi::g_object_set_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, + b"valignment\0".as_ptr() as *const _, + valignment.to_value().to_glib_none().0, + ); + } + } + + fn connect_color_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_color_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::GESTextOverlayClip, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(TextOverlayClip::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::color\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_color_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + + fn connect_font_desc_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_font_desc_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::GESTextOverlayClip, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(TextOverlayClip::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::font-desc\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_font_desc_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + + fn connect_halignment_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_halignment_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::GESTextOverlayClip, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(TextOverlayClip::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::halignment\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_halignment_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + + fn connect_text_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_text_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::GESTextOverlayClip, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(TextOverlayClip::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::text\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_text_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + + fn connect_valignment_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_valignment_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::GESTextOverlayClip, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(TextOverlayClip::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::valignment\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_valignment_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + + fn connect_xpos_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_xpos_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::GESTextOverlayClip, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(TextOverlayClip::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::xpos\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_xpos_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + + fn connect_ypos_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_ypos_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::GESTextOverlayClip, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(TextOverlayClip::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::ypos\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_ypos_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } +} diff --git a/gstreamer-editing-services/src/auto/timeline.rs b/gstreamer-editing-services/src/auto/timeline.rs index a35a62286..d9d320466 100644 --- a/gstreamer-editing-services/src/auto/timeline.rs +++ b/gstreamer-editing-services/src/auto/timeline.rs @@ -13,6 +13,7 @@ use crate::Extractable; use crate::FrameNumber; use crate::Group; use crate::Layer; +use crate::MetaContainer; use crate::TimelineElement; use crate::Track; use crate::TrackElement; @@ -27,7 +28,7 @@ use std::ptr; glib::wrapper! { #[doc(alias = "GESTimeline")] - pub struct Timeline(Object) @extends gst::Bin, gst::Element, gst::Object, @implements Extractable; + pub struct Timeline(Object) @extends gst::Bin, gst::Element, gst::Object, @implements gst::ChildProxy, Extractable, MetaContainer; match fn { type_ => || ffi::ges_timeline_get_type(), diff --git a/gstreamer-editing-services/src/auto/timeline_element.rs b/gstreamer-editing-services/src/auto/timeline_element.rs index eb2cccfdd..b79df8f15 100644 --- a/gstreamer-editing-services/src/auto/timeline_element.rs +++ b/gstreamer-editing-services/src/auto/timeline_element.rs @@ -13,6 +13,7 @@ use crate::Extractable; #[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] use crate::Layer; +use crate::MetaContainer; use crate::Timeline; use crate::TrackType; use glib::object::Cast; @@ -33,7 +34,7 @@ use std::ptr; glib::wrapper! { #[doc(alias = "GESTimelineElement")] - pub struct TimelineElement(Object) @implements Extractable; + pub struct TimelineElement(Object) @implements Extractable, MetaContainer; match fn { type_ => || ffi::ges_timeline_element_get_type(), diff --git a/gstreamer-editing-services/src/auto/title_clip.rs b/gstreamer-editing-services/src/auto/title_clip.rs new file mode 100644 index 000000000..4d5792621 --- /dev/null +++ b/gstreamer-editing-services/src/auto/title_clip.rs @@ -0,0 +1,462 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Clip; +use crate::Container; +use crate::Extractable; +use crate::MetaContainer; +use crate::SourceClip; +use crate::TextHAlign; +use crate::TextVAlign; +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::StaticType; +use std::boxed::Box as Box_; +use std::mem::transmute; + +glib::wrapper! { + #[doc(alias = "GESTitleClip")] + pub struct TitleClip(Object) @extends SourceClip, Clip, Container, TimelineElement, @implements Extractable, MetaContainer; + + match fn { + type_ => || ffi::ges_title_clip_get_type(), + } +} + +impl TitleClip { + #[doc(alias = "ges_title_clip_new")] + pub fn new() -> Option { + assert_initialized_main_thread!(); + unsafe { from_glib_none(ffi::ges_title_clip_new()) } + } +} + +pub const NONE_TITLE_CLIP: Option<&TitleClip> = None; + +pub trait TitleClipExt: 'static { + #[deprecated = "Since 1.6"] + #[doc(alias = "ges_title_clip_get_background_color")] + #[doc(alias = "get_background_color")] + fn background_color(&self) -> u32; + + #[deprecated = "Since 1.6"] + #[doc(alias = "ges_title_clip_get_font_desc")] + #[doc(alias = "get_font_desc")] + fn font_desc(&self) -> Option; + + #[deprecated = "Since 1.6"] + #[doc(alias = "ges_title_clip_get_halignment")] + #[doc(alias = "get_halignment")] + fn halignment(&self) -> TextHAlign; + + #[deprecated = "Since 1.6"] + #[doc(alias = "ges_title_clip_get_text")] + #[doc(alias = "get_text")] + fn text(&self) -> Option; + + #[deprecated = "Since 1.6"] + #[doc(alias = "ges_title_clip_get_text_color")] + #[doc(alias = "get_text_color")] + fn text_color(&self) -> u32; + + #[deprecated = "Since 1.6"] + #[doc(alias = "ges_title_clip_get_valignment")] + #[doc(alias = "get_valignment")] + fn valignment(&self) -> TextVAlign; + + #[deprecated = "Since 1.6"] + #[doc(alias = "ges_title_clip_get_xpos")] + #[doc(alias = "get_xpos")] + fn xpos(&self) -> f64; + + #[deprecated = "Since 1.6"] + #[doc(alias = "ges_title_clip_get_ypos")] + #[doc(alias = "get_ypos")] + fn ypos(&self) -> f64; + + #[deprecated = "Since 1.6"] + #[doc(alias = "ges_title_clip_set_background")] + fn set_background(&self, background: u32); + + #[deprecated = "Since 1.6"] + #[doc(alias = "ges_title_clip_set_color")] + fn set_color(&self, color: u32); + + #[deprecated = "Since 1.6"] + #[doc(alias = "ges_title_clip_set_font_desc")] + fn set_font_desc(&self, font_desc: &str); + + #[deprecated = "Since 1.6"] + #[doc(alias = "ges_title_clip_set_halignment")] + fn set_halignment(&self, halign: TextHAlign); + + #[deprecated = "Since 1.6"] + #[doc(alias = "ges_title_clip_set_text")] + fn set_text(&self, text: &str); + + #[deprecated = "Since 1.6"] + #[doc(alias = "ges_title_clip_set_valignment")] + fn set_valignment(&self, valign: TextVAlign); + + #[deprecated = "Since 1.6"] + #[doc(alias = "ges_title_clip_set_xpos")] + fn set_xpos(&self, position: f64); + + #[deprecated = "Since 1.6"] + #[doc(alias = "ges_title_clip_set_ypos")] + fn set_ypos(&self, position: f64); + + #[deprecated = "Since 1.6"] + fn background(&self) -> u32; + + #[deprecated = "Since 1.6"] + fn color(&self) -> u32; + + #[deprecated = "Since 1.6"] + #[doc(alias = "background")] + fn connect_background_notify(&self, f: F) -> SignalHandlerId; + + #[deprecated = "Since 1.6"] + #[doc(alias = "color")] + fn connect_color_notify(&self, f: F) -> SignalHandlerId; + + #[deprecated = "Since 1.6"] + #[doc(alias = "font-desc")] + fn connect_font_desc_notify(&self, f: F) -> SignalHandlerId; + + #[deprecated = "Since 1.6"] + #[doc(alias = "halignment")] + fn connect_halignment_notify(&self, f: F) -> SignalHandlerId; + + #[deprecated = "Since 1.6"] + #[doc(alias = "text")] + fn connect_text_notify(&self, f: F) -> SignalHandlerId; + + #[deprecated = "Since 1.6"] + #[doc(alias = "valignment")] + fn connect_valignment_notify(&self, f: F) -> SignalHandlerId; + + #[deprecated = "Since 1.6"] + #[doc(alias = "xpos")] + fn connect_xpos_notify(&self, f: F) -> SignalHandlerId; + + #[deprecated = "Since 1.6"] + #[doc(alias = "ypos")] + fn connect_ypos_notify(&self, f: F) -> SignalHandlerId; +} + +impl> TitleClipExt for O { + fn background_color(&self) -> u32 { + unsafe { ffi::ges_title_clip_get_background_color(self.as_ref().to_glib_none().0) } + } + + fn font_desc(&self) -> Option { + unsafe { + from_glib_none(ffi::ges_title_clip_get_font_desc( + self.as_ref().to_glib_none().0, + )) + } + } + + fn halignment(&self) -> TextHAlign { + unsafe { + from_glib(ffi::ges_title_clip_get_halignment( + self.as_ref().to_glib_none().0, + )) + } + } + + fn text(&self) -> Option { + unsafe { from_glib_none(ffi::ges_title_clip_get_text(self.as_ref().to_glib_none().0)) } + } + + fn text_color(&self) -> u32 { + unsafe { ffi::ges_title_clip_get_text_color(self.as_ref().to_glib_none().0) } + } + + fn valignment(&self) -> TextVAlign { + unsafe { + from_glib(ffi::ges_title_clip_get_valignment( + self.as_ref().to_glib_none().0, + )) + } + } + + fn xpos(&self) -> f64 { + unsafe { ffi::ges_title_clip_get_xpos(self.as_ref().to_glib_none().0) } + } + + fn ypos(&self) -> f64 { + unsafe { ffi::ges_title_clip_get_ypos(self.as_ref().to_glib_none().0) } + } + + fn set_background(&self, background: u32) { + unsafe { + ffi::ges_title_clip_set_background(self.as_ref().to_glib_none().0, background); + } + } + + fn set_color(&self, color: u32) { + unsafe { + ffi::ges_title_clip_set_color(self.as_ref().to_glib_none().0, color); + } + } + + fn set_font_desc(&self, font_desc: &str) { + unsafe { + ffi::ges_title_clip_set_font_desc( + self.as_ref().to_glib_none().0, + font_desc.to_glib_none().0, + ); + } + } + + fn set_halignment(&self, halign: TextHAlign) { + unsafe { + ffi::ges_title_clip_set_halignment(self.as_ref().to_glib_none().0, halign.into_glib()); + } + } + + fn set_text(&self, text: &str) { + unsafe { + ffi::ges_title_clip_set_text(self.as_ref().to_glib_none().0, text.to_glib_none().0); + } + } + + fn set_valignment(&self, valign: TextVAlign) { + unsafe { + ffi::ges_title_clip_set_valignment(self.as_ref().to_glib_none().0, valign.into_glib()); + } + } + + fn set_xpos(&self, position: f64) { + unsafe { + ffi::ges_title_clip_set_xpos(self.as_ref().to_glib_none().0, position); + } + } + + fn set_ypos(&self, position: f64) { + unsafe { + ffi::ges_title_clip_set_ypos(self.as_ref().to_glib_none().0, position); + } + } + + fn background(&self) -> u32 { + unsafe { + let mut value = glib::Value::from_type(::static_type()); + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, + b"background\0".as_ptr() as *const _, + value.to_glib_none_mut().0, + ); + value + .get() + .expect("Return Value for property `background` getter") + } + } + + fn color(&self) -> u32 { + unsafe { + let mut value = glib::Value::from_type(::static_type()); + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, + b"color\0".as_ptr() as *const _, + value.to_glib_none_mut().0, + ); + value + .get() + .expect("Return Value for property `color` getter") + } + } + + fn connect_background_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_background_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::GESTitleClip, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(TitleClip::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::background\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_background_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + + fn connect_color_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_color_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::GESTitleClip, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(TitleClip::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::color\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_color_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + + fn connect_font_desc_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_font_desc_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::GESTitleClip, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(TitleClip::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::font-desc\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_font_desc_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + + fn connect_halignment_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_halignment_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::GESTitleClip, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(TitleClip::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::halignment\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_halignment_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + + fn connect_text_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_text_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::GESTitleClip, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(TitleClip::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::text\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_text_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + + fn connect_valignment_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_valignment_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::GESTitleClip, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(TitleClip::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::valignment\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_valignment_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + + fn connect_xpos_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_xpos_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::GESTitleClip, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(TitleClip::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::xpos\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_xpos_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + + fn connect_ypos_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_ypos_trampoline, F: Fn(&P) + 'static>( + this: *mut ffi::GESTitleClip, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(TitleClip::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::ypos\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_ypos_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } +} diff --git a/gstreamer-editing-services/src/auto/title_source.rs b/gstreamer-editing-services/src/auto/title_source.rs new file mode 100644 index 000000000..a30b64dc0 --- /dev/null +++ b/gstreamer-editing-services/src/auto/title_source.rs @@ -0,0 +1,193 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Extractable; +use crate::MetaContainer; +use crate::Source; +use crate::TextHAlign; +use crate::TextVAlign; +use crate::TimelineElement; +use crate::TrackElement; +use crate::VideoSource; +use glib::object::IsA; +use glib::translate::*; + +glib::wrapper! { + #[doc(alias = "GESTitleSource")] + pub struct TitleSource(Object) @extends VideoSource, Source, TrackElement, TimelineElement, @implements Extractable, MetaContainer; + + match fn { + type_ => || ffi::ges_title_source_get_type(), + } +} + +pub const NONE_TITLE_SOURCE: Option<&TitleSource> = None; + +pub trait TitleSourceExt: 'static { + #[doc(alias = "ges_title_source_get_background_color")] + #[doc(alias = "get_background_color")] + fn background_color(&self) -> u32; + + #[cfg_attr(feature = "v1_16", deprecated = "Since 1.16")] + #[doc(alias = "ges_title_source_get_font_desc")] + #[doc(alias = "get_font_desc")] + fn font_desc(&self) -> Option; + + #[doc(alias = "ges_title_source_get_halignment")] + #[doc(alias = "get_halignment")] + fn halignment(&self) -> TextHAlign; + + #[cfg_attr(feature = "v1_16", deprecated = "Since 1.16")] + #[doc(alias = "ges_title_source_get_text")] + #[doc(alias = "get_text")] + fn text(&self) -> Option; + + #[doc(alias = "ges_title_source_get_text_color")] + #[doc(alias = "get_text_color")] + fn text_color(&self) -> u32; + + #[doc(alias = "ges_title_source_get_valignment")] + #[doc(alias = "get_valignment")] + fn valignment(&self) -> TextVAlign; + + #[doc(alias = "ges_title_source_get_xpos")] + #[doc(alias = "get_xpos")] + fn xpos(&self) -> f64; + + #[doc(alias = "ges_title_source_get_ypos")] + #[doc(alias = "get_ypos")] + fn ypos(&self) -> f64; + + #[doc(alias = "ges_title_source_set_background_color")] + fn set_background_color(&self, color: u32); + + #[doc(alias = "ges_title_source_set_font_desc")] + fn set_font_desc(&self, font_desc: &str); + + #[doc(alias = "ges_title_source_set_halignment")] + fn set_halignment(&self, halign: TextHAlign); + + #[doc(alias = "ges_title_source_set_text")] + fn set_text(&self, text: &str); + + #[doc(alias = "ges_title_source_set_text_color")] + fn set_text_color(&self, color: u32); + + #[doc(alias = "ges_title_source_set_valignment")] + fn set_valignment(&self, valign: TextVAlign); + + #[doc(alias = "ges_title_source_set_xpos")] + fn set_xpos(&self, position: f64); + + #[doc(alias = "ges_title_source_set_ypos")] + fn set_ypos(&self, position: f64); +} + +impl> TitleSourceExt for O { + fn background_color(&self) -> u32 { + unsafe { ffi::ges_title_source_get_background_color(self.as_ref().to_glib_none().0) } + } + + fn font_desc(&self) -> Option { + unsafe { + from_glib_full(ffi::ges_title_source_get_font_desc( + self.as_ref().to_glib_none().0, + )) + } + } + + fn halignment(&self) -> TextHAlign { + unsafe { + from_glib(ffi::ges_title_source_get_halignment( + self.as_ref().to_glib_none().0, + )) + } + } + + fn text(&self) -> Option { + unsafe { + from_glib_full(ffi::ges_title_source_get_text( + self.as_ref().to_glib_none().0, + )) + } + } + + fn text_color(&self) -> u32 { + unsafe { ffi::ges_title_source_get_text_color(self.as_ref().to_glib_none().0) } + } + + fn valignment(&self) -> TextVAlign { + unsafe { + from_glib(ffi::ges_title_source_get_valignment( + self.as_ref().to_glib_none().0, + )) + } + } + + fn xpos(&self) -> f64 { + unsafe { ffi::ges_title_source_get_xpos(self.as_ref().to_glib_none().0) } + } + + fn ypos(&self) -> f64 { + unsafe { ffi::ges_title_source_get_ypos(self.as_ref().to_glib_none().0) } + } + + fn set_background_color(&self, color: u32) { + unsafe { + ffi::ges_title_source_set_background_color(self.as_ref().to_glib_none().0, color); + } + } + + fn set_font_desc(&self, font_desc: &str) { + unsafe { + ffi::ges_title_source_set_font_desc( + self.as_ref().to_glib_none().0, + font_desc.to_glib_none().0, + ); + } + } + + fn set_halignment(&self, halign: TextHAlign) { + unsafe { + ffi::ges_title_source_set_halignment( + self.as_ref().to_glib_none().0, + halign.into_glib(), + ); + } + } + + fn set_text(&self, text: &str) { + unsafe { + ffi::ges_title_source_set_text(self.as_ref().to_glib_none().0, text.to_glib_none().0); + } + } + + fn set_text_color(&self, color: u32) { + unsafe { + ffi::ges_title_source_set_text_color(self.as_ref().to_glib_none().0, color); + } + } + + fn set_valignment(&self, valign: TextVAlign) { + unsafe { + ffi::ges_title_source_set_valignment( + self.as_ref().to_glib_none().0, + valign.into_glib(), + ); + } + } + + fn set_xpos(&self, position: f64) { + unsafe { + ffi::ges_title_source_set_xpos(self.as_ref().to_glib_none().0, position); + } + } + + fn set_ypos(&self, position: f64) { + unsafe { + ffi::ges_title_source_set_ypos(self.as_ref().to_glib_none().0, position); + } + } +} diff --git a/gstreamer-editing-services/src/auto/track.rs b/gstreamer-editing-services/src/auto/track.rs index d23cbf421..3e584889f 100644 --- a/gstreamer-editing-services/src/auto/track.rs +++ b/gstreamer-editing-services/src/auto/track.rs @@ -3,6 +3,7 @@ // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) // DO NOT EDIT +use crate::MetaContainer; use crate::Timeline; use crate::TrackElement; use crate::TrackType; @@ -23,7 +24,7 @@ use std::ptr; glib::wrapper! { #[doc(alias = "GESTrack")] - pub struct Track(Object) @extends gst::Bin, gst::Element, gst::Object; + pub struct Track(Object) @extends gst::Bin, gst::Element, gst::Object, @implements gst::ChildProxy, MetaContainer; match fn { type_ => || ffi::ges_track_get_type(), diff --git a/gstreamer-editing-services/src/auto/track_element.rs b/gstreamer-editing-services/src/auto/track_element.rs index c59d06ffe..5fbf5ddcf 100644 --- a/gstreamer-editing-services/src/auto/track_element.rs +++ b/gstreamer-editing-services/src/auto/track_element.rs @@ -7,6 +7,7 @@ use crate::Edge; use crate::EditMode; use crate::Extractable; use crate::Layer; +use crate::MetaContainer; use crate::TimelineElement; use crate::Track; use crate::TrackType; @@ -20,7 +21,7 @@ use std::mem::transmute; glib::wrapper! { #[doc(alias = "GESTrackElement")] - pub struct TrackElement(Object) @extends TimelineElement, @implements Extractable; + pub struct TrackElement(Object) @extends TimelineElement, @implements Extractable, MetaContainer; match fn { type_ => || ffi::ges_track_element_get_type(), diff --git a/gstreamer-editing-services/src/auto/track_element_asset.rs b/gstreamer-editing-services/src/auto/track_element_asset.rs new file mode 100644 index 000000000..af4894777 --- /dev/null +++ b/gstreamer-editing-services/src/auto/track_element_asset.rs @@ -0,0 +1,112 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Asset; +use crate::MetaContainer; +use crate::TrackType; +use glib::object::Cast; +use glib::object::IsA; +use glib::signal::connect_raw; +use glib::signal::SignalHandlerId; +use glib::translate::*; +use std::boxed::Box as Box_; +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +use std::mem; +use std::mem::transmute; + +glib::wrapper! { + #[doc(alias = "GESTrackElementAsset")] + pub struct TrackElementAsset(Object) @extends Asset, @implements MetaContainer; + + match fn { + type_ => || ffi::ges_track_element_asset_get_type(), + } +} + +pub const NONE_TRACK_ELEMENT_ASSET: Option<&TrackElementAsset> = None; + +pub trait TrackElementAssetExt: 'static { + #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[doc(alias = "ges_track_element_asset_get_natural_framerate")] + #[doc(alias = "get_natural_framerate")] + fn natural_framerate(&self) -> Option<(i32, i32)>; + + #[doc(alias = "ges_track_element_asset_get_track_type")] + #[doc(alias = "get_track_type")] + fn track_type(&self) -> TrackType; + + #[doc(alias = "ges_track_element_asset_set_track_type")] + fn set_track_type(&self, type_: TrackType); + + #[doc(alias = "track-type")] + fn connect_track_type_notify(&self, f: F) -> SignalHandlerId; +} + +impl> TrackElementAssetExt for O { + #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + fn natural_framerate(&self) -> Option<(i32, i32)> { + unsafe { + let mut framerate_n = mem::MaybeUninit::uninit(); + let mut framerate_d = mem::MaybeUninit::uninit(); + let ret = from_glib(ffi::ges_track_element_asset_get_natural_framerate( + self.as_ref().to_glib_none().0, + framerate_n.as_mut_ptr(), + framerate_d.as_mut_ptr(), + )); + let framerate_n = framerate_n.assume_init(); + let framerate_d = framerate_d.assume_init(); + if ret { + Some((framerate_n, framerate_d)) + } else { + None + } + } + } + + fn track_type(&self) -> TrackType { + unsafe { + from_glib(ffi::ges_track_element_asset_get_track_type( + self.as_ref().to_glib_none().0, + )) + } + } + + fn set_track_type(&self, type_: TrackType) { + unsafe { + ffi::ges_track_element_asset_set_track_type( + self.as_ref().to_glib_none().0, + type_.into_glib(), + ); + } + } + + fn connect_track_type_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_track_type_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::GESTrackElementAsset, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(TrackElementAsset::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::track-type\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_track_type_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } +} diff --git a/gstreamer-editing-services/src/auto/transition.rs b/gstreamer-editing-services/src/auto/transition.rs new file mode 100644 index 000000000..e0ffa168c --- /dev/null +++ b/gstreamer-editing-services/src/auto/transition.rs @@ -0,0 +1,23 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Extractable; +use crate::MetaContainer; +use crate::Operation; +use crate::TimelineElement; +use crate::TrackElement; + +glib::wrapper! { + #[doc(alias = "GESTransition")] + pub struct Transition(Object) @extends Operation, TrackElement, TimelineElement, @implements Extractable, MetaContainer; + + match fn { + type_ => || ffi::ges_transition_get_type(), + } +} + +impl Transition {} + +pub const NONE_TRANSITION: Option<&Transition> = None; diff --git a/gstreamer-editing-services/src/auto/transition_clip.rs b/gstreamer-editing-services/src/auto/transition_clip.rs index 02e7cdadd..d4f5c6da4 100644 --- a/gstreamer-editing-services/src/auto/transition_clip.rs +++ b/gstreamer-editing-services/src/auto/transition_clip.rs @@ -7,6 +7,7 @@ use crate::BaseTransitionClip; use crate::Clip; use crate::Container; use crate::Extractable; +use crate::MetaContainer; use crate::OperationClip; use crate::TimelineElement; use crate::VideoStandardTransitionType; @@ -22,7 +23,7 @@ use std::mem::transmute; glib::wrapper! { #[doc(alias = "GESTransitionClip")] - pub struct TransitionClip(Object) @extends BaseTransitionClip, OperationClip, Clip, Container, TimelineElement, @implements Extractable; + pub struct TransitionClip(Object) @extends BaseTransitionClip, OperationClip, Clip, Container, TimelineElement, @implements Extractable, MetaContainer; match fn { type_ => || ffi::ges_transition_clip_get_type(), diff --git a/gstreamer-editing-services/src/auto/uri_clip.rs b/gstreamer-editing-services/src/auto/uri_clip.rs index 9ce111fab..d04e16de3 100644 --- a/gstreamer-editing-services/src/auto/uri_clip.rs +++ b/gstreamer-editing-services/src/auto/uri_clip.rs @@ -6,6 +6,8 @@ use crate::Clip; use crate::Container; use crate::Extractable; +use crate::MetaContainer; +use crate::SourceClip; use crate::TimelineElement; use glib::object::Cast; use glib::object::IsA; @@ -17,7 +19,7 @@ use std::mem::transmute; glib::wrapper! { #[doc(alias = "GESUriClip")] - pub struct UriClip(Object) @extends Clip, Container, TimelineElement, @implements Extractable; + pub struct UriClip(Object) @extends SourceClip, Clip, Container, TimelineElement, @implements Extractable, MetaContainer; match fn { type_ => || ffi::ges_uri_clip_get_type(), diff --git a/gstreamer-editing-services/src/auto/uri_clip_asset.rs b/gstreamer-editing-services/src/auto/uri_clip_asset.rs index aea07e94a..b11dfd28d 100644 --- a/gstreamer-editing-services/src/auto/uri_clip_asset.rs +++ b/gstreamer-editing-services/src/auto/uri_clip_asset.rs @@ -4,6 +4,11 @@ // DO NOT EDIT use crate::Asset; +use crate::ClipAsset; +use crate::MetaContainer; +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +use crate::SourceClipAsset; use crate::UriSourceAsset; use glib::object::Cast; use glib::object::IsA; @@ -18,9 +23,21 @@ use std::boxed::Box as Box_; use std::mem::transmute; use std::ptr; +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] glib::wrapper! { #[doc(alias = "GESUriClipAsset")] - pub struct UriClipAsset(Object) @extends Asset; + pub struct UriClipAsset(Object) @extends SourceClipAsset, ClipAsset, Asset, @implements MetaContainer; + + match fn { + type_ => || ffi::ges_uri_clip_asset_get_type(), + } +} + +#[cfg(not(any(feature = "v1_18", feature = "dox")))] +glib::wrapper! { + #[doc(alias = "GESUriClipAsset")] + pub struct UriClipAsset(Object) @extends ClipAsset, Asset, @implements MetaContainer; match fn { type_ => || ffi::ges_uri_clip_asset_get_type(), diff --git a/gstreamer-editing-services/src/auto/uri_source_asset.rs b/gstreamer-editing-services/src/auto/uri_source_asset.rs index d4ced12d6..4e05ba4c5 100644 --- a/gstreamer-editing-services/src/auto/uri_source_asset.rs +++ b/gstreamer-editing-services/src/auto/uri_source_asset.rs @@ -4,13 +4,15 @@ // DO NOT EDIT use crate::Asset; +use crate::MetaContainer; +use crate::TrackElementAsset; use crate::UriClipAsset; use glib::object::IsA; use glib::translate::*; glib::wrapper! { #[doc(alias = "GESUriSourceAsset")] - pub struct UriSourceAsset(Object) @extends Asset; + pub struct UriSourceAsset(Object) @extends TrackElementAsset, Asset, @implements MetaContainer; match fn { type_ => || ffi::ges_uri_source_asset_get_type(), diff --git a/gstreamer-editing-services/src/auto/video_source.rs b/gstreamer-editing-services/src/auto/video_source.rs new file mode 100644 index 000000000..56454c01b --- /dev/null +++ b/gstreamer-editing-services/src/auto/video_source.rs @@ -0,0 +1,59 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Extractable; +use crate::MetaContainer; +use crate::Source; +use crate::TimelineElement; +use crate::TrackElement; +use glib::object::IsA; +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +use glib::translate::*; +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +use std::mem; + +glib::wrapper! { + #[doc(alias = "GESVideoSource")] + pub struct VideoSource(Object) @extends Source, TrackElement, TimelineElement, @implements Extractable, MetaContainer; + + match fn { + type_ => || ffi::ges_video_source_get_type(), + } +} + +pub const NONE_VIDEO_SOURCE: Option<&VideoSource> = None; + +pub trait VideoSourceExt: 'static { + #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[doc(alias = "ges_video_source_get_natural_size")] + #[doc(alias = "get_natural_size")] + fn natural_size(&self) -> Option<(i32, i32)>; +} + +impl> VideoSourceExt for O { + #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + fn natural_size(&self) -> Option<(i32, i32)> { + unsafe { + let mut width = mem::MaybeUninit::uninit(); + let mut height = mem::MaybeUninit::uninit(); + let ret = from_glib(ffi::ges_video_source_get_natural_size( + self.as_ref().to_glib_none().0, + width.as_mut_ptr(), + height.as_mut_ptr(), + )); + let width = width.assume_init(); + let height = height.assume_init(); + if ret { + Some((width, height)) + } else { + None + } + } + } +} diff --git a/gstreamer-editing-services/src/auto/video_test_source.rs b/gstreamer-editing-services/src/auto/video_test_source.rs new file mode 100644 index 000000000..a28028ebc --- /dev/null +++ b/gstreamer-editing-services/src/auto/video_test_source.rs @@ -0,0 +1,53 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Extractable; +use crate::MetaContainer; +use crate::Source; +use crate::TimelineElement; +use crate::TrackElement; +use crate::VideoSource; +use crate::VideoTestPattern; +use glib::object::IsA; +use glib::translate::*; + +glib::wrapper! { + #[doc(alias = "GESVideoTestSource")] + pub struct VideoTestSource(Object) @extends VideoSource, Source, TrackElement, TimelineElement, @implements Extractable, MetaContainer; + + match fn { + type_ => || ffi::ges_video_test_source_get_type(), + } +} + +pub const NONE_VIDEO_TEST_SOURCE: Option<&VideoTestSource> = None; + +pub trait VideoTestSourceExt: 'static { + #[doc(alias = "ges_video_test_source_get_pattern")] + #[doc(alias = "get_pattern")] + fn pattern(&self) -> VideoTestPattern; + + #[doc(alias = "ges_video_test_source_set_pattern")] + fn set_pattern(&self, pattern: VideoTestPattern); +} + +impl> VideoTestSourceExt for O { + fn pattern(&self) -> VideoTestPattern { + unsafe { + from_glib(ffi::ges_video_test_source_get_pattern( + self.as_ref().to_glib_none().0, + )) + } + } + + fn set_pattern(&self, pattern: VideoTestPattern) { + unsafe { + ffi::ges_video_test_source_set_pattern( + self.as_ref().to_glib_none().0, + pattern.into_glib(), + ); + } + } +} diff --git a/gstreamer-editing-services/src/auto/video_track.rs b/gstreamer-editing-services/src/auto/video_track.rs new file mode 100644 index 000000000..ed8ce58ea --- /dev/null +++ b/gstreamer-editing-services/src/auto/video_track.rs @@ -0,0 +1,33 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::MetaContainer; +use crate::Track; +use glib::translate::*; + +glib::wrapper! { + #[doc(alias = "GESVideoTrack")] + pub struct VideoTrack(Object) @extends Track, gst::Bin, gst::Element, gst::Object, @implements gst::ChildProxy, MetaContainer; + + match fn { + type_ => || ffi::ges_video_track_get_type(), + } +} + +impl VideoTrack { + #[doc(alias = "ges_video_track_new")] + pub fn new() -> VideoTrack { + assert_initialized_main_thread!(); + unsafe { from_glib_none(ffi::ges_video_track_new()) } + } +} + +impl Default for VideoTrack { + fn default() -> Self { + Self::new() + } +} + +pub const NONE_VIDEO_TRACK: Option<&VideoTrack> = None; diff --git a/gstreamer-editing-services/src/auto/video_transition.rs b/gstreamer-editing-services/src/auto/video_transition.rs new file mode 100644 index 000000000..f0a87ea16 --- /dev/null +++ b/gstreamer-editing-services/src/auto/video_transition.rs @@ -0,0 +1,233 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Extractable; +use crate::MetaContainer; +use crate::Operation; +use crate::TimelineElement; +use crate::TrackElement; +use crate::Transition; +use crate::VideoStandardTransitionType; +use glib::object::Cast; +use glib::object::IsA; +use glib::signal::connect_raw; +use glib::signal::SignalHandlerId; +use glib::translate::*; +use glib::StaticType; +use glib::ToValue; +use std::boxed::Box as Box_; +use std::mem::transmute; + +glib::wrapper! { + #[doc(alias = "GESVideoTransition")] + pub struct VideoTransition(Object) @extends Transition, Operation, TrackElement, TimelineElement, @implements Extractable, MetaContainer; + + match fn { + type_ => || ffi::ges_video_transition_get_type(), + } +} + +impl VideoTransition { + #[doc(alias = "ges_video_transition_new")] + pub fn new() -> VideoTransition { + assert_initialized_main_thread!(); + unsafe { from_glib_none(ffi::ges_video_transition_new()) } + } +} + +impl Default for VideoTransition { + fn default() -> Self { + Self::new() + } +} + +pub const NONE_VIDEO_TRANSITION: Option<&VideoTransition> = None; + +pub trait VideoTransitionExt: 'static { + #[cfg_attr(feature = "v1_20", deprecated = "Since 1.20")] + #[doc(alias = "ges_video_transition_get_border")] + #[doc(alias = "get_border")] + fn border(&self) -> i32; + + #[doc(alias = "ges_video_transition_get_transition_type")] + #[doc(alias = "get_transition_type")] + fn transition_type(&self) -> VideoStandardTransitionType; + + #[cfg_attr(feature = "v1_20", deprecated = "Since 1.20")] + #[doc(alias = "ges_video_transition_is_inverted")] + fn is_inverted(&self) -> bool; + + #[cfg_attr(feature = "v1_20", deprecated = "Since 1.20")] + #[doc(alias = "ges_video_transition_set_border")] + fn set_border(&self, value: u32); + + #[cfg_attr(feature = "v1_20", deprecated = "Since 1.20")] + #[doc(alias = "ges_video_transition_set_inverted")] + fn set_inverted(&self, inverted: bool); + + #[doc(alias = "ges_video_transition_set_transition_type")] + fn set_transition_type(&self, type_: VideoStandardTransitionType) -> bool; + + #[cfg_attr(feature = "v1_20", deprecated = "Since 1.20")] + fn inverts(&self) -> bool; + + #[cfg_attr(feature = "v1_20", deprecated = "Since 1.20")] + fn set_invert(&self, invert: bool); + + #[doc(alias = "border")] + fn connect_border_notify(&self, f: F) -> SignalHandlerId; + + #[cfg_attr(feature = "v1_20", deprecated = "Since 1.20")] + #[doc(alias = "invert")] + fn connect_invert_notify(&self, f: F) -> SignalHandlerId; + + #[doc(alias = "transition-type")] + fn connect_transition_type_notify(&self, f: F) -> SignalHandlerId; +} + +impl> VideoTransitionExt for O { + fn border(&self) -> i32 { + unsafe { ffi::ges_video_transition_get_border(self.as_ref().to_glib_none().0) } + } + + fn transition_type(&self) -> VideoStandardTransitionType { + unsafe { + from_glib(ffi::ges_video_transition_get_transition_type( + self.as_ref().to_glib_none().0, + )) + } + } + + fn is_inverted(&self) -> bool { + unsafe { + from_glib(ffi::ges_video_transition_is_inverted( + self.as_ref().to_glib_none().0, + )) + } + } + + fn set_border(&self, value: u32) { + unsafe { + ffi::ges_video_transition_set_border(self.as_ref().to_glib_none().0, value); + } + } + + fn set_inverted(&self, inverted: bool) { + unsafe { + ffi::ges_video_transition_set_inverted( + self.as_ref().to_glib_none().0, + inverted.into_glib(), + ); + } + } + + fn set_transition_type(&self, type_: VideoStandardTransitionType) -> bool { + unsafe { + from_glib(ffi::ges_video_transition_set_transition_type( + self.as_ref().to_glib_none().0, + type_.into_glib(), + )) + } + } + + fn inverts(&self) -> bool { + unsafe { + let mut value = glib::Value::from_type(::static_type()); + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, + b"invert\0".as_ptr() as *const _, + value.to_glib_none_mut().0, + ); + value + .get() + .expect("Return Value for property `invert` getter") + } + } + + fn set_invert(&self, invert: bool) { + unsafe { + glib::gobject_ffi::g_object_set_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, + b"invert\0".as_ptr() as *const _, + invert.to_value().to_glib_none().0, + ); + } + } + + fn connect_border_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_border_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::GESVideoTransition, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(VideoTransition::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::border\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_border_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + + fn connect_invert_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_invert_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::GESVideoTransition, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(VideoTransition::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::invert\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_invert_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } + + fn connect_transition_type_notify(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn notify_transition_type_trampoline< + P: IsA, + F: Fn(&P) + 'static, + >( + this: *mut ffi::GESVideoTransition, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) { + let f: &F = &*(f as *const F); + f(VideoTransition::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::transition-type\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_transition_type_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } +} diff --git a/gstreamer-editing-services/src/auto/video_uri_source.rs b/gstreamer-editing-services/src/auto/video_uri_source.rs new file mode 100644 index 000000000..12388b6aa --- /dev/null +++ b/gstreamer-editing-services/src/auto/video_uri_source.rs @@ -0,0 +1,43 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::Extractable; +use crate::MetaContainer; +use crate::Source; +use crate::TimelineElement; +use crate::TrackElement; +use crate::VideoSource; +use glib::object::IsA; +use glib::translate::*; +use glib::StaticType; + +glib::wrapper! { + #[doc(alias = "GESVideoUriSource")] + pub struct VideoUriSource(Object) @extends VideoSource, Source, TrackElement, TimelineElement, @implements Extractable, MetaContainer; + + match fn { + type_ => || ffi::ges_video_uri_source_get_type(), + } +} + +pub const NONE_VIDEO_URI_SOURCE: Option<&VideoUriSource> = None; + +pub trait VideoUriSourceExt: 'static { + fn uri(&self) -> Option; +} + +impl> VideoUriSourceExt for O { + fn uri(&self) -> Option { + unsafe { + let mut value = glib::Value::from_type(::static_type()); + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, + b"uri\0".as_ptr() as *const _, + value.to_glib_none_mut().0, + ); + value.get().expect("Return Value for property `uri` getter") + } + } +} diff --git a/gstreamer-editing-services/src/auto/xml_formatter.rs b/gstreamer-editing-services/src/auto/xml_formatter.rs new file mode 100644 index 000000000..f391097b5 --- /dev/null +++ b/gstreamer-editing-services/src/auto/xml_formatter.rs @@ -0,0 +1,21 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) +// DO NOT EDIT + +use crate::BaseXmlFormatter; +use crate::Extractable; +use crate::Formatter; + +glib::wrapper! { + #[doc(alias = "GESXmlFormatter")] + pub struct XmlFormatter(Object) @extends BaseXmlFormatter, Formatter, @implements Extractable; + + match fn { + type_ => || ffi::ges_xml_formatter_get_type(), + } +} + +impl XmlFormatter {} + +pub const NONE_XML_FORMATTER: Option<&XmlFormatter> = None; diff --git a/gstreamer-editing-services/src/lib.rs b/gstreamer-editing-services/src/lib.rs index ebead2a76..f1feff0a1 100644 --- a/gstreamer-editing-services/src/lib.rs +++ b/gstreamer-editing-services/src/lib.rs @@ -56,6 +56,7 @@ macro_rules! skip_assert_initialized { #[allow(clippy::match_same_arms)] #[allow(clippy::use_self)] #[allow(clippy::needless_borrow)] +#[allow(deprecated)] mod auto; pub use crate::auto::*;