xref: /aosp_15_r20/external/crosvm/win_audio/src/r8brain_sys/bindings.rs (revision bb4ee6a4ae7042d18b07a98463b9c8b875e44b39)
1 /* automatically generated by rust-bindgen
2 See instructions from: https://rust-lang.github.io/rust-bindgen/print.html
3 
4 Original library: https://github.com/avaneev/r8brain-free-src
5 
6 To generate bindings:
7 1. go to the r8brain-free-src location. In my case it'll be:
8 
9     cd C:\src\crosvm\third_party\r8brain\
10 
11 2. Run bindgen and put the binding file in the win_audio r8brain_sys directory"
12 
13     bindgen .\DLL\r8bsrc.h -o ..\..\platform\crosvm\win_audio\src\r8brain_sys\binding.rs -- -x c++
14 */
15 
16 #[doc = " Resampler object handle."]
17 pub type CR8BResampler = *mut ::std::os::raw::c_void;
18 #[doc = "< 16-bit precision resampler."]
19 #[doc = "<"]
20 pub const ER8BResamplerRes_r8brr16: ER8BResamplerRes = 0;
21 #[doc = "< 16-bit precision resampler for impulse responses."]
22 #[doc = "<"]
23 pub const ER8BResamplerRes_r8brr16IR: ER8BResamplerRes = 1;
24 #[doc = "< 24-bit precision resampler (including 32-bit floating"]
25 #[doc = "< point)."]
26 #[doc = "<"]
27 pub const ER8BResamplerRes_r8brr24: ER8BResamplerRes = 2;
28 #[doc = " Possible resampler object resolutions."]
29 pub type ER8BResamplerRes = i32;
30 extern "C" {
31     #[doc = " Function creates a new linear-phase resampler object."]
32     #[doc = ""]
33     #[doc = " @param SrcSampleRate Source signal sample rate. Both sample rates can"]
34     #[doc = " be specified as a ratio, e.g. SrcSampleRate = 1.0, DstSampleRate = 2.0."]
35     #[doc = " @param DstSampleRate Destination signal sample rate."]
36     #[doc = " @param MaxInLen The maximal planned length of the input buffer (in samples)"]
37     #[doc = " that will be passed to the resampler. The resampler relies on this value as"]
38     #[doc = " it allocates intermediate buffers. Input buffers longer than this value"]
39     #[doc = " should never be supplied to the resampler. Note that the resampler may use"]
40     #[doc = " the input buffer itself for intermediate sample data storage."]
41     #[doc = " @param Res Resampler's required resolution."]
r8b_create( SrcSampleRate: f64, DstSampleRate: f64, MaxInLen: ::std::os::raw::c_int, ReqTransBand: f64, Res: ER8BResamplerRes, ) -> CR8BResampler42     pub fn r8b_create(
43         SrcSampleRate: f64,
44         DstSampleRate: f64,
45         MaxInLen: ::std::os::raw::c_int,
46         ReqTransBand: f64,
47         Res: ER8BResamplerRes,
48     ) -> CR8BResampler;
49 }
50 extern "C" {
51     #[doc = " Function deletes a resampler previously created via the r8b_create()"]
52     #[doc = " function."]
53     #[doc = ""]
54     #[doc = " @param rs Resampler object to delete."]
r8b_delete(rs: CR8BResampler)55     pub fn r8b_delete(rs: CR8BResampler);
56 }
57 extern "C" {
58     #[doc = " Function clears (resets) the state of the resampler object and returns it"]
59     #[doc = " to the state after construction. All input data accumulated in the"]
60     #[doc = " internal buffer of this resampler object so far will be discarded."]
61     #[doc = ""]
62     #[doc = " @param rs Resampler object to clear."]
r8b_clear(rs: CR8BResampler)63     pub fn r8b_clear(rs: CR8BResampler);
64 }
65 extern "C" {
66     #[doc = " Function performs sample rate conversion."]
67     #[doc = ""]
68     #[doc = " If the source and destination sample rates are equal, the resampler will do"]
69     #[doc = " nothing and will simply return the input buffer unchanged."]
70     #[doc = ""]
71     #[doc = " You do not need to allocate an intermediate output buffer for use with this"]
72     #[doc = " function. If required, the resampler will allocate a suitable intermediate"]
73     #[doc = " output buffer itself."]
74     #[doc = ""]
75     #[doc = " @param rs Resampler object that performs processing."]
76     #[doc = " @param ip0 Input buffer. This buffer may be used as output buffer by this"]
77     #[doc = " function."]
78     #[doc = " @param l The number of samples available in the input buffer."]
79     #[doc = " @param[out] op0 This variable receives the pointer to the resampled data."]
80     #[doc = " This pointer may point to the address within the \"ip0\" input buffer, or to"]
81     #[doc = " *this object's internal buffer. In real-time applications it is suggested"]
82     #[doc = " to pass this pointer to the next output audio block and consume any data"]
83     #[doc = " left from the previous output audio block first before calling the"]
84     #[doc = " r8b_process() function again. The buffer pointed to by the \"op0\" on return"]
85     #[doc = " may be owned by the resampler, so it should not be freed by the caller."]
86     #[doc = " @return The number of samples available in the \"op0\" output buffer. If the"]
87     #[doc = " data from the output buffer \"op0\" is going to be written to a bigger output"]
88     #[doc = " buffer, it is suggested to check the returned number of samples so that no"]
89     #[doc = " overflow of the bigger output buffer happens."]
r8b_process( rs: CR8BResampler, ip0: *mut f64, l: ::std::os::raw::c_int, op0: *mut *mut f64, ) -> ::std::os::raw::c_int90     pub fn r8b_process(
91         rs: CR8BResampler,
92         ip0: *mut f64,
93         l: ::std::os::raw::c_int,
94         op0: *mut *mut f64,
95     ) -> ::std::os::raw::c_int;
96 }
97