2021-09-19 08:07:33 +00:00
|
|
|
// 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
|
|
|
|
|
2023-01-03 18:56:00 +00:00
|
|
|
use crate::{Extractable, MetaContainer, Source, TimelineElement, TrackElement};
|
|
|
|
use glib::prelude::*;
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_18")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
|
2021-09-19 08:07:33 +00:00
|
|
|
use glib::translate::*;
|
|
|
|
|
|
|
|
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(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-03 17:28:46 +00:00
|
|
|
impl VideoSource {
|
|
|
|
pub const NONE: Option<&'static VideoSource> = None;
|
|
|
|
}
|
2021-09-19 08:07:33 +00:00
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
mod sealed {
|
|
|
|
pub trait Sealed {}
|
|
|
|
impl<T: super::IsA<super::VideoSource>> Sealed for T {}
|
2021-09-19 08:07:33 +00:00
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
pub trait VideoSourceExt: IsA<VideoSource> + sealed::Sealed + 'static {
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_18")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "ges_video_source_get_natural_size")]
|
|
|
|
#[doc(alias = "get_natural_size")]
|
2021-09-19 08:07:33 +00:00
|
|
|
fn natural_size(&self) -> Option<(i32, i32)> {
|
|
|
|
unsafe {
|
2023-08-28 16:52:26 +00:00
|
|
|
let mut width = std::mem::MaybeUninit::uninit();
|
|
|
|
let mut height = std::mem::MaybeUninit::uninit();
|
2021-09-19 08:07:33 +00:00
|
|
|
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(),
|
|
|
|
));
|
|
|
|
if ret {
|
2022-05-18 20:27:53 +00:00
|
|
|
Some((width.assume_init(), height.assume_init()))
|
2021-09-19 08:07:33 +00:00
|
|
|
} else {
|
|
|
|
None
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-07-05 18:20:29 +00:00
|
|
|
|
|
|
|
impl<O: IsA<VideoSource>> VideoSourceExt for O {}
|