1#![no_std]
2#![allow(non_upper_case_globals)]
3#![allow(non_camel_case_types)]
4#![allow(non_snake_case)]
5
6pub const OPUS_OK: u32 = 0;
9pub const OPUS_BAD_ARG: i32 = -1;
10pub const OPUS_BUFFER_TOO_SMALL: i32 = -2;
11pub const OPUS_INTERNAL_ERROR: i32 = -3;
12pub const OPUS_INVALID_PACKET: i32 = -4;
13pub const OPUS_UNIMPLEMENTED: i32 = -5;
14pub const OPUS_INVALID_STATE: i32 = -6;
15pub const OPUS_ALLOC_FAIL: i32 = -7;
16pub const OPUS_SET_APPLICATION_REQUEST: u32 = 4000;
17pub const OPUS_GET_APPLICATION_REQUEST: u32 = 4001;
18pub const OPUS_SET_BITRATE_REQUEST: u32 = 4002;
19pub const OPUS_GET_BITRATE_REQUEST: u32 = 4003;
20pub const OPUS_SET_MAX_BANDWIDTH_REQUEST: u32 = 4004;
21pub const OPUS_GET_MAX_BANDWIDTH_REQUEST: u32 = 4005;
22pub const OPUS_SET_VBR_REQUEST: u32 = 4006;
23pub const OPUS_GET_VBR_REQUEST: u32 = 4007;
24pub const OPUS_SET_BANDWIDTH_REQUEST: u32 = 4008;
25pub const OPUS_GET_BANDWIDTH_REQUEST: u32 = 4009;
26pub const OPUS_SET_COMPLEXITY_REQUEST: u32 = 4010;
27pub const OPUS_GET_COMPLEXITY_REQUEST: u32 = 4011;
28pub const OPUS_SET_INBAND_FEC_REQUEST: u32 = 4012;
29pub const OPUS_GET_INBAND_FEC_REQUEST: u32 = 4013;
30pub const OPUS_SET_PACKET_LOSS_PERC_REQUEST: u32 = 4014;
31pub const OPUS_GET_PACKET_LOSS_PERC_REQUEST: u32 = 4015;
32pub const OPUS_SET_DTX_REQUEST: u32 = 4016;
33pub const OPUS_GET_DTX_REQUEST: u32 = 4017;
34pub const OPUS_SET_VBR_CONSTRAINT_REQUEST: u32 = 4020;
35pub const OPUS_GET_VBR_CONSTRAINT_REQUEST: u32 = 4021;
36pub const OPUS_SET_FORCE_CHANNELS_REQUEST: u32 = 4022;
37pub const OPUS_GET_FORCE_CHANNELS_REQUEST: u32 = 4023;
38pub const OPUS_SET_SIGNAL_REQUEST: u32 = 4024;
39pub const OPUS_GET_SIGNAL_REQUEST: u32 = 4025;
40pub const OPUS_GET_LOOKAHEAD_REQUEST: u32 = 4027;
41pub const OPUS_GET_SAMPLE_RATE_REQUEST: u32 = 4029;
42pub const OPUS_GET_FINAL_RANGE_REQUEST: u32 = 4031;
43pub const OPUS_GET_PITCH_REQUEST: u32 = 4033;
44pub const OPUS_SET_GAIN_REQUEST: u32 = 4034;
45pub const OPUS_GET_GAIN_REQUEST: u32 = 4045;
46pub const OPUS_SET_LSB_DEPTH_REQUEST: u32 = 4036;
47pub const OPUS_GET_LSB_DEPTH_REQUEST: u32 = 4037;
48pub const OPUS_GET_LAST_PACKET_DURATION_REQUEST: u32 = 4039;
49pub const OPUS_SET_EXPERT_FRAME_DURATION_REQUEST: u32 = 4040;
50pub const OPUS_GET_EXPERT_FRAME_DURATION_REQUEST: u32 = 4041;
51pub const OPUS_SET_PREDICTION_DISABLED_REQUEST: u32 = 4042;
52pub const OPUS_GET_PREDICTION_DISABLED_REQUEST: u32 = 4043;
53pub const OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST: u32 = 4046;
54pub const OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST: u32 = 4047;
55pub const OPUS_GET_IN_DTX_REQUEST: u32 = 4049;
56pub const OPUS_SET_DRED_DURATION_REQUEST: u32 = 4050;
57pub const OPUS_GET_DRED_DURATION_REQUEST: u32 = 4051;
58pub const OPUS_SET_DNN_BLOB_REQUEST: u32 = 4052;
59pub const OPUS_AUTO: i32 = -1000;
60pub const OPUS_BITRATE_MAX: i32 = -1;
61pub const OPUS_APPLICATION_VOIP: u32 = 2048;
62pub const OPUS_APPLICATION_AUDIO: u32 = 2049;
63pub const OPUS_APPLICATION_RESTRICTED_LOWDELAY: u32 = 2051;
64pub const OPUS_SIGNAL_VOICE: u32 = 3001;
65pub const OPUS_SIGNAL_MUSIC: u32 = 3002;
66pub const OPUS_BANDWIDTH_NARROWBAND: u32 = 1101;
67pub const OPUS_BANDWIDTH_MEDIUMBAND: u32 = 1102;
68pub const OPUS_BANDWIDTH_WIDEBAND: u32 = 1103;
69pub const OPUS_BANDWIDTH_SUPERWIDEBAND: u32 = 1104;
70pub const OPUS_BANDWIDTH_FULLBAND: u32 = 1105;
71pub const OPUS_FRAMESIZE_ARG: u32 = 5000;
72pub const OPUS_FRAMESIZE_2_5_MS: u32 = 5001;
73pub const OPUS_FRAMESIZE_5_MS: u32 = 5002;
74pub const OPUS_FRAMESIZE_10_MS: u32 = 5003;
75pub const OPUS_FRAMESIZE_20_MS: u32 = 5004;
76pub const OPUS_FRAMESIZE_40_MS: u32 = 5005;
77pub const OPUS_FRAMESIZE_60_MS: u32 = 5006;
78pub const OPUS_FRAMESIZE_80_MS: u32 = 5007;
79pub const OPUS_FRAMESIZE_100_MS: u32 = 5008;
80pub const OPUS_FRAMESIZE_120_MS: u32 = 5009;
81pub const OPUS_RESET_STATE: u32 = 4028;
82pub type opus_int8 = i8;
83pub type opus_uint8 = u8;
84pub type opus_int16 = i16;
85pub type opus_uint16 = u16;
86pub type opus_int32 = i32;
87pub type opus_uint32 = u32;
88pub type opus_int64 = i64;
89pub type opus_uint64 = u64;
90#[repr(C)]
91#[derive(Debug, Copy, Clone)]
92pub struct OpusEncoder {
93 _unused: [u8; 0],
94}
95#[repr(C)]
96#[derive(Debug, Copy, Clone)]
97pub struct OpusDecoder {
98 _unused: [u8; 0],
99}
100#[repr(C)]
101#[derive(Debug, Copy, Clone)]
102pub struct OpusDREDDecoder {
103 _unused: [u8; 0],
104}
105#[repr(C)]
106#[derive(Debug, Copy, Clone)]
107pub struct OpusDRED {
108 _unused: [u8; 0],
109}
110#[repr(C)]
111#[derive(Debug, Copy, Clone)]
112pub struct OpusRepacketizer {
113 _unused: [u8; 0],
114}
115unsafe extern "C" {
116 #[doc = "Converts an opus error code into a human readable string.\n\n# Arguments\n\n* `error` [in] - <tt>int</tt>: Error number\n\n# Returns\n\nError string"]
117 pub fn opus_strerror(error: ::core::ffi::c_int) -> *const ::core::ffi::c_char;
118 #[doc = "Gets the libopus version string.\nApplications may look for the substring \"-fixed\" in the version string to\ndetermine whether they have a fixed-point or floating-point build at\nruntime.\n\n# Returns\n\nVersion string"]
119 pub fn opus_get_version_string() -> *const ::core::ffi::c_char;
120 #[doc = "Gets the size of an <code>OpusEncoder</code> structure.\n\n# Arguments\n\n* `channels` [in] - <tt>int</tt>: Number of channels.\nThis must be 1 or 2.\n\n# Returns\n\nThe size in bytes."]
121 pub fn opus_encoder_get_size(channels: ::core::ffi::c_int) -> ::core::ffi::c_int;
122 #[doc = "Allocates and initializes an encoder state.\nThere are three coding modes:\n[`OPUS_APPLICATION_VOIP`] gives best quality at a given bitrate for voice\nsignals. It enhances the input signal by high-pass filtering and\nemphasizing formants and harmonics. Optionally it includes in-band\nforward error correction to protect against packet loss. Use this\nmode for typical VoIP applications. Because of the enhancement,\neven at high bitrates the output may sound different from the input.\n[`OPUS_APPLICATION_AUDIO`] gives best quality at a given bitrate for most\nnon-voice signals like music. Use this mode for music and mixed\n(music/voice) content, broadcast, and applications requiring less\nthan 15 ms of coding delay.\n[`OPUS_APPLICATION_RESTRICTED_LOWDELAY`] configures low-delay mode that\ndisables the speech-optimized mode in exchange for slightly reduced delay.\nThis mode can only be set on an newly initialized or freshly reset encoder\nbecause it changes the codec delay.\nThis is useful when the caller knows that the speech-optimized modes will not be needed (use with caution).\n\n# Arguments\n\n* `Fs` [in] - <tt>opus_int32</tt>: Sampling rate of input signal (Hz)\nThis must be one of 8000, 12000, 16000,\n24000, or 48000.\n* `channels` [in] - <tt>int</tt>: Number of channels (1 or 2) in input signal\n* `application` [in] - <tt>int</tt>: Coding mode (one of [`OPUS_APPLICATION_VOIP,`] [`OPUS_APPLICATION_AUDIO,`] or [`OPUS_APPLICATION_RESTRICTED_LOWDELAY)`]\n* `error` [out] - <tt>int*</tt>: [`opus_errorcodes`]\n> **Note** Regardless of the sampling rate and number channels selected, the Opus encoder\ncan switch to a lower audio bandwidth or number of channels if the bitrate\nselected is too low. This also means that it is safe to always use 48 kHz stereo input\nand let the encoder optimize the encoding."]
123 pub fn opus_encoder_create(
124 Fs: opus_int32,
125 channels: ::core::ffi::c_int,
126 application: ::core::ffi::c_int,
127 error: *mut ::core::ffi::c_int,
128 ) -> *mut OpusEncoder;
129 #[doc = "Initializes a previously allocated encoder state\nThe memory pointed to by st must be at least the size returned by opus_encoder_get_size().\nThis is intended for applications which use their own allocator instead of malloc.\n\n# See also\n\n> [`opus_encoder_create(),opus_encoder_get_size()`]\nTo reset a previously initialized state, use the #OPUS_RESET_STATE CTL.\n\n# Arguments\n\n* `st` [in] - <tt>OpusEncoder*</tt>: Encoder state\n* `Fs` [in] - <tt>opus_int32</tt>: Sampling rate of input signal (Hz)\nThis must be one of 8000, 12000, 16000,\n24000, or 48000.\n* `channels` [in] - <tt>int</tt>: Number of channels (1 or 2) in input signal\n* `application` [in] - <tt>int</tt>: Coding mode (one of OPUS_APPLICATION_VOIP, OPUS_APPLICATION_AUDIO, or OPUS_APPLICATION_RESTRICTED_LOWDELAY)\n@retval #OPUS_OK Success or [`opus_errorcodes`]"]
130 pub fn opus_encoder_init(
131 st: *mut OpusEncoder,
132 Fs: opus_int32,
133 channels: ::core::ffi::c_int,
134 application: ::core::ffi::c_int,
135 ) -> ::core::ffi::c_int;
136 #[doc = "Encodes an Opus frame.\n\n# Arguments\n\n* `st` [in] - <tt>OpusEncoder*</tt>: Encoder state\n* `pcm` [in] - <tt>opus_int16*</tt>: Input signal (interleaved if 2 channels). length is frame_size*channels*sizeof(opus_int16)\n* `frame_size` [in] - <tt>int</tt>: Number of samples per channel in the\ninput signal.\nThis must be an Opus frame size for\nthe encoder's sampling rate.\nFor example, at 48 kHz the permitted\nvalues are 120, 240, 480, 960, 1920,\nand 2880.\nPassing in a duration of less than\n10 ms (480 samples at 48 kHz) will\nprevent the encoder from using the LPC\nor hybrid modes.\n* `data` [out] - <tt>unsigned char*</tt>: Output payload.\nThis must contain storage for at\nleast _max_data_bytes._\n* `max_data_bytes` [in] - <tt>opus_int32</tt>: Size of the allocated\nmemory for the output\npayload. This may be\nused to impose an upper limit on\nthe instant bitrate, but should\nnot be used as the only bitrate\ncontrol. Use #OPUS_SET_BITRATE to\ncontrol the bitrate.\n\n# Returns\n\nThe length of the encoded packet (in bytes) on success or a\nnegative error code (see [`opus_errorcodes)`] on failure."]
137 pub fn opus_encode(
138 st: *mut OpusEncoder,
139 pcm: *const opus_int16,
140 frame_size: ::core::ffi::c_int,
141 data: *mut ::core::ffi::c_uchar,
142 max_data_bytes: opus_int32,
143 ) -> opus_int32;
144 #[doc = "Encodes an Opus frame.\n\n# Arguments\n\n* `st` [in] - <tt>OpusEncoder*</tt>: Encoder state\n* `pcm` [in] - <tt>opus_int32*</tt>: Input signal (interleaved if 2 channels) representing (or slightly exceeding) 24-bit values. length is frame_size*channels*sizeof(opus_int32)\n* `frame_size` [in] - <tt>int</tt>: Number of samples per channel in the\ninput signal.\nThis must be an Opus frame size for\nthe encoder's sampling rate.\nFor example, at 48 kHz the permitted\nvalues are 120, 240, 480, 960, 1920,\nand 2880.\nPassing in a duration of less than\n10 ms (480 samples at 48 kHz) will\nprevent the encoder from using the LPC\nor hybrid modes.\n* `data` [out] - <tt>unsigned char*</tt>: Output payload.\nThis must contain storage for at\nleast _max_data_bytes._\n* `max_data_bytes` [in] - <tt>opus_int32</tt>: Size of the allocated\nmemory for the output\npayload. This may be\nused to impose an upper limit on\nthe instant bitrate, but should\nnot be used as the only bitrate\ncontrol. Use #OPUS_SET_BITRATE to\ncontrol the bitrate.\n\n# Returns\n\nThe length of the encoded packet (in bytes) on success or a\nnegative error code (see [`opus_errorcodes)`] on failure."]
145 pub fn opus_encode24(
146 st: *mut OpusEncoder,
147 pcm: *const opus_int32,
148 frame_size: ::core::ffi::c_int,
149 data: *mut ::core::ffi::c_uchar,
150 max_data_bytes: opus_int32,
151 ) -> opus_int32;
152 #[doc = "Encodes an Opus frame from floating point input.\n\n# Arguments\n\n* `st` [in] - <tt>OpusEncoder*</tt>: Encoder state\n* `pcm` [in] - <tt>float*</tt>: Input in float format (interleaved if 2 channels), with a normal range of +/-1.0.\nSamples with a range beyond +/-1.0 are supported but will\nbe clipped by decoders using the integer API and should\nonly be used if it is known that the far end supports\nextended dynamic range.\nlength is frame_size*channels*sizeof(float)\n* `frame_size` [in] - <tt>int</tt>: Number of samples per channel in the\ninput signal.\nThis must be an Opus frame size for\nthe encoder's sampling rate.\nFor example, at 48 kHz the permitted\nvalues are 120, 240, 480, 960, 1920,\nand 2880.\nPassing in a duration of less than\n10 ms (480 samples at 48 kHz) will\nprevent the encoder from using the LPC\nor hybrid modes.\n* `data` [out] - <tt>unsigned char*</tt>: Output payload.\nThis must contain storage for at\nleast _max_data_bytes._\n* `max_data_bytes` [in] - <tt>opus_int32</tt>: Size of the allocated\nmemory for the output\npayload. This may be\nused to impose an upper limit on\nthe instant bitrate, but should\nnot be used as the only bitrate\ncontrol. Use #OPUS_SET_BITRATE to\ncontrol the bitrate.\n\n# Returns\n\nThe length of the encoded packet (in bytes) on success or a\nnegative error code (see [`opus_errorcodes)`] on failure."]
153 pub fn opus_encode_float(
154 st: *mut OpusEncoder,
155 pcm: *const f32,
156 frame_size: ::core::ffi::c_int,
157 data: *mut ::core::ffi::c_uchar,
158 max_data_bytes: opus_int32,
159 ) -> opus_int32;
160 #[doc = "Frees an <code>OpusEncoder</code> allocated by opus_encoder_create().\n\n# Arguments\n\n* `st` [in] - <tt>OpusEncoder*</tt>: State to be freed."]
161 pub fn opus_encoder_destroy(st: *mut OpusEncoder);
162 #[doc = "Perform a CTL function on an Opus encoder.\nGenerally the request and subsequent arguments are generated\nby a convenience macro.\n\n# Arguments\n\n* `st` - <tt>OpusEncoder*</tt>: Encoder state.\n* `request` - This and all remaining parameters should be replaced by one\nof the convenience macros in [`opus_genericctls`] or\n[`opus_encoderctls.`]\n\n# See also\n\n> [`opus_genericctls`]\n> [`opus_encoderctls`]"]
163 pub fn opus_encoder_ctl(st: *mut OpusEncoder, request: ::core::ffi::c_int, ...) -> ::core::ffi::c_int;
164 #[doc = "Gets the size of an <code>OpusDecoder</code> structure.\n\n# Arguments\n\n* `channels` [in] - <tt>int</tt>: Number of channels.\nThis must be 1 or 2.\n\n# Returns\n\nThe size in bytes."]
165 pub fn opus_decoder_get_size(channels: ::core::ffi::c_int) -> ::core::ffi::c_int;
166 #[doc = "Allocates and initializes a decoder state.\n\n# Arguments\n\n* `Fs` [in] - <tt>opus_int32</tt>: Sample rate to decode at (Hz).\nThis must be one of 8000, 12000, 16000,\n24000, or 48000.\n* `channels` [in] - <tt>int</tt>: Number of channels (1 or 2) to decode\n* `error` [out] - <tt>int*</tt>: #OPUS_OK Success or [`opus_errorcodes`]\nInternally Opus stores data at 48000 Hz, so that should be the default\nvalue for Fs. However, the decoder can efficiently decode to buffers\nat 8, 12, 16, and 24 kHz so if for some reason the caller cannot use\ndata at the full sample rate, or knows the compressed data doesn't\nuse the full frequency range, it can request decoding at a reduced\nrate. Likewise, the decoder is capable of filling in either mono or\ninterleaved stereo pcm buffers, at the caller's request."]
167 pub fn opus_decoder_create(
168 Fs: opus_int32,
169 channels: ::core::ffi::c_int,
170 error: *mut ::core::ffi::c_int,
171 ) -> *mut OpusDecoder;
172 #[doc = "Initializes a previously allocated decoder state.\nThe state must be at least the size returned by opus_decoder_get_size().\nThis is intended for applications which use their own allocator instead of malloc. # See also\n\n> [`opus_decoder_create,opus_decoder_get_size`]\nTo reset a previously initialized state, use the #OPUS_RESET_STATE CTL.\n\n# Arguments\n\n* `st` [in] - <tt>OpusDecoder*</tt>: Decoder state.\n* `Fs` [in] - <tt>opus_int32</tt>: Sampling rate to decode to (Hz).\nThis must be one of 8000, 12000, 16000,\n24000, or 48000.\n* `channels` [in] - <tt>int</tt>: Number of channels (1 or 2) to decode\n@retval #OPUS_OK Success or [`opus_errorcodes`]"]
173 pub fn opus_decoder_init(st: *mut OpusDecoder, Fs: opus_int32, channels: ::core::ffi::c_int) -> ::core::ffi::c_int;
174 #[doc = "Decode an Opus packet.\n\n# Arguments\n\n* `st` [in] - <tt>OpusDecoder*</tt>: Decoder state\n* `data` [in] - <tt>char*</tt>: Input payload. Use a NULL pointer to indicate packet loss\n* `len` [in] - <tt>opus_int32</tt>: Number of bytes in payload*\n* `pcm` [out] - <tt>opus_int16*</tt>: Output signal (interleaved if 2 channels). length\nis frame_size*channels*sizeof(opus_int16)\n* `frame_size` [in] - Number of samples per channel of available space in _pcm._\nIf this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will\nnot be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1),\nthen frame_size needs to be exactly the duration of audio that is missing, otherwise the\ndecoder will not be in the optimal state to decode the next incoming packet. For the PLC and\nFEC cases, frame_size <b>must</b> be a multiple of 2.5 ms.\n* `decode_fec` [in] - <tt>int</tt>: Flag (0 or 1) to request that any in-band forward error correction data be\ndecoded. If no such data is available, the frame is decoded as if it were lost.\n\n# Returns\n\nNumber of decoded samples or [`opus_errorcodes`]"]
175 pub fn opus_decode(
176 st: *mut OpusDecoder,
177 data: *const ::core::ffi::c_uchar,
178 len: opus_int32,
179 pcm: *mut opus_int16,
180 frame_size: ::core::ffi::c_int,
181 decode_fec: ::core::ffi::c_int,
182 ) -> ::core::ffi::c_int;
183 #[doc = "Decode an Opus packet.\n\n# Arguments\n\n* `st` [in] - <tt>OpusDecoder*</tt>: Decoder state\n* `data` [in] - <tt>char*</tt>: Input payload. Use a NULL pointer to indicate packet loss\n* `len` [in] - <tt>opus_int32</tt>: Number of bytes in payload*\n* `pcm` [out] - <tt>opus_int32*</tt>: Output signal (interleaved if 2 channels) representing (or slightly exceeding) 24-bit values. length\nis frame_size*channels*sizeof(opus_int32)\n* `frame_size` [in] - Number of samples per channel of available space in _pcm._\nIf this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will\nnot be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1),\nthen frame_size needs to be exactly the duration of audio that is missing, otherwise the\ndecoder will not be in the optimal state to decode the next incoming packet. For the PLC and\nFEC cases, frame_size <b>must</b> be a multiple of 2.5 ms.\n* `decode_fec` [in] - <tt>int</tt>: Flag (0 or 1) to request that any in-band forward error correction data be\ndecoded. If no such data is available, the frame is decoded as if it were lost.\n\n# Returns\n\nNumber of decoded samples or [`opus_errorcodes`]"]
184 pub fn opus_decode24(
185 st: *mut OpusDecoder,
186 data: *const ::core::ffi::c_uchar,
187 len: opus_int32,
188 pcm: *mut opus_int32,
189 frame_size: ::core::ffi::c_int,
190 decode_fec: ::core::ffi::c_int,
191 ) -> ::core::ffi::c_int;
192 #[doc = "Decode an Opus packet with floating point output.\n\n# Arguments\n\n* `st` [in] - <tt>OpusDecoder*</tt>: Decoder state\n* `data` [in] - <tt>char*</tt>: Input payload. Use a NULL pointer to indicate packet loss\n* `len` [in] - <tt>opus_int32</tt>: Number of bytes in payload\n* `pcm` [out] - <tt>float*</tt>: Output signal (interleaved if 2 channels). length\nis frame_size*channels*sizeof(float)\n* `frame_size` [in] - Number of samples per channel of available space in _pcm._\nIf this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will\nnot be capable of decoding some packets. In the case of PLC (data==NULL) or FEC (decode_fec=1),\nthen frame_size needs to be exactly the duration of audio that is missing, otherwise the\ndecoder will not be in the optimal state to decode the next incoming packet. For the PLC and\nFEC cases, frame_size <b>must</b> be a multiple of 2.5 ms.\n* `decode_fec` [in] - <tt>int</tt>: Flag (0 or 1) to request that any in-band forward error correction data be\ndecoded. If no such data is available the frame is decoded as if it were lost.\n\n# Returns\n\nNumber of decoded samples or [`opus_errorcodes`]"]
193 pub fn opus_decode_float(
194 st: *mut OpusDecoder,
195 data: *const ::core::ffi::c_uchar,
196 len: opus_int32,
197 pcm: *mut f32,
198 frame_size: ::core::ffi::c_int,
199 decode_fec: ::core::ffi::c_int,
200 ) -> ::core::ffi::c_int;
201 #[doc = "Perform a CTL function on an Opus decoder.\nGenerally the request and subsequent arguments are generated\nby a convenience macro.\n\n# Arguments\n\n* `st` - <tt>OpusDecoder*</tt>: Decoder state.\n* `request` - This and all remaining parameters should be replaced by one\nof the convenience macros in [`opus_genericctls`] or\n[`opus_decoderctls.`]\n\n# See also\n\n> [`opus_genericctls`]\n> [`opus_decoderctls`]"]
202 pub fn opus_decoder_ctl(st: *mut OpusDecoder, request: ::core::ffi::c_int, ...) -> ::core::ffi::c_int;
203 #[doc = "Frees an <code>OpusDecoder</code> allocated by opus_decoder_create().\n\n# Arguments\n\n* `st` [in] - <tt>OpusDecoder*</tt>: State to be freed."]
204 pub fn opus_decoder_destroy(st: *mut OpusDecoder);
205 #[doc = "Gets the size of an <code>OpusDREDDecoder</code> structure.\n\n# Returns\n\nThe size in bytes."]
206 pub fn opus_dred_decoder_get_size() -> ::core::ffi::c_int;
207 #[doc = "Allocates and initializes an OpusDREDDecoder state.\n\n# Arguments\n\n* `error` [out] - <tt>int*</tt>: #OPUS_OK Success or [`opus_errorcodes`]"]
208 pub fn opus_dred_decoder_create(error: *mut ::core::ffi::c_int) -> *mut OpusDREDDecoder;
209 #[doc = "Initializes an <code>OpusDREDDecoder</code> state.\n\n# Arguments\n\n* `dec` [in] - <tt>OpusDREDDecoder*</tt>: State to be initialized."]
210 pub fn opus_dred_decoder_init(dec: *mut OpusDREDDecoder) -> ::core::ffi::c_int;
211 #[doc = "Frees an <code>OpusDREDDecoder</code> allocated by opus_dred_decoder_create().\n\n# Arguments\n\n* `dec` [in] - <tt>OpusDREDDecoder*</tt>: State to be freed."]
212 pub fn opus_dred_decoder_destroy(dec: *mut OpusDREDDecoder);
213 #[doc = "Perform a CTL function on an Opus DRED decoder.\nGenerally the request and subsequent arguments are generated\nby a convenience macro.\n\n# Arguments\n\n* `dred_dec` - <tt>OpusDREDDecoder*</tt>: DRED Decoder state.\n* `request` - This and all remaining parameters should be replaced by one\nof the convenience macros in [`opus_genericctls`] or\n[`opus_decoderctls.`]\n\n# See also\n\n> [`opus_genericctls`]\n> [`opus_decoderctls`]"]
214 pub fn opus_dred_decoder_ctl(dred_dec: *mut OpusDREDDecoder, request: ::core::ffi::c_int, ...) -> ::core::ffi::c_int;
215 #[doc = "Gets the size of an <code>OpusDRED</code> structure.\n\n# Returns\n\nThe size in bytes."]
216 pub fn opus_dred_get_size() -> ::core::ffi::c_int;
217 #[doc = "Allocates and initializes a DRED state.\n\n# Arguments\n\n* `error` [out] - <tt>int*</tt>: #OPUS_OK Success or [`opus_errorcodes`]"]
218 pub fn opus_dred_alloc(error: *mut ::core::ffi::c_int) -> *mut OpusDRED;
219 #[doc = "Frees an <code>OpusDRED</code> allocated by opus_dred_create().\n\n# Arguments\n\n* `dec` [in] - <tt>OpusDRED*</tt>: State to be freed."]
220 pub fn opus_dred_free(dec: *mut OpusDRED);
221 #[doc = "Decode an Opus DRED packet.\n\n# Arguments\n\n* `dred_dec` [in] - <tt>OpusDRED*</tt>: DRED Decoder state\n* `dred` [in] - <tt>OpusDRED*</tt>: DRED state\n* `data` [in] - <tt>char*</tt>: Input payload\n* `len` [in] - <tt>opus_int32</tt>: Number of bytes in payload\n* `max_dred_samples` [in] - <tt>opus_int32</tt>: Maximum number of DRED samples that may be needed (if available in the packet).\n* `sampling_rate` [in] - <tt>opus_int32</tt>: Sampling rate used for max_dred_samples argument. Needs not match the actual sampling rate of the decoder.\n* `dred_end` [out] - <tt>opus_int32*</tt>: Number of non-encoded (silence) samples between the DRED timestamp and the last DRED sample.\n* `defer_processing` [in] - <tt>int</tt>: Flag (0 or 1). If set to one, the CPU-intensive part of the DRED decoding is deferred until opus_dred_process() is called.\n\n# Returns\n\nOffset (positive) of the first decoded DRED samples, zero if no DRED is present, or [`opus_errorcodes`]"]
222 pub fn opus_dred_parse(
223 dred_dec: *mut OpusDREDDecoder,
224 dred: *mut OpusDRED,
225 data: *const ::core::ffi::c_uchar,
226 len: opus_int32,
227 max_dred_samples: opus_int32,
228 sampling_rate: opus_int32,
229 dred_end: *mut ::core::ffi::c_int,
230 defer_processing: ::core::ffi::c_int,
231 ) -> ::core::ffi::c_int;
232 #[doc = "Finish decoding an Opus DRED packet. The function only needs to be called if opus_dred_parse() was called with defer_processing=1.\nThe source and destination will often be the same DRED state.\n\n# Arguments\n\n* `dred_dec` [in] - <tt>OpusDRED*</tt>: DRED Decoder state\n* `src` [in] - <tt>OpusDRED*</tt>: Source DRED state to start the processing from.\n* `dst` [out] - <tt>OpusDRED*</tt>: Destination DRED state to store the updated state after processing.\n\n# Returns\n\n[`opus_errorcodes`]"]
233 pub fn opus_dred_process(
234 dred_dec: *mut OpusDREDDecoder,
235 src: *const OpusDRED,
236 dst: *mut OpusDRED,
237 ) -> ::core::ffi::c_int;
238 #[doc = "Decode audio from an Opus DRED packet with 16-bit output.\n\n# Arguments\n\n* `st` [in] - <tt>OpusDecoder*</tt>: Decoder state\n* `dred` [in] - <tt>OpusDRED*</tt>: DRED state\n* `dred_offset` [in] - <tt>opus_int32</tt>: position of the redundancy to decode (in samples before the beginning of the real audio data in the packet).\n* `pcm` [out] - <tt>opus_int16*</tt>: Output signal (interleaved if 2 channels). length\nis frame_size*channels*sizeof(opus_int16)\n* `frame_size` [in] - Number of samples per channel to decode in _pcm._\nframe_size <b>must</b> be a multiple of 2.5 ms.\n\n# Returns\n\nNumber of decoded samples or [`opus_errorcodes`]"]
239 pub fn opus_decoder_dred_decode(
240 st: *mut OpusDecoder,
241 dred: *const OpusDRED,
242 dred_offset: opus_int32,
243 pcm: *mut opus_int16,
244 frame_size: opus_int32,
245 ) -> ::core::ffi::c_int;
246 #[doc = "Decode audio from an Opus DRED packet with 24-bit output.\n\n# Arguments\n\n* `st` [in] - <tt>OpusDecoder*</tt>: Decoder state\n* `dred` [in] - <tt>OpusDRED*</tt>: DRED state\n* `dred_offset` [in] - <tt>opus_int32</tt>: position of the redundancy to decode (in samples before the beginning of the real audio data in the packet).\n* `pcm` [out] - <tt>opus_int32*</tt>: Output signal (interleaved if 2 channels). length\nis frame_size*channels*sizeof(opus_int16)\n* `frame_size` [in] - Number of samples per channel to decode in _pcm._\nframe_size <b>must</b> be a multiple of 2.5 ms.\n\n# Returns\n\nNumber of decoded samples or [`opus_errorcodes`]"]
247 pub fn opus_decoder_dred_decode24(
248 st: *mut OpusDecoder,
249 dred: *const OpusDRED,
250 dred_offset: opus_int32,
251 pcm: *mut opus_int32,
252 frame_size: opus_int32,
253 ) -> ::core::ffi::c_int;
254 #[doc = "Decode audio from an Opus DRED packet with floating point output.\n\n# Arguments\n\n* `st` [in] - <tt>OpusDecoder*</tt>: Decoder state\n* `dred` [in] - <tt>OpusDRED*</tt>: DRED state\n* `dred_offset` [in] - <tt>opus_int32</tt>: position of the redundancy to decode (in samples before the beginning of the real audio data in the packet).\n* `pcm` [out] - <tt>float*</tt>: Output signal (interleaved if 2 channels). length\nis frame_size*channels*sizeof(float)\n* `frame_size` [in] - Number of samples per channel to decode in _pcm._\nframe_size <b>must</b> be a multiple of 2.5 ms.\n\n# Returns\n\nNumber of decoded samples or [`opus_errorcodes`]"]
255 pub fn opus_decoder_dred_decode_float(
256 st: *mut OpusDecoder,
257 dred: *const OpusDRED,
258 dred_offset: opus_int32,
259 pcm: *mut f32,
260 frame_size: opus_int32,
261 ) -> ::core::ffi::c_int;
262 #[doc = "Parse an opus packet into one or more frames.\nOpus_decode will perform this operation internally so most applications do\nnot need to use this function.\nThis function does not copy the frames, the returned pointers are pointers into\nthe input packet.\n\n# Arguments\n\n* `data` [in] - <tt>char*</tt>: Opus packet to be parsed\n* `len` [in] - <tt>opus_int32</tt>: size of data\n* `out_toc` [out] - <tt>char*</tt>: TOC pointer\n* `frames` [out] - <tt>char*[48]</tt> encapsulated frames\n* `size` [out] - <tt>opus_int16[48]</tt> sizes of the encapsulated frames\n* `payload_offset` [out] - <tt>int*</tt>: returns the position of the payload within the packet (in bytes)\n\n# Returns\n\nnumber of frames"]
263 pub fn opus_packet_parse(
264 data: *const ::core::ffi::c_uchar,
265 len: opus_int32,
266 out_toc: *mut ::core::ffi::c_uchar,
267 frames: *mut *const ::core::ffi::c_uchar,
268 size: *mut opus_int16,
269 payload_offset: *mut ::core::ffi::c_int,
270 ) -> ::core::ffi::c_int;
271 #[doc = "Gets the bandwidth of an Opus packet.\n\n# Arguments\n\n* `data` [in] - <tt>char*</tt>: Opus packet\n@retval OPUS_BANDWIDTH_NARROWBAND Narrowband (4kHz bandpass)\n@retval OPUS_BANDWIDTH_MEDIUMBAND Mediumband (6kHz bandpass)\n@retval OPUS_BANDWIDTH_WIDEBAND Wideband (8kHz bandpass)\n@retval OPUS_BANDWIDTH_SUPERWIDEBAND Superwideband (12kHz bandpass)\n@retval OPUS_BANDWIDTH_FULLBAND Fullband (20kHz bandpass)\n@retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type"]
272 pub fn opus_packet_get_bandwidth(data: *const ::core::ffi::c_uchar) -> ::core::ffi::c_int;
273 #[doc = "Gets the number of samples per frame from an Opus packet.\n\n# Arguments\n\n* `data` [in] - <tt>char*</tt>: Opus packet.\nThis must contain at least one byte of\ndata.\n* `Fs` [in] - <tt>opus_int32</tt>: Sampling rate in Hz.\nThis must be a multiple of 400, or\ninaccurate results will be returned.\n\n# Returns\n\nNumber of samples per frame."]
274 pub fn opus_packet_get_samples_per_frame(data: *const ::core::ffi::c_uchar, Fs: opus_int32) -> ::core::ffi::c_int;
275 #[doc = "Gets the number of channels from an Opus packet.\n\n# Arguments\n\n* `data` [in] - <tt>char*</tt>: Opus packet\n\n# Returns\n\nNumber of channels\n@retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type"]
276 pub fn opus_packet_get_nb_channels(data: *const ::core::ffi::c_uchar) -> ::core::ffi::c_int;
277 #[doc = "Gets the number of frames in an Opus packet.\n\n# Arguments\n\n* `packet` [in] - <tt>char*</tt>: Opus packet\n* `len` [in] - <tt>opus_int32</tt>: Length of packet\n\n# Returns\n\nNumber of frames\n@retval OPUS_BAD_ARG Insufficient data was passed to the function\n@retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type"]
278 pub fn opus_packet_get_nb_frames(packet: *const ::core::ffi::c_uchar, len: opus_int32) -> ::core::ffi::c_int;
279 #[doc = "Gets the number of samples of an Opus packet.\n\n# Arguments\n\n* `packet` [in] - <tt>char*</tt>: Opus packet\n* `len` [in] - <tt>opus_int32</tt>: Length of packet\n* `Fs` [in] - <tt>opus_int32</tt>: Sampling rate in Hz.\nThis must be a multiple of 400, or\ninaccurate results will be returned.\n\n# Returns\n\nNumber of samples\n@retval OPUS_BAD_ARG Insufficient data was passed to the function\n@retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type"]
280 pub fn opus_packet_get_nb_samples(
281 packet: *const ::core::ffi::c_uchar,
282 len: opus_int32,
283 Fs: opus_int32,
284 ) -> ::core::ffi::c_int;
285 #[doc = "Checks whether an Opus packet has LBRR.\n\n# Arguments\n\n* `packet` [in] - <tt>char*</tt>: Opus packet\n* `len` [in] - <tt>opus_int32</tt>: Length of packet\n\n# Returns\n\n1 is LBRR is present, 0 otherwise\n@retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type"]
286 pub fn opus_packet_has_lbrr(packet: *const ::core::ffi::c_uchar, len: opus_int32) -> ::core::ffi::c_int;
287 #[doc = "Gets the number of samples of an Opus packet.\n\n# Arguments\n\n* `dec` [in] - <tt>OpusDecoder*</tt>: Decoder state\n* `packet` [in] - <tt>char*</tt>: Opus packet\n* `len` [in] - <tt>opus_int32</tt>: Length of packet\n\n# Returns\n\nNumber of samples\n@retval OPUS_BAD_ARG Insufficient data was passed to the function\n@retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type"]
288 pub fn opus_decoder_get_nb_samples(
289 dec: *const OpusDecoder,
290 packet: *const ::core::ffi::c_uchar,
291 len: opus_int32,
292 ) -> ::core::ffi::c_int;
293 #[doc = "Applies soft-clipping to bring a float signal within the [-1,1] range. If\nthe signal is already in that range, nothing is done. If there are values\noutside of [-1,1], then the signal is clipped as smoothly as possible to\nboth fit in the range and avoid creating excessive distortion in the\nprocess.\n\n# Arguments\n\n* `pcm` [in,out] - <tt>float*</tt>: Input PCM and modified PCM\n* `frame_size` [in] - <tt>int</tt> Number of samples per channel to process\n* `channels` [in] - <tt>int</tt>: Number of channels\n* `softclip_mem` [in,out] - <tt>float*</tt>: State memory for the soft clipping process (one float per channel, initialized to zero)"]
294 pub fn opus_pcm_soft_clip(
295 pcm: *mut f32,
296 frame_size: ::core::ffi::c_int,
297 channels: ::core::ffi::c_int,
298 softclip_mem: *mut f32,
299 );
300 #[doc = "Gets the size of an <code>OpusRepacketizer</code> structure.\n\n# Returns\n\nThe size in bytes."]
301 pub fn opus_repacketizer_get_size() -> ::core::ffi::c_int;
302 #[doc = "(Re)initializes a previously allocated repacketizer state.\nThe state must be at least the size returned by opus_repacketizer_get_size().\nThis can be used for applications which use their own allocator instead of\nmalloc().\nIt must also be called to reset the queue of packets waiting to be\nrepacketized, which is necessary if the maximum packet duration of 120 ms\nis reached or if you wish to submit packets with a different Opus\nconfiguration (coding mode, audio bandwidth, frame size, or channel count).\nFailure to do so will prevent a new packet from being added with\nopus_repacketizer_cat().\n\n# See also\n\n> [`opus_repacketizer_create`]\n> [`opus_repacketizer_get_size`]\n> [`opus_repacketizer_cat`]\n\n# Arguments\n\n* `rp` - <tt>OpusRepacketizer*</tt>: The repacketizer state to\n(re)initialize.\n\n# Returns\n\nA pointer to the same repacketizer state that was passed in."]
303 pub fn opus_repacketizer_init(rp: *mut OpusRepacketizer) -> *mut OpusRepacketizer;
304 #[doc = "Allocates memory and initializes the new repacketizer with\nopus_repacketizer_init()."]
305 pub fn opus_repacketizer_create() -> *mut OpusRepacketizer;
306 #[doc = "Frees an <code>OpusRepacketizer</code> allocated by\nopus_repacketizer_create().\n\n# Arguments\n\n* `rp` [in] - <tt>OpusRepacketizer*</tt>: State to be freed."]
307 pub fn opus_repacketizer_destroy(rp: *mut OpusRepacketizer);
308 #[doc = "Add a packet to the current repacketizer state.\nThis packet must match the configuration of any packets already submitted\nfor repacketization since the last call to opus_repacketizer_init().\nThis means that it must have the same coding mode, audio bandwidth, frame\nsize, and channel count.\nThis can be checked in advance by examining the top 6 bits of the first\nbyte of the packet, and ensuring they match the top 6 bits of the first\nbyte of any previously submitted packet.\nThe total duration of audio in the repacketizer state also must not exceed\n120 ms, the maximum duration of a single packet, after adding this packet.\nThe contents of the current repacketizer state can be extracted into new\npackets using opus_repacketizer_out() or opus_repacketizer_out_range().\nIn order to add a packet with a different configuration or to add more\naudio beyond 120 ms, you must clear the repacketizer state by calling\nopus_repacketizer_init().\nIf a packet is too large to add to the current repacketizer state, no part\nof it is added, even if it contains multiple frames, some of which might\nfit.\nIf you wish to be able to add parts of such packets, you should first use\nanother repacketizer to split the packet into pieces and add them\nindividually.\n\n# See also\n\n> [`opus_repacketizer_out_range`]\n> [`opus_repacketizer_out`]\n> [`opus_repacketizer_init`]\n\n# Arguments\n\n* `rp` - <tt>OpusRepacketizer*</tt>: The repacketizer state to which to\nadd the packet.\n* `data` [in] - <tt>const unsigned char*</tt>: The packet data.\nThe application must ensure\nthis pointer remains valid\nuntil the next call to\nopus_repacketizer_init() or\nopus_repacketizer_destroy().\n* `len` - <tt>opus_int32</tt>: The number of bytes in the packet data.\n\n# Returns\n\nAn error code indicating whether or not the operation succeeded.\n@retval #OPUS_OK The packet's contents have been added to the repacketizer\nstate.\n@retval #OPUS_INVALID_PACKET The packet did not have a valid TOC sequence,\nthe packet's TOC sequence was not compatible\nwith previously submitted packets (because\nthe coding mode, audio bandwidth, frame size,\nor channel count did not match), or adding\nthis packet would increase the total amount of\naudio stored in the repacketizer state to more\nthan 120 ms."]
309 pub fn opus_repacketizer_cat(
310 rp: *mut OpusRepacketizer,
311 data: *const ::core::ffi::c_uchar,
312 len: opus_int32,
313 ) -> ::core::ffi::c_int;
314 #[doc = "Construct a new packet from data previously submitted to the repacketizer\nstate via opus_repacketizer_cat().\n\n# Arguments\n\n* `rp` - <tt>OpusRepacketizer*</tt>: The repacketizer state from which to\nconstruct the new packet.\n* `begin` - <tt>int</tt>: The index of the first frame in the current\nrepacketizer state to include in the output.\n* `end` - <tt>int</tt>: One past the index of the last frame in the\ncurrent repacketizer state to include in the\noutput.\n* `data` [out] - <tt>const unsigned char*</tt>: The buffer in which to\nstore the output packet.\n* `maxlen` - <tt>opus_int32</tt>: The maximum number of bytes to store in\nthe output buffer. In order to guarantee\nsuccess, this should be at least\n<code>1276</code> for a single frame,\nor for multiple frames,\n<code>1277*(end-begin)</code>.\nHowever, <code>1*(end-begin)</code> plus\nthe size of all packet data submitted to\nthe repacketizer since the last call to\nopus_repacketizer_init() or\nopus_repacketizer_create() is also\nsufficient, and possibly much smaller.\n\n# Returns\n\nThe total size of the output packet on success, or an error code\non failure.\n@retval #OPUS_BAD_ARG <code>[begin,end)</code> was an invalid range of\nframes (begin < 0, begin >= end, or end >\nopus_repacketizer_get_nb_frames()).\n@retval #OPUS_BUFFER_TOO_SMALL _maxlen_ was insufficient to contain the\ncomplete output packet."]
315 pub fn opus_repacketizer_out_range(
316 rp: *mut OpusRepacketizer,
317 begin: ::core::ffi::c_int,
318 end: ::core::ffi::c_int,
319 data: *mut ::core::ffi::c_uchar,
320 maxlen: opus_int32,
321 ) -> opus_int32;
322 #[doc = "Return the total number of frames contained in packet data submitted to\nthe repacketizer state so far via opus_repacketizer_cat() since the last\ncall to opus_repacketizer_init() or opus_repacketizer_create().\nThis defines the valid range of packets that can be extracted with\nopus_repacketizer_out_range() or opus_repacketizer_out().\n\n# Arguments\n\n* `rp` - <tt>OpusRepacketizer*</tt>: The repacketizer state containing the\nframes.\n\n# Returns\n\nThe total number of frames contained in the packet data submitted\nto the repacketizer state."]
323 pub fn opus_repacketizer_get_nb_frames(rp: *mut OpusRepacketizer) -> ::core::ffi::c_int;
324 #[doc = "Construct a new packet from data previously submitted to the repacketizer\nstate via opus_repacketizer_cat().\nThis is a convenience routine that returns all the data submitted so far\nin a single packet.\nIt is equivalent to calling\n@code opus_repacketizer_out_range(rp, 0, opus_repacketizer_get_nb_frames(rp),\ndata, maxlen)\n@endcode # Arguments\n\n* `rp` - <tt>OpusRepacketizer*</tt>: The repacketizer state from which to\nconstruct the new packet.\n* `data` [out] - <tt>const unsigned char*</tt>: The buffer in which to\nstore the output packet.\n* `maxlen` - <tt>opus_int32</tt>: The maximum number of bytes to store in\nthe output buffer. In order to guarantee\nsuccess, this should be at least\n<code>1277*opus_repacketizer_get_nb_frames(rp)</code>.\nHowever,\n<code>1*opus_repacketizer_get_nb_frames(rp)</code>\nplus the size of all packet data\nsubmitted to the repacketizer since the\nlast call to opus_repacketizer_init() or\nopus_repacketizer_create() is also\nsufficient, and possibly much smaller.\n\n# Returns\n\nThe total size of the output packet on success, or an error code\non failure.\n@retval #OPUS_BUFFER_TOO_SMALL _maxlen_ was insufficient to contain the\ncomplete output packet."]
325 pub fn opus_repacketizer_out(
326 rp: *mut OpusRepacketizer,
327 data: *mut ::core::ffi::c_uchar,
328 maxlen: opus_int32,
329 ) -> opus_int32;
330 #[doc = "Pads a given Opus packet to a larger size (possibly changing the TOC sequence).\n\n# Arguments\n\n* `data` [in,out] - <tt>const unsigned char*</tt>: The buffer containing the\npacket to pad.\n* `len` - <tt>opus_int32</tt>: The size of the packet.\nThis must be at least 1.\n* `new_len` - <tt>opus_int32</tt>: The desired size of the packet after padding.\nThis must be at least as large as len.\n\n# Returns\n\nan error code\n@retval #OPUS_OK _on_ success.\n@retval #OPUS_BAD_ARG _len_ was less than 1 or new_len was less than len.\n@retval #OPUS_INVALID_PACKET _data_ did not contain a valid Opus packet."]
331 pub fn opus_packet_pad(data: *mut ::core::ffi::c_uchar, len: opus_int32, new_len: opus_int32) -> ::core::ffi::c_int;
332 #[doc = "Remove all padding from a given Opus packet and rewrite the TOC sequence to\nminimize space usage.\n\n# Arguments\n\n* `data` [in,out] - <tt>const unsigned char*</tt>: The buffer containing the\npacket to strip.\n* `len` - <tt>opus_int32</tt>: The size of the packet.\nThis must be at least 1.\n\n# Returns\n\nThe new size of the output packet on success, or an error code\non failure.\n@retval #OPUS_BAD_ARG _len_ was less than 1.\n@retval #OPUS_INVALID_PACKET _data_ did not contain a valid Opus packet."]
333 pub fn opus_packet_unpad(data: *mut ::core::ffi::c_uchar, len: opus_int32) -> opus_int32;
334 #[doc = "Pads a given Opus multi-stream packet to a larger size (possibly changing the TOC sequence).\n\n# Arguments\n\n* `data` [in,out] - <tt>const unsigned char*</tt>: The buffer containing the\npacket to pad.\n* `len` - <tt>opus_int32</tt>: The size of the packet.\nThis must be at least 1.\n* `new_len` - <tt>opus_int32</tt>: The desired size of the packet after padding.\nThis must be at least 1.\n* `nb_streams` - <tt>opus_int32</tt>: The number of streams (not channels) in the packet.\nThis must be at least as large as len.\n\n# Returns\n\nan error code\n@retval #OPUS_OK _on_ success.\n@retval #OPUS_BAD_ARG _len_ was less than 1.\n@retval #OPUS_INVALID_PACKET _data_ did not contain a valid Opus packet."]
335 pub fn opus_multistream_packet_pad(
336 data: *mut ::core::ffi::c_uchar,
337 len: opus_int32,
338 new_len: opus_int32,
339 nb_streams: ::core::ffi::c_int,
340 ) -> ::core::ffi::c_int;
341 #[doc = "Remove all padding from a given Opus multi-stream packet and rewrite the TOC sequence to\nminimize space usage.\n\n# Arguments\n\n* `data` [in,out] - <tt>const unsigned char*</tt>: The buffer containing the\npacket to strip.\n* `len` - <tt>opus_int32</tt>: The size of the packet.\nThis must be at least 1.\n* `nb_streams` - <tt>opus_int32</tt>: The number of streams (not channels) in the packet.\nThis must be at least 1.\n\n# Returns\n\nThe new size of the output packet on success, or an error code\non failure.\n@retval #OPUS_BAD_ARG _len_ was less than 1 or new_len was less than len.\n@retval #OPUS_INVALID_PACKET _data_ did not contain a valid Opus packet."]
342 pub fn opus_multistream_packet_unpad(
343 data: *mut ::core::ffi::c_uchar,
344 len: opus_int32,
345 nb_streams: ::core::ffi::c_int,
346 ) -> opus_int32;
347}