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 glib::translate::*;
7use std::mem;
8
9glib::wrapper! {
10 #[doc(alias = "GstAdapter")]
11 pub struct Adapter(Object<ffi::GstAdapter, ffi::GstAdapterClass>);
12
13 match fn {
14 type_ => || ffi::gst_adapter_get_type(),
15 }
16}
17
18impl Adapter {
19 #[doc(alias = "gst_adapter_new")]
20 pub fn new() -> Adapter {
21 assert_initialized_main_thread!();
22 unsafe { from_glib_full(ffi::gst_adapter_new()) }
23 }
24
25 #[doc(alias = "gst_adapter_available")]
26 pub fn available(&self) -> usize {
27 unsafe { ffi::gst_adapter_available(self.to_glib_none().0) }
28 }
29
30 #[doc(alias = "gst_adapter_available_fast")]
31 pub fn available_fast(&self) -> usize {
32 unsafe { ffi::gst_adapter_available_fast(self.to_glib_none().0) }
33 }
34
35 #[doc(alias = "gst_adapter_clear")]
36 pub fn clear(&self) {
37 unsafe {
38 ffi::gst_adapter_clear(self.to_glib_none().0);
39 }
40 }
41
42 #[doc(alias = "gst_adapter_distance_from_discont")]
43 pub fn distance_from_discont(&self) -> u64 {
44 unsafe { ffi::gst_adapter_distance_from_discont(self.to_glib_none().0) }
45 }
46
47 #[doc(alias = "gst_adapter_dts_at_discont")]
48 pub fn dts_at_discont(&self) -> Option<gst::ClockTime> {
49 unsafe { from_glib(ffi::gst_adapter_dts_at_discont(self.to_glib_none().0)) }
50 }
51
52 #[doc(alias = "gst_adapter_offset_at_discont")]
53 pub fn offset_at_discont(&self) -> u64 {
54 unsafe { ffi::gst_adapter_offset_at_discont(self.to_glib_none().0) }
55 }
56
57 #[doc(alias = "gst_adapter_prev_dts")]
58 pub fn prev_dts(&self) -> (Option<gst::ClockTime>, u64) {
59 unsafe {
60 let mut distance = mem::MaybeUninit::uninit();
61 let ret = from_glib(ffi::gst_adapter_prev_dts(
62 self.to_glib_none().0,
63 distance.as_mut_ptr(),
64 ));
65 (ret, distance.assume_init())
66 }
67 }
68
69 #[doc(alias = "gst_adapter_prev_dts_at_offset")]
70 pub fn prev_dts_at_offset(&self, offset: usize) -> (Option<gst::ClockTime>, u64) {
71 unsafe {
72 let mut distance = mem::MaybeUninit::uninit();
73 let ret = from_glib(ffi::gst_adapter_prev_dts_at_offset(
74 self.to_glib_none().0,
75 offset,
76 distance.as_mut_ptr(),
77 ));
78 (ret, distance.assume_init())
79 }
80 }
81
82 #[doc(alias = "gst_adapter_prev_offset")]
83 pub fn prev_offset(&self) -> (u64, u64) {
84 unsafe {
85 let mut distance = mem::MaybeUninit::uninit();
86 let ret = ffi::gst_adapter_prev_offset(self.to_glib_none().0, distance.as_mut_ptr());
87 (ret, distance.assume_init())
88 }
89 }
90
91 #[doc(alias = "gst_adapter_prev_pts")]
92 pub fn prev_pts(&self) -> (Option<gst::ClockTime>, u64) {
93 unsafe {
94 let mut distance = mem::MaybeUninit::uninit();
95 let ret = from_glib(ffi::gst_adapter_prev_pts(
96 self.to_glib_none().0,
97 distance.as_mut_ptr(),
98 ));
99 (ret, distance.assume_init())
100 }
101 }
102
103 #[doc(alias = "gst_adapter_prev_pts_at_offset")]
104 pub fn prev_pts_at_offset(&self, offset: usize) -> (Option<gst::ClockTime>, u64) {
105 unsafe {
106 let mut distance = mem::MaybeUninit::uninit();
107 let ret = from_glib(ffi::gst_adapter_prev_pts_at_offset(
108 self.to_glib_none().0,
109 offset,
110 distance.as_mut_ptr(),
111 ));
112 (ret, distance.assume_init())
113 }
114 }
115
116 #[doc(alias = "gst_adapter_pts_at_discont")]
117 pub fn pts_at_discont(&self) -> Option<gst::ClockTime> {
118 unsafe { from_glib(ffi::gst_adapter_pts_at_discont(self.to_glib_none().0)) }
119 }
120}
121
122impl Default for Adapter {
123 fn default() -> Self {
124 Self::new()
125 }
126}
127