gstreamer_app_sys/
lib.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
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(docsrs, feature(doc_cfg))]
14
15use glib_sys as glib;
16use gstreamer_base_sys as gst_base;
17use gstreamer_sys as gst;
18
19#[cfg(unix)]
20#[allow(unused_imports)]
21use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t};
22#[allow(unused_imports)]
23use libc::{intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t, FILE};
24#[allow(unused_imports)]
25use std::ffi::{
26    c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
27};
28
29#[allow(unused_imports)]
30use glib::{gboolean, gconstpointer, gpointer, GType};
31
32// Enums
33pub type GstAppLeakyType = c_int;
34pub const GST_APP_LEAKY_TYPE_NONE: GstAppLeakyType = 0;
35pub const GST_APP_LEAKY_TYPE_UPSTREAM: GstAppLeakyType = 1;
36pub const GST_APP_LEAKY_TYPE_DOWNSTREAM: GstAppLeakyType = 2;
37
38pub type GstAppStreamType = c_int;
39pub const GST_APP_STREAM_TYPE_STREAM: GstAppStreamType = 0;
40pub const GST_APP_STREAM_TYPE_SEEKABLE: GstAppStreamType = 1;
41pub const GST_APP_STREAM_TYPE_RANDOM_ACCESS: GstAppStreamType = 2;
42
43// Records
44#[derive(Copy, Clone)]
45#[repr(C)]
46pub struct GstAppSinkCallbacks {
47    pub eos: Option<unsafe extern "C" fn(*mut GstAppSink, gpointer)>,
48    pub new_preroll: Option<unsafe extern "C" fn(*mut GstAppSink, gpointer) -> gst::GstFlowReturn>,
49    pub new_sample: Option<unsafe extern "C" fn(*mut GstAppSink, gpointer) -> gst::GstFlowReturn>,
50    pub new_event: Option<unsafe extern "C" fn(*mut GstAppSink, gpointer) -> gboolean>,
51    pub propose_allocation:
52        Option<unsafe extern "C" fn(*mut GstAppSink, *mut gst::GstQuery, gpointer) -> gboolean>,
53    pub _gst_reserved: [gpointer; 2],
54}
55
56impl ::std::fmt::Debug for GstAppSinkCallbacks {
57    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
58        f.debug_struct(&format!("GstAppSinkCallbacks @ {self:p}"))
59            .field("eos", &self.eos)
60            .field("new_preroll", &self.new_preroll)
61            .field("new_sample", &self.new_sample)
62            .field("new_event", &self.new_event)
63            .field("propose_allocation", &self.propose_allocation)
64            .finish()
65    }
66}
67
68#[derive(Copy, Clone)]
69#[repr(C)]
70pub struct GstAppSinkClass {
71    pub basesink_class: gst_base::GstBaseSinkClass,
72    pub eos: Option<unsafe extern "C" fn(*mut GstAppSink)>,
73    pub new_preroll: Option<unsafe extern "C" fn(*mut GstAppSink) -> gst::GstFlowReturn>,
74    pub new_sample: Option<unsafe extern "C" fn(*mut GstAppSink) -> gst::GstFlowReturn>,
75    pub pull_preroll: Option<unsafe extern "C" fn(*mut GstAppSink) -> *mut gst::GstSample>,
76    pub pull_sample: Option<unsafe extern "C" fn(*mut GstAppSink) -> *mut gst::GstSample>,
77    pub try_pull_preroll:
78        Option<unsafe extern "C" fn(*mut GstAppSink, gst::GstClockTime) -> *mut gst::GstSample>,
79    pub try_pull_sample:
80        Option<unsafe extern "C" fn(*mut GstAppSink, gst::GstClockTime) -> *mut gst::GstSample>,
81    pub try_pull_object:
82        Option<unsafe extern "C" fn(*mut GstAppSink, gst::GstClockTime) -> *mut gst::GstMiniObject>,
83    pub _gst_reserved: [gpointer; 1],
84}
85
86impl ::std::fmt::Debug for GstAppSinkClass {
87    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
88        f.debug_struct(&format!("GstAppSinkClass @ {self:p}"))
89            .field("basesink_class", &self.basesink_class)
90            .field("eos", &self.eos)
91            .field("new_preroll", &self.new_preroll)
92            .field("new_sample", &self.new_sample)
93            .field("pull_preroll", &self.pull_preroll)
94            .field("pull_sample", &self.pull_sample)
95            .field("try_pull_preroll", &self.try_pull_preroll)
96            .field("try_pull_sample", &self.try_pull_sample)
97            .field("try_pull_object", &self.try_pull_object)
98            .finish()
99    }
100}
101
102#[repr(C)]
103#[allow(dead_code)]
104pub struct _GstAppSinkPrivate {
105    _data: [u8; 0],
106    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
107}
108
109pub type GstAppSinkPrivate = _GstAppSinkPrivate;
110
111#[derive(Copy, Clone)]
112#[repr(C)]
113pub struct GstAppSrcCallbacks {
114    pub need_data: Option<unsafe extern "C" fn(*mut GstAppSrc, c_uint, gpointer)>,
115    pub enough_data: Option<unsafe extern "C" fn(*mut GstAppSrc, gpointer)>,
116    pub seek_data: Option<unsafe extern "C" fn(*mut GstAppSrc, u64, gpointer) -> gboolean>,
117    pub _gst_reserved: [gpointer; 4],
118}
119
120impl ::std::fmt::Debug for GstAppSrcCallbacks {
121    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
122        f.debug_struct(&format!("GstAppSrcCallbacks @ {self:p}"))
123            .field("need_data", &self.need_data)
124            .field("enough_data", &self.enough_data)
125            .field("seek_data", &self.seek_data)
126            .finish()
127    }
128}
129
130#[derive(Copy, Clone)]
131#[repr(C)]
132pub struct GstAppSrcClass {
133    pub basesrc_class: gst_base::GstBaseSrcClass,
134    pub need_data: Option<unsafe extern "C" fn(*mut GstAppSrc, c_uint)>,
135    pub enough_data: Option<unsafe extern "C" fn(*mut GstAppSrc)>,
136    pub seek_data: Option<unsafe extern "C" fn(*mut GstAppSrc, u64) -> gboolean>,
137    pub push_buffer:
138        Option<unsafe extern "C" fn(*mut GstAppSrc, *mut gst::GstBuffer) -> gst::GstFlowReturn>,
139    pub end_of_stream: Option<unsafe extern "C" fn(*mut GstAppSrc) -> gst::GstFlowReturn>,
140    pub push_sample:
141        Option<unsafe extern "C" fn(*mut GstAppSrc, *mut gst::GstSample) -> gst::GstFlowReturn>,
142    pub push_buffer_list:
143        Option<unsafe extern "C" fn(*mut GstAppSrc, *mut gst::GstBufferList) -> gst::GstFlowReturn>,
144    pub _gst_reserved: [gpointer; 2],
145}
146
147impl ::std::fmt::Debug for GstAppSrcClass {
148    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
149        f.debug_struct(&format!("GstAppSrcClass @ {self:p}"))
150            .field("basesrc_class", &self.basesrc_class)
151            .field("need_data", &self.need_data)
152            .field("enough_data", &self.enough_data)
153            .field("seek_data", &self.seek_data)
154            .field("push_buffer", &self.push_buffer)
155            .field("end_of_stream", &self.end_of_stream)
156            .field("push_sample", &self.push_sample)
157            .field("push_buffer_list", &self.push_buffer_list)
158            .finish()
159    }
160}
161
162#[repr(C)]
163#[allow(dead_code)]
164pub struct _GstAppSrcPrivate {
165    _data: [u8; 0],
166    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
167}
168
169pub type GstAppSrcPrivate = _GstAppSrcPrivate;
170
171// Classes
172#[derive(Copy, Clone)]
173#[repr(C)]
174pub struct GstAppSink {
175    pub basesink: gst_base::GstBaseSink,
176    pub priv_: *mut GstAppSinkPrivate,
177    pub _gst_reserved: [gpointer; 4],
178}
179
180impl ::std::fmt::Debug for GstAppSink {
181    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
182        f.debug_struct(&format!("GstAppSink @ {self:p}"))
183            .field("basesink", &self.basesink)
184            .finish()
185    }
186}
187
188#[derive(Copy, Clone)]
189#[repr(C)]
190pub struct GstAppSrc {
191    pub basesrc: gst_base::GstBaseSrc,
192    pub priv_: *mut GstAppSrcPrivate,
193    pub _gst_reserved: [gpointer; 4],
194}
195
196impl ::std::fmt::Debug for GstAppSrc {
197    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
198        f.debug_struct(&format!("GstAppSrc @ {self:p}"))
199            .field("basesrc", &self.basesrc)
200            .finish()
201    }
202}
203
204extern "C" {
205
206    //=========================================================================
207    // GstAppLeakyType
208    //=========================================================================
209    #[cfg(feature = "v1_20")]
210    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
211    pub fn gst_app_leaky_type_get_type() -> GType;
212
213    //=========================================================================
214    // GstAppStreamType
215    //=========================================================================
216    pub fn gst_app_stream_type_get_type() -> GType;
217
218    //=========================================================================
219    // GstAppSink
220    //=========================================================================
221    pub fn gst_app_sink_get_type() -> GType;
222    pub fn gst_app_sink_get_buffer_list_support(appsink: *mut GstAppSink) -> gboolean;
223    pub fn gst_app_sink_get_caps(appsink: *mut GstAppSink) -> *mut gst::GstCaps;
224    #[cfg(feature = "v1_28")]
225    #[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
226    pub fn gst_app_sink_get_current_level_buffers(appsink: *mut GstAppSink) -> u64;
227    #[cfg(feature = "v1_28")]
228    #[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
229    pub fn gst_app_sink_get_current_level_bytes(appsink: *mut GstAppSink) -> u64;
230    #[cfg(feature = "v1_28")]
231    #[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
232    pub fn gst_app_sink_get_current_level_time(appsink: *mut GstAppSink) -> gst::GstClockTime;
233    pub fn gst_app_sink_get_drop(appsink: *mut GstAppSink) -> gboolean;
234    pub fn gst_app_sink_get_emit_signals(appsink: *mut GstAppSink) -> gboolean;
235    #[cfg(feature = "v1_28")]
236    #[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
237    pub fn gst_app_sink_get_leaky_type(appsink: *mut GstAppSink) -> GstAppLeakyType;
238    pub fn gst_app_sink_get_max_buffers(appsink: *mut GstAppSink) -> c_uint;
239    #[cfg(feature = "v1_24")]
240    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
241    pub fn gst_app_sink_get_max_bytes(appsink: *mut GstAppSink) -> u64;
242    #[cfg(feature = "v1_24")]
243    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
244    pub fn gst_app_sink_get_max_time(appsink: *mut GstAppSink) -> gst::GstClockTime;
245    pub fn gst_app_sink_get_wait_on_eos(appsink: *mut GstAppSink) -> gboolean;
246    pub fn gst_app_sink_is_eos(appsink: *mut GstAppSink) -> gboolean;
247    #[cfg(feature = "v1_20")]
248    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
249    pub fn gst_app_sink_pull_object(appsink: *mut GstAppSink) -> *mut gst::GstMiniObject;
250    pub fn gst_app_sink_pull_preroll(appsink: *mut GstAppSink) -> *mut gst::GstSample;
251    pub fn gst_app_sink_pull_sample(appsink: *mut GstAppSink) -> *mut gst::GstSample;
252    pub fn gst_app_sink_set_buffer_list_support(appsink: *mut GstAppSink, enable_lists: gboolean);
253    pub fn gst_app_sink_set_callbacks(
254        appsink: *mut GstAppSink,
255        callbacks: *mut GstAppSinkCallbacks,
256        user_data: gpointer,
257        notify: glib::GDestroyNotify,
258    );
259    pub fn gst_app_sink_set_caps(appsink: *mut GstAppSink, caps: *const gst::GstCaps);
260    pub fn gst_app_sink_set_drop(appsink: *mut GstAppSink, drop: gboolean);
261    pub fn gst_app_sink_set_emit_signals(appsink: *mut GstAppSink, emit: gboolean);
262    #[cfg(feature = "v1_28")]
263    #[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
264    pub fn gst_app_sink_set_leaky_type(appsink: *mut GstAppSink, leaky: GstAppLeakyType);
265    pub fn gst_app_sink_set_max_buffers(appsink: *mut GstAppSink, max: c_uint);
266    #[cfg(feature = "v1_24")]
267    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
268    pub fn gst_app_sink_set_max_bytes(appsink: *mut GstAppSink, max: u64);
269    #[cfg(feature = "v1_24")]
270    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
271    pub fn gst_app_sink_set_max_time(appsink: *mut GstAppSink, max: gst::GstClockTime);
272    pub fn gst_app_sink_set_wait_on_eos(appsink: *mut GstAppSink, wait: gboolean);
273    #[cfg(feature = "v1_20")]
274    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
275    pub fn gst_app_sink_try_pull_object(
276        appsink: *mut GstAppSink,
277        timeout: gst::GstClockTime,
278    ) -> *mut gst::GstMiniObject;
279    pub fn gst_app_sink_try_pull_preroll(
280        appsink: *mut GstAppSink,
281        timeout: gst::GstClockTime,
282    ) -> *mut gst::GstSample;
283    pub fn gst_app_sink_try_pull_sample(
284        appsink: *mut GstAppSink,
285        timeout: gst::GstClockTime,
286    ) -> *mut gst::GstSample;
287
288    //=========================================================================
289    // GstAppSrc
290    //=========================================================================
291    pub fn gst_app_src_get_type() -> GType;
292    pub fn gst_app_src_end_of_stream(appsrc: *mut GstAppSrc) -> gst::GstFlowReturn;
293    pub fn gst_app_src_get_caps(appsrc: *mut GstAppSrc) -> *mut gst::GstCaps;
294    #[cfg(feature = "v1_20")]
295    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
296    pub fn gst_app_src_get_current_level_buffers(appsrc: *mut GstAppSrc) -> u64;
297    pub fn gst_app_src_get_current_level_bytes(appsrc: *mut GstAppSrc) -> u64;
298    #[cfg(feature = "v1_20")]
299    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
300    pub fn gst_app_src_get_current_level_time(appsrc: *mut GstAppSrc) -> gst::GstClockTime;
301    pub fn gst_app_src_get_duration(appsrc: *mut GstAppSrc) -> gst::GstClockTime;
302    pub fn gst_app_src_get_emit_signals(appsrc: *mut GstAppSrc) -> gboolean;
303    pub fn gst_app_src_get_latency(appsrc: *mut GstAppSrc, min: *mut u64, max: *mut u64);
304    #[cfg(feature = "v1_20")]
305    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
306    pub fn gst_app_src_get_leaky_type(appsrc: *mut GstAppSrc) -> GstAppLeakyType;
307    #[cfg(feature = "v1_20")]
308    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
309    pub fn gst_app_src_get_max_buffers(appsrc: *mut GstAppSrc) -> u64;
310    pub fn gst_app_src_get_max_bytes(appsrc: *mut GstAppSrc) -> u64;
311    #[cfg(feature = "v1_20")]
312    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
313    pub fn gst_app_src_get_max_time(appsrc: *mut GstAppSrc) -> gst::GstClockTime;
314    pub fn gst_app_src_get_size(appsrc: *mut GstAppSrc) -> i64;
315    pub fn gst_app_src_get_stream_type(appsrc: *mut GstAppSrc) -> GstAppStreamType;
316    pub fn gst_app_src_push_buffer(
317        appsrc: *mut GstAppSrc,
318        buffer: *mut gst::GstBuffer,
319    ) -> gst::GstFlowReturn;
320    pub fn gst_app_src_push_buffer_list(
321        appsrc: *mut GstAppSrc,
322        buffer_list: *mut gst::GstBufferList,
323    ) -> gst::GstFlowReturn;
324    pub fn gst_app_src_push_sample(
325        appsrc: *mut GstAppSrc,
326        sample: *mut gst::GstSample,
327    ) -> gst::GstFlowReturn;
328    pub fn gst_app_src_set_callbacks(
329        appsrc: *mut GstAppSrc,
330        callbacks: *mut GstAppSrcCallbacks,
331        user_data: gpointer,
332        notify: glib::GDestroyNotify,
333    );
334    pub fn gst_app_src_set_caps(appsrc: *mut GstAppSrc, caps: *const gst::GstCaps);
335    pub fn gst_app_src_set_duration(appsrc: *mut GstAppSrc, duration: gst::GstClockTime);
336    pub fn gst_app_src_set_emit_signals(appsrc: *mut GstAppSrc, emit: gboolean);
337    pub fn gst_app_src_set_latency(appsrc: *mut GstAppSrc, min: u64, max: u64);
338    #[cfg(feature = "v1_20")]
339    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
340    pub fn gst_app_src_set_leaky_type(appsrc: *mut GstAppSrc, leaky: GstAppLeakyType);
341    #[cfg(feature = "v1_20")]
342    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
343    pub fn gst_app_src_set_max_buffers(appsrc: *mut GstAppSrc, max: u64);
344    pub fn gst_app_src_set_max_bytes(appsrc: *mut GstAppSrc, max: u64);
345    #[cfg(feature = "v1_20")]
346    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
347    pub fn gst_app_src_set_max_time(appsrc: *mut GstAppSrc, max: gst::GstClockTime);
348    pub fn gst_app_src_set_size(appsrc: *mut GstAppSrc, size: i64);
349    pub fn gst_app_src_set_stream_type(appsrc: *mut GstAppSrc, type_: GstAppStreamType);
350
351}