gstreamer_gl/auto/
gl_base_src.rs

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
6use crate::ffi;
7use glib::{
8    prelude::*,
9    signal::{connect_raw, SignalHandlerId},
10    translate::*,
11};
12use std::boxed::Box as Box_;
13
14glib::wrapper! {
15    #[doc(alias = "GstGLBaseSrc")]
16    pub struct GLBaseSrc(Object<ffi::GstGLBaseSrc, ffi::GstGLBaseSrcClass>) @extends gst_base::PushSrc, gst_base::BaseSrc, gst::Element, gst::Object;
17
18    match fn {
19        type_ => || ffi::gst_gl_base_src_get_type(),
20    }
21}
22
23impl GLBaseSrc {
24    pub const NONE: Option<&'static GLBaseSrc> = None;
25}
26
27unsafe impl Send for GLBaseSrc {}
28unsafe impl Sync for GLBaseSrc {}
29
30pub trait GLBaseSrcExt: IsA<GLBaseSrc> + 'static {
31    #[doc(alias = "timestamp-offset")]
32    fn timestamp_offset(&self) -> i64 {
33        ObjectExt::property(self.as_ref(), "timestamp-offset")
34    }
35
36    #[doc(alias = "timestamp-offset")]
37    fn set_timestamp_offset(&self, timestamp_offset: i64) {
38        ObjectExt::set_property(self.as_ref(), "timestamp-offset", timestamp_offset)
39    }
40
41    #[doc(alias = "timestamp-offset")]
42    fn connect_timestamp_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(
43        &self,
44        f: F,
45    ) -> SignalHandlerId {
46        unsafe extern "C" fn notify_timestamp_offset_trampoline<
47            P: IsA<GLBaseSrc>,
48            F: Fn(&P) + Send + Sync + 'static,
49        >(
50            this: *mut ffi::GstGLBaseSrc,
51            _param_spec: glib::ffi::gpointer,
52            f: glib::ffi::gpointer,
53        ) {
54            let f: &F = &*(f as *const F);
55            f(GLBaseSrc::from_glib_borrow(this).unsafe_cast_ref())
56        }
57        unsafe {
58            let f: Box_<F> = Box_::new(f);
59            connect_raw(
60                self.as_ptr() as *mut _,
61                c"notify::timestamp-offset".as_ptr() as *const _,
62                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
63                    notify_timestamp_offset_trampoline::<Self, F> as *const (),
64                )),
65                Box_::into_raw(f),
66            )
67        }
68    }
69}
70
71impl<O: IsA<GLBaseSrc>> GLBaseSrcExt for O {}