2021-02-19 16:42:38 +00:00
|
|
|
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
|
|
|
// from gir-files (https://github.com/gtk-rs/gir-files)
|
2021-04-01 13:58:41 +00:00
|
|
|
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
2021-02-19 16:42:38 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
|
|
|
use glib::object::IsA;
|
|
|
|
use glib::translate::*;
|
|
|
|
use std::mem;
|
|
|
|
|
|
|
|
glib::wrapper! {
|
2021-03-08 10:25:37 +00:00
|
|
|
pub struct VideoOrientation(Interface<ffi::GstVideoOrientation, ffi::GstVideoOrientationInterface>);
|
2021-02-19 16:42:38 +00:00
|
|
|
|
|
|
|
match fn {
|
2021-04-19 19:55:01 +00:00
|
|
|
type_ => || ffi::gst_video_orientation_get_type(),
|
2021-02-19 16:42:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe impl Send for VideoOrientation {}
|
|
|
|
unsafe impl Sync for VideoOrientation {}
|
|
|
|
|
|
|
|
pub const NONE_VIDEO_ORIENTATION: Option<&VideoOrientation> = None;
|
|
|
|
|
|
|
|
pub trait VideoOrientationExt: 'static {
|
|
|
|
#[doc(alias = "gst_video_orientation_get_hcenter")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn hcenter(&self) -> Option<i32>;
|
2021-02-19 16:42:38 +00:00
|
|
|
|
|
|
|
#[doc(alias = "gst_video_orientation_get_hflip")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn hflip(&self) -> Option<bool>;
|
2021-02-19 16:42:38 +00:00
|
|
|
|
|
|
|
#[doc(alias = "gst_video_orientation_get_vcenter")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn vcenter(&self) -> Option<i32>;
|
2021-02-19 16:42:38 +00:00
|
|
|
|
|
|
|
#[doc(alias = "gst_video_orientation_get_vflip")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn vflip(&self) -> Option<bool>;
|
2021-02-19 16:42:38 +00:00
|
|
|
|
|
|
|
#[doc(alias = "gst_video_orientation_set_hcenter")]
|
|
|
|
fn set_hcenter(&self, center: i32) -> Result<(), glib::error::BoolError>;
|
|
|
|
|
|
|
|
#[doc(alias = "gst_video_orientation_set_hflip")]
|
|
|
|
fn set_hflip(&self, flip: bool) -> Result<(), glib::error::BoolError>;
|
|
|
|
|
|
|
|
#[doc(alias = "gst_video_orientation_set_vcenter")]
|
|
|
|
fn set_vcenter(&self, center: i32) -> Result<(), glib::error::BoolError>;
|
|
|
|
|
|
|
|
#[doc(alias = "gst_video_orientation_set_vflip")]
|
|
|
|
fn set_vflip(&self, flip: bool) -> Result<(), glib::error::BoolError>;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<O: IsA<VideoOrientation>> VideoOrientationExt for O {
|
2021-04-11 19:38:18 +00:00
|
|
|
fn hcenter(&self) -> Option<i32> {
|
2021-02-19 16:42:38 +00:00
|
|
|
unsafe {
|
|
|
|
let mut center = mem::MaybeUninit::uninit();
|
|
|
|
let ret = from_glib(ffi::gst_video_orientation_get_hcenter(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
center.as_mut_ptr(),
|
|
|
|
));
|
|
|
|
let center = center.assume_init();
|
|
|
|
if ret {
|
|
|
|
Some(center)
|
|
|
|
} else {
|
|
|
|
None
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn hflip(&self) -> Option<bool> {
|
2021-02-19 16:42:38 +00:00
|
|
|
unsafe {
|
|
|
|
let mut flip = mem::MaybeUninit::uninit();
|
|
|
|
let ret = from_glib(ffi::gst_video_orientation_get_hflip(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
flip.as_mut_ptr(),
|
|
|
|
));
|
|
|
|
let flip = flip.assume_init();
|
|
|
|
if ret {
|
|
|
|
Some(from_glib(flip))
|
|
|
|
} else {
|
|
|
|
None
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn vcenter(&self) -> Option<i32> {
|
2021-02-19 16:42:38 +00:00
|
|
|
unsafe {
|
|
|
|
let mut center = mem::MaybeUninit::uninit();
|
|
|
|
let ret = from_glib(ffi::gst_video_orientation_get_vcenter(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
center.as_mut_ptr(),
|
|
|
|
));
|
|
|
|
let center = center.assume_init();
|
|
|
|
if ret {
|
|
|
|
Some(center)
|
|
|
|
} else {
|
|
|
|
None
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn vflip(&self) -> Option<bool> {
|
2021-02-19 16:42:38 +00:00
|
|
|
unsafe {
|
|
|
|
let mut flip = mem::MaybeUninit::uninit();
|
|
|
|
let ret = from_glib(ffi::gst_video_orientation_get_vflip(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
flip.as_mut_ptr(),
|
|
|
|
));
|
|
|
|
let flip = flip.assume_init();
|
|
|
|
if ret {
|
|
|
|
Some(from_glib(flip))
|
|
|
|
} else {
|
|
|
|
None
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn set_hcenter(&self, center: i32) -> Result<(), glib::error::BoolError> {
|
|
|
|
unsafe {
|
|
|
|
glib::result_from_gboolean!(
|
|
|
|
ffi::gst_video_orientation_set_hcenter(self.as_ref().to_glib_none().0, center),
|
|
|
|
"Failed to set horizontal centering"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn set_hflip(&self, flip: bool) -> Result<(), glib::error::BoolError> {
|
|
|
|
unsafe {
|
|
|
|
glib::result_from_gboolean!(
|
|
|
|
ffi::gst_video_orientation_set_hflip(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
flip.to_glib()
|
|
|
|
),
|
|
|
|
"Failed to set horizontal flipping"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn set_vcenter(&self, center: i32) -> Result<(), glib::error::BoolError> {
|
|
|
|
unsafe {
|
|
|
|
glib::result_from_gboolean!(
|
|
|
|
ffi::gst_video_orientation_set_vcenter(self.as_ref().to_glib_none().0, center),
|
|
|
|
"Failed to set vertical centering"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn set_vflip(&self, flip: bool) -> Result<(), glib::error::BoolError> {
|
|
|
|
unsafe {
|
|
|
|
glib::result_from_gboolean!(
|
|
|
|
ffi::gst_video_orientation_set_vflip(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
flip.to_glib()
|
|
|
|
),
|
|
|
|
"Failed to set vertical flipping"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|