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 /// [`GLBaseSrc`][crate::GLBaseSrc] handles the nitty gritty details of retrieving an OpenGL
16 /// context. It also provided some wrappers around [`gst_base::BaseSrc`][crate::gst_base::BaseSrc]'s ``start()`` and
17 /// ``stop()`` virtual methods that ensure an OpenGL context is available and
18 /// current in the calling thread.
19 ///
20 /// This is an Abstract Base Class, you cannot instantiate it.
21 ///
22 /// ## Properties
23 ///
24 ///
25 /// #### `timestamp-offset`
26 /// Readable | Writeable
27 /// <details><summary><h4>BaseSrc</h4></summary>
28 ///
29 ///
30 /// #### `automatic-eos`
31 /// See [`BaseSrcExtManual::set_automatic_eos()`][crate::gst_base::prelude::BaseSrcExtManual::set_automatic_eos()]
32 ///
33 /// Readable | Writeable
34 ///
35 ///
36 /// #### `blocksize`
37 /// Readable | Writeable
38 ///
39 ///
40 /// #### `do-timestamp`
41 /// Readable | Writeable
42 ///
43 ///
44 /// #### `num-buffers`
45 /// Readable | Writeable
46 ///
47 ///
48 /// #### `typefind`
49 /// Readable | Writeable
50 /// </details>
51 /// <details><summary><h4>Object</h4></summary>
52 ///
53 ///
54 /// #### `name`
55 /// Readable | Writeable | Construct
56 ///
57 ///
58 /// #### `parent`
59 /// The parent of the object. Please note, that when changing the 'parent'
60 /// property, we don't emit [`notify`][struct@crate::glib::Object#notify] and [`deep-notify`][struct@crate::gst::Object#deep-notify]
61 /// signals due to locking issues. In some cases one can use
62 /// `GstBin::element-added` or `GstBin::element-removed` signals on the parent to
63 /// achieve a similar effect.
64 ///
65 /// Readable | Writeable
66 /// </details>
67 ///
68 /// # Implements
69 ///
70 /// [`GLBaseSrcExt`][trait@crate::prelude::GLBaseSrcExt], [`trait@gst_base::prelude::PushSrcExt`], [`trait@gst_base::prelude::BaseSrcExt`], [`trait@gst::prelude::ElementExt`], [`trait@gst::prelude::ObjectExt`], [`trait@glib::ObjectExt`]
71 #[doc(alias = "GstGLBaseSrc")]
72 pub struct GLBaseSrc(Object<ffi::GstGLBaseSrc, ffi::GstGLBaseSrcClass>) @extends gst_base::PushSrc, gst_base::BaseSrc, gst::Element, gst::Object;
73
74 match fn {
75 type_ => || ffi::gst_gl_base_src_get_type(),
76 }
77}
78
79impl GLBaseSrc {
80 pub const NONE: Option<&'static GLBaseSrc> = None;
81}
82
83unsafe impl Send for GLBaseSrc {}
84unsafe impl Sync for GLBaseSrc {}
85
86mod sealed {
87 pub trait Sealed {}
88 impl<T: super::IsA<super::GLBaseSrc>> Sealed for T {}
89}
90
91/// Trait containing all [`struct@GLBaseSrc`] methods.
92///
93/// # Implementors
94///
95/// [`GLBaseSrc`][struct@crate::GLBaseSrc]
96pub trait GLBaseSrcExt: IsA<GLBaseSrc> + sealed::Sealed + 'static {
97 #[doc(alias = "timestamp-offset")]
98 fn timestamp_offset(&self) -> i64 {
99 ObjectExt::property(self.as_ref(), "timestamp-offset")
100 }
101
102 #[doc(alias = "timestamp-offset")]
103 fn set_timestamp_offset(&self, timestamp_offset: i64) {
104 ObjectExt::set_property(self.as_ref(), "timestamp-offset", timestamp_offset)
105 }
106
107 #[doc(alias = "timestamp-offset")]
108 fn connect_timestamp_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(
109 &self,
110 f: F,
111 ) -> SignalHandlerId {
112 unsafe extern "C" fn notify_timestamp_offset_trampoline<
113 P: IsA<GLBaseSrc>,
114 F: Fn(&P) + Send + Sync + 'static,
115 >(
116 this: *mut ffi::GstGLBaseSrc,
117 _param_spec: glib::ffi::gpointer,
118 f: glib::ffi::gpointer,
119 ) {
120 let f: &F = &*(f as *const F);
121 f(GLBaseSrc::from_glib_borrow(this).unsafe_cast_ref())
122 }
123 unsafe {
124 let f: Box_<F> = Box_::new(f);
125 connect_raw(
126 self.as_ptr() as *mut _,
127 b"notify::timestamp-offset\0".as_ptr() as *const _,
128 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
129 notify_timestamp_offset_trampoline::<Self, F> as *const (),
130 )),
131 Box_::into_raw(f),
132 )
133 }
134 }
135}
136
137impl<O: IsA<GLBaseSrc>> GLBaseSrcExt for O {}