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
93/// Trait containing all [`struct@VideoAggregatorPad`] methods.
94///
95/// # Implementors
96///
97/// [`VideoAggregatorConvertPad`][struct@crate::VideoAggregatorConvertPad], [`VideoAggregatorPad`][struct@crate::VideoAggregatorPad]
98pub trait VideoAggregatorPadExt: IsA<VideoAggregatorPad> + 'static {
99    /// Allows selecting that this pad requires an output format with alpha
100    /// ## `needs_alpha`
101    /// [`true`] if this pad requires alpha output
102    #[doc(alias = "gst_video_aggregator_pad_set_needs_alpha")]
103    fn set_needs_alpha(&self, needs_alpha: bool) {
104        unsafe {
105            ffi::gst_video_aggregator_pad_set_needs_alpha(
106                self.as_ref().to_glib_none().0,
107                needs_alpha.into_glib(),
108            );
109        }
110    }
111
112    #[doc(alias = "max-last-buffer-repeat")]
113    fn max_last_buffer_repeat(&self) -> u64 {
114        ObjectExt::property(self.as_ref(), "max-last-buffer-repeat")
115    }
116
117    #[doc(alias = "max-last-buffer-repeat")]
118    fn set_max_last_buffer_repeat(&self, max_last_buffer_repeat: u64) {
119        ObjectExt::set_property(
120            self.as_ref(),
121            "max-last-buffer-repeat",
122            max_last_buffer_repeat,
123        )
124    }
125
126    #[doc(alias = "repeat-after-eos")]
127    fn is_repeat_after_eos(&self) -> bool {
128        ObjectExt::property(self.as_ref(), "repeat-after-eos")
129    }
130
131    #[doc(alias = "repeat-after-eos")]
132    fn set_repeat_after_eos(&self, repeat_after_eos: bool) {
133        ObjectExt::set_property(self.as_ref(), "repeat-after-eos", repeat_after_eos)
134    }
135
136    fn zorder(&self) -> u32 {
137        ObjectExt::property(self.as_ref(), "zorder")
138    }
139
140    fn set_zorder(&self, zorder: u32) {
141        ObjectExt::set_property(self.as_ref(), "zorder", zorder)
142    }
143
144    #[doc(alias = "max-last-buffer-repeat")]
145    fn connect_max_last_buffer_repeat_notify<F: Fn(&Self) + Send + Sync + 'static>(
146        &self,
147        f: F,
148    ) -> SignalHandlerId {
149        unsafe extern "C" fn notify_max_last_buffer_repeat_trampoline<
150            P: IsA<VideoAggregatorPad>,
151            F: Fn(&P) + Send + Sync + 'static,
152        >(
153            this: *mut ffi::GstVideoAggregatorPad,
154            _param_spec: glib::ffi::gpointer,
155            f: glib::ffi::gpointer,
156        ) {
157            let f: &F = &*(f as *const F);
158            f(VideoAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
159        }
160        unsafe {
161            let f: Box_<F> = Box_::new(f);
162            connect_raw(
163                self.as_ptr() as *mut _,
164                c"notify::max-last-buffer-repeat".as_ptr() as *const _,
165                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
166                    notify_max_last_buffer_repeat_trampoline::<Self, F> as *const (),
167                )),
168                Box_::into_raw(f),
169            )
170        }
171    }
172
173    #[doc(alias = "repeat-after-eos")]
174    fn connect_repeat_after_eos_notify<F: Fn(&Self) + Send + Sync + 'static>(
175        &self,
176        f: F,
177    ) -> SignalHandlerId {
178        unsafe extern "C" fn notify_repeat_after_eos_trampoline<
179            P: IsA<VideoAggregatorPad>,
180            F: Fn(&P) + Send + Sync + 'static,
181        >(
182            this: *mut ffi::GstVideoAggregatorPad,
183            _param_spec: glib::ffi::gpointer,
184            f: glib::ffi::gpointer,
185        ) {
186            let f: &F = &*(f as *const F);
187            f(VideoAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
188        }
189        unsafe {
190            let f: Box_<F> = Box_::new(f);
191            connect_raw(
192                self.as_ptr() as *mut _,
193                c"notify::repeat-after-eos".as_ptr() as *const _,
194                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
195                    notify_repeat_after_eos_trampoline::<Self, F> as *const (),
196                )),
197                Box_::into_raw(f),
198            )
199        }
200    }
201
202    #[doc(alias = "zorder")]
203    fn connect_zorder_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
204        unsafe extern "C" fn notify_zorder_trampoline<
205            P: IsA<VideoAggregatorPad>,
206            F: Fn(&P) + Send + Sync + 'static,
207        >(
208            this: *mut ffi::GstVideoAggregatorPad,
209            _param_spec: glib::ffi::gpointer,
210            f: glib::ffi::gpointer,
211        ) {
212            let f: &F = &*(f as *const F);
213            f(VideoAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
214        }
215        unsafe {
216            let f: Box_<F> = Box_::new(f);
217            connect_raw(
218                self.as_ptr() as *mut _,
219                c"notify::zorder".as_ptr() as *const _,
220                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
221                    notify_zorder_trampoline::<Self, F> as *const (),
222                )),
223                Box_::into_raw(f),
224            )
225        }
226    }
227}
228
229impl<O: IsA<VideoAggregatorPad>> VideoAggregatorPadExt for O {}