1 | // This file was generated by gir (https://github.com/gtk-rs/gir) |
2 | // from gir-files (https://github.com/gtk-rs/gir-files) |
3 | // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) |
4 | // DO NOT EDIT |
5 | |
6 | use crate::{ffi, GLContext}; |
7 | #[cfg (feature = "v1_16" )] |
8 | #[cfg_attr (docsrs, doc(cfg(feature = "v1_16" )))] |
9 | use glib::signal::{connect_raw, SignalHandlerId}; |
10 | use glib::{prelude::*, translate::*}; |
11 | #[cfg (feature = "v1_16" )] |
12 | #[cfg_attr (docsrs, doc(cfg(feature = "v1_16" )))] |
13 | use std::boxed::Box as Box_; |
14 | |
15 | glib::wrapper! { |
16 | #[doc (alias = "GstGLOverlayCompositor" )] |
17 | pub struct GLOverlayCompositor(Object<ffi::GstGLOverlayCompositor, ffi::GstGLOverlayCompositorClass>) @extends gst::Object; |
18 | |
19 | match fn { |
20 | type_ => || ffi::gst_gl_overlay_compositor_get_type(), |
21 | } |
22 | } |
23 | |
24 | impl GLOverlayCompositor { |
25 | #[doc (alias = "gst_gl_overlay_compositor_new" )] |
26 | pub fn new(context: &impl IsA<GLContext>) -> GLOverlayCompositor { |
27 | skip_assert_initialized!(); |
28 | unsafe { |
29 | from_glib_none(ffi::gst_gl_overlay_compositor_new( |
30 | context.as_ref().to_glib_none().0, |
31 | )) |
32 | } |
33 | } |
34 | |
35 | #[doc (alias = "gst_gl_overlay_compositor_draw_overlays" )] |
36 | pub fn draw_overlays(&self) { |
37 | unsafe { |
38 | ffi::gst_gl_overlay_compositor_draw_overlays(self.to_glib_none().0); |
39 | } |
40 | } |
41 | |
42 | #[doc (alias = "gst_gl_overlay_compositor_free_overlays" )] |
43 | pub fn free_overlays(&self) { |
44 | unsafe { |
45 | ffi::gst_gl_overlay_compositor_free_overlays(self.to_glib_none().0); |
46 | } |
47 | } |
48 | |
49 | #[cfg (feature = "v1_16" )] |
50 | #[cfg_attr (docsrs, doc(cfg(feature = "v1_16" )))] |
51 | pub fn is_yinvert(&self) -> bool { |
52 | ObjectExt::property(self, "yinvert" ) |
53 | } |
54 | |
55 | #[cfg (feature = "v1_16" )] |
56 | #[cfg_attr (docsrs, doc(cfg(feature = "v1_16" )))] |
57 | pub fn set_yinvert(&self, yinvert: bool) { |
58 | ObjectExt::set_property(self, "yinvert" , yinvert) |
59 | } |
60 | |
61 | #[doc (alias = "gst_gl_overlay_compositor_add_caps" )] |
62 | pub fn add_caps(caps: &gst::Caps) -> gst::Caps { |
63 | assert_initialized_main_thread!(); |
64 | unsafe { |
65 | from_glib_full(ffi::gst_gl_overlay_compositor_add_caps( |
66 | caps.to_glib_none().0, |
67 | )) |
68 | } |
69 | } |
70 | |
71 | #[cfg (feature = "v1_16" )] |
72 | #[cfg_attr (docsrs, doc(cfg(feature = "v1_16" )))] |
73 | #[doc (alias = "yinvert" )] |
74 | pub fn connect_yinvert_notify<F: Fn(&Self) + Send + Sync + 'static>( |
75 | &self, |
76 | f: F, |
77 | ) -> SignalHandlerId { |
78 | unsafe extern "C" fn notify_yinvert_trampoline< |
79 | F: Fn(&GLOverlayCompositor) + Send + Sync + 'static, |
80 | >( |
81 | this: *mut ffi::GstGLOverlayCompositor, |
82 | _param_spec: glib::ffi::gpointer, |
83 | f: glib::ffi::gpointer, |
84 | ) { |
85 | let f: &F = &*(f as *const F); |
86 | f(&from_glib_borrow(this)) |
87 | } |
88 | unsafe { |
89 | let f: Box_<F> = Box_::new(f); |
90 | connect_raw( |
91 | self.as_ptr() as *mut _, |
92 | b"notify::yinvert \0" .as_ptr() as *const _, |
93 | Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( |
94 | notify_yinvert_trampoline::<F> as *const (), |
95 | )), |
96 | Box_::into_raw(f), |
97 | ) |
98 | } |
99 | } |
100 | } |
101 | |
102 | unsafe impl Send for GLOverlayCompositor {} |
103 | unsafe impl Sync for GLOverlayCompositor {} |
104 | |