x42ltc_sys/
bindings.rs

1/* automatically generated by rust-bindgen 0.69.1 */
2
3#[repr(C)]
4#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
5pub struct __BindgenBitfieldUnit<Storage> {
6    storage: Storage,
7}
8impl<Storage> __BindgenBitfieldUnit<Storage> {
9    #[inline]
10    pub const fn new(storage: Storage) -> Self {
11        Self { storage }
12    }
13}
14impl<Storage> __BindgenBitfieldUnit<Storage>
15where
16    Storage: AsRef<[u8]> + AsMut<[u8]>,
17{
18    #[inline]
19    pub fn get_bit(&self, index: usize) -> bool {
20        debug_assert!(index / 8 < self.storage.as_ref().len());
21        let byte_index = index / 8;
22        let byte = self.storage.as_ref()[byte_index];
23        let bit_index = if cfg!(target_endian = "big") {
24            7 - (index % 8)
25        } else {
26            index % 8
27        };
28        let mask = 1 << bit_index;
29        byte & mask == mask
30    }
31    #[inline]
32    pub fn set_bit(&mut self, index: usize, val: bool) {
33        debug_assert!(index / 8 < self.storage.as_ref().len());
34        let byte_index = index / 8;
35        let byte = &mut self.storage.as_mut()[byte_index];
36        let bit_index = if cfg!(target_endian = "big") {
37            7 - (index % 8)
38        } else {
39            index % 8
40        };
41        let mask = 1 << bit_index;
42        if val {
43            *byte |= mask;
44        } else {
45            *byte &= !mask;
46        }
47    }
48    #[inline]
49    pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
50        debug_assert!(bit_width <= 64);
51        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
52        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
53        let mut val = 0;
54        for i in 0..(bit_width as usize) {
55            if self.get_bit(i + bit_offset) {
56                let index = if cfg!(target_endian = "big") {
57                    bit_width as usize - 1 - i
58                } else {
59                    i
60                };
61                val |= 1 << index;
62            }
63        }
64        val
65    }
66    #[inline]
67    pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
68        debug_assert!(bit_width <= 64);
69        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
70        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
71        for i in 0..(bit_width as usize) {
72            let mask = 1 << i;
73            let val_bit_is_set = val & mask == mask;
74            let index = if cfg!(target_endian = "big") {
75                bit_width as usize - 1 - i
76            } else {
77                i
78            };
79            self.set_bit(index + bit_offset, val_bit_is_set);
80        }
81    }
82}
83pub const LTC_H: u32 = 1;
84pub const LIBLTC_VERSION: &[u8; 6] = b"1.3.2\0";
85pub const LIBLTC_VERSION_MAJOR: u32 = 1;
86pub const LIBLTC_VERSION_MINOR: u32 = 3;
87pub const LIBLTC_VERSION_MICRO: u32 = 2;
88pub const LIBLTC_CUR: u32 = 13;
89pub const LIBLTC_REV: u32 = 0;
90pub const LIBLTC_AGE: u32 = 2;
91pub const LTC_FRAME_BIT_COUNT: u32 = 80;
92pub type wchar_t = ::std::os::raw::c_int;
93#[repr(C)]
94#[repr(align(16))]
95#[derive(Debug, Default, Copy, Clone)]
96pub struct max_align_t {
97    pub __clang_max_align_nonce1: ::std::os::raw::c_longlong,
98    pub __bindgen_padding_0: u64,
99    pub __clang_max_align_nonce2: u128,
100}
101#[test]
102fn bindgen_test_layout_max_align_t() {
103    const UNINIT: ::std::mem::MaybeUninit<max_align_t> = ::std::mem::MaybeUninit::uninit();
104    let ptr = UNINIT.as_ptr();
105    assert_eq!(
106        ::std::mem::size_of::<max_align_t>(),
107        32usize,
108        concat!("Size of: ", stringify!(max_align_t))
109    );
110    assert_eq!(
111        ::std::mem::align_of::<max_align_t>(),
112        16usize,
113        concat!("Alignment of ", stringify!(max_align_t))
114    );
115    assert_eq!(
116        unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce1) as usize - ptr as usize },
117        0usize,
118        concat!(
119            "Offset of field: ",
120            stringify!(max_align_t),
121            "::",
122            stringify!(__clang_max_align_nonce1)
123        )
124    );
125    assert_eq!(
126        unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce2) as usize - ptr as usize },
127        16usize,
128        concat!(
129            "Offset of field: ",
130            stringify!(max_align_t),
131            "::",
132            stringify!(__clang_max_align_nonce2)
133        )
134    );
135}
136#[doc = " default audio sample type: 8bit unsigned (mono)"]
137pub type ltcsnd_sample_t = ::std::os::raw::c_uchar;
138#[doc = " sample-count offset - 64bit wide"]
139pub type ltc_off_t = ::std::os::raw::c_longlong;
140#[repr(C)]
141#[repr(align(4))]
142#[derive(Debug, Default, Copy, Clone)]
143pub struct LTCFrame {
144    pub _bitfield_align_1: [u16; 0],
145    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 10usize]>,
146    pub __bindgen_padding_0: u16,
147}
148#[test]
149fn bindgen_test_layout_LTCFrame() {
150    assert_eq!(
151        ::std::mem::size_of::<LTCFrame>(),
152        12usize,
153        concat!("Size of: ", stringify!(LTCFrame))
154    );
155    assert_eq!(
156        ::std::mem::align_of::<LTCFrame>(),
157        4usize,
158        concat!("Alignment of ", stringify!(LTCFrame))
159    );
160}
161impl LTCFrame {
162    #[inline]
163    pub fn frame_units(&self) -> ::std::os::raw::c_uint {
164        unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u32) }
165    }
166    #[inline]
167    pub fn set_frame_units(&mut self, val: ::std::os::raw::c_uint) {
168        unsafe {
169            let val: u32 = ::std::mem::transmute(val);
170            self._bitfield_1.set(0usize, 4u8, val as u64)
171        }
172    }
173    #[inline]
174    pub fn user1(&self) -> ::std::os::raw::c_uint {
175        unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u32) }
176    }
177    #[inline]
178    pub fn set_user1(&mut self, val: ::std::os::raw::c_uint) {
179        unsafe {
180            let val: u32 = ::std::mem::transmute(val);
181            self._bitfield_1.set(4usize, 4u8, val as u64)
182        }
183    }
184    #[inline]
185    pub fn frame_tens(&self) -> ::std::os::raw::c_uint {
186        unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 2u8) as u32) }
187    }
188    #[inline]
189    pub fn set_frame_tens(&mut self, val: ::std::os::raw::c_uint) {
190        unsafe {
191            let val: u32 = ::std::mem::transmute(val);
192            self._bitfield_1.set(8usize, 2u8, val as u64)
193        }
194    }
195    #[inline]
196    pub fn dfbit(&self) -> ::std::os::raw::c_uint {
197        unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u32) }
198    }
199    #[inline]
200    pub fn set_dfbit(&mut self, val: ::std::os::raw::c_uint) {
201        unsafe {
202            let val: u32 = ::std::mem::transmute(val);
203            self._bitfield_1.set(10usize, 1u8, val as u64)
204        }
205    }
206    #[inline]
207    pub fn col_frame(&self) -> ::std::os::raw::c_uint {
208        unsafe { ::std::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u32) }
209    }
210    #[inline]
211    pub fn set_col_frame(&mut self, val: ::std::os::raw::c_uint) {
212        unsafe {
213            let val: u32 = ::std::mem::transmute(val);
214            self._bitfield_1.set(11usize, 1u8, val as u64)
215        }
216    }
217    #[inline]
218    pub fn user2(&self) -> ::std::os::raw::c_uint {
219        unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 4u8) as u32) }
220    }
221    #[inline]
222    pub fn set_user2(&mut self, val: ::std::os::raw::c_uint) {
223        unsafe {
224            let val: u32 = ::std::mem::transmute(val);
225            self._bitfield_1.set(12usize, 4u8, val as u64)
226        }
227    }
228    #[inline]
229    pub fn secs_units(&self) -> ::std::os::raw::c_uint {
230        unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 4u8) as u32) }
231    }
232    #[inline]
233    pub fn set_secs_units(&mut self, val: ::std::os::raw::c_uint) {
234        unsafe {
235            let val: u32 = ::std::mem::transmute(val);
236            self._bitfield_1.set(16usize, 4u8, val as u64)
237        }
238    }
239    #[inline]
240    pub fn user3(&self) -> ::std::os::raw::c_uint {
241        unsafe { ::std::mem::transmute(self._bitfield_1.get(20usize, 4u8) as u32) }
242    }
243    #[inline]
244    pub fn set_user3(&mut self, val: ::std::os::raw::c_uint) {
245        unsafe {
246            let val: u32 = ::std::mem::transmute(val);
247            self._bitfield_1.set(20usize, 4u8, val as u64)
248        }
249    }
250    #[inline]
251    pub fn secs_tens(&self) -> ::std::os::raw::c_uint {
252        unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 3u8) as u32) }
253    }
254    #[inline]
255    pub fn set_secs_tens(&mut self, val: ::std::os::raw::c_uint) {
256        unsafe {
257            let val: u32 = ::std::mem::transmute(val);
258            self._bitfield_1.set(24usize, 3u8, val as u64)
259        }
260    }
261    #[inline]
262    pub fn biphase_mark_phase_correction(&self) -> ::std::os::raw::c_uint {
263        unsafe { ::std::mem::transmute(self._bitfield_1.get(27usize, 1u8) as u32) }
264    }
265    #[inline]
266    pub fn set_biphase_mark_phase_correction(&mut self, val: ::std::os::raw::c_uint) {
267        unsafe {
268            let val: u32 = ::std::mem::transmute(val);
269            self._bitfield_1.set(27usize, 1u8, val as u64)
270        }
271    }
272    #[inline]
273    pub fn user4(&self) -> ::std::os::raw::c_uint {
274        unsafe { ::std::mem::transmute(self._bitfield_1.get(28usize, 4u8) as u32) }
275    }
276    #[inline]
277    pub fn set_user4(&mut self, val: ::std::os::raw::c_uint) {
278        unsafe {
279            let val: u32 = ::std::mem::transmute(val);
280            self._bitfield_1.set(28usize, 4u8, val as u64)
281        }
282    }
283    #[inline]
284    pub fn mins_units(&self) -> ::std::os::raw::c_uint {
285        unsafe { ::std::mem::transmute(self._bitfield_1.get(32usize, 4u8) as u32) }
286    }
287    #[inline]
288    pub fn set_mins_units(&mut self, val: ::std::os::raw::c_uint) {
289        unsafe {
290            let val: u32 = ::std::mem::transmute(val);
291            self._bitfield_1.set(32usize, 4u8, val as u64)
292        }
293    }
294    #[inline]
295    pub fn user5(&self) -> ::std::os::raw::c_uint {
296        unsafe { ::std::mem::transmute(self._bitfield_1.get(36usize, 4u8) as u32) }
297    }
298    #[inline]
299    pub fn set_user5(&mut self, val: ::std::os::raw::c_uint) {
300        unsafe {
301            let val: u32 = ::std::mem::transmute(val);
302            self._bitfield_1.set(36usize, 4u8, val as u64)
303        }
304    }
305    #[inline]
306    pub fn mins_tens(&self) -> ::std::os::raw::c_uint {
307        unsafe { ::std::mem::transmute(self._bitfield_1.get(40usize, 3u8) as u32) }
308    }
309    #[inline]
310    pub fn set_mins_tens(&mut self, val: ::std::os::raw::c_uint) {
311        unsafe {
312            let val: u32 = ::std::mem::transmute(val);
313            self._bitfield_1.set(40usize, 3u8, val as u64)
314        }
315    }
316    #[inline]
317    pub fn binary_group_flag_bit0(&self) -> ::std::os::raw::c_uint {
318        unsafe { ::std::mem::transmute(self._bitfield_1.get(43usize, 1u8) as u32) }
319    }
320    #[inline]
321    pub fn set_binary_group_flag_bit0(&mut self, val: ::std::os::raw::c_uint) {
322        unsafe {
323            let val: u32 = ::std::mem::transmute(val);
324            self._bitfield_1.set(43usize, 1u8, val as u64)
325        }
326    }
327    #[inline]
328    pub fn user6(&self) -> ::std::os::raw::c_uint {
329        unsafe { ::std::mem::transmute(self._bitfield_1.get(44usize, 4u8) as u32) }
330    }
331    #[inline]
332    pub fn set_user6(&mut self, val: ::std::os::raw::c_uint) {
333        unsafe {
334            let val: u32 = ::std::mem::transmute(val);
335            self._bitfield_1.set(44usize, 4u8, val as u64)
336        }
337    }
338    #[inline]
339    pub fn hours_units(&self) -> ::std::os::raw::c_uint {
340        unsafe { ::std::mem::transmute(self._bitfield_1.get(48usize, 4u8) as u32) }
341    }
342    #[inline]
343    pub fn set_hours_units(&mut self, val: ::std::os::raw::c_uint) {
344        unsafe {
345            let val: u32 = ::std::mem::transmute(val);
346            self._bitfield_1.set(48usize, 4u8, val as u64)
347        }
348    }
349    #[inline]
350    pub fn user7(&self) -> ::std::os::raw::c_uint {
351        unsafe { ::std::mem::transmute(self._bitfield_1.get(52usize, 4u8) as u32) }
352    }
353    #[inline]
354    pub fn set_user7(&mut self, val: ::std::os::raw::c_uint) {
355        unsafe {
356            let val: u32 = ::std::mem::transmute(val);
357            self._bitfield_1.set(52usize, 4u8, val as u64)
358        }
359    }
360    #[inline]
361    pub fn hours_tens(&self) -> ::std::os::raw::c_uint {
362        unsafe { ::std::mem::transmute(self._bitfield_1.get(56usize, 2u8) as u32) }
363    }
364    #[inline]
365    pub fn set_hours_tens(&mut self, val: ::std::os::raw::c_uint) {
366        unsafe {
367            let val: u32 = ::std::mem::transmute(val);
368            self._bitfield_1.set(56usize, 2u8, val as u64)
369        }
370    }
371    #[inline]
372    pub fn binary_group_flag_bit1(&self) -> ::std::os::raw::c_uint {
373        unsafe { ::std::mem::transmute(self._bitfield_1.get(58usize, 1u8) as u32) }
374    }
375    #[inline]
376    pub fn set_binary_group_flag_bit1(&mut self, val: ::std::os::raw::c_uint) {
377        unsafe {
378            let val: u32 = ::std::mem::transmute(val);
379            self._bitfield_1.set(58usize, 1u8, val as u64)
380        }
381    }
382    #[inline]
383    pub fn binary_group_flag_bit2(&self) -> ::std::os::raw::c_uint {
384        unsafe { ::std::mem::transmute(self._bitfield_1.get(59usize, 1u8) as u32) }
385    }
386    #[inline]
387    pub fn set_binary_group_flag_bit2(&mut self, val: ::std::os::raw::c_uint) {
388        unsafe {
389            let val: u32 = ::std::mem::transmute(val);
390            self._bitfield_1.set(59usize, 1u8, val as u64)
391        }
392    }
393    #[inline]
394    pub fn user8(&self) -> ::std::os::raw::c_uint {
395        unsafe { ::std::mem::transmute(self._bitfield_1.get(60usize, 4u8) as u32) }
396    }
397    #[inline]
398    pub fn set_user8(&mut self, val: ::std::os::raw::c_uint) {
399        unsafe {
400            let val: u32 = ::std::mem::transmute(val);
401            self._bitfield_1.set(60usize, 4u8, val as u64)
402        }
403    }
404    #[inline]
405    pub fn sync_word(&self) -> ::std::os::raw::c_uint {
406        unsafe { ::std::mem::transmute(self._bitfield_1.get(64usize, 16u8) as u32) }
407    }
408    #[inline]
409    pub fn set_sync_word(&mut self, val: ::std::os::raw::c_uint) {
410        unsafe {
411            let val: u32 = ::std::mem::transmute(val);
412            self._bitfield_1.set(64usize, 16u8, val as u64)
413        }
414    }
415    #[inline]
416    pub fn new_bitfield_1(
417        frame_units: ::std::os::raw::c_uint,
418        user1: ::std::os::raw::c_uint,
419        frame_tens: ::std::os::raw::c_uint,
420        dfbit: ::std::os::raw::c_uint,
421        col_frame: ::std::os::raw::c_uint,
422        user2: ::std::os::raw::c_uint,
423        secs_units: ::std::os::raw::c_uint,
424        user3: ::std::os::raw::c_uint,
425        secs_tens: ::std::os::raw::c_uint,
426        biphase_mark_phase_correction: ::std::os::raw::c_uint,
427        user4: ::std::os::raw::c_uint,
428        mins_units: ::std::os::raw::c_uint,
429        user5: ::std::os::raw::c_uint,
430        mins_tens: ::std::os::raw::c_uint,
431        binary_group_flag_bit0: ::std::os::raw::c_uint,
432        user6: ::std::os::raw::c_uint,
433        hours_units: ::std::os::raw::c_uint,
434        user7: ::std::os::raw::c_uint,
435        hours_tens: ::std::os::raw::c_uint,
436        binary_group_flag_bit1: ::std::os::raw::c_uint,
437        binary_group_flag_bit2: ::std::os::raw::c_uint,
438        user8: ::std::os::raw::c_uint,
439        sync_word: ::std::os::raw::c_uint,
440    ) -> __BindgenBitfieldUnit<[u8; 10usize]> {
441        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 10usize]> = Default::default();
442        __bindgen_bitfield_unit.set(0usize, 4u8, {
443            let frame_units: u32 = unsafe { ::std::mem::transmute(frame_units) };
444            frame_units as u64
445        });
446        __bindgen_bitfield_unit.set(4usize, 4u8, {
447            let user1: u32 = unsafe { ::std::mem::transmute(user1) };
448            user1 as u64
449        });
450        __bindgen_bitfield_unit.set(8usize, 2u8, {
451            let frame_tens: u32 = unsafe { ::std::mem::transmute(frame_tens) };
452            frame_tens as u64
453        });
454        __bindgen_bitfield_unit.set(10usize, 1u8, {
455            let dfbit: u32 = unsafe { ::std::mem::transmute(dfbit) };
456            dfbit as u64
457        });
458        __bindgen_bitfield_unit.set(11usize, 1u8, {
459            let col_frame: u32 = unsafe { ::std::mem::transmute(col_frame) };
460            col_frame as u64
461        });
462        __bindgen_bitfield_unit.set(12usize, 4u8, {
463            let user2: u32 = unsafe { ::std::mem::transmute(user2) };
464            user2 as u64
465        });
466        __bindgen_bitfield_unit.set(16usize, 4u8, {
467            let secs_units: u32 = unsafe { ::std::mem::transmute(secs_units) };
468            secs_units as u64
469        });
470        __bindgen_bitfield_unit.set(20usize, 4u8, {
471            let user3: u32 = unsafe { ::std::mem::transmute(user3) };
472            user3 as u64
473        });
474        __bindgen_bitfield_unit.set(24usize, 3u8, {
475            let secs_tens: u32 = unsafe { ::std::mem::transmute(secs_tens) };
476            secs_tens as u64
477        });
478        __bindgen_bitfield_unit.set(27usize, 1u8, {
479            let biphase_mark_phase_correction: u32 =
480                unsafe { ::std::mem::transmute(biphase_mark_phase_correction) };
481            biphase_mark_phase_correction as u64
482        });
483        __bindgen_bitfield_unit.set(28usize, 4u8, {
484            let user4: u32 = unsafe { ::std::mem::transmute(user4) };
485            user4 as u64
486        });
487        __bindgen_bitfield_unit.set(32usize, 4u8, {
488            let mins_units: u32 = unsafe { ::std::mem::transmute(mins_units) };
489            mins_units as u64
490        });
491        __bindgen_bitfield_unit.set(36usize, 4u8, {
492            let user5: u32 = unsafe { ::std::mem::transmute(user5) };
493            user5 as u64
494        });
495        __bindgen_bitfield_unit.set(40usize, 3u8, {
496            let mins_tens: u32 = unsafe { ::std::mem::transmute(mins_tens) };
497            mins_tens as u64
498        });
499        __bindgen_bitfield_unit.set(43usize, 1u8, {
500            let binary_group_flag_bit0: u32 =
501                unsafe { ::std::mem::transmute(binary_group_flag_bit0) };
502            binary_group_flag_bit0 as u64
503        });
504        __bindgen_bitfield_unit.set(44usize, 4u8, {
505            let user6: u32 = unsafe { ::std::mem::transmute(user6) };
506            user6 as u64
507        });
508        __bindgen_bitfield_unit.set(48usize, 4u8, {
509            let hours_units: u32 = unsafe { ::std::mem::transmute(hours_units) };
510            hours_units as u64
511        });
512        __bindgen_bitfield_unit.set(52usize, 4u8, {
513            let user7: u32 = unsafe { ::std::mem::transmute(user7) };
514            user7 as u64
515        });
516        __bindgen_bitfield_unit.set(56usize, 2u8, {
517            let hours_tens: u32 = unsafe { ::std::mem::transmute(hours_tens) };
518            hours_tens as u64
519        });
520        __bindgen_bitfield_unit.set(58usize, 1u8, {
521            let binary_group_flag_bit1: u32 =
522                unsafe { ::std::mem::transmute(binary_group_flag_bit1) };
523            binary_group_flag_bit1 as u64
524        });
525        __bindgen_bitfield_unit.set(59usize, 1u8, {
526            let binary_group_flag_bit2: u32 =
527                unsafe { ::std::mem::transmute(binary_group_flag_bit2) };
528            binary_group_flag_bit2 as u64
529        });
530        __bindgen_bitfield_unit.set(60usize, 4u8, {
531            let user8: u32 = unsafe { ::std::mem::transmute(user8) };
532            user8 as u64
533        });
534        __bindgen_bitfield_unit.set(64usize, 16u8, {
535            let sync_word: u32 = unsafe { ::std::mem::transmute(sync_word) };
536            sync_word as u64
537        });
538        __bindgen_bitfield_unit
539    }
540}
541#[doc = "< 30fps"]
542pub const LTC_TV_STANDARD_LTC_TV_525_60: LTC_TV_STANDARD = 0;
543#[doc = "< 25fps"]
544pub const LTC_TV_STANDARD_LTC_TV_625_50: LTC_TV_STANDARD = 1;
545#[doc = "< 30fps"]
546pub const LTC_TV_STANDARD_LTC_TV_1125_60: LTC_TV_STANDARD = 2;
547#[doc = "< 24fps"]
548pub const LTC_TV_STANDARD_LTC_TV_FILM_24: LTC_TV_STANDARD = 3;
549#[doc = " the standard defines the assignment of the binary-group-flag bits\n basically only 25fps is different, but other standards defined in\n the SMPTE spec have been included for completeness."]
550pub type LTC_TV_STANDARD = ::std::os::raw::c_uint;
551#[doc = "< LTCFrame <> SMPTETimecode converter and LTCFrame increment/decrement use date, also set BGF2 to '1' when encoder is initialized or re-initialized (unless LTC_BGF_DONT_TOUCH is given)"]
552pub const LTC_BG_FLAGS_LTC_USE_DATE: LTC_BG_FLAGS = 1;
553#[doc = "< the Timecode is wall-clock aka freerun. This also sets BGF1 (unless LTC_BGF_DONT_TOUCH is given)"]
554pub const LTC_BG_FLAGS_LTC_TC_CLOCK: LTC_BG_FLAGS = 2;
555#[doc = "< encoder init or re-init does not touch the BGF bits (initial values after initialization is zero)"]
556pub const LTC_BG_FLAGS_LTC_BGF_DONT_TOUCH: LTC_BG_FLAGS = 4;
557#[doc = "< parity bit is left untouched when setting or in/decrementing the encoder frame-number"]
558pub const LTC_BG_FLAGS_LTC_NO_PARITY: LTC_BG_FLAGS = 8;
559#[doc = " encoder and LTCframe <> timecode operation flags"]
560pub type LTC_BG_FLAGS = ::std::os::raw::c_uint;
561#[doc = " Extended LTC frame - includes audio-sample position offsets, volume, etc\n\n Note: For TV systems, the sample in the LTC audio data stream where the LTC Frame starts is not necessarily at the same time\n as the video-frame which is described by the LTC Frame.\n\n \\ref off_start denotes the time of the first transition of bit 0 in the LTC frame.\n\n For 525/60 Television systems, the first transition shall occur at the beginning of line 5 of the frame with which it is\n associated. The tolerance is ± 1.5 lines.\n\n For 625/50 systems, the first transition shall occur at the beginning of line 2  ± 1.5 lines of the frame with which it is associated.\n\n Only for 1125/60 systems, the first transition occurs exactly at the vertical sync timing reference of the frame. ± 1 line.\n"]
562#[repr(C)]
563#[derive(Debug, Copy, Clone)]
564pub struct LTCFrameExt {
565    #[doc = "< the actual LTC frame. see \\ref LTCFrame"]
566    pub ltc: LTCFrame,
567    #[doc = "< \\anchor off_start the approximate sample in the stream corresponding to the start of the LTC frame."]
568    pub off_start: ltc_off_t,
569    #[doc = "< \\anchor off_end the sample in the stream corresponding to the end of the LTC frame."]
570    pub off_end: ltc_off_t,
571    #[doc = "< if non-zero, a reverse played LTC frame was detected. Since the frame was reversed, it started at off_end and finishes as off_start (off_end > off_start). (Note: in reverse playback the (reversed) sync-word of the next/previous frame is detected, this offset is corrected)."]
572    pub reverse: ::std::os::raw::c_int,
573    #[doc = "< detailed timing info: phase of the LTC signal; the time between each bit in the LTC-frame in audio-frames. Summing all 80 values in the array will yield audio-frames/LTC-frame = (\\ref off_end - \\ref off_start + 1)."]
574    pub biphase_tics: [f32; 80usize],
575    #[doc = "< the minimum input sample signal for this frame (0..255)"]
576    pub sample_min: ltcsnd_sample_t,
577    #[doc = "< the maximum input sample signal for this frame (0..255)"]
578    pub sample_max: ltcsnd_sample_t,
579    #[doc = "< the volume of the input signal in dbFS"]
580    pub volume: f64,
581}
582#[test]
583fn bindgen_test_layout_LTCFrameExt() {
584    const UNINIT: ::std::mem::MaybeUninit<LTCFrameExt> = ::std::mem::MaybeUninit::uninit();
585    let ptr = UNINIT.as_ptr();
586    assert_eq!(
587        ::std::mem::size_of::<LTCFrameExt>(),
588        368usize,
589        concat!("Size of: ", stringify!(LTCFrameExt))
590    );
591    assert_eq!(
592        ::std::mem::align_of::<LTCFrameExt>(),
593        8usize,
594        concat!("Alignment of ", stringify!(LTCFrameExt))
595    );
596    assert_eq!(
597        unsafe { ::std::ptr::addr_of!((*ptr).ltc) as usize - ptr as usize },
598        0usize,
599        concat!(
600            "Offset of field: ",
601            stringify!(LTCFrameExt),
602            "::",
603            stringify!(ltc)
604        )
605    );
606    assert_eq!(
607        unsafe { ::std::ptr::addr_of!((*ptr).off_start) as usize - ptr as usize },
608        16usize,
609        concat!(
610            "Offset of field: ",
611            stringify!(LTCFrameExt),
612            "::",
613            stringify!(off_start)
614        )
615    );
616    assert_eq!(
617        unsafe { ::std::ptr::addr_of!((*ptr).off_end) as usize - ptr as usize },
618        24usize,
619        concat!(
620            "Offset of field: ",
621            stringify!(LTCFrameExt),
622            "::",
623            stringify!(off_end)
624        )
625    );
626    assert_eq!(
627        unsafe { ::std::ptr::addr_of!((*ptr).reverse) as usize - ptr as usize },
628        32usize,
629        concat!(
630            "Offset of field: ",
631            stringify!(LTCFrameExt),
632            "::",
633            stringify!(reverse)
634        )
635    );
636    assert_eq!(
637        unsafe { ::std::ptr::addr_of!((*ptr).biphase_tics) as usize - ptr as usize },
638        36usize,
639        concat!(
640            "Offset of field: ",
641            stringify!(LTCFrameExt),
642            "::",
643            stringify!(biphase_tics)
644        )
645    );
646    assert_eq!(
647        unsafe { ::std::ptr::addr_of!((*ptr).sample_min) as usize - ptr as usize },
648        356usize,
649        concat!(
650            "Offset of field: ",
651            stringify!(LTCFrameExt),
652            "::",
653            stringify!(sample_min)
654        )
655    );
656    assert_eq!(
657        unsafe { ::std::ptr::addr_of!((*ptr).sample_max) as usize - ptr as usize },
658        357usize,
659        concat!(
660            "Offset of field: ",
661            stringify!(LTCFrameExt),
662            "::",
663            stringify!(sample_max)
664        )
665    );
666    assert_eq!(
667        unsafe { ::std::ptr::addr_of!((*ptr).volume) as usize - ptr as usize },
668        360usize,
669        concat!(
670            "Offset of field: ",
671            stringify!(LTCFrameExt),
672            "::",
673            stringify!(volume)
674        )
675    );
676}
677impl Default for LTCFrameExt {
678    fn default() -> Self {
679        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
680        unsafe {
681            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
682            s.assume_init()
683        }
684    }
685}
686#[doc = " Human readable time representation, decimal values."]
687#[repr(C)]
688#[derive(Debug, Default, Copy, Clone)]
689pub struct SMPTETimecode {
690    #[doc = "< the timezone 6bytes: \"+HHMM\" textual representation"]
691    pub timezone: [::std::os::raw::c_char; 6usize],
692    #[doc = "< LTC-date uses 2-digit year 00.99"]
693    pub years: ::std::os::raw::c_uchar,
694    #[doc = "< valid months are 1..12"]
695    pub months: ::std::os::raw::c_uchar,
696    #[doc = "< day of month 1..31"]
697    pub days: ::std::os::raw::c_uchar,
698    #[doc = "< hour 0..23"]
699    pub hours: ::std::os::raw::c_uchar,
700    #[doc = "< minute 0..60"]
701    pub mins: ::std::os::raw::c_uchar,
702    #[doc = "< second 0..60"]
703    pub secs: ::std::os::raw::c_uchar,
704    #[doc = "< sub-second frame 0..(FPS - 1)"]
705    pub frame: ::std::os::raw::c_uchar,
706}
707#[test]
708fn bindgen_test_layout_SMPTETimecode() {
709    const UNINIT: ::std::mem::MaybeUninit<SMPTETimecode> = ::std::mem::MaybeUninit::uninit();
710    let ptr = UNINIT.as_ptr();
711    assert_eq!(
712        ::std::mem::size_of::<SMPTETimecode>(),
713        13usize,
714        concat!("Size of: ", stringify!(SMPTETimecode))
715    );
716    assert_eq!(
717        ::std::mem::align_of::<SMPTETimecode>(),
718        1usize,
719        concat!("Alignment of ", stringify!(SMPTETimecode))
720    );
721    assert_eq!(
722        unsafe { ::std::ptr::addr_of!((*ptr).timezone) as usize - ptr as usize },
723        0usize,
724        concat!(
725            "Offset of field: ",
726            stringify!(SMPTETimecode),
727            "::",
728            stringify!(timezone)
729        )
730    );
731    assert_eq!(
732        unsafe { ::std::ptr::addr_of!((*ptr).years) as usize - ptr as usize },
733        6usize,
734        concat!(
735            "Offset of field: ",
736            stringify!(SMPTETimecode),
737            "::",
738            stringify!(years)
739        )
740    );
741    assert_eq!(
742        unsafe { ::std::ptr::addr_of!((*ptr).months) as usize - ptr as usize },
743        7usize,
744        concat!(
745            "Offset of field: ",
746            stringify!(SMPTETimecode),
747            "::",
748            stringify!(months)
749        )
750    );
751    assert_eq!(
752        unsafe { ::std::ptr::addr_of!((*ptr).days) as usize - ptr as usize },
753        8usize,
754        concat!(
755            "Offset of field: ",
756            stringify!(SMPTETimecode),
757            "::",
758            stringify!(days)
759        )
760    );
761    assert_eq!(
762        unsafe { ::std::ptr::addr_of!((*ptr).hours) as usize - ptr as usize },
763        9usize,
764        concat!(
765            "Offset of field: ",
766            stringify!(SMPTETimecode),
767            "::",
768            stringify!(hours)
769        )
770    );
771    assert_eq!(
772        unsafe { ::std::ptr::addr_of!((*ptr).mins) as usize - ptr as usize },
773        10usize,
774        concat!(
775            "Offset of field: ",
776            stringify!(SMPTETimecode),
777            "::",
778            stringify!(mins)
779        )
780    );
781    assert_eq!(
782        unsafe { ::std::ptr::addr_of!((*ptr).secs) as usize - ptr as usize },
783        11usize,
784        concat!(
785            "Offset of field: ",
786            stringify!(SMPTETimecode),
787            "::",
788            stringify!(secs)
789        )
790    );
791    assert_eq!(
792        unsafe { ::std::ptr::addr_of!((*ptr).frame) as usize - ptr as usize },
793        12usize,
794        concat!(
795            "Offset of field: ",
796            stringify!(SMPTETimecode),
797            "::",
798            stringify!(frame)
799        )
800    );
801}
802#[repr(C)]
803#[derive(Debug, Copy, Clone)]
804pub struct LTCDecoder {
805    _unused: [u8; 0],
806}
807#[repr(C)]
808#[derive(Debug, Copy, Clone)]
809pub struct LTCEncoder {
810    _unused: [u8; 0],
811}
812extern "C" {
813    #[doc = " Convert binary LTCFrame into SMPTETimecode struct\n\n @param stime output\n @param frame input\n @param flags binary combination of \\ref LTC_BG_FLAGS - here only LTC_USE_DATE is relevant.\n if LTC_USE_DATE is set, the user-fields in LTCFrame will be parsed into the date variable of SMPTETimecode.\n otherwise the date information in the SMPTETimecode is set to zero."]
814    pub fn ltc_frame_to_time(
815        stime: *mut SMPTETimecode,
816        frame: *mut LTCFrame,
817        flags: ::std::os::raw::c_int,
818    );
819}
820extern "C" {
821    #[doc = " Translate SMPTETimecode struct into its binary LTC representation\n and set the LTC frame's parity bit accordingly (see \\ref ltc_frame_set_parity)\n\n @param frame output - the frame to be set\n @param stime input - timecode input\n @param standard the TV standard to use for parity bit assignment\n @param flags binary combination of \\ref LTC_BG_FLAGS - here only LTC_USE_DATE and LTC_NO_PARITY are relevant.\n if LTC_USE_DATE is given, user-fields in LTCFrame will be set from the date in SMPTETimecode,\n otherwise the user-bits are not modified. All non-timecode fields remain untouched - except for the parity bit\n unless LTC_NO_PARITY is given."]
822    pub fn ltc_time_to_frame(
823        frame: *mut LTCFrame,
824        stime: *mut SMPTETimecode,
825        standard: LTC_TV_STANDARD,
826        flags: ::std::os::raw::c_int,
827    );
828}
829extern "C" {
830    #[doc = " Reset all values of a LTC FRAME to zero, except for the sync-word (0x3FFD) at the end.\n The sync word is set according to architecture (big/little endian).\n Also set the Frame's parity bit accordingly (see \\ref ltc_frame_set_parity)\n @param frame the LTCFrame to reset"]
831    pub fn ltc_frame_reset(frame: *mut LTCFrame);
832}
833extern "C" {
834    #[doc = " Increment the timecode by one Frame (1/framerate seconds)\n and set the Frame's parity bit accordingly (see \\ref ltc_frame_set_parity)\n\n @param frame the LTC-timecode to increment\n @param fps integer framerate (for drop-frame-timecode set frame->dfbit and round-up the fps).\n @param standard the TV standard to use for parity bit assignment\n if set to 1 the 25fps standard is enabled and LTC Frame bit 59 instead of 27 is used for the parity. It only has only has effect flag bit 4 (LTC_NO_PARITY) is cleared.\n @param flags binary combination of \\ref LTC_BG_FLAGS - here only LTC_USE_DATE and LTC_NO_PARITY are relevant.\n If the bit 0 (1) is set (1) interpret user-data as date and increment date if timecode wraps after 24h.\n (Note: leap-years are taken into account, but since the year is two-digit only, the 100,400yr rules are ignored.\n \"00\" is assumed to be year 2000 which was a leap year.)\n @return 1 if timecode was wrapped around after 23:59:59:ff, 0 otherwise"]
835    pub fn ltc_frame_increment(
836        frame: *mut LTCFrame,
837        fps: ::std::os::raw::c_int,
838        standard: LTC_TV_STANDARD,
839        flags: ::std::os::raw::c_int,
840    ) -> ::std::os::raw::c_int;
841}
842extern "C" {
843    #[doc = " Decrement the timecode by one Frame (1/framerate seconds)\n and set the Frame's parity bit accordingly (see \\ref ltc_frame_set_parity)\n\n @param frame the LTC-timecode to decrement\n @param fps integer framerate (for drop-frame-timecode set frame->dfbit and round-up the fps).\n @param standard the TV standard to use for parity bit assignment\n if set to 1 the 25fps standard is enabled and LTC Frame bit 59 instead of 27 is used for the parity. It only has only has effect flag bit 4 (LTC_NO_PARITY) is cleared.\n @param flags binary combination of \\ref LTC_BG_FLAGS - here only LTC_USE_DATE and LTC_NO_PARITY are relevant.\n if the bit 0 is set (1) interpret user-data as date and decrement date if timecode wraps at 24h.\n (Note: leap-years are taken into account, but since the year is two-digit only, the 100,400yr rules are ignored.\n \"00\" is assumed to be year 2000 which was a leap year.)\n bit 3 (8) indicates that the parity bit should not be touched\n @return 1 if timecode was wrapped around at 23:59:59:ff, 0 otherwise"]
844    pub fn ltc_frame_decrement(
845        frame: *mut LTCFrame,
846        fps: ::std::os::raw::c_int,
847        standard: LTC_TV_STANDARD,
848        flags: ::std::os::raw::c_int,
849    ) -> ::std::os::raw::c_int;
850}
851extern "C" {
852    #[doc = " Create a new LTC decoder.\n\n @param apv audio-frames per video frame. This is just used for initial settings, the speed is tracked dynamically. setting this in the right ballpark is needed to properly decode the first LTC frame in a sequence.\n @param queue_size length of the internal queue to store decoded frames\n to SMPTEDecoderWrite.\n @return decoder handle or NULL if out-of-memory"]
853    pub fn ltc_decoder_create(
854        apv: ::std::os::raw::c_int,
855        queue_size: ::std::os::raw::c_int,
856    ) -> *mut LTCDecoder;
857}
858extern "C" {
859    #[doc = " Release memory of decoder.\n @param d decoder handle"]
860    pub fn ltc_decoder_free(d: *mut LTCDecoder) -> ::std::os::raw::c_int;
861}
862extern "C" {
863    #[doc = " Feed the LTC decoder with new audio samples.\n\n Parse raw audio for LTC timestamps. Once a complete LTC frame has been\n decoded it is pushed into a queue (\\ref ltc_decoder_read)\n\n @param d decoder handle\n @param buf pointer to ltcsnd_sample_t - unsigned 8 bit mono audio data\n @param size size number of samples to parse\n @param posinfo (optional, recommended) sample-offset in the audio-stream. It is added to \\ref off_start, \\ref off_end in \\ref LTCFrameExt and should be monotonic (ie incremented by \\p size for every call to ltc_decoder_write)"]
864    pub fn ltc_decoder_write(
865        d: *mut LTCDecoder,
866        buf: *mut ltcsnd_sample_t,
867        size: usize,
868        posinfo: ltc_off_t,
869    );
870}
871extern "C" {
872    #[doc = " Wrapper around \\ref ltc_decoder_write that accepts 64-bit floating point\n audio samples. Note: internally libltc uses 8 bit only.\n\n @param d decoder handle\n @param buf pointer to audio sample data\n @param size number of samples to parse\n @param posinfo (optional, recommended) sample-offset in the audio-stream."]
873    pub fn ltc_decoder_write_double(
874        d: *mut LTCDecoder,
875        buf: *mut f64,
876        size: usize,
877        posinfo: ltc_off_t,
878    );
879}
880extern "C" {
881    #[doc = " Wrapper around \\ref ltc_decoder_write that accepts 32-bit floating point\n audio samples. Note: internally libltc uses 8 bit only.\n\n @param d decoder handle\n @param buf pointer to audio sample data\n @param size number of samples to parse\n @param posinfo (optional, recommended) sample-offset in the audio-stream."]
882    pub fn ltc_decoder_write_float(
883        d: *mut LTCDecoder,
884        buf: *mut f32,
885        size: usize,
886        posinfo: ltc_off_t,
887    );
888}
889extern "C" {
890    #[doc = " Wrapper around \\ref ltc_decoder_write that accepts signed 16 bit\n audio samples. Note: internally libltc uses 8 bit only.\n\n @param d decoder handle\n @param buf pointer to audio sample data\n @param size number of samples to parse\n @param posinfo (optional, recommended) sample-offset in the audio-stream."]
891    pub fn ltc_decoder_write_s16(
892        d: *mut LTCDecoder,
893        buf: *mut ::std::os::raw::c_short,
894        size: usize,
895        posinfo: ltc_off_t,
896    );
897}
898extern "C" {
899    #[doc = " Wrapper around \\ref ltc_decoder_write that accepts unsigned 16 bit\n audio samples. Note: internally libltc uses 8 bit only.\n\n @param d decoder handle\n @param buf pointer to audio sample data\n @param size number of samples to parse\n @param posinfo (optional, recommended) sample-offset in the audio-stream."]
900    pub fn ltc_decoder_write_u16(
901        d: *mut LTCDecoder,
902        buf: *mut ::std::os::raw::c_ushort,
903        size: usize,
904        posinfo: ltc_off_t,
905    );
906}
907extern "C" {
908    #[doc = " Decoded LTC frames are placed in a queue. This function retrieves\n a frame from the queue, and stores it at LTCFrameExt*\n\n @param d decoder handle\n @param frame the decoded LTC frame is copied there\n @return 1 on success or 0 when no frames queued."]
909    pub fn ltc_decoder_read(d: *mut LTCDecoder, frame: *mut LTCFrameExt) -> ::std::os::raw::c_int;
910}
911extern "C" {
912    #[doc = " Remove all LTC frames from the internal queue.\n @param d decoder handle"]
913    pub fn ltc_decoder_queue_flush(d: *mut LTCDecoder);
914}
915extern "C" {
916    #[doc = " Count number of LTC frames currently in the queue.\n @param d decoder handle\n @return number of queued frames"]
917    pub fn ltc_decoder_queue_length(d: *mut LTCDecoder) -> ::std::os::raw::c_int;
918}
919extern "C" {
920    #[doc = " Allocate and initialize LTC audio encoder.\n\n calls \\ref ltc_encoder_reinit internally see, see notes there.\n\n @param sample_rate audio sample rate (eg. 48000)\n @param fps video-frames per second (e.g. 25.0)\n @param standard the TV standard to use for Binary Group Flag bit position\n @param flags binary combination of \\ref LTC_BG_FLAGS"]
921    pub fn ltc_encoder_create(
922        sample_rate: f64,
923        fps: f64,
924        standard: LTC_TV_STANDARD,
925        flags: ::std::os::raw::c_int,
926    ) -> *mut LTCEncoder;
927}
928extern "C" {
929    #[doc = " Release memory of the encoder.\n @param e encoder handle"]
930    pub fn ltc_encoder_free(e: *mut LTCEncoder);
931}
932extern "C" {
933    #[doc = " Set the encoder LTC-frame to the given SMPTETimecode.\n The next call to \\ref ltc_encoder_encode_byte or\n \\ref ltc_encoder_encode_frame will encode this time to LTC audio-samples.\n\n Internally this call uses \\ref ltc_time_to_frame because\n the LTCEncoder operates on LTCframes only.\n see als \\ref ltc_encoder_set_frame\n\n @param e encoder handle\n @param t timecode to set."]
934    pub fn ltc_encoder_set_timecode(e: *mut LTCEncoder, t: *mut SMPTETimecode);
935}
936extern "C" {
937    #[doc = " Query the current encoder timecode.\n\n Note: the decoder stores its internal state in an LTC-frame,\n this function converts that LTC-Frame into SMPTETimecode on demand.\n see also \\ref ltc_encoder_get_frame.\n\n @param e encoder handle\n @param t is set to current timecode"]
938    pub fn ltc_encoder_get_timecode(e: *mut LTCEncoder, t: *mut SMPTETimecode);
939}
940extern "C" {
941    #[doc = " Set the user-bits of the frame to the given data.\n\n The data should be a 32-bits unsigned integer.\n It is written LSB first continiously int the eight user fields.\n\n @param e encoder handle\n @param data the data to write"]
942    pub fn ltc_encoder_set_user_bits(e: *mut LTCEncoder, data: ::std::os::raw::c_ulong);
943}
944extern "C" {
945    #[doc = " Get the 32-bits unsigned integer from the user-data bits.\n The data should be written LSB first in the frame\n\n @param f LTC frame data to parse"]
946    pub fn ltc_frame_get_user_bits(f: *mut LTCFrame) -> ::std::os::raw::c_ulong;
947}
948extern "C" {
949    #[doc = " Move the encoder to the next timecode frame.\n uses \\ref ltc_frame_increment() internally."]
950    pub fn ltc_encoder_inc_timecode(e: *mut LTCEncoder) -> ::std::os::raw::c_int;
951}
952extern "C" {
953    #[doc = " Move the encoder to the previous timecode frame.\n This is useful for encoding reverse LTC.\n uses \\ref ltc_frame_decrement() internally."]
954    pub fn ltc_encoder_dec_timecode(e: *mut LTCEncoder) -> ::std::os::raw::c_int;
955}
956extern "C" {
957    #[doc = " Low-level access to the internal LTCFrame data.\n\n Note: be careful to about f->dfbit, the encoder sets this [only] upon\n initialization.\n\n @param e encoder handle\n @param f LTC frame data to use"]
958    pub fn ltc_encoder_set_frame(e: *mut LTCEncoder, f: *mut LTCFrame);
959}
960extern "C" {
961    #[doc = " Low-level access to the encoder internal LTCFrame data\n\n @param e encoder handle\n @param f return LTC frame data"]
962    pub fn ltc_encoder_get_frame(e: *mut LTCEncoder, f: *mut LTCFrame);
963}
964extern "C" {
965    #[doc = " Copy the accumulated encoded audio to the given\n sample-buffer and flush the internal buffer.\n\n @param e encoder handle\n @param buf place to store the audio-samples, needs to be large enough\n to hold \\ref ltc_encoder_get_buffersize bytes\n @return the number of bytes written to the memory area\n pointed to by buf.\n\n @deprecated please use ltc_encoder_copy_buffer() instead"]
966    pub fn ltc_encoder_get_buffer(
967        e: *mut LTCEncoder,
968        buf: *mut ltcsnd_sample_t,
969    ) -> ::std::os::raw::c_int;
970}
971extern "C" {
972    #[doc = " Copy the accumulated encoded audio to the given\n sample-buffer and flush the internal buffer.\n\n @param e encoder handle\n @param buf place to store the audio-samples, needs to be large enough\n to hold \\ref ltc_encoder_get_buffersize bytes\n @return the number of bytes written to the memory area\n pointed to by buf."]
973    pub fn ltc_encoder_copy_buffer(
974        e: *mut LTCEncoder,
975        buf: *mut ltcsnd_sample_t,
976    ) -> ::std::os::raw::c_int;
977}
978extern "C" {
979    #[doc = " Retrieve a pointer to the accumulated encoded audio-data.\n\n @param e encoder handle\n @param size if set, the number of valid bytes in the buffer is stored there\n @param flush call \\ref ltc_encoder_buffer_flush - reset the buffer write-pointer\n @return pointer to encoder-buffer\n\n @deprecated please use ltc_encoder_get_bufferptr() instead"]
980    pub fn ltc_encoder_get_bufptr(
981        e: *mut LTCEncoder,
982        size: *mut ::std::os::raw::c_int,
983        flush: ::std::os::raw::c_int,
984    ) -> *mut ltcsnd_sample_t;
985}
986extern "C" {
987    #[doc = " Retrieve a pointer to the accumulated encoded audio-data.\n\n @param e encoder handle\n @param buf if set, the pointer to encoder-buffer\n @param flush call \\ref ltc_encoder_buffer_flush - reset the buffer write-pointer\n @return the number of valid bytes in the buffer"]
988    pub fn ltc_encoder_get_bufferptr(
989        e: *mut LTCEncoder,
990        buf: *mut *mut ltcsnd_sample_t,
991        flush: ::std::os::raw::c_int,
992    ) -> ::std::os::raw::c_int;
993}
994extern "C" {
995    #[doc = " reset the write-pointer of the encoder-buffer\n @param e encoder handle"]
996    pub fn ltc_encoder_buffer_flush(e: *mut LTCEncoder);
997}
998extern "C" {
999    #[doc = " Query the length of the internal buffer. It is allocated\n to hold audio-frames for exactly one LTC frame for the given\n sample-rate and frame-rate.  ie. (1 + sample-rate / fps) bytes\n\n Note this returns the total size of the buffer, not the used/free\n part. See also \\ref ltc_encoder_get_bufferptr\n\n @param e encoder handle\n @return size of the allocated internal buffer."]
1000    pub fn ltc_encoder_get_buffersize(e: *mut LTCEncoder) -> usize;
1001}
1002extern "C" {
1003    #[doc = " Change the encoder settings without re-allocating any\n library internal data structure (realtime safe).\n changing the fps and or sample-rate implies a buffer flush,\n and biphase state reset.\n\n This call will fail if the internal buffer is too small\n to hold one full LTC frame. Use \\ref ltc_encoder_set_buffersize to\n prepare an internal buffer large enough to accommodate all\n sample_rate, fps combinations that you would like to re-init to.\n\n The LTC frame payload data is not modified by this call, however,\n the flag-bits of the LTC-Frame are updated:\n If fps equals to 29.97 or 30000.0/1001.0, the LTCFrame's 'dfbit' bit is set to 1\n to indicate drop-frame timecode.\n\n Unless the LTC_BGF_DONT_TOUCH flag is set the BGF1 is set or cleared depending\n on LTC_TC_CLOCK and BGF0,2 according to LTC_USE_DATE and the given standard.\n col_frame is cleared  and the parity recomputed (unless LTC_NO_PARITY is given).\n\n @param e encoder handle\n @param sample_rate audio sample rate (eg. 48000)\n @param fps video-frames per second (e.g. 25.0)\n @param standard the TV standard to use for Binary Group Flag bit position\n @param flags binary combination of \\ref LTC_BG_FLAGS"]
1004    pub fn ltc_encoder_reinit(
1005        e: *mut LTCEncoder,
1006        sample_rate: f64,
1007        fps: f64,
1008        standard: LTC_TV_STANDARD,
1009        flags: ::std::os::raw::c_int,
1010    ) -> ::std::os::raw::c_int;
1011}
1012extern "C" {
1013    #[doc = " reset ecoder state.\n flushes buffer, reset biphase state\n\n @param e encoder handle"]
1014    pub fn ltc_encoder_reset(e: *mut LTCEncoder);
1015}
1016extern "C" {
1017    #[doc = " Configure a custom size for the internal buffer.\n\n This is needed if you are planning to call \\ref ltc_encoder_reinit()\n or if you want to keep more than one LTC frame's worth of data in\n the library's internal buffer.\n\n The buffer-size is (1 + sample_rate / fps) bytes.\n resizing the internal buffer will flush all existing data\n in it - alike \\ref ltc_encoder_buffer_flush.\n\n @param e encoder handle\n @param sample_rate audio sample rate (eg. 48000)\n @param fps video-frames per second (e.g. 25.0)\n @return 0 on success, -1 if allocation fails (which makes the\n   encoder unusable, call \\ref ltc_encoder_free or realloc the buffer)\n\n @deprecated please use ltc_encoder_set_buffersize() instead"]
1018    pub fn ltc_encoder_set_bufsize(
1019        e: *mut LTCEncoder,
1020        sample_rate: f64,
1021        fps: f64,
1022    ) -> ::std::os::raw::c_int;
1023}
1024extern "C" {
1025    #[doc = " Configure a custom size for the internal buffer.\n\n This is needed if you are planning to call \\ref ltc_encoder_reinit()\n or if you want to keep more than one LTC frame's worth of data in\n the library's internal buffer.\n\n The buffer-size is (1 + sample_rate / fps) bytes.\n resizing the internal buffer will flush all existing data\n in it - alike \\ref ltc_encoder_buffer_flush.\n\n @param e encoder handle\n @param sample_rate audio sample rate (eg. 48000)\n @param fps video-frames per second (e.g. 25.0)\n @return 0 on success, -1 if allocation fails (which makes the\n   encoder unusable, call \\ref ltc_encoder_free or realloc the buffer)"]
1026    pub fn ltc_encoder_set_buffersize(
1027        e: *mut LTCEncoder,
1028        sample_rate: f64,
1029        fps: f64,
1030    ) -> ::std::os::raw::c_int;
1031}
1032extern "C" {
1033    #[doc = " Query the volume of the generated LTC signal\n\n @param e encoder handle\n @return the volume in dB full-scale (<= 0.0)"]
1034    pub fn ltc_encoder_get_volume(e: *mut LTCEncoder) -> f64;
1035}
1036extern "C" {
1037    #[doc = " Set the volume of the generated LTC signal\n\n typically LTC is sent at 0dBu ; in EBU callibrated systems that\n corresponds to -18dBFS. - by default libltc creates -3dBFS\n\n since libltc generated 8bit audio-data, the minimum dBFS\n is about -42dB which corresponds to 1 bit.\n\n 0dB corresponds to a signal range of 127\n 1..255 with 128 at the center.\n\n @param e encoder handle\n @param dBFS the volume in dB full-scale (<= 0.0)\n @return 0 on success, -1 if the value was out of range"]
1038    pub fn ltc_encoder_set_volume(e: *mut LTCEncoder, dBFS: f64) -> ::std::os::raw::c_int;
1039}
1040extern "C" {
1041    #[doc = " Get encoder signal rise-time / signal filtering\n\n @param e encoder handle\n @return the signal rise-time in us (10^(-6) sec)"]
1042    pub fn ltc_encoder_get_filter(e: *mut LTCEncoder) -> f64;
1043}
1044extern "C" {
1045    #[doc = " Set encoder signal rise-time / signal filtering\n\n LTC signal should have a rise time of 40us +/- 10 us.\n by default the encoder honors this and low-pass filters\n the output depending on the sample-rate.\n\n If you want a perfect square wave, set 'rise_time' to 0.\n\n Note \\ref ltc_encoder_reinit resets the filter-time-constant to use\n the default 40us for the given sample-rate, overriding any value\n previously set with \\ref ltc_encoder_set_filter\n\n @param e encoder handle\n @param rise_time the signal rise-time in us (10^(-6) sec), set to 0 for perfect square wave, default 40.0"]
1046    pub fn ltc_encoder_set_filter(e: *mut LTCEncoder, rise_time: f64);
1047}
1048extern "C" {
1049    #[doc = " Generate LTC audio for given byte of the LTC-frame and\n place it into the internal buffer.\n\n see \\ref ltc_encoder_copy_buffer and  \\ref ltc_encoder_get_bufferptr\n\n LTC has 10 bytes per frame: 0 <= bytecnt < 10\n use SMPTESetTime(..) to set the current frame before Encoding.\n see tests/encoder.c for an example.\n\n The default output signal is @ -3dBFS (38..218 at 8 bit unsigned).\n see also \\ref ltc_encoder_set_volume\n\n if speed is < 0, the bits are encoded in reverse.\n slowdown > 10.0 requires custom buffer sizes; see \\ref ltc_encoder_set_buffersize\n\n @param e encoder handle\n @param byte byte of the LTC-frame to encode 0..9\n @param speed vari-speed, < 1.0 faster,  > 1.0 slower ; must be != 0\n\n @return 0 on success, -1 if byte is invalid or buffer overflow (speed > 10.0)"]
1050    pub fn ltc_encoder_encode_byte(
1051        e: *mut LTCEncoder,
1052        byte: ::std::os::raw::c_int,
1053        speed: f64,
1054    ) -> ::std::os::raw::c_int;
1055}
1056extern "C" {
1057    #[doc = " Terminate encoding and add final transition\n\n Refer to the image at \\ref LTCFrame. In this example, the encoded data\n starts and ends with a rising edge.\n The transition at the start of tne next frame marks the end of\n the previous frame. This transition is encoded at the\n beginning of a frame. However if there is no additional frame to be encoded,\n a final terminating transition has to be added.\n\n Since LTC is usually sent as continuous stream, this is of no concern.\n However for a fixed, finite duration to be encoded, this method adds\n a terminating transition to the buffer.\n\n After this one must either call \\ref ltc_encoder_reset() or \\ref ltc_encoder_free.\n\n @param e encoder handle\n @return 0 on success, -1 if byte is invalid or buffer overflow (speed > 10.0)"]
1058    pub fn ltc_encoder_end_encode(e: *mut LTCEncoder) -> ::std::os::raw::c_int;
1059}
1060extern "C" {
1061    #[doc = " Encode a full LTC frame at fixed speed.\n This is equivalent to calling \\ref ltc_encoder_encode_byte 10 times for\n bytes 0..9 with speed 1.0.\n\n Note: The internal buffer must be empty before calling this function.\n Otherwise it may overflow. This is usually the case if it is read with\n \\ref ltc_encoder_copy_buffer after calling this function.\n\n The default internal buffersize is exactly one full LTC frame at speed 1.0.\n\n @param e encoder handle"]
1062    pub fn ltc_encoder_encode_frame(e: *mut LTCEncoder);
1063}
1064extern "C" {
1065    #[doc = " Encode a full LTC frame at fixed speed -1.\n This is equivalent to calling \\ref ltc_encoder_encode_byte 10 times for\n bytes 9..0, rolling in reverse at speed 1.\n\n Note: The internal buffer must be empty before calling this function.\n Otherwise it may overflow. This is usually the case if it is read with\n \\ref ltc_encoder_copy_buffer after calling this function.\n\n @param e encoder handle"]
1066    pub fn ltc_encoder_encode_reversed_frame(e: *mut LTCEncoder);
1067}
1068extern "C" {
1069    #[doc = " Set the parity of the LTC frame.\n\n Bi-Phase Mark Phase Correction bit (bit 27 - or 59) may be set or cleared so that\n that every 80-bit word contains an even number of zeroes.\n This means that the phase in every Sync Word will be the same.\n\n This is merely cosmetic; the motivation to keep the polarity of the waveform\n constant is to make finding the Sync Word visibly (on a scope) easier.\n\n There is usually no need to call this function directly. The encoder utility\n functions \\ref ltc_time_to_frame, \\ref ltc_frame_increment and\n \\ref ltc_frame_decrement include a call to it.\n\n @param frame the LTC to analyze and set or clear the biphase_mark_phase_correction bit.\n @param standard If 1 (aka LTC_TV_625_50) , the 25fps mode (bit 59 - aka binary_group_flag_bit2) is used, otherwise the 30fps, 24fps mode (bit 27 -- biphase_mark_phase_correction) is set or cleared."]
1070    pub fn ltc_frame_set_parity(frame: *mut LTCFrame, standard: LTC_TV_STANDARD);
1071}
1072extern "C" {
1073    #[doc = " Parse Binary Coded Group Flags into standard independent format:\n bit 0 (1) - BGF 0,\n bit 1 (2) - BGF 1,\n bit 2 (4) - BGF 2\n\n @param frame LTC frame data analyze\n @param standard the TV standard to use -- see \\ref LTCFrame for BGF assignment\n @return LTC Binary Group Flags"]
1074    pub fn ltc_frame_parse_bcg_flags(
1075        frame: *mut LTCFrame,
1076        standard: LTC_TV_STANDARD,
1077    ) -> ::std::os::raw::c_int;
1078}
1079extern "C" {
1080    #[doc = " LTCFrame sample alignment offset.\n\n There is a relative offset of the LTC-Frame start and the TV-frame.\n The first bit of a LTC frame corresponds to a specific line in the actual video\n frame. When decoding this offset needs to be subtracted from the LTC-frame's\n audio-sample-time to match the TV-frame's start position.\n\n For film frames or HDV the offset is zero.\n\n @param samples_per_frame audio-samples per timecode-frame (eg. 1920 = 48000/25)\n @param standard the TV standard\n @return offset in samples"]
1081    pub fn ltc_frame_alignment(samples_per_frame: f64, standard: LTC_TV_STANDARD) -> ltc_off_t;
1082}