gstreamer_video/auto/
video_aggregator_pad.rs1use crate::ffi;
7use glib::{
8 prelude::*,
9 signal::{SignalHandlerId, connect_raw},
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 unsafe {
87 let f: &F = &*(f as *const F);
88 f(VideoAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
89 }
90 }
91 unsafe {
92 let f: Box_<F> = Box_::new(f);
93 connect_raw(
94 self.as_ptr() as *mut _,
95 c"notify::max-last-buffer-repeat".as_ptr(),
96 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
97 notify_max_last_buffer_repeat_trampoline::<Self, F> as *const (),
98 )),
99 Box_::into_raw(f),
100 )
101 }
102 }
103
104 #[doc(alias = "repeat-after-eos")]
105 fn connect_repeat_after_eos_notify<F: Fn(&Self) + Send + Sync + 'static>(
106 &self,
107 f: F,
108 ) -> SignalHandlerId {
109 unsafe extern "C" fn notify_repeat_after_eos_trampoline<
110 P: IsA<VideoAggregatorPad>,
111 F: Fn(&P) + Send + Sync + 'static,
112 >(
113 this: *mut ffi::GstVideoAggregatorPad,
114 _param_spec: glib::ffi::gpointer,
115 f: glib::ffi::gpointer,
116 ) {
117 unsafe {
118 let f: &F = &*(f as *const F);
119 f(VideoAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
120 }
121 }
122 unsafe {
123 let f: Box_<F> = Box_::new(f);
124 connect_raw(
125 self.as_ptr() as *mut _,
126 c"notify::repeat-after-eos".as_ptr(),
127 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
128 notify_repeat_after_eos_trampoline::<Self, F> as *const (),
129 )),
130 Box_::into_raw(f),
131 )
132 }
133 }
134
135 #[doc(alias = "zorder")]
136 fn connect_zorder_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
137 unsafe extern "C" fn notify_zorder_trampoline<
138 P: IsA<VideoAggregatorPad>,
139 F: Fn(&P) + Send + Sync + 'static,
140 >(
141 this: *mut ffi::GstVideoAggregatorPad,
142 _param_spec: glib::ffi::gpointer,
143 f: glib::ffi::gpointer,
144 ) {
145 unsafe {
146 let f: &F = &*(f as *const F);
147 f(VideoAggregatorPad::from_glib_borrow(this).unsafe_cast_ref())
148 }
149 }
150 unsafe {
151 let f: Box_<F> = Box_::new(f);
152 connect_raw(
153 self.as_ptr() as *mut _,
154 c"notify::zorder".as_ptr(),
155 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
156 notify_zorder_trampoline::<Self, F> as *const (),
157 )),
158 Box_::into_raw(f),
159 )
160 }
161 }
162}
163
164impl<O: IsA<VideoAggregatorPad>> VideoAggregatorPadExt for O {}