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    #[doc(alias = "GstVideoAggregatorPad")]
16    pub struct VideoAggregatorPad(Object<ffi::GstVideoAggregatorPad, ffi::GstVideoAggregatorPadClass>) @extends gst_base::AggregatorPad, gst::Pad, gst::Object;
17
18    match fn {
19        type_ => || ffi::gst_video_aggregator_pad_get_type(),
20    }
21}
22
23impl VideoAggregatorPad {
24    pub const NONE: Option<&'static VideoAggregatorPad> = None;
25}
26
27unsafe impl Send for VideoAggregatorPad {}
28unsafe impl Sync for VideoAggregatorPad {}
29
30pub trait VideoAggregatorPadExt: IsA<VideoAggregatorPad> + 'static {
31    #[doc(alias = "gst_video_aggregator_pad_set_needs_alpha")]
32    fn set_needs_alpha(&self, needs_alpha: bool) {
33        unsafe {
34            ffi::gst_video_aggregator_pad_set_needs_alpha(
35                self.as_ref().to_glib_none().0,
36                needs_alpha.into_glib(),
37            );
38        }
39    }
40
41    #[doc(alias = "max-last-buffer-repeat")]
42    fn max_last_buffer_repeat(&self) -> u64 {
43        ObjectExt::property(self.as_ref(), "max-last-buffer-repeat")
44    }
45
46    #[doc(alias = "max-last-buffer-repeat")]
47    fn set_max_last_buffer_repeat(&self, max_last_buffer_repeat: u64) {
48        ObjectExt::set_property(
49            self.as_ref(),
50            "max-last-buffer-repeat",
51            max_last_buffer_repeat,
52        )
53    }
54
55    #[doc(alias = "repeat-after-eos")]
56    fn is_repeat_after_eos(&self) -> bool {
57        ObjectExt::property(self.as_ref(), "repeat-after-eos")
58    }
59
60    #[doc(alias = "repeat-after-eos")]
61    fn set_repeat_after_eos(&self, repeat_after_eos: bool) {
62        ObjectExt::set_property(self.as_ref(), "repeat-after-eos", repeat_after_eos)
63    }
64
65    fn zorder(&self) -> u32 {
66        ObjectExt::property(self.as_ref(), "zorder")
67    }
68
69    fn set_zorder(&self, zorder: u32) {
70        ObjectExt::set_property(self.as_ref(), "zorder", zorder)
71    }
72
73    #[doc(alias = "max-last-buffer-repeat")]
74    fn connect_max_last_buffer_repeat_notify<F: Fn(&Self) + Send + Sync + 'static>(
75        &self,
76        f: F,
77    ) -> SignalHandlerId {
78        unsafe extern "C" fn notify_max_last_buffer_repeat_trampoline<
79            P: IsA<VideoAggregatorPad>,
80            F: Fn(&P) + Send + Sync + 'static,
81        >(
82            this: *mut ffi::GstVideoAggregatorPad,
83            _param_spec: glib::ffi::gpointer,
84            f: glib::ffi::gpointer,
85        ) {
86            let f: &F = &*(f as *const F);
87            f(VideoAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
88        }
89        unsafe {
90            let f: Box_<F> = Box_::new(f);
91            connect_raw(
92                self.as_ptr() as *mut _,
93                c"notify::max-last-buffer-repeat".as_ptr() as *const _,
94                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
95                    notify_max_last_buffer_repeat_trampoline::<Self, F> as *const (),
96                )),
97                Box_::into_raw(f),
98            )
99        }
100    }
101
102    #[doc(alias = "repeat-after-eos")]
103    fn connect_repeat_after_eos_notify<F: Fn(&Self) + Send + Sync + 'static>(
104        &self,
105        f: F,
106    ) -> SignalHandlerId {
107        unsafe extern "C" fn notify_repeat_after_eos_trampoline<
108            P: IsA<VideoAggregatorPad>,
109            F: Fn(&P) + Send + Sync + 'static,
110        >(
111            this: *mut ffi::GstVideoAggregatorPad,
112            _param_spec: glib::ffi::gpointer,
113            f: glib::ffi::gpointer,
114        ) {
115            let f: &F = &*(f as *const F);
116            f(VideoAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
117        }
118        unsafe {
119            let f: Box_<F> = Box_::new(f);
120            connect_raw(
121                self.as_ptr() as *mut _,
122                c"notify::repeat-after-eos".as_ptr() as *const _,
123                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
124                    notify_repeat_after_eos_trampoline::<Self, F> as *const (),
125                )),
126                Box_::into_raw(f),
127            )
128        }
129    }
130
131    #[doc(alias = "zorder")]
132    fn connect_zorder_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
133        unsafe extern "C" fn notify_zorder_trampoline<
134            P: IsA<VideoAggregatorPad>,
135            F: Fn(&P) + Send + Sync + 'static,
136        >(
137            this: *mut ffi::GstVideoAggregatorPad,
138            _param_spec: glib::ffi::gpointer,
139            f: glib::ffi::gpointer,
140        ) {
141            let f: &F = &*(f as *const F);
142            f(VideoAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
143        }
144        unsafe {
145            let f: Box_<F> = Box_::new(f);
146            connect_raw(
147                self.as_ptr() as *mut _,
148                c"notify::zorder".as_ptr() as *const _,
149                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
150                    notify_zorder_trampoline::<Self, F> as *const (),
151                )),
152                Box_::into_raw(f),
153            )
154        }
155    }
156}
157
158impl<O: IsA<VideoAggregatorPad>> VideoAggregatorPadExt for O {}