ges: Bind a lot of missing API

This commit is contained in:
Sebastian Dröge 2021-09-19 11:07:33 +03:00
parent c4cbcecc7c
commit 757530bd8a
59 changed files with 4857 additions and 28 deletions

View file

@ -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"

View file

@ -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<ffi::GESAsset, ffi::GESAssetClass>);
pub struct Asset(Object<ffi::GESAsset, ffi::GESAssetClass>) @implements MetaContainer;
match fn {
type_ => || ffi::ges_asset_get_type(),

View file

@ -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<ffi::GESAudioSource, ffi::GESAudioSourceClass>) @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;

View file

@ -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<ffi::GESAudioTestSource, ffi::GESAudioTestSourceClass>) @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<O: IsA<AudioTestSource>> 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);
}
}
}

View file

@ -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<ffi::GESAudioTrack, ffi::GESAudioTrackClass>) @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;

View file

@ -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<ffi::GESAudioTransition, ffi::GESAudioTransitionClass>) @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;

View file

@ -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<ffi::GESAudioUriSource, ffi::GESAudioUriSourceClass>) @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<glib::GString>;
}
impl<O: IsA<AudioUriSource>> AudioUriSourceExt for O {
fn uri(&self) -> Option<glib::GString> {
unsafe {
let mut value = glib::Value::from_type(<glib::GString as StaticType>::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")
}
}
}

View file

@ -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<ffi::GESBaseEffect, ffi::GESBaseEffectClass>) @extends TrackElement, TimelineElement, @implements Extractable;
pub struct BaseEffect(Object<ffi::GESBaseEffect, ffi::GESBaseEffectClass>) @extends Operation, TrackElement, TimelineElement, @implements Extractable, MetaContainer;
match fn {
type_ => || ffi::ges_base_effect_get_type(),

View file

@ -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<ffi::GESBaseEffectClip, ffi::GESBaseEffectClipClass>) @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;

View file

@ -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<ffi::GESBaseTransitionClip, ffi::GESBaseTransitionClipClass>) @extends OperationClip, Clip, Container, TimelineElement, @implements Extractable;
pub struct BaseTransitionClip(Object<ffi::GESBaseTransitionClip, ffi::GESBaseTransitionClipClass>) @extends OperationClip, Clip, Container, TimelineElement, @implements Extractable, MetaContainer;
match fn {
type_ => || ffi::ges_base_transition_clip_get_type(),

View file

@ -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<ffi::GESBaseXmlFormatter, ffi::GESBaseXmlFormatterClass>) @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;

View file

@ -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<ffi::GESClip, ffi::GESClipClass>) @extends Container, TimelineElement, @implements Extractable;
pub struct Clip(Object<ffi::GESClip, ffi::GESClipClass>) @extends Container, TimelineElement, @implements Extractable, MetaContainer;
match fn {
type_ => || ffi::ges_clip_get_type(),

View file

@ -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<ffi::GESClipAsset, ffi::GESClipAssetClass>) @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<gst::ClockTime>;
#[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<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
}
impl<O: IsA<ClipAsset>> 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<gst::ClockTime> {
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<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_supported_formats_trampoline<
P: IsA<ClipAsset>,
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_<F> = 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}

View file

@ -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<ffi::GESCommandLineFormatter, ffi::GESCommandLineFormatterClass>) @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<Timeline>) -> 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;

View file

@ -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<ffi::GESContainer, ffi::GESContainerClass>) @extends TimelineElement, @implements Extractable;
pub struct Container(Object<ffi::GESContainer, ffi::GESContainerClass>) @extends TimelineElement, @implements Extractable, MetaContainer;
match fn {
type_ => || ffi::ges_container_get_type(),

View file

@ -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<ffi::GESEffect, ffi::GESEffectClass>) @extends BaseEffect, TrackElement, TimelineElement, @implements Extractable;
pub struct Effect(Object<ffi::GESEffect, ffi::GESEffectClass>) @extends BaseEffect, Operation, TrackElement, TimelineElement, @implements Extractable, MetaContainer;
match fn {
type_ => || ffi::ges_effect_get_type(),

View file

@ -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<ffi::GESEffectAsset, ffi::GESEffectAssetClass>) @extends TrackElementAsset, Asset, @implements MetaContainer;
match fn {
type_ => || ffi::ges_effect_asset_get_type(),
}
}
impl EffectAsset {}
pub const NONE_EFFECT_ASSET: Option<&EffectAsset> = None;

View file

@ -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<ffi::GESEffectClip, ffi::GESEffectClipClass>) @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<EffectClip> {
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<glib::GString>;
#[doc(alias = "video-bin-description")]
fn video_bin_description(&self) -> Option<glib::GString>;
}
impl<O: IsA<EffectClip>> EffectClipExt for O {
fn audio_bin_description(&self) -> Option<glib::GString> {
unsafe {
let mut value = glib::Value::from_type(<glib::GString as StaticType>::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<glib::GString> {
unsafe {
let mut value = glib::Value::from_type(<glib::GString as StaticType>::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")
}
}
}

View file

@ -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<ffi::GESAssetLoadingReturn> 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<ffi::GESChildrenControlMode> 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<ffi::GESError> 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<ffi::GESTextHAlign> 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<Self>;
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::<Self>();
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<ffi::GESTextVAlign> 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<Self>;
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::<Self>();
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<ffi::GESVideoTestPattern> 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<Self>;
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::<Self>();
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()
}
}

View file

@ -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<ffi::GESMarkerFlags> 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<Self>;
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::<Self>();
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<ffi::GESMetaFlag> 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<Self>;
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::<Self>();
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 {

View file

@ -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<ffi::GESFormatter, ffi::GESFormatterClass>) @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<Asset> {
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<Timeline>, 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<Timeline>,
uri: &str,
overwrite: bool,
) -> Result<(), glib::Error>;
}
impl<O: IsA<Formatter>> FormatterExt for O {
fn load_from_uri(&self, timeline: &impl IsA<Timeline>, 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<Timeline>,
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))
}
}
}
}

View file

@ -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<ffi::GESGroup, ffi::GESGroupClass>) @extends Container, TimelineElement, @implements Extractable;
pub struct Group(Object<ffi::GESGroup, ffi::GESGroupClass>) @extends Container, TimelineElement, @implements Extractable, MetaContainer;
match fn {
type_ => || ffi::ges_group_get_type(),

View file

@ -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<ffi::GESImageSource, ffi::GESImageSourceClass>) @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<glib::GString>;
}
impl<O: IsA<ImageSource>> ImageSourceExt for O {
fn uri(&self) -> Option<glib::GString> {
unsafe {
let mut value = glib::Value::from_type(<glib::GString as StaticType>::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")
}
}
}

View file

@ -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<ffi::GESLayer, ffi::GESLayerClass>) @implements Extractable;
pub struct Layer(Object<ffi::GESLayer, ffi::GESLayerClass>) @implements Extractable, MetaContainer;
match fn {
type_ => || ffi::ges_layer_get_type(),

View file

@ -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<ffi::GESMarker, ffi::GESMarkerClass>) @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(<u64 as StaticType>::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<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_position_trampoline<F: Fn(&Marker) + 'static>(
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_<F> = 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::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}

View file

@ -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<ffi::GESMarkerList, ffi::GESMarkerListClass>);
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<gst::ClockTime>>) -> Option<Marker> {
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<Marker> {
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<Option<gst::ClockTime>>) -> 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(<MarkerFlags as StaticType>::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<F: Fn(&Self, u64, &Marker) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn marker_added_trampoline<F: Fn(&MarkerList, u64, &Marker) + 'static>(
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_<F> = 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::<F> 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<F: Fn(&Self, u64, u64, &Marker) + 'static>(
&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_<F> = 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::<F> 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<F: Fn(&Self, &Marker) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn marker_removed_trampoline<F: Fn(&MarkerList, &Marker) + 'static>(
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_<F> = 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::<F> 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<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_flags_trampoline<F: Fn(&MarkerList) + 'static>(
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_<F> = 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::<F> 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()
}
}

View file

@ -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<ffi::GESMetaContainer, ffi::GESMetaContainerInterface>);
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<P: FnMut(&MetaContainer, &str, &glib::Value)>(&self, func: P);
#[doc(alias = "ges_meta_container_get_boolean")]
#[doc(alias = "get_boolean")]
fn boolean(&self, meta_item: &str) -> Option<bool>;
#[doc(alias = "ges_meta_container_get_date")]
#[doc(alias = "get_date")]
fn date(&self, meta_item: &str) -> Option<glib::Date>;
#[doc(alias = "ges_meta_container_get_date_time")]
#[doc(alias = "get_date_time")]
fn date_time(&self, meta_item: &str) -> Option<gst::DateTime>;
#[doc(alias = "ges_meta_container_get_double")]
#[doc(alias = "get_double")]
fn double(&self, meta_item: &str) -> Option<f64>;
#[doc(alias = "ges_meta_container_get_float")]
#[doc(alias = "get_float")]
fn float(&self, meta_item: &str) -> Option<f32>;
#[doc(alias = "ges_meta_container_get_int")]
#[doc(alias = "get_int")]
fn int(&self, meta_item: &str) -> Option<i32>;
#[doc(alias = "ges_meta_container_get_int64")]
#[doc(alias = "get_int64")]
fn int64(&self, meta_item: &str) -> Option<i64>;
#[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<MarkerList>;
#[doc(alias = "ges_meta_container_get_meta")]
#[doc(alias = "get_meta")]
fn meta(&self, key: &str) -> Option<glib::Value>;
#[doc(alias = "ges_meta_container_get_string")]
#[doc(alias = "get_string")]
fn string(&self, meta_item: &str) -> Option<glib::GString>;
#[doc(alias = "ges_meta_container_get_uint")]
#[doc(alias = "get_uint")]
fn uint(&self, meta_item: &str) -> Option<u32>;
#[doc(alias = "ges_meta_container_get_uint64")]
#[doc(alias = "get_uint64")]
fn uint64(&self, meta_item: &str) -> Option<u64>;
#[doc(alias = "ges_meta_container_metas_to_string")]
fn metas_to_string(&self) -> Option<glib::GString>;
#[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<F: Fn(&Self, &str, Option<&glib::Value>) + 'static>(
&self,
detail: Option<&str>,
f: F,
) -> SignalHandlerId;
}
impl<O: IsA<MetaContainer>> 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<P: FnMut(&MetaContainer, &str, &glib::Value)>(&self, func: P) {
let func_data: P = func;
unsafe extern "C" fn func_func<P: FnMut(&MetaContainer, &str, &glib::Value)>(
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<glib::GString> = 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::<P> 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<bool> {
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<glib::Date> {
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<gst::DateTime> {
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<f64> {
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<f32> {
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<i32> {
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<i64> {
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<MarkerList> {
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<glib::Value> {
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<glib::GString> {
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<u32> {
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<u64> {
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<glib::GString> {
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<F: Fn(&Self, &str, Option<&glib::Value>) + 'static>(
&self,
detail: Option<&str>,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_meta_trampoline<
P: IsA<MetaContainer>,
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::<glib::Value>::from_glib_borrow(value)
.as_ref()
.as_ref(),
)
}
unsafe {
let f: Box_<F> = 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}

View file

@ -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;
}

View file

@ -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<ffi::GESMultiFileSource, ffi::GESMultiFileSourceClass>) @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<glib::GString>;
}
impl<O: IsA<MultiFileSource>> MultiFileSourceExt for O {
fn uri(&self) -> Option<glib::GString> {
unsafe {
let mut value = glib::Value::from_type(<glib::GString as StaticType>::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")
}
}
}

View file

@ -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<ffi::GESOperation, ffi::GESOperationClass>) @extends TrackElement, TimelineElement, @implements Extractable, MetaContainer;
match fn {
type_ => || ffi::ges_operation_get_type(),
}
}
impl Operation {}
pub const NONE_OPERATION: Option<&Operation> = None;

View file

@ -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<ffi::GESOperationClip, ffi::GESOperationClipClass>) @extends Clip, Container, TimelineElement, @implements Extractable;
pub struct OperationClip(Object<ffi::GESOperationClip, ffi::GESOperationClipClass>) @extends Clip, Container, TimelineElement, @implements Extractable, MetaContainer;
match fn {
type_ => || ffi::ges_operation_clip_get_type(),

View file

@ -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<ffi::GESOverlayClip, ffi::GESOverlayClipClass>) @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;

View file

@ -18,7 +18,7 @@ use std::ptr;
glib::wrapper! {
#[doc(alias = "GESPipeline")]
pub struct Pipeline(Object<ffi::GESPipeline, ffi::GESPipelineClass>) @extends gst::Pipeline, gst::Bin, gst::Element, gst::Object;
pub struct Pipeline(Object<ffi::GESPipeline, ffi::GESPipelineClass>) @extends gst::Pipeline, gst::Bin, gst::Element, gst::Object, @implements gst::ChildProxy;
match fn {
type_ => || ffi::ges_pipeline_get_type(),

View file

@ -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<ffi::GESProject, ffi::GESProjectClass>) @extends Asset;
pub struct Project(Object<ffi::GESProject, ffi::GESProjectClass>) @extends Asset, @implements MetaContainer;
match fn {
type_ => || ffi::ges_project_get_type(),
@ -43,10 +47,10 @@ pub trait ProjectExt: 'static {
profile: &impl IsA<gst_pbutils::EncodingProfile>,
) -> 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<Formatter>);
#[doc(alias = "ges_project_create_asset")]
fn create_asset(&self, id: Option<&str>, extractable_type: glib::types::Type) -> bool;
@ -154,11 +158,16 @@ impl<O: IsA<Project>> 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<Formatter>) {
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 {

View file

@ -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<ffi::GESSource, ffi::GESSourceClass>) @extends TrackElement, TimelineElement, @implements Extractable, MetaContainer;
match fn {
type_ => || ffi::ges_source_get_type(),
}
}
impl Source {}
pub const NONE_SOURCE: Option<&Source> = None;

View file

@ -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<ffi::GESSourceClip, ffi::GESSourceClipClass>) @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<SourceClip> {
assert_initialized_main_thread!();
unsafe { from_glib_none(ffi::ges_source_clip_new_time_overlay()) }
}
}
pub const NONE_SOURCE_CLIP: Option<&SourceClip> = None;

View file

@ -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<ffi::GESSourceClipAsset, ffi::GESSourceClipAssetClass>) @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;

View file

@ -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<ffi::GESTestClip, ffi::GESTestClipClass>) @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<TestClip> {
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<TestClip> {
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<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "mute")]
fn connect_mute_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "volume")]
fn connect_volume_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "vpattern")]
fn connect_vpattern_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
}
impl<O: IsA<TestClip>> 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(<f64 as StaticType>::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<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_freq_trampoline<P: IsA<TestClip>, 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_<F> = 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_mute_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_mute_trampoline<P: IsA<TestClip>, 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_<F> = 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_volume_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_volume_trampoline<P: IsA<TestClip>, 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_<F> = 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_vpattern_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_vpattern_trampoline<P: IsA<TestClip>, 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_<F> = 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}

View file

@ -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<ffi::GESTextOverlay, ffi::GESTextOverlayClass>) @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<TextOverlay> {
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<glib::GString>;
#[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<glib::GString>;
#[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<O: IsA<TextOverlay>> 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<glib::GString> {
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<glib::GString> {
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);
}
}
}

View file

@ -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<ffi::GESTextOverlayClip, ffi::GESTextOverlayClipClass>) @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<TextOverlayClip> {
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<glib::GString>;
#[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<glib::GString>;
#[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<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "font-desc")]
fn connect_font_desc_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "halignment")]
fn connect_halignment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "text")]
fn connect_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "valignment")]
fn connect_valignment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "xpos")]
fn connect_xpos_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "ypos")]
fn connect_ypos_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
}
impl<O: IsA<TextOverlayClip>> 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<glib::GString> {
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<glib::GString> {
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<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_color_trampoline<
P: IsA<TextOverlayClip>,
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_<F> = 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_font_desc_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_font_desc_trampoline<
P: IsA<TextOverlayClip>,
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_<F> = 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_halignment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_halignment_trampoline<
P: IsA<TextOverlayClip>,
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_<F> = 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_text_trampoline<
P: IsA<TextOverlayClip>,
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_<F> = 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_valignment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_valignment_trampoline<
P: IsA<TextOverlayClip>,
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_<F> = 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_xpos_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_xpos_trampoline<
P: IsA<TextOverlayClip>,
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_<F> = 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_ypos_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_ypos_trampoline<
P: IsA<TextOverlayClip>,
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_<F> = 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}

View file

@ -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<ffi::GESTimeline, ffi::GESTimelineClass>) @extends gst::Bin, gst::Element, gst::Object, @implements Extractable;
pub struct Timeline(Object<ffi::GESTimeline, ffi::GESTimelineClass>) @extends gst::Bin, gst::Element, gst::Object, @implements gst::ChildProxy, Extractable, MetaContainer;
match fn {
type_ => || ffi::ges_timeline_get_type(),

View file

@ -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<ffi::GESTimelineElement, ffi::GESTimelineElementClass>) @implements Extractable;
pub struct TimelineElement(Object<ffi::GESTimelineElement, ffi::GESTimelineElementClass>) @implements Extractable, MetaContainer;
match fn {
type_ => || ffi::ges_timeline_element_get_type(),

View file

@ -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<ffi::GESTitleClip, ffi::GESTitleClipClass>) @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<TitleClip> {
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<glib::GString>;
#[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<glib::GString>;
#[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<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[deprecated = "Since 1.6"]
#[doc(alias = "color")]
fn connect_color_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[deprecated = "Since 1.6"]
#[doc(alias = "font-desc")]
fn connect_font_desc_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[deprecated = "Since 1.6"]
#[doc(alias = "halignment")]
fn connect_halignment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[deprecated = "Since 1.6"]
#[doc(alias = "text")]
fn connect_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[deprecated = "Since 1.6"]
#[doc(alias = "valignment")]
fn connect_valignment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[deprecated = "Since 1.6"]
#[doc(alias = "xpos")]
fn connect_xpos_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[deprecated = "Since 1.6"]
#[doc(alias = "ypos")]
fn connect_ypos_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
}
impl<O: IsA<TitleClip>> 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<glib::GString> {
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<glib::GString> {
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(<u32 as StaticType>::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(<u32 as StaticType>::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<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_background_trampoline<
P: IsA<TitleClip>,
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_<F> = 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_color_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_color_trampoline<P: IsA<TitleClip>, 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_<F> = 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_font_desc_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_font_desc_trampoline<P: IsA<TitleClip>, 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_<F> = 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_halignment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_halignment_trampoline<
P: IsA<TitleClip>,
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_<F> = 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_text_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_text_trampoline<P: IsA<TitleClip>, 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_<F> = 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_valignment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_valignment_trampoline<
P: IsA<TitleClip>,
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_<F> = 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_xpos_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_xpos_trampoline<P: IsA<TitleClip>, 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_<F> = 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_ypos_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_ypos_trampoline<P: IsA<TitleClip>, 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_<F> = 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}

View file

@ -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<ffi::GESTitleSource, ffi::GESTitleSourceClass>) @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<glib::GString>;
#[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<glib::GString>;
#[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<O: IsA<TitleSource>> 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<glib::GString> {
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<glib::GString> {
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);
}
}
}

View file

@ -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<ffi::GESTrack, ffi::GESTrackClass>) @extends gst::Bin, gst::Element, gst::Object;
pub struct Track(Object<ffi::GESTrack, ffi::GESTrackClass>) @extends gst::Bin, gst::Element, gst::Object, @implements gst::ChildProxy, MetaContainer;
match fn {
type_ => || ffi::ges_track_get_type(),

View file

@ -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<ffi::GESTrackElement, ffi::GESTrackElementClass>) @extends TimelineElement, @implements Extractable;
pub struct TrackElement(Object<ffi::GESTrackElement, ffi::GESTrackElementClass>) @extends TimelineElement, @implements Extractable, MetaContainer;
match fn {
type_ => || ffi::ges_track_element_get_type(),

View file

@ -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<ffi::GESTrackElementAsset, ffi::GESTrackElementAssetClass>) @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<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
}
impl<O: IsA<TrackElementAsset>> 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<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_track_type_trampoline<
P: IsA<TrackElementAsset>,
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_<F> = 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}

View file

@ -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<ffi::GESTransition, ffi::GESTransitionClass>) @extends Operation, TrackElement, TimelineElement, @implements Extractable, MetaContainer;
match fn {
type_ => || ffi::ges_transition_get_type(),
}
}
impl Transition {}
pub const NONE_TRANSITION: Option<&Transition> = None;

View file

@ -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<ffi::GESTransitionClip, ffi::GESTransitionClipClass>) @extends BaseTransitionClip, OperationClip, Clip, Container, TimelineElement, @implements Extractable;
pub struct TransitionClip(Object<ffi::GESTransitionClip, ffi::GESTransitionClipClass>) @extends BaseTransitionClip, OperationClip, Clip, Container, TimelineElement, @implements Extractable, MetaContainer;
match fn {
type_ => || ffi::ges_transition_clip_get_type(),

View file

@ -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<ffi::GESUriClip, ffi::GESUriClipClass>) @extends Clip, Container, TimelineElement, @implements Extractable;
pub struct UriClip(Object<ffi::GESUriClip, ffi::GESUriClipClass>) @extends SourceClip, Clip, Container, TimelineElement, @implements Extractable, MetaContainer;
match fn {
type_ => || ffi::ges_uri_clip_get_type(),

View file

@ -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<ffi::GESUriClipAsset, ffi::GESUriClipAssetClass>) @extends Asset;
pub struct UriClipAsset(Object<ffi::GESUriClipAsset, ffi::GESUriClipAssetClass>) @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<ffi::GESUriClipAsset, ffi::GESUriClipAssetClass>) @extends ClipAsset, Asset, @implements MetaContainer;
match fn {
type_ => || ffi::ges_uri_clip_asset_get_type(),

View file

@ -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<ffi::GESUriSourceAsset, ffi::GESUriSourceAssetClass>) @extends Asset;
pub struct UriSourceAsset(Object<ffi::GESUriSourceAsset, ffi::GESUriSourceAssetClass>) @extends TrackElementAsset, Asset, @implements MetaContainer;
match fn {
type_ => || ffi::ges_uri_source_asset_get_type(),

View file

@ -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<ffi::GESVideoSource, ffi::GESVideoSourceClass>) @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<O: IsA<VideoSource>> 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
}
}
}
}

View file

@ -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<ffi::GESVideoTestSource, ffi::GESVideoTestSourceClass>) @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<O: IsA<VideoTestSource>> 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(),
);
}
}
}

View file

@ -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<ffi::GESVideoTrack, ffi::GESVideoTrackClass>) @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;

View file

@ -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<ffi::GESVideoTransition, ffi::GESVideoTransitionClass>) @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<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[cfg_attr(feature = "v1_20", deprecated = "Since 1.20")]
#[doc(alias = "invert")]
fn connect_invert_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[doc(alias = "transition-type")]
fn connect_transition_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
}
impl<O: IsA<VideoTransition>> 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(<bool as StaticType>::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<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_border_trampoline<
P: IsA<VideoTransition>,
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_<F> = 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_invert_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_invert_trampoline<
P: IsA<VideoTransition>,
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_<F> = 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
fn connect_transition_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_transition_type_trampoline<
P: IsA<VideoTransition>,
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_<F> = 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::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}

View file

@ -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<ffi::GESVideoUriSource, ffi::GESVideoUriSourceClass>) @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<glib::GString>;
}
impl<O: IsA<VideoUriSource>> VideoUriSourceExt for O {
fn uri(&self) -> Option<glib::GString> {
unsafe {
let mut value = glib::Value::from_type(<glib::GString as StaticType>::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")
}
}
}

View file

@ -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<ffi::GESXmlFormatter, ffi::GESXmlFormatterClass>) @extends BaseXmlFormatter, Formatter, @implements Extractable;
match fn {
type_ => || ffi::ges_xml_formatter_get_type(),
}
}
impl XmlFormatter {}
pub const NONE_XML_FORMATTER: Option<&XmlFormatter> = None;

View file

@ -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::*;