Skip to main content

gstreamer_video/auto/
video_aggregator_pad.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::{SignalHandlerId, connect_raw},
10    translate::*,
11};
12use std::boxed::Box as Box_;
13
14glib::wrapper! {
15    ///
16    ///
17    /// ## Properties
18    ///
19    ///
20    /// #### `max-last-buffer-repeat`
21    ///  Readable | Writeable
22    ///
23    ///
24    /// #### `repeat-after-eos`
25    ///  Readable | Writeable
26    ///
27    ///
28    /// #### `zorder`
29    ///  Readable | Writeable
30    /// <details><summary><h4>AggregatorPad</h4></summary>
31    ///
32    ///
33    /// #### `current-level-buffers`
34    ///  The number of currently queued buffers inside this pad
35    ///
36    /// Readable
37    ///
38    ///
39    /// #### `current-level-bytes`
40    ///  The number of currently queued bytes inside this pad
41    ///
42    /// Readable
43    ///
44    ///
45    /// #### `current-level-time`
46    ///  The amount of currently queued time inside this pad
47    ///
48    /// Readable
49    ///
50    ///
51    /// #### `emit-signals`
52    ///  Enables the emission of signals such as [`buffer-consumed`][struct@crate::gst_base::AggregatorPad#buffer-consumed]
53    ///
54    /// Readable | Writeable
55    /// </details>
56    /// <details><summary><h4>Pad</h4></summary>
57    ///
58    ///
59    /// #### `caps`
60    ///  Readable
61    ///
62    ///
63    /// #### `direction`
64    ///  Readable | Writeable | Construct Only
65    ///
66    ///
67    /// #### `offset`
68    ///  The offset that will be applied to the running time of the pad.
69    ///
70    /// Readable | Writeable
71    ///
72    ///
73    /// #### `template`
74    ///  Readable | Writeable
75    /// </details>
76    /// <details><summary><h4>Object</h4></summary>
77    ///
78    ///
79    /// #### `name`
80    ///  Readable | Writeable | Construct
81    ///
82    ///
83    /// #### `parent`
84    ///  The parent of the object. Please note, that when changing the 'parent'
85    /// property, we don't emit [`notify`][struct@crate::glib::Object#notify] and [`deep-notify`][struct@crate::gst::Object#deep-notify]
86    /// signals due to locking issues. In some cases one can use
87    /// `GstBin::element-added` or `GstBin::element-removed` signals on the parent to
88    /// achieve a similar effect.
89    ///
90    /// Readable | Writeable
91    /// </details>
92    ///
93    /// # Implements
94    ///
95    /// [`VideoAggregatorPadExt`][trait@crate::prelude::VideoAggregatorPadExt], [`trait@gst_base::prelude::AggregatorPadExt`], [`trait@gst::prelude::PadExt`], [`trait@gst::prelude::ObjectExt`], [`trait@glib::ObjectExt`]
96    #[doc(alias = "GstVideoAggregatorPad")]
97    pub struct VideoAggregatorPad(Object<ffi::GstVideoAggregatorPad, ffi::GstVideoAggregatorPadClass>) @extends gst_base::AggregatorPad, gst::Pad, gst::Object;
98
99    match fn {
100        type_ => || ffi::gst_video_aggregator_pad_get_type(),
101    }
102}
103
104impl VideoAggregatorPad {
105    pub const NONE: Option<&'static VideoAggregatorPad> = None;
106}
107
108unsafe impl Send for VideoAggregatorPad {}
109unsafe impl Sync for VideoAggregatorPad {}
110
111/// Trait containing all [`struct@VideoAggregatorPad`] methods.
112///
113/// # Implementors
114///
115/// [`VideoAggregatorConvertPad`][struct@crate::VideoAggregatorConvertPad], [`VideoAggregatorPad`][struct@crate::VideoAggregatorPad]
116pub trait VideoAggregatorPadExt: IsA<VideoAggregatorPad> + 'static {
117    /// Allows selecting that this pad requires an output format with alpha
118    /// ## `needs_alpha`
119    /// [`true`] if this pad requires alpha output
120    #[doc(alias = "gst_video_aggregator_pad_set_needs_alpha")]
121    fn set_needs_alpha(&self, needs_alpha: bool) {
122        unsafe {
123            ffi::gst_video_aggregator_pad_set_needs_alpha(
124                self.as_ref().to_glib_none().0,
125                needs_alpha.into_glib(),
126            );
127        }
128    }
129
130    #[doc(alias = "max-last-buffer-repeat")]
131    fn max_last_buffer_repeat(&self) -> u64 {
132        ObjectExt::property(self.as_ref(), "max-last-buffer-repeat")
133    }
134
135    #[doc(alias = "max-last-buffer-repeat")]
136    fn set_max_last_buffer_repeat(&self, max_last_buffer_repeat: u64) {
137        ObjectExt::set_property(
138            self.as_ref(),
139            "max-last-buffer-repeat",
140            max_last_buffer_repeat,
141        )
142    }
143
144    #[doc(alias = "repeat-after-eos")]
145    fn is_repeat_after_eos(&self) -> bool {
146        ObjectExt::property(self.as_ref(), "repeat-after-eos")
147    }
148
149    #[doc(alias = "repeat-after-eos")]
150    fn set_repeat_after_eos(&self, repeat_after_eos: bool) {
151        ObjectExt::set_property(self.as_ref(), "repeat-after-eos", repeat_after_eos)
152    }
153
154    fn zorder(&self) -> u32 {
155        ObjectExt::property(self.as_ref(), "zorder")
156    }
157
158    fn set_zorder(&self, zorder: u32) {
159        ObjectExt::set_property(self.as_ref(), "zorder", zorder)
160    }
161
162    #[doc(alias = "max-last-buffer-repeat")]
163    fn connect_max_last_buffer_repeat_notify<F: Fn(&Self) + Send + Sync + 'static>(
164        &self,
165        f: F,
166    ) -> SignalHandlerId {
167        unsafe extern "C" fn notify_max_last_buffer_repeat_trampoline<
168            P: IsA<VideoAggregatorPad>,
169            F: Fn(&P) + Send + Sync + 'static,
170        >(
171            this: *mut ffi::GstVideoAggregatorPad,
172            _param_spec: glib::ffi::gpointer,
173            f: glib::ffi::gpointer,
174        ) {
175            unsafe {
176                let f: &F = &*(f as *const F);
177                f(VideoAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
178            }
179        }
180        unsafe {
181            let f: Box_<F> = Box_::new(f);
182            connect_raw(
183                self.as_ptr() as *mut _,
184                c"notify::max-last-buffer-repeat".as_ptr(),
185                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
186                    notify_max_last_buffer_repeat_trampoline::<Self, F> as *const (),
187                )),
188                Box_::into_raw(f),
189            )
190        }
191    }
192
193    #[doc(alias = "repeat-after-eos")]
194    fn connect_repeat_after_eos_notify<F: Fn(&Self) + Send + Sync + 'static>(
195        &self,
196        f: F,
197    ) -> SignalHandlerId {
198        unsafe extern "C" fn notify_repeat_after_eos_trampoline<
199            P: IsA<VideoAggregatorPad>,
200            F: Fn(&P) + Send + Sync + 'static,
201        >(
202            this: *mut ffi::GstVideoAggregatorPad,
203            _param_spec: glib::ffi::gpointer,
204            f: glib::ffi::gpointer,
205        ) {
206            unsafe {
207                let f: &F = &*(f as *const F);
208                f(VideoAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
209            }
210        }
211        unsafe {
212            let f: Box_<F> = Box_::new(f);
213            connect_raw(
214                self.as_ptr() as *mut _,
215                c"notify::repeat-after-eos".as_ptr(),
216                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
217                    notify_repeat_after_eos_trampoline::<Self, F> as *const (),
218                )),
219                Box_::into_raw(f),
220            )
221        }
222    }
223
224    #[doc(alias = "zorder")]
225    fn connect_zorder_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
226        unsafe extern "C" fn notify_zorder_trampoline<
227            P: IsA<VideoAggregatorPad>,
228            F: Fn(&P) + Send + Sync + 'static,
229        >(
230            this: *mut ffi::GstVideoAggregatorPad,
231            _param_spec: glib::ffi::gpointer,
232            f: glib::ffi::gpointer,
233        ) {
234            unsafe {
235                let f: &F = &*(f as *const F);
236                f(VideoAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
237            }
238        }
239        unsafe {
240            let f: Box_<F> = Box_::new(f);
241            connect_raw(
242                self.as_ptr() as *mut _,
243                c"notify::zorder".as_ptr(),
244                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
245                    notify_zorder_trampoline::<Self, F> as *const (),
246                )),
247                Box_::into_raw(f),
248            )
249        }
250    }
251}
252
253impl<O: IsA<VideoAggregatorPad>> VideoAggregatorPadExt for O {}