gstreamer-rs/gstreamer-gl/src/auto/gl_overlay_compositor.rs

131 lines
4.5 KiB
Rust
Raw Normal View History

2018-11-27 21:52:42 +00:00
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
2020-11-22 10:20:20 +00:00
use crate::GLContext;
2019-01-16 11:32:39 +00:00
use glib::object::IsA;
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
2019-06-18 10:10:46 +00:00
use glib::object::ObjectType as ObjectType_;
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
2019-04-23 14:32:09 +00:00
use glib::signal::connect_raw;
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
use glib::signal::SignalHandlerId;
2018-11-27 21:52:42 +00:00
use glib::translate::*;
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
use glib::StaticType;
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
2019-04-23 14:32:09 +00:00
use std::boxed::Box as Box_;
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
2020-04-13 16:11:33 +00:00
use std::mem::transmute;
2018-11-27 21:52:42 +00:00
2020-12-17 22:34:53 +00:00
glib::wrapper! {
2020-11-22 10:20:20 +00:00
pub struct GLOverlayCompositor(Object<ffi::GstGLOverlayCompositor, ffi::GstGLOverlayCompositorClass>) @extends gst::Object;
2018-11-27 21:52:42 +00:00
match fn {
2020-11-22 10:20:20 +00:00
get_type => || ffi::gst_gl_overlay_compositor_get_type(),
2018-11-27 21:52:42 +00:00
}
}
impl GLOverlayCompositor {
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_gl_overlay_compositor_new")]
2019-01-16 11:32:39 +00:00
pub fn new<P: IsA<GLContext>>(context: &P) -> GLOverlayCompositor {
2018-11-27 21:52:42 +00:00
skip_assert_initialized!();
unsafe {
2020-11-22 10:20:20 +00:00
from_glib_none(ffi::gst_gl_overlay_compositor_new(
context.as_ref().to_glib_none().0,
))
2018-11-27 21:52:42 +00:00
}
}
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_gl_overlay_compositor_draw_overlays")]
2018-11-27 21:52:42 +00:00
pub fn draw_overlays(&self) {
unsafe {
2020-11-22 10:20:20 +00:00
ffi::gst_gl_overlay_compositor_draw_overlays(self.to_glib_none().0);
2018-11-27 21:52:42 +00:00
}
}
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_gl_overlay_compositor_free_overlays")]
2018-11-27 21:52:42 +00:00
pub fn free_overlays(&self) {
unsafe {
2020-11-22 10:20:20 +00:00
ffi::gst_gl_overlay_compositor_free_overlays(self.to_glib_none().0);
2018-11-27 21:52:42 +00:00
}
}
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
2019-04-23 14:32:09 +00:00
pub fn get_property_yinvert(&self) -> bool {
unsafe {
2020-11-27 13:37:24 +00:00
let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
2020-11-22 10:20:20 +00:00
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"yinvert\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
2019-08-10 17:32:57 +00:00
value
.get()
.expect("Return Value for property `yinvert` getter")
.unwrap()
2019-04-23 14:32:09 +00:00
}
}
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
2019-04-23 14:32:09 +00:00
pub fn set_property_yinvert(&self, yinvert: bool) {
unsafe {
2020-11-22 10:20:20 +00:00
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"yinvert\0".as_ptr() as *const _,
2020-11-27 13:37:24 +00:00
glib::Value::from(&yinvert).to_glib_none().0,
);
2019-04-23 14:32:09 +00:00
}
}
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_gl_overlay_compositor_add_caps")]
2018-11-27 21:52:42 +00:00
pub fn add_caps(caps: &gst::Caps) -> Option<gst::Caps> {
assert_initialized_main_thread!();
unsafe {
2020-11-22 10:20:20 +00:00
from_glib_full(ffi::gst_gl_overlay_compositor_add_caps(
caps.to_glib_none().0,
))
2018-11-27 21:52:42 +00:00
}
}
2019-04-23 14:32:09 +00:00
2020-11-27 13:37:24 +00:00
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
pub fn connect_property_yinvert_notify<F: Fn(&GLOverlayCompositor) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_yinvert_trampoline<
F: Fn(&GLOverlayCompositor) + Send + Sync + 'static,
>(
2020-11-22 10:20:20 +00:00
this: *mut ffi::GstGLOverlayCompositor,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
2019-06-18 10:10:46 +00:00
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
2019-04-23 14:32:09 +00:00
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::yinvert\0".as_ptr() as *const _,
2020-04-13 16:11:33 +00:00
Some(transmute::<_, unsafe extern "C" fn()>(
notify_yinvert_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
2019-04-23 14:32:09 +00:00
}
}
2018-11-27 21:52:42 +00:00
}
unsafe impl Send for GLOverlayCompositor {}
unsafe impl Sync for GLOverlayCompositor {}