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 | use glib::translate::*; |
7 | |
8 | glib::wrapper! { |
9 | #[derive (Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] |
10 | pub struct AudioStreamAlign(Boxed<ffi::GstAudioStreamAlign>); |
11 | |
12 | match fn { |
13 | copy => |ptr| ffi::gst_audio_stream_align_copy(ptr), |
14 | free => |ptr| ffi::gst_audio_stream_align_free(ptr), |
15 | type_ => || ffi::gst_audio_stream_align_get_type(), |
16 | } |
17 | } |
18 | |
19 | impl AudioStreamAlign { |
20 | #[doc (alias = "gst_audio_stream_align_new" )] |
21 | pub fn new( |
22 | rate: i32, |
23 | alignment_threshold: gst::ClockTime, |
24 | discont_wait: gst::ClockTime, |
25 | ) -> AudioStreamAlign { |
26 | assert_initialized_main_thread!(); |
27 | unsafe { |
28 | from_glib_full(ffi::gst_audio_stream_align_new( |
29 | rate, |
30 | alignment_threshold.into_glib(), |
31 | discont_wait.into_glib(), |
32 | )) |
33 | } |
34 | } |
35 | |
36 | #[doc (alias = "gst_audio_stream_align_get_alignment_threshold" )] |
37 | #[doc (alias = "get_alignment_threshold" )] |
38 | pub fn alignment_threshold(&self) -> gst::ClockTime { |
39 | unsafe { |
40 | try_from_glib(ffi::gst_audio_stream_align_get_alignment_threshold( |
41 | self.to_glib_none().0, |
42 | )) |
43 | .expect("mandatory glib value is None" ) |
44 | } |
45 | } |
46 | |
47 | #[doc (alias = "gst_audio_stream_align_get_discont_wait" )] |
48 | #[doc (alias = "get_discont_wait" )] |
49 | pub fn discont_wait(&self) -> gst::ClockTime { |
50 | unsafe { |
51 | try_from_glib(ffi::gst_audio_stream_align_get_discont_wait( |
52 | self.to_glib_none().0, |
53 | )) |
54 | .expect("mandatory glib value is None" ) |
55 | } |
56 | } |
57 | |
58 | #[doc (alias = "gst_audio_stream_align_get_rate" )] |
59 | #[doc (alias = "get_rate" )] |
60 | pub fn rate(&self) -> i32 { |
61 | unsafe { ffi::gst_audio_stream_align_get_rate(self.to_glib_none().0) } |
62 | } |
63 | |
64 | #[doc (alias = "gst_audio_stream_align_get_samples_since_discont" )] |
65 | #[doc (alias = "get_samples_since_discont" )] |
66 | pub fn samples_since_discont(&self) -> u64 { |
67 | unsafe { ffi::gst_audio_stream_align_get_samples_since_discont(self.to_glib_none().0) } |
68 | } |
69 | |
70 | #[doc (alias = "gst_audio_stream_align_get_timestamp_at_discont" )] |
71 | #[doc (alias = "get_timestamp_at_discont" )] |
72 | pub fn timestamp_at_discont(&self) -> Option<gst::ClockTime> { |
73 | unsafe { |
74 | from_glib(ffi::gst_audio_stream_align_get_timestamp_at_discont( |
75 | self.to_glib_none().0, |
76 | )) |
77 | } |
78 | } |
79 | |
80 | #[doc (alias = "gst_audio_stream_align_mark_discont" )] |
81 | pub fn mark_discont(&mut self) { |
82 | unsafe { |
83 | ffi::gst_audio_stream_align_mark_discont(self.to_glib_none_mut().0); |
84 | } |
85 | } |
86 | |
87 | #[doc (alias = "gst_audio_stream_align_set_alignment_threshold" )] |
88 | pub fn set_alignment_threshold(&mut self, alignment_threshold: gst::ClockTime) { |
89 | unsafe { |
90 | ffi::gst_audio_stream_align_set_alignment_threshold( |
91 | self.to_glib_none_mut().0, |
92 | alignment_threshold.into_glib(), |
93 | ); |
94 | } |
95 | } |
96 | |
97 | #[doc (alias = "gst_audio_stream_align_set_discont_wait" )] |
98 | pub fn set_discont_wait(&mut self, discont_wait: gst::ClockTime) { |
99 | unsafe { |
100 | ffi::gst_audio_stream_align_set_discont_wait( |
101 | self.to_glib_none_mut().0, |
102 | discont_wait.into_glib(), |
103 | ); |
104 | } |
105 | } |
106 | |
107 | #[doc (alias = "gst_audio_stream_align_set_rate" )] |
108 | pub fn set_rate(&mut self, rate: i32) { |
109 | unsafe { |
110 | ffi::gst_audio_stream_align_set_rate(self.to_glib_none_mut().0, rate); |
111 | } |
112 | } |
113 | } |
114 | |
115 | unsafe impl Send for AudioStreamAlign {} |
116 | unsafe impl Sync for AudioStreamAlign {} |
117 | |