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::{connect_raw, SignalHandlerId},
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            let f: &F = &*(f as *const F);
176            f(VideoAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
177        }
178        unsafe {
179            let f: Box_<F> = Box_::new(f);
180            connect_raw(
181                self.as_ptr() as *mut _,
182                c"notify::max-last-buffer-repeat".as_ptr() as *const _,
183                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
184                    notify_max_last_buffer_repeat_trampoline::<Self, F> as *const (),
185                )),
186                Box_::into_raw(f),
187            )
188        }
189    }
190
191    #[doc(alias = "repeat-after-eos")]
192    fn connect_repeat_after_eos_notify<F: Fn(&Self) + Send + Sync + 'static>(
193        &self,
194        f: F,
195    ) -> SignalHandlerId {
196        unsafe extern "C" fn notify_repeat_after_eos_trampoline<
197            P: IsA<VideoAggregatorPad>,
198            F: Fn(&P) + Send + Sync + 'static,
199        >(
200            this: *mut ffi::GstVideoAggregatorPad,
201            _param_spec: glib::ffi::gpointer,
202            f: glib::ffi::gpointer,
203        ) {
204            let f: &F = &*(f as *const F);
205            f(VideoAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
206        }
207        unsafe {
208            let f: Box_<F> = Box_::new(f);
209            connect_raw(
210                self.as_ptr() as *mut _,
211                c"notify::repeat-after-eos".as_ptr() as *const _,
212                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
213                    notify_repeat_after_eos_trampoline::<Self, F> as *const (),
214                )),
215                Box_::into_raw(f),
216            )
217        }
218    }
219
220    #[doc(alias = "zorder")]
221    fn connect_zorder_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
222        unsafe extern "C" fn notify_zorder_trampoline<
223            P: IsA<VideoAggregatorPad>,
224            F: Fn(&P) + Send + Sync + 'static,
225        >(
226            this: *mut ffi::GstVideoAggregatorPad,
227            _param_spec: glib::ffi::gpointer,
228            f: glib::ffi::gpointer,
229        ) {
230            let f: &F = &*(f as *const F);
231            f(VideoAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
232        }
233        unsafe {
234            let f: Box_<F> = Box_::new(f);
235            connect_raw(
236                self.as_ptr() as *mut _,
237                c"notify::zorder".as_ptr() as *const _,
238                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
239                    notify_zorder_trampoline::<Self, F> as *const (),
240                )),
241                Box_::into_raw(f),
242            )
243        }
244    }
245}
246
247impl<O: IsA<VideoAggregatorPad>> VideoAggregatorPadExt for O {}