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