1 // Generated by gir (https://github.com/gtk-rs/gir @ 1bef39f)
2 // from gir-files (https://github.com/gtk-rs/gir-files @ 7d95377)
3 // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 831b444)
4 // DO NOT EDIT
5 
6 #![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
7 #![allow(
8     clippy::approx_constant,
9     clippy::type_complexity,
10     clippy::unreadable_literal,
11     clippy::upper_case_acronyms
12 )]
13 #![cfg_attr(feature = "dox", feature(doc_cfg))]
14 
15 use glib_sys as glib;
16 use gstreamer_base_sys as gst_base;
17 use gstreamer_sys as gst;
18 
19 #[allow(unused_imports)]
20 use libc::{
21     c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
22     intptr_t, size_t, ssize_t, time_t, uintptr_t, FILE,
23 };
24 
25 #[allow(unused_imports)]
26 use glib::{gboolean, gconstpointer, gpointer, GType};
27 
28 // Enums
29 pub type GstAppLeakyType = c_int;
30 pub const GST_APP_LEAKY_TYPE_NONE: GstAppLeakyType = 0;
31 pub const GST_APP_LEAKY_TYPE_UPSTREAM: GstAppLeakyType = 1;
32 pub const GST_APP_LEAKY_TYPE_DOWNSTREAM: GstAppLeakyType = 2;
33 
34 pub type GstAppStreamType = c_int;
35 pub const GST_APP_STREAM_TYPE_STREAM: GstAppStreamType = 0;
36 pub const GST_APP_STREAM_TYPE_SEEKABLE: GstAppStreamType = 1;
37 pub const GST_APP_STREAM_TYPE_RANDOM_ACCESS: GstAppStreamType = 2;
38 
39 // Records
40 #[repr(C)]
41 #[derive(Copy, Clone)]
42 pub struct GstAppSinkCallbacks {
43     pub eos: Option<unsafe extern "C" fn(*mut GstAppSink, gpointer)>,
44     pub new_preroll: Option<unsafe extern "C" fn(*mut GstAppSink, gpointer) -> gst::GstFlowReturn>,
45     pub new_sample: Option<unsafe extern "C" fn(*mut GstAppSink, gpointer) -> gst::GstFlowReturn>,
46     pub _gst_reserved: [gpointer; 4],
47 }
48 
49 impl ::std::fmt::Debug for GstAppSinkCallbacks {
fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result50     fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
51         f.debug_struct(&format!("GstAppSinkCallbacks @ {:p}", self))
52             .field("eos", &self.eos)
53             .field("new_preroll", &self.new_preroll)
54             .field("new_sample", &self.new_sample)
55             .finish()
56     }
57 }
58 
59 #[repr(C)]
60 #[derive(Copy, Clone)]
61 pub struct GstAppSinkClass {
62     pub basesink_class: gst_base::GstBaseSinkClass,
63     pub eos: Option<unsafe extern "C" fn(*mut GstAppSink)>,
64     pub new_preroll: Option<unsafe extern "C" fn(*mut GstAppSink) -> gst::GstFlowReturn>,
65     pub new_sample: Option<unsafe extern "C" fn(*mut GstAppSink) -> gst::GstFlowReturn>,
66     pub pull_preroll: Option<unsafe extern "C" fn(*mut GstAppSink) -> *mut gst::GstSample>,
67     pub pull_sample: Option<unsafe extern "C" fn(*mut GstAppSink) -> *mut gst::GstSample>,
68     pub try_pull_preroll:
69         Option<unsafe extern "C" fn(*mut GstAppSink, gst::GstClockTime) -> *mut gst::GstSample>,
70     pub try_pull_sample:
71         Option<unsafe extern "C" fn(*mut GstAppSink, gst::GstClockTime) -> *mut gst::GstSample>,
72     pub _gst_reserved: [gpointer; 2],
73 }
74 
75 impl ::std::fmt::Debug for GstAppSinkClass {
fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result76     fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
77         f.debug_struct(&format!("GstAppSinkClass @ {:p}", self))
78             .field("basesink_class", &self.basesink_class)
79             .field("eos", &self.eos)
80             .field("new_preroll", &self.new_preroll)
81             .field("new_sample", &self.new_sample)
82             .field("pull_preroll", &self.pull_preroll)
83             .field("pull_sample", &self.pull_sample)
84             .field("try_pull_preroll", &self.try_pull_preroll)
85             .field("try_pull_sample", &self.try_pull_sample)
86             .finish()
87     }
88 }
89 
90 #[repr(C)]
91 pub struct _GstAppSinkPrivate(c_void);
92 
93 pub type GstAppSinkPrivate = *mut _GstAppSinkPrivate;
94 
95 #[repr(C)]
96 #[derive(Copy, Clone)]
97 pub struct GstAppSrcCallbacks {
98     pub need_data: Option<unsafe extern "C" fn(*mut GstAppSrc, c_uint, gpointer)>,
99     pub enough_data: Option<unsafe extern "C" fn(*mut GstAppSrc, gpointer)>,
100     pub seek_data: Option<unsafe extern "C" fn(*mut GstAppSrc, u64, gpointer) -> gboolean>,
101     pub _gst_reserved: [gpointer; 4],
102 }
103 
104 impl ::std::fmt::Debug for GstAppSrcCallbacks {
fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result105     fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
106         f.debug_struct(&format!("GstAppSrcCallbacks @ {:p}", self))
107             .field("need_data", &self.need_data)
108             .field("enough_data", &self.enough_data)
109             .field("seek_data", &self.seek_data)
110             .finish()
111     }
112 }
113 
114 #[repr(C)]
115 #[derive(Copy, Clone)]
116 pub struct GstAppSrcClass {
117     pub basesrc_class: gst_base::GstBaseSrcClass,
118     pub need_data: Option<unsafe extern "C" fn(*mut GstAppSrc, c_uint)>,
119     pub enough_data: Option<unsafe extern "C" fn(*mut GstAppSrc)>,
120     pub seek_data: Option<unsafe extern "C" fn(*mut GstAppSrc, u64) -> gboolean>,
121     pub push_buffer:
122         Option<unsafe extern "C" fn(*mut GstAppSrc, *mut gst::GstBuffer) -> gst::GstFlowReturn>,
123     pub end_of_stream: Option<unsafe extern "C" fn(*mut GstAppSrc) -> gst::GstFlowReturn>,
124     pub push_sample:
125         Option<unsafe extern "C" fn(*mut GstAppSrc, *mut gst::GstSample) -> gst::GstFlowReturn>,
126     pub push_buffer_list:
127         Option<unsafe extern "C" fn(*mut GstAppSrc, *mut gst::GstBufferList) -> gst::GstFlowReturn>,
128     pub _gst_reserved: [gpointer; 2],
129 }
130 
131 impl ::std::fmt::Debug for GstAppSrcClass {
fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result132     fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
133         f.debug_struct(&format!("GstAppSrcClass @ {:p}", self))
134             .field("basesrc_class", &self.basesrc_class)
135             .field("need_data", &self.need_data)
136             .field("enough_data", &self.enough_data)
137             .field("seek_data", &self.seek_data)
138             .field("push_buffer", &self.push_buffer)
139             .field("end_of_stream", &self.end_of_stream)
140             .field("push_sample", &self.push_sample)
141             .field("push_buffer_list", &self.push_buffer_list)
142             .finish()
143     }
144 }
145 
146 #[repr(C)]
147 pub struct _GstAppSrcPrivate(c_void);
148 
149 pub type GstAppSrcPrivate = *mut _GstAppSrcPrivate;
150 
151 // Classes
152 #[repr(C)]
153 #[derive(Copy, Clone)]
154 pub struct GstAppSink {
155     pub basesink: gst_base::GstBaseSink,
156     pub priv_: *mut GstAppSinkPrivate,
157     pub _gst_reserved: [gpointer; 4],
158 }
159 
160 impl ::std::fmt::Debug for GstAppSink {
fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result161     fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
162         f.debug_struct(&format!("GstAppSink @ {:p}", self))
163             .field("basesink", &self.basesink)
164             .finish()
165     }
166 }
167 
168 #[repr(C)]
169 #[derive(Copy, Clone)]
170 pub struct GstAppSrc {
171     pub basesrc: gst_base::GstBaseSrc,
172     pub priv_: *mut GstAppSrcPrivate,
173     pub _gst_reserved: [gpointer; 4],
174 }
175 
176 impl ::std::fmt::Debug for GstAppSrc {
fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result177     fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
178         f.debug_struct(&format!("GstAppSrc @ {:p}", self))
179             .field("basesrc", &self.basesrc)
180             .finish()
181     }
182 }
183 
184 #[link(name = "gstapp-1.0")]
185 extern "C" {
186 
187     //=========================================================================
188     // GstAppLeakyType
189     //=========================================================================
190     #[cfg(any(feature = "v1_20", feature = "dox"))]
191     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
gst_app_leaky_type_get_type() -> GType192     pub fn gst_app_leaky_type_get_type() -> GType;
193 
194     //=========================================================================
195     // GstAppStreamType
196     //=========================================================================
gst_app_stream_type_get_type() -> GType197     pub fn gst_app_stream_type_get_type() -> GType;
198 
199     //=========================================================================
200     // GstAppSink
201     //=========================================================================
gst_app_sink_get_type() -> GType202     pub fn gst_app_sink_get_type() -> GType;
203     #[cfg(any(feature = "v1_12", feature = "dox"))]
204     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
gst_app_sink_get_buffer_list_support(appsink: *mut GstAppSink) -> gboolean205     pub fn gst_app_sink_get_buffer_list_support(appsink: *mut GstAppSink) -> gboolean;
gst_app_sink_get_caps(appsink: *mut GstAppSink) -> *mut gst::GstCaps206     pub fn gst_app_sink_get_caps(appsink: *mut GstAppSink) -> *mut gst::GstCaps;
gst_app_sink_get_drop(appsink: *mut GstAppSink) -> gboolean207     pub fn gst_app_sink_get_drop(appsink: *mut GstAppSink) -> gboolean;
gst_app_sink_get_emit_signals(appsink: *mut GstAppSink) -> gboolean208     pub fn gst_app_sink_get_emit_signals(appsink: *mut GstAppSink) -> gboolean;
gst_app_sink_get_max_buffers(appsink: *mut GstAppSink) -> c_uint209     pub fn gst_app_sink_get_max_buffers(appsink: *mut GstAppSink) -> c_uint;
gst_app_sink_get_wait_on_eos(appsink: *mut GstAppSink) -> gboolean210     pub fn gst_app_sink_get_wait_on_eos(appsink: *mut GstAppSink) -> gboolean;
gst_app_sink_is_eos(appsink: *mut GstAppSink) -> gboolean211     pub fn gst_app_sink_is_eos(appsink: *mut GstAppSink) -> gboolean;
gst_app_sink_pull_preroll(appsink: *mut GstAppSink) -> *mut gst::GstSample212     pub fn gst_app_sink_pull_preroll(appsink: *mut GstAppSink) -> *mut gst::GstSample;
gst_app_sink_pull_sample(appsink: *mut GstAppSink) -> *mut gst::GstSample213     pub fn gst_app_sink_pull_sample(appsink: *mut GstAppSink) -> *mut gst::GstSample;
214     #[cfg(any(feature = "v1_12", feature = "dox"))]
215     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
gst_app_sink_set_buffer_list_support(appsink: *mut GstAppSink, enable_lists: gboolean)216     pub fn gst_app_sink_set_buffer_list_support(appsink: *mut GstAppSink, enable_lists: gboolean);
gst_app_sink_set_callbacks( appsink: *mut GstAppSink, callbacks: *mut GstAppSinkCallbacks, user_data: gpointer, notify: glib::GDestroyNotify, )217     pub fn gst_app_sink_set_callbacks(
218         appsink: *mut GstAppSink,
219         callbacks: *mut GstAppSinkCallbacks,
220         user_data: gpointer,
221         notify: glib::GDestroyNotify,
222     );
gst_app_sink_set_caps(appsink: *mut GstAppSink, caps: *const gst::GstCaps)223     pub fn gst_app_sink_set_caps(appsink: *mut GstAppSink, caps: *const gst::GstCaps);
gst_app_sink_set_drop(appsink: *mut GstAppSink, drop: gboolean)224     pub fn gst_app_sink_set_drop(appsink: *mut GstAppSink, drop: gboolean);
gst_app_sink_set_emit_signals(appsink: *mut GstAppSink, emit: gboolean)225     pub fn gst_app_sink_set_emit_signals(appsink: *mut GstAppSink, emit: gboolean);
gst_app_sink_set_max_buffers(appsink: *mut GstAppSink, max: c_uint)226     pub fn gst_app_sink_set_max_buffers(appsink: *mut GstAppSink, max: c_uint);
gst_app_sink_set_wait_on_eos(appsink: *mut GstAppSink, wait: gboolean)227     pub fn gst_app_sink_set_wait_on_eos(appsink: *mut GstAppSink, wait: gboolean);
228     #[cfg(any(feature = "v1_10", feature = "dox"))]
229     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
gst_app_sink_try_pull_preroll( appsink: *mut GstAppSink, timeout: gst::GstClockTime, ) -> *mut gst::GstSample230     pub fn gst_app_sink_try_pull_preroll(
231         appsink: *mut GstAppSink,
232         timeout: gst::GstClockTime,
233     ) -> *mut gst::GstSample;
234     #[cfg(any(feature = "v1_10", feature = "dox"))]
235     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
gst_app_sink_try_pull_sample( appsink: *mut GstAppSink, timeout: gst::GstClockTime, ) -> *mut gst::GstSample236     pub fn gst_app_sink_try_pull_sample(
237         appsink: *mut GstAppSink,
238         timeout: gst::GstClockTime,
239     ) -> *mut gst::GstSample;
240 
241     //=========================================================================
242     // GstAppSrc
243     //=========================================================================
gst_app_src_get_type() -> GType244     pub fn gst_app_src_get_type() -> GType;
gst_app_src_end_of_stream(appsrc: *mut GstAppSrc) -> gst::GstFlowReturn245     pub fn gst_app_src_end_of_stream(appsrc: *mut GstAppSrc) -> gst::GstFlowReturn;
gst_app_src_get_caps(appsrc: *mut GstAppSrc) -> *mut gst::GstCaps246     pub fn gst_app_src_get_caps(appsrc: *mut GstAppSrc) -> *mut gst::GstCaps;
247     #[cfg(any(feature = "v1_20", feature = "dox"))]
248     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
gst_app_src_get_current_level_buffers(appsrc: *mut GstAppSrc) -> u64249     pub fn gst_app_src_get_current_level_buffers(appsrc: *mut GstAppSrc) -> u64;
gst_app_src_get_current_level_bytes(appsrc: *mut GstAppSrc) -> u64250     pub fn gst_app_src_get_current_level_bytes(appsrc: *mut GstAppSrc) -> u64;
251     #[cfg(any(feature = "v1_20", feature = "dox"))]
252     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
gst_app_src_get_current_level_time(appsrc: *mut GstAppSrc) -> gst::GstClockTime253     pub fn gst_app_src_get_current_level_time(appsrc: *mut GstAppSrc) -> gst::GstClockTime;
254     #[cfg(any(feature = "v1_10", feature = "dox"))]
255     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
gst_app_src_get_duration(appsrc: *mut GstAppSrc) -> gst::GstClockTime256     pub fn gst_app_src_get_duration(appsrc: *mut GstAppSrc) -> gst::GstClockTime;
gst_app_src_get_emit_signals(appsrc: *mut GstAppSrc) -> gboolean257     pub fn gst_app_src_get_emit_signals(appsrc: *mut GstAppSrc) -> gboolean;
gst_app_src_get_latency(appsrc: *mut GstAppSrc, min: *mut u64, max: *mut u64)258     pub fn gst_app_src_get_latency(appsrc: *mut GstAppSrc, min: *mut u64, max: *mut u64);
259     #[cfg(any(feature = "v1_20", feature = "dox"))]
260     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
gst_app_src_get_leaky_type(appsrc: *mut GstAppSrc) -> GstAppLeakyType261     pub fn gst_app_src_get_leaky_type(appsrc: *mut GstAppSrc) -> GstAppLeakyType;
262     #[cfg(any(feature = "v1_20", feature = "dox"))]
263     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
gst_app_src_get_max_buffers(appsrc: *mut GstAppSrc) -> u64264     pub fn gst_app_src_get_max_buffers(appsrc: *mut GstAppSrc) -> u64;
gst_app_src_get_max_bytes(appsrc: *mut GstAppSrc) -> u64265     pub fn gst_app_src_get_max_bytes(appsrc: *mut GstAppSrc) -> u64;
266     #[cfg(any(feature = "v1_20", feature = "dox"))]
267     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
gst_app_src_get_max_time(appsrc: *mut GstAppSrc) -> gst::GstClockTime268     pub fn gst_app_src_get_max_time(appsrc: *mut GstAppSrc) -> gst::GstClockTime;
gst_app_src_get_size(appsrc: *mut GstAppSrc) -> i64269     pub fn gst_app_src_get_size(appsrc: *mut GstAppSrc) -> i64;
gst_app_src_get_stream_type(appsrc: *mut GstAppSrc) -> GstAppStreamType270     pub fn gst_app_src_get_stream_type(appsrc: *mut GstAppSrc) -> GstAppStreamType;
gst_app_src_push_buffer( appsrc: *mut GstAppSrc, buffer: *mut gst::GstBuffer, ) -> gst::GstFlowReturn271     pub fn gst_app_src_push_buffer(
272         appsrc: *mut GstAppSrc,
273         buffer: *mut gst::GstBuffer,
274     ) -> gst::GstFlowReturn;
275     #[cfg(any(feature = "v1_14", feature = "dox"))]
276     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
gst_app_src_push_buffer_list( appsrc: *mut GstAppSrc, buffer_list: *mut gst::GstBufferList, ) -> gst::GstFlowReturn277     pub fn gst_app_src_push_buffer_list(
278         appsrc: *mut GstAppSrc,
279         buffer_list: *mut gst::GstBufferList,
280     ) -> gst::GstFlowReturn;
gst_app_src_push_sample( appsrc: *mut GstAppSrc, sample: *mut gst::GstSample, ) -> gst::GstFlowReturn281     pub fn gst_app_src_push_sample(
282         appsrc: *mut GstAppSrc,
283         sample: *mut gst::GstSample,
284     ) -> gst::GstFlowReturn;
gst_app_src_set_callbacks( appsrc: *mut GstAppSrc, callbacks: *mut GstAppSrcCallbacks, user_data: gpointer, notify: glib::GDestroyNotify, )285     pub fn gst_app_src_set_callbacks(
286         appsrc: *mut GstAppSrc,
287         callbacks: *mut GstAppSrcCallbacks,
288         user_data: gpointer,
289         notify: glib::GDestroyNotify,
290     );
gst_app_src_set_caps(appsrc: *mut GstAppSrc, caps: *const gst::GstCaps)291     pub fn gst_app_src_set_caps(appsrc: *mut GstAppSrc, caps: *const gst::GstCaps);
292     #[cfg(any(feature = "v1_10", feature = "dox"))]
293     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
gst_app_src_set_duration(appsrc: *mut GstAppSrc, duration: gst::GstClockTime)294     pub fn gst_app_src_set_duration(appsrc: *mut GstAppSrc, duration: gst::GstClockTime);
gst_app_src_set_emit_signals(appsrc: *mut GstAppSrc, emit: gboolean)295     pub fn gst_app_src_set_emit_signals(appsrc: *mut GstAppSrc, emit: gboolean);
gst_app_src_set_latency(appsrc: *mut GstAppSrc, min: u64, max: u64)296     pub fn gst_app_src_set_latency(appsrc: *mut GstAppSrc, min: u64, max: u64);
297     #[cfg(any(feature = "v1_20", feature = "dox"))]
298     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
gst_app_src_set_leaky_type(appsrc: *mut GstAppSrc, leaky: GstAppLeakyType)299     pub fn gst_app_src_set_leaky_type(appsrc: *mut GstAppSrc, leaky: GstAppLeakyType);
300     #[cfg(any(feature = "v1_20", feature = "dox"))]
301     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
gst_app_src_set_max_buffers(appsrc: *mut GstAppSrc, max: u64)302     pub fn gst_app_src_set_max_buffers(appsrc: *mut GstAppSrc, max: u64);
gst_app_src_set_max_bytes(appsrc: *mut GstAppSrc, max: u64)303     pub fn gst_app_src_set_max_bytes(appsrc: *mut GstAppSrc, max: u64);
304     #[cfg(any(feature = "v1_20", feature = "dox"))]
305     #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
gst_app_src_set_max_time(appsrc: *mut GstAppSrc, max: gst::GstClockTime)306     pub fn gst_app_src_set_max_time(appsrc: *mut GstAppSrc, max: gst::GstClockTime);
gst_app_src_set_size(appsrc: *mut GstAppSrc, size: i64)307     pub fn gst_app_src_set_size(appsrc: *mut GstAppSrc, size: i64);
gst_app_src_set_stream_type(appsrc: *mut GstAppSrc, type_: GstAppStreamType)308     pub fn gst_app_src_set_stream_type(appsrc: *mut GstAppSrc, type_: GstAppStreamType);
309 
310 }
311