Skip to main content

ohaudio_sys/audiostream_base/
audiostream_base_ffi.rs

1// automatically generated by rust-bindgen 0.71.1
2
3#![allow(non_upper_case_globals)]
4#![allow(non_camel_case_types)]
5#![allow(non_snake_case)]
6
7impl OH_AudioChannelSet {
8    pub const CH_SET_FRONT_LEFT: OH_AudioChannelSet = OH_AudioChannelSet(1);
9    pub const CH_SET_FRONT_RIGHT: OH_AudioChannelSet = OH_AudioChannelSet(2);
10    pub const CH_SET_FRONT_CENTER: OH_AudioChannelSet = OH_AudioChannelSet(4);
11    pub const CH_SET_LOW_FREQUENCY: OH_AudioChannelSet = OH_AudioChannelSet(8);
12    pub const CH_SET_BACK_LEFT: OH_AudioChannelSet = OH_AudioChannelSet(16);
13    pub const CH_SET_BACK_RIGHT: OH_AudioChannelSet = OH_AudioChannelSet(32);
14    pub const CH_SET_FRONT_LEFT_OF_CENTER: OH_AudioChannelSet = OH_AudioChannelSet(64);
15    pub const CH_SET_FRONT_RIGHT_OF_CENTER: OH_AudioChannelSet = OH_AudioChannelSet(128);
16    pub const CH_SET_BACK_CENTER: OH_AudioChannelSet = OH_AudioChannelSet(256);
17    pub const CH_SET_SIDE_LEFT: OH_AudioChannelSet = OH_AudioChannelSet(512);
18    pub const CH_SET_SIDE_RIGHT: OH_AudioChannelSet = OH_AudioChannelSet(1024);
19    pub const CH_SET_TOP_CENTER: OH_AudioChannelSet = OH_AudioChannelSet(2048);
20    pub const CH_SET_TOP_FRONT_LEFT: OH_AudioChannelSet = OH_AudioChannelSet(4096);
21    pub const CH_SET_TOP_FRONT_CENTER: OH_AudioChannelSet = OH_AudioChannelSet(8192);
22    pub const CH_SET_TOP_FRONT_RIGHT: OH_AudioChannelSet = OH_AudioChannelSet(16384);
23    pub const CH_SET_TOP_BACK_LEFT: OH_AudioChannelSet = OH_AudioChannelSet(32768);
24    pub const CH_SET_TOP_BACK_CENTER: OH_AudioChannelSet = OH_AudioChannelSet(65536);
25    pub const CH_SET_TOP_BACK_RIGHT: OH_AudioChannelSet = OH_AudioChannelSet(131072);
26    pub const CH_SET_STEREO_LEFT: OH_AudioChannelSet = OH_AudioChannelSet(536870912);
27    pub const CH_SET_STEREO_RIGHT: OH_AudioChannelSet = OH_AudioChannelSet(1073741824);
28    pub const CH_SET_WIDE_LEFT: OH_AudioChannelSet = OH_AudioChannelSet(2147483648);
29    pub const CH_SET_WIDE_RIGHT: OH_AudioChannelSet = OH_AudioChannelSet(4294967296);
30    pub const CH_SET_SURROUND_DIRECT_LEFT: OH_AudioChannelSet = OH_AudioChannelSet(8589934592);
31    pub const CH_SET_SURROUND_DIRECT_RIGHT: OH_AudioChannelSet = OH_AudioChannelSet(17179869184);
32    pub const CH_SET_LOW_FREQUENCY_2: OH_AudioChannelSet = OH_AudioChannelSet(34359738368);
33    pub const CH_SET_TOP_SIDE_LEFT: OH_AudioChannelSet = OH_AudioChannelSet(68719476736);
34    pub const CH_SET_TOP_SIDE_RIGHT: OH_AudioChannelSet = OH_AudioChannelSet(137438953472);
35    pub const CH_SET_BOTTOM_FRONT_CENTER: OH_AudioChannelSet = OH_AudioChannelSet(274877906944);
36    pub const CH_SET_BOTTOM_FRONT_LEFT: OH_AudioChannelSet = OH_AudioChannelSet(549755813888);
37    pub const CH_SET_BOTTOM_FRONT_RIGHT: OH_AudioChannelSet = OH_AudioChannelSet(1099511627776);
38}
39#[repr(transparent)]
40#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
41pub struct OH_AudioChannelSet(pub ::core::ffi::c_ulonglong);
42impl OH_AmbAttributeSet {
43    pub const AMB_ORD_1: OH_AmbAttributeSet = OH_AmbAttributeSet(1);
44    pub const AMB_ORD_2: OH_AmbAttributeSet = OH_AmbAttributeSet(2);
45    pub const AMB_ORD_3: OH_AmbAttributeSet = OH_AmbAttributeSet(3);
46    pub const AMB_COM_ACN: OH_AmbAttributeSet = OH_AmbAttributeSet(0);
47    pub const AMB_COM_FUMA: OH_AmbAttributeSet = OH_AmbAttributeSet(256);
48    pub const AMB_NOR_N3D: OH_AmbAttributeSet = OH_AmbAttributeSet(0);
49    pub const AMB_NOR_SN3D: OH_AmbAttributeSet = OH_AmbAttributeSet(4096);
50    pub const AMB_MODE: OH_AmbAttributeSet = OH_AmbAttributeSet(17592186044416);
51}
52#[repr(transparent)]
53#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
54pub struct OH_AmbAttributeSet(pub ::core::ffi::c_ulonglong);
55impl OH_AudioChannelLayout {
56    pub const CH_LAYOUT_UNKNOWN: OH_AudioChannelLayout = OH_AudioChannelLayout(0);
57    pub const CH_LAYOUT_MONO: OH_AudioChannelLayout = OH_AudioChannelLayout(4);
58    pub const CH_LAYOUT_STEREO: OH_AudioChannelLayout = OH_AudioChannelLayout(3);
59    pub const CH_LAYOUT_STEREO_DOWNMIX: OH_AudioChannelLayout = OH_AudioChannelLayout(1610612736);
60    pub const CH_LAYOUT_2POINT1: OH_AudioChannelLayout = OH_AudioChannelLayout(11);
61    pub const CH_LAYOUT_3POINT0: OH_AudioChannelLayout = OH_AudioChannelLayout(259);
62    pub const CH_LAYOUT_SURROUND: OH_AudioChannelLayout = OH_AudioChannelLayout(7);
63    pub const CH_LAYOUT_3POINT1: OH_AudioChannelLayout = OH_AudioChannelLayout(15);
64    pub const CH_LAYOUT_4POINT0: OH_AudioChannelLayout = OH_AudioChannelLayout(263);
65    pub const CH_LAYOUT_QUAD_SIDE: OH_AudioChannelLayout = OH_AudioChannelLayout(1539);
66    pub const CH_LAYOUT_QUAD: OH_AudioChannelLayout = OH_AudioChannelLayout(51);
67    pub const CH_LAYOUT_2POINT0POINT2: OH_AudioChannelLayout = OH_AudioChannelLayout(206158430211);
68    pub const CH_LAYOUT_AMB_ORDER1_ACN_N3D: OH_AudioChannelLayout =
69        OH_AudioChannelLayout(17592186044417);
70    pub const CH_LAYOUT_AMB_ORDER1_ACN_SN3D: OH_AudioChannelLayout =
71        OH_AudioChannelLayout(17592186048513);
72    pub const CH_LAYOUT_AMB_ORDER1_FUMA: OH_AudioChannelLayout =
73        OH_AudioChannelLayout(17592186044673);
74    pub const CH_LAYOUT_4POINT1: OH_AudioChannelLayout = OH_AudioChannelLayout(271);
75    pub const CH_LAYOUT_5POINT0: OH_AudioChannelLayout = OH_AudioChannelLayout(1543);
76    pub const CH_LAYOUT_5POINT0_BACK: OH_AudioChannelLayout = OH_AudioChannelLayout(55);
77    pub const CH_LAYOUT_2POINT1POINT2: OH_AudioChannelLayout = OH_AudioChannelLayout(206158430219);
78    pub const CH_LAYOUT_3POINT0POINT2: OH_AudioChannelLayout = OH_AudioChannelLayout(206158430215);
79    pub const CH_LAYOUT_5POINT1: OH_AudioChannelLayout = OH_AudioChannelLayout(1551);
80    pub const CH_LAYOUT_5POINT1_BACK: OH_AudioChannelLayout = OH_AudioChannelLayout(63);
81    pub const CH_LAYOUT_6POINT0: OH_AudioChannelLayout = OH_AudioChannelLayout(1799);
82    pub const CH_LAYOUT_3POINT1POINT2: OH_AudioChannelLayout = OH_AudioChannelLayout(20495);
83    pub const CH_LAYOUT_6POINT0_FRONT: OH_AudioChannelLayout = OH_AudioChannelLayout(1731);
84    pub const CH_LAYOUT_HEXAGONAL: OH_AudioChannelLayout = OH_AudioChannelLayout(311);
85    pub const CH_LAYOUT_6POINT1: OH_AudioChannelLayout = OH_AudioChannelLayout(1807);
86    pub const CH_LAYOUT_6POINT1_BACK: OH_AudioChannelLayout = OH_AudioChannelLayout(319);
87    pub const CH_LAYOUT_6POINT1_FRONT: OH_AudioChannelLayout = OH_AudioChannelLayout(1739);
88    pub const CH_LAYOUT_7POINT0: OH_AudioChannelLayout = OH_AudioChannelLayout(1591);
89    pub const CH_LAYOUT_7POINT0_FRONT: OH_AudioChannelLayout = OH_AudioChannelLayout(1735);
90    pub const CH_LAYOUT_7POINT1: OH_AudioChannelLayout = OH_AudioChannelLayout(1599);
91    pub const CH_LAYOUT_OCTAGONAL: OH_AudioChannelLayout = OH_AudioChannelLayout(1847);
92    pub const CH_LAYOUT_5POINT1POINT2: OH_AudioChannelLayout = OH_AudioChannelLayout(206158431759);
93    pub const CH_LAYOUT_7POINT1_WIDE: OH_AudioChannelLayout = OH_AudioChannelLayout(1743);
94    pub const CH_LAYOUT_7POINT1_WIDE_BACK: OH_AudioChannelLayout = OH_AudioChannelLayout(255);
95    pub const CH_LAYOUT_AMB_ORDER2_ACN_N3D: OH_AudioChannelLayout =
96        OH_AudioChannelLayout(17592186044418);
97    pub const CH_LAYOUT_AMB_ORDER2_ACN_SN3D: OH_AudioChannelLayout =
98        OH_AudioChannelLayout(17592186048514);
99    pub const CH_LAYOUT_AMB_ORDER2_FUMA: OH_AudioChannelLayout =
100        OH_AudioChannelLayout(17592186044674);
101    pub const CH_LAYOUT_5POINT1POINT4: OH_AudioChannelLayout = OH_AudioChannelLayout(185871);
102    pub const CH_LAYOUT_7POINT1POINT2: OH_AudioChannelLayout = OH_AudioChannelLayout(206158431807);
103    pub const CH_LAYOUT_7POINT1POINT4: OH_AudioChannelLayout = OH_AudioChannelLayout(185919);
104    pub const CH_LAYOUT_10POINT2: OH_AudioChannelLayout = OH_AudioChannelLayout(6442473271);
105    pub const CH_LAYOUT_9POINT1POINT4: OH_AudioChannelLayout = OH_AudioChannelLayout(6442636863);
106    pub const CH_LAYOUT_9POINT1POINT6: OH_AudioChannelLayout = OH_AudioChannelLayout(212601067071);
107    pub const CH_LAYOUT_HEXADECAGONAL: OH_AudioChannelLayout = OH_AudioChannelLayout(6442710839);
108    pub const CH_LAYOUT_AMB_ORDER3_ACN_N3D: OH_AudioChannelLayout =
109        OH_AudioChannelLayout(17592186044419);
110    pub const CH_LAYOUT_AMB_ORDER3_ACN_SN3D: OH_AudioChannelLayout =
111        OH_AudioChannelLayout(17592186048515);
112    pub const CH_LAYOUT_AMB_ORDER3_FUMA: OH_AudioChannelLayout =
113        OH_AudioChannelLayout(17592186044675);
114    pub const CH_LAYOUT_22POINT2: OH_AudioChannelLayout = OH_AudioChannelLayout(2164663779327);
115}
116#[repr(transparent)]
117#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
118pub struct OH_AudioChannelLayout(pub ::core::ffi::c_ulonglong);
119pub type OH_AudioStream_Result = Result<(), OH_AudioStreamErrorCode>;
120impl OH_AudioStreamErrorCode {
121    /// This means that the function was executed with an invalid input parameter.
122    ///
123    ///
124    /// Available since API-level: 10
125    pub const INVALID_PARAM: OH_AudioStreamErrorCode =
126        OH_AudioStreamErrorCode(const { core::num::NonZero::new(1).unwrap() });
127    /// Execution status exception.
128    ///
129    ///
130    /// Available since API-level: 10
131    pub const ILLEGAL_STATE: OH_AudioStreamErrorCode =
132        OH_AudioStreamErrorCode(const { core::num::NonZero::new(2).unwrap() });
133    /// An system error has occurred.
134    ///
135    ///
136    /// Available since API-level: 10
137    pub const SYSTEM: OH_AudioStreamErrorCode =
138        OH_AudioStreamErrorCode(const { core::num::NonZero::new(3).unwrap() });
139    /// Unsupported audio format, such as unsupported encoding type, sample format etc.
140    ///
141    ///
142    /// Available since API-level: 19
143    #[cfg(feature = "api-19")]
144    #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
145    pub const UNSUPPORTED_FORMAT: OH_AudioStreamErrorCode =
146        OH_AudioStreamErrorCode(const { core::num::NonZero::new(4).unwrap() });
147}
148#[repr(transparent)]
149/// Define the result of the function execution.
150///
151///
152/// Available since API-level: 10
153#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
154pub struct OH_AudioStreamErrorCode(pub core::num::NonZero<::core::ffi::c_uint>);
155impl OH_AudioStream_Type {
156    /// The type for audio stream is renderer.
157    ///
158    ///
159    /// Available since API-level: 10
160    pub const AUDIOSTREAM_TYPE_RENDERER: OH_AudioStream_Type = OH_AudioStream_Type(1);
161    /// The type for audio stream is capturer.
162    ///
163    ///
164    /// Available since API-level: 10
165    pub const AUDIOSTREAM_TYPE_CAPTURER: OH_AudioStream_Type = OH_AudioStream_Type(2);
166}
167#[repr(transparent)]
168/// Define the audio stream type.
169///
170///
171/// Available since API-level: 10
172#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
173pub struct OH_AudioStream_Type(pub ::core::ffi::c_uint);
174impl OH_AudioStream_SampleFormat {
175    /// Unsigned 8 format.
176    ///
177    ///
178    /// Available since API-level: 10
179    pub const AUDIOSTREAM_SAMPLE_U8: OH_AudioStream_SampleFormat = OH_AudioStream_SampleFormat(0);
180    /// Signed 16 bit integer, little endian.
181    ///
182    ///
183    /// Available since API-level: 10
184    pub const AUDIOSTREAM_SAMPLE_S16LE: OH_AudioStream_SampleFormat =
185        OH_AudioStream_SampleFormat(1);
186    /// Signed 24 bit integer, little endian.
187    ///
188    ///
189    /// Available since API-level: 10
190    pub const AUDIOSTREAM_SAMPLE_S24LE: OH_AudioStream_SampleFormat =
191        OH_AudioStream_SampleFormat(2);
192    /// Signed 32 bit integer, little endian.
193    ///
194    ///
195    /// Available since API-level: 10
196    pub const AUDIOSTREAM_SAMPLE_S32LE: OH_AudioStream_SampleFormat =
197        OH_AudioStream_SampleFormat(3);
198    /// Float 32, little endian.
199    ///
200    ///
201    /// Available since API-level: 17
202    #[cfg(feature = "api-17")]
203    #[cfg_attr(docsrs, doc(cfg(feature = "api-17")))]
204    pub const AUDIOSTREAM_SAMPLE_F32LE: OH_AudioStream_SampleFormat =
205        OH_AudioStream_SampleFormat(4);
206}
207#[repr(transparent)]
208/// Define the audio stream sample format.
209///
210///
211/// Available since API-level: 10
212#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
213pub struct OH_AudioStream_SampleFormat(pub ::core::ffi::c_uint);
214impl OH_AudioStream_EncodingType {
215    /// PCM encoding type.
216    ///
217    ///
218    /// Available since API-level: 10
219    pub const AUDIOSTREAM_ENCODING_TYPE_RAW: OH_AudioStream_EncodingType =
220        OH_AudioStream_EncodingType(0);
221    /// AudioVivid encoding type.
222    ///
223    ///
224    /// Available since API-level: 12
225    #[cfg(feature = "api-12")]
226    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
227    pub const AUDIOSTREAM_ENCODING_TYPE_AUDIOVIVID: OH_AudioStream_EncodingType =
228        OH_AudioStream_EncodingType(1);
229    /// E_AC3 encoding type.
230    ///
231    ///
232    /// Available since API-level: 19
233    #[cfg(feature = "api-19")]
234    #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
235    pub const AUDIOSTREAM_ENCODING_TYPE_E_AC3: OH_AudioStream_EncodingType =
236        OH_AudioStream_EncodingType(2);
237}
238#[repr(transparent)]
239/// Define the audio encoding type.
240///
241///
242/// Available since API-level: 10
243#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
244pub struct OH_AudioStream_EncodingType(pub ::core::ffi::c_uint);
245/// Define the audio stream info structure, used to describe basic audio format.
246///
247///
248/// Available since API-level: 19
249#[cfg(feature = "api-19")]
250#[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
251#[repr(C)]
252#[derive(Debug, Copy, Clone)]
253pub struct OH_AudioStreamInfo {
254    /// Audio sampling rate.
255    ///
256    ///
257    /// Available since API-level: 19
258    pub samplingRate: i32,
259    /// Audio channel layout.
260    ///
261    ///
262    /// Available since API-level: 19
263    pub channelLayout: OH_AudioChannelLayout,
264    /// Audio encoding format type.
265    ///
266    ///
267    /// Available since API-level: 19
268    pub encodingType: OH_AudioStream_EncodingType,
269    /// Audio sample format.
270    ///
271    ///
272    /// Available since API-level: 19
273    pub sampleFormat: OH_AudioStream_SampleFormat,
274}
275impl OH_AudioStream_Usage {
276    /// Unknown usage.
277    ///
278    ///
279    /// Available since API-level: 10
280    pub const AUDIOSTREAM_USAGE_UNKNOWN: OH_AudioStream_Usage = OH_AudioStream_Usage(0);
281    /// Music usage.
282    ///
283    ///
284    /// Available since API-level: 10
285    pub const AUDIOSTREAM_USAGE_MUSIC: OH_AudioStream_Usage = OH_AudioStream_Usage(1);
286    /// Voice communication usage.
287    ///
288    ///
289    /// Available since API-level: 10
290    pub const AUDIOSTREAM_USAGE_VOICE_COMMUNICATION: OH_AudioStream_Usage = OH_AudioStream_Usage(2);
291    /// Voice assistant usage.
292    ///
293    ///
294    /// Available since API-level: 10
295    pub const AUDIOSTREAM_USAGE_VOICE_ASSISTANT: OH_AudioStream_Usage = OH_AudioStream_Usage(3);
296    /// Alarm usage.
297    ///
298    ///
299    /// Available since API-level: 10
300    pub const AUDIOSTREAM_USAGE_ALARM: OH_AudioStream_Usage = OH_AudioStream_Usage(4);
301    /// Voice message usage.
302    ///
303    ///
304    /// Available since API-level: 10
305    pub const AUDIOSTREAM_USAGE_VOICE_MESSAGE: OH_AudioStream_Usage = OH_AudioStream_Usage(5);
306    /// Ringtone usage.
307    ///
308    ///
309    /// Available since API-level: 10
310    pub const AUDIOSTREAM_USAGE_RINGTONE: OH_AudioStream_Usage = OH_AudioStream_Usage(6);
311    /// Notification usage.
312    ///
313    ///
314    /// Available since API-level: 10
315    pub const AUDIOSTREAM_USAGE_NOTIFICATION: OH_AudioStream_Usage = OH_AudioStream_Usage(7);
316    /// Accessibility usage, such as screen reader.
317    ///
318    ///
319    /// Available since API-level: 10
320    pub const AUDIOSTREAM_USAGE_ACCESSIBILITY: OH_AudioStream_Usage = OH_AudioStream_Usage(8);
321    /// Movie or video usage.
322    ///
323    ///
324    /// Available since API-level: 10
325    pub const AUDIOSTREAM_USAGE_MOVIE: OH_AudioStream_Usage = OH_AudioStream_Usage(10);
326    /// Game sound effect usage.
327    ///
328    ///
329    /// Available since API-level: 10
330    pub const AUDIOSTREAM_USAGE_GAME: OH_AudioStream_Usage = OH_AudioStream_Usage(11);
331    /// Audiobook usage.
332    ///
333    ///
334    /// Available since API-level: 10
335    pub const AUDIOSTREAM_USAGE_AUDIOBOOK: OH_AudioStream_Usage = OH_AudioStream_Usage(12);
336    /// Navigation usage.
337    ///
338    ///
339    /// Available since API-level: 10
340    pub const AUDIOSTREAM_USAGE_NAVIGATION: OH_AudioStream_Usage = OH_AudioStream_Usage(13);
341    /// Video call usage.
342    ///
343    ///
344    /// Available since API-level: 12
345    #[cfg(feature = "api-12")]
346    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
347    pub const AUDIOSTREAM_USAGE_VIDEO_COMMUNICATION: OH_AudioStream_Usage =
348        OH_AudioStream_Usage(17);
349}
350#[repr(transparent)]
351/// Define the audio stream usage.
352/// Audio stream usage is used to describe what work scenario
353/// the current stream is used for.
354///
355///
356/// Available since API-level: 10
357#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
358pub struct OH_AudioStream_Usage(pub ::core::ffi::c_uint);
359impl OH_AudioStream_LatencyMode {
360    /// This is a normal audio scene.
361    ///
362    ///
363    /// Available since API-level: 10
364    pub const AUDIOSTREAM_LATENCY_MODE_NORMAL: OH_AudioStream_LatencyMode =
365        OH_AudioStream_LatencyMode(0);
366    /// This is a low latency audio scene.
367    ///
368    ///
369    /// Available since API-level: 10
370    pub const AUDIOSTREAM_LATENCY_MODE_FAST: OH_AudioStream_LatencyMode =
371        OH_AudioStream_LatencyMode(1);
372}
373#[repr(transparent)]
374/// Define the audio latency mode.
375///
376///
377/// Available since API-level: 10
378#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
379pub struct OH_AudioStream_LatencyMode(pub ::core::ffi::c_uint);
380#[cfg(feature = "api-19")]
381#[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
382impl OH_AudioStream_DirectPlaybackMode {
383    /// Direct playback is not supported.
384    ///
385    ///
386    /// Available since API-level: 19
387    #[cfg(feature = "api-19")]
388    #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
389    pub const AUDIOSTREAM_DIRECT_PLAYBACK_NOT_SUPPORTED: OH_AudioStream_DirectPlaybackMode =
390        OH_AudioStream_DirectPlaybackMode(0);
391    /// Direct playback mode which is bitstream pass-through such as compressed pass-through.
392    ///
393    ///
394    /// Available since API-level: 19
395    #[cfg(feature = "api-19")]
396    #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
397    pub const AUDIOSTREAM_DIRECT_PLAYBACK_BITSTREAM_SUPPORTED: OH_AudioStream_DirectPlaybackMode =
398        OH_AudioStream_DirectPlaybackMode(1);
399    /// Direct playback mode of pcm.
400    ///
401    ///
402    /// Available since API-level: 19
403    #[cfg(feature = "api-19")]
404    #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
405    pub const AUDIOSTREAM_DIRECT_PLAYBACK_PCM_SUPPORTED: OH_AudioStream_DirectPlaybackMode =
406        OH_AudioStream_DirectPlaybackMode(2);
407}
408#[repr(transparent)]
409/// Enumerates audio direct playback modes.
410///
411///
412/// Available since API-level: 19
413#[cfg(feature = "api-19")]
414#[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
415#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
416pub struct OH_AudioStream_DirectPlaybackMode(pub ::core::ffi::c_uint);
417impl OH_AudioStream_Event {
418    /// The routing of the audio has changed.
419    ///
420    ///
421    /// **Deprecated** since 20
422    ///
423    /// **Use instead:** OH_AudioRenderer_OutputDeviceChangeCallback.
424    ///
425    /// Available since API-level: 10
426    #[deprecated(
427        since = "20",
428        note = "Use instead: OH_AudioRenderer_OutputDeviceChangeCallback"
429    )]
430    pub const AUDIOSTREAM_EVENT_ROUTING_CHANGED: OH_AudioStream_Event = OH_AudioStream_Event(0);
431}
432#[repr(transparent)]
433/// Define the audio event.
434///
435///
436/// **Deprecated** since 20
437///
438/// **Use instead:** OH_AudioRenderer_OutputDeviceChangeCallback.
439///
440/// Available since API-level: 10
441#[deprecated(
442    since = "20",
443    note = "Use instead: OH_AudioRenderer_OutputDeviceChangeCallback"
444)]
445#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
446pub struct OH_AudioStream_Event(pub ::core::ffi::c_uint);
447impl OH_AudioStream_State {
448    /// The invalid state.
449    ///
450    ///
451    /// Available since API-level: 10
452    pub const AUDIOSTREAM_STATE_INVALID: OH_AudioStream_State = OH_AudioStream_State(-1);
453    /// Create new instance state.
454    ///
455    ///
456    /// Available since API-level: 10
457    pub const AUDIOSTREAM_STATE_NEW: OH_AudioStream_State = OH_AudioStream_State(0);
458    /// The prepared state.
459    ///
460    ///
461    /// Available since API-level: 10
462    pub const AUDIOSTREAM_STATE_PREPARED: OH_AudioStream_State = OH_AudioStream_State(1);
463    /// The stream is running.
464    ///
465    ///
466    /// Available since API-level: 10
467    pub const AUDIOSTREAM_STATE_RUNNING: OH_AudioStream_State = OH_AudioStream_State(2);
468    /// The stream is stopped.
469    ///
470    ///
471    /// Available since API-level: 10
472    pub const AUDIOSTREAM_STATE_STOPPED: OH_AudioStream_State = OH_AudioStream_State(3);
473    /// The stream is released.
474    ///
475    ///
476    /// Available since API-level: 10
477    pub const AUDIOSTREAM_STATE_RELEASED: OH_AudioStream_State = OH_AudioStream_State(4);
478    /// The stream is paused.
479    ///
480    ///
481    /// Available since API-level: 10
482    pub const AUDIOSTREAM_STATE_PAUSED: OH_AudioStream_State = OH_AudioStream_State(5);
483}
484#[repr(transparent)]
485/// The audio stream states
486///
487///
488/// Available since API-level: 10
489#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
490pub struct OH_AudioStream_State(pub ::core::ffi::c_int);
491impl OH_AudioInterrupt_ForceType {
492    /// Force type, system change audio state.
493    ///
494    ///
495    /// Available since API-level: 10
496    pub const AUDIOSTREAM_INTERRUPT_FORCE: OH_AudioInterrupt_ForceType =
497        OH_AudioInterrupt_ForceType(0);
498    /// Share type, application change audio state.
499    ///
500    ///
501    /// Available since API-level: 10
502    pub const AUDIOSTREAM_INTERRUPT_SHARE: OH_AudioInterrupt_ForceType =
503        OH_AudioInterrupt_ForceType(1);
504}
505#[repr(transparent)]
506/// Defines the audio interrupt type.
507///
508///
509/// Available since API-level: 10
510#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
511pub struct OH_AudioInterrupt_ForceType(pub ::core::ffi::c_uint);
512impl OH_AudioInterrupt_Hint {
513    /// None.
514    ///
515    ///
516    /// Available since API-level: 10
517    pub const AUDIOSTREAM_INTERRUPT_HINT_NONE: OH_AudioInterrupt_Hint = OH_AudioInterrupt_Hint(0);
518    /// Resume the stream.
519    ///
520    ///
521    /// Available since API-level: 10
522    pub const AUDIOSTREAM_INTERRUPT_HINT_RESUME: OH_AudioInterrupt_Hint = OH_AudioInterrupt_Hint(1);
523    /// Pause the stream.
524    ///
525    ///
526    /// Available since API-level: 10
527    pub const AUDIOSTREAM_INTERRUPT_HINT_PAUSE: OH_AudioInterrupt_Hint = OH_AudioInterrupt_Hint(2);
528    /// Stop the stream.
529    ///
530    ///
531    /// Available since API-level: 10
532    pub const AUDIOSTREAM_INTERRUPT_HINT_STOP: OH_AudioInterrupt_Hint = OH_AudioInterrupt_Hint(3);
533    /// Ducked the stream.
534    ///
535    ///
536    /// Available since API-level: 10
537    pub const AUDIOSTREAM_INTERRUPT_HINT_DUCK: OH_AudioInterrupt_Hint = OH_AudioInterrupt_Hint(4);
538    /// Unducked the stream.
539    ///
540    ///
541    /// Available since API-level: 10
542    pub const AUDIOSTREAM_INTERRUPT_HINT_UNDUCK: OH_AudioInterrupt_Hint = OH_AudioInterrupt_Hint(5);
543    /// Mute the stream.
544    ///
545    ///
546    /// Available since API-level: 20
547    #[cfg(feature = "api-20")]
548    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
549    pub const AUDIOSTREAM_INTERRUPT_HINT_MUTE: OH_AudioInterrupt_Hint = OH_AudioInterrupt_Hint(6);
550    /// Unmute the stream.
551    ///
552    ///
553    /// Available since API-level: 20
554    #[cfg(feature = "api-20")]
555    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
556    pub const AUDIOSTREAM_INTERRUPT_HINT_UNMUTE: OH_AudioInterrupt_Hint = OH_AudioInterrupt_Hint(7);
557}
558#[repr(transparent)]
559/// Defines the audio interrupt hint type.
560///
561///
562/// Available since API-level: 10
563#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
564pub struct OH_AudioInterrupt_Hint(pub ::core::ffi::c_uint);
565impl OH_AudioStream_SourceType {
566    /// Invalid type.
567    ///
568    ///
569    /// Available since API-level: 10
570    pub const AUDIOSTREAM_SOURCE_TYPE_INVALID: OH_AudioStream_SourceType =
571        OH_AudioStream_SourceType(-1);
572    /// Mic source type.
573    ///
574    ///
575    /// Available since API-level: 10
576    pub const AUDIOSTREAM_SOURCE_TYPE_MIC: OH_AudioStream_SourceType = OH_AudioStream_SourceType(0);
577    /// Voice recognition source type.
578    ///
579    ///
580    /// Available since API-level: 10
581    pub const AUDIOSTREAM_SOURCE_TYPE_VOICE_RECOGNITION: OH_AudioStream_SourceType =
582        OH_AudioStream_SourceType(1);
583    /// Playback capture source type.
584    ///
585    ///
586    /// **Deprecated** since 12
587    ///
588    /// **Use instead:** OH_AVScreenCapture in native interface.
589    ///
590    /// Available since API-level: 10
591    #[deprecated(
592        since = "12",
593        note = "Use instead: OH_AVScreenCapture in native interface"
594    )]
595    pub const AUDIOSTREAM_SOURCE_TYPE_PLAYBACK_CAPTURE: OH_AudioStream_SourceType =
596        OH_AudioStream_SourceType(2);
597    /// Voice communication source type.
598    ///
599    ///
600    /// Available since API-level: 10
601    pub const AUDIOSTREAM_SOURCE_TYPE_VOICE_COMMUNICATION: OH_AudioStream_SourceType =
602        OH_AudioStream_SourceType(7);
603    /// Voice message source type.
604    ///
605    ///
606    /// Available since API-level: 12
607    #[cfg(feature = "api-12")]
608    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
609    pub const AUDIOSTREAM_SOURCE_TYPE_VOICE_MESSAGE: OH_AudioStream_SourceType =
610        OH_AudioStream_SourceType(10);
611    /// Camcorder source type.
612    ///
613    ///
614    /// Available since API-level: 13
615    #[cfg(feature = "api-13")]
616    #[cfg_attr(docsrs, doc(cfg(feature = "api-13")))]
617    pub const AUDIOSTREAM_SOURCE_TYPE_CAMCORDER: OH_AudioStream_SourceType =
618        OH_AudioStream_SourceType(13);
619    /// Unprocessed source type.
620    ///
621    ///
622    /// Available since API-level: 14
623    #[cfg(feature = "api-14")]
624    #[cfg_attr(docsrs, doc(cfg(feature = "api-14")))]
625    pub const AUDIOSTREAM_SOURCE_TYPE_UNPROCESSED: OH_AudioStream_SourceType =
626        OH_AudioStream_SourceType(14);
627    /// Live Broadcast source type.
628    ///
629    ///
630    /// Available since API-level: 20
631    #[cfg(feature = "api-20")]
632    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
633    pub const AUDIOSTREAM_SOURCE_TYPE_LIVE: OH_AudioStream_SourceType =
634        OH_AudioStream_SourceType(17);
635}
636#[repr(transparent)]
637/// Defines the audio source type.
638///
639///
640/// Available since API-level: 10
641#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
642pub struct OH_AudioStream_SourceType(pub ::core::ffi::c_int);
643#[cfg(feature = "api-12")]
644#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
645impl OH_AudioInterrupt_Mode {
646    /// Share mode
647    pub const AUDIOSTREAM_INTERRUPT_MODE_SHARE: OH_AudioInterrupt_Mode = OH_AudioInterrupt_Mode(0);
648    /// Independent mode
649    pub const AUDIOSTREAM_INTERRUPT_MODE_INDEPENDENT: OH_AudioInterrupt_Mode =
650        OH_AudioInterrupt_Mode(1);
651}
652#[repr(transparent)]
653/// Defines the audio interrupt mode.
654///
655///
656/// Available since API-level: 12
657#[cfg(feature = "api-12")]
658#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
659#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
660pub struct OH_AudioInterrupt_Mode(pub ::core::ffi::c_uint);
661#[cfg(feature = "api-12")]
662#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
663impl OH_AudioStream_AudioEffectMode {
664    /// Audio Effect Mode effect none.
665    ///
666    ///
667    /// Available since API-level: 12
668    #[cfg(feature = "api-12")]
669    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
670    pub const EFFECT_NONE: OH_AudioStream_AudioEffectMode = OH_AudioStream_AudioEffectMode(0);
671    /// Audio Effect Mode effect default.
672    ///
673    ///
674    /// Available since API-level: 12
675    #[cfg(feature = "api-12")]
676    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
677    pub const EFFECT_DEFAULT: OH_AudioStream_AudioEffectMode = OH_AudioStream_AudioEffectMode(1);
678}
679#[repr(transparent)]
680/// Defines the audio effect mode.
681///
682///
683/// Available since API-level: 12
684#[cfg(feature = "api-12")]
685#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
686#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
687pub struct OH_AudioStream_AudioEffectMode(pub ::core::ffi::c_uint);
688#[cfg(feature = "api-20")]
689#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
690impl OH_AudioStream_FastStatus {
691    /// normal status
692    pub const AUDIOSTREAM_FASTSTATUS_NORMAL: OH_AudioStream_FastStatus =
693        OH_AudioStream_FastStatus(0);
694    /// fast status
695    pub const AUDIOSTREAM_FASTSTATUS_FAST: OH_AudioStream_FastStatus = OH_AudioStream_FastStatus(1);
696}
697#[repr(transparent)]
698/// Defines the fast status.
699///
700///
701/// Available since API-level: 20
702#[cfg(feature = "api-20")]
703#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
704#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
705pub struct OH_AudioStream_FastStatus(pub ::core::ffi::c_uint);
706#[repr(C)]
707pub struct OH_AudioStreamBuilderStruct {
708    _unused: [u8; 0],
709}
710/// Declaring the audio stream builder.
711/// The instance of builder is used for creating audio stream.
712///
713///
714/// Available since API-level: 10
715pub type OH_AudioStreamBuilder = OH_AudioStreamBuilderStruct;
716#[repr(C)]
717pub struct OH_AudioRendererStruct {
718    _unused: [u8; 0],
719}
720/// Declaring the audio renderer stream.
721/// The instance of renderer stream is used for playing audio data.
722///
723///
724/// Available since API-level: 10
725pub type OH_AudioRenderer = OH_AudioRendererStruct;
726#[repr(C)]
727pub struct OH_AudioCapturerStruct {
728    _unused: [u8; 0],
729}
730/// Declaring the audio capturer stream.
731/// The instance of renderer stream is used for capturing audio data.
732///
733///
734/// Available since API-level: 10
735pub type OH_AudioCapturer = OH_AudioCapturerStruct;
736/// Declaring the callback struct for renderer stream.
737///
738///
739/// **Deprecated** since 20
740///
741/// **Use instead:** Use the callback type: OH_AudioRenderer_OnWriteDataCallback, OH_AudioRenderer_OutputDeviceChangeCallback,
742/// OH_AudioRenderer_OnInterruptEvent, OH_AudioRenderer_OnErrorCallback separately.
743///
744/// Available since API-level: 10
745#[deprecated(
746    since = "20",
747    note = "Use instead: Use the callback type: OH_AudioRenderer_OnWriteDataCallback, OH_AudioRenderer_OutputDeviceChangeCallback, OH_AudioRenderer_OnInterruptEvent, OH_AudioRenderer_OnErrorCallback separately"
748)]
749#[repr(C)]
750#[derive(Debug, Copy, Clone)]
751pub struct OH_AudioRenderer_Callbacks_Struct {
752    /// This function pointer will point to the callback function that
753    /// is used to write audio data
754    ///
755    ///
756    /// **Deprecated** since 20
757    ///
758    /// **Use instead:** OH_AudioRenderer_OnWriteDataCallback.
759    ///
760    /// Available since API-level: 10
761    pub OH_AudioRenderer_OnWriteData: ::core::option::Option<
762        unsafe extern "C" fn(
763            renderer: *mut OH_AudioRenderer,
764            userData: *mut ::core::ffi::c_void,
765            buffer: *mut ::core::ffi::c_void,
766            length: i32,
767        ) -> i32,
768    >,
769    /// This function pointer will point to the callback function that
770    /// is used to handle audio renderer stream events.
771    ///
772    ///
773    /// **Deprecated** since 20
774    ///
775    /// **Use instead:** OH_AudioRenderer_OutputDeviceChangeCallback.
776    ///
777    /// Available since API-level: 10
778    pub OH_AudioRenderer_OnStreamEvent: ::core::option::Option<
779        unsafe extern "C" fn(
780            renderer: *mut OH_AudioRenderer,
781            userData: *mut ::core::ffi::c_void,
782            event: OH_AudioStream_Event,
783        ) -> i32,
784    >,
785    /// This function pointer will point to the callback function that
786    /// is used to handle audio interrupt events.
787    ///
788    ///
789    /// **Deprecated** since 20
790    ///
791    /// **Use instead:** OH_AudioRenderer_OnInterruptCallback.
792    ///
793    /// Available since API-level: 10
794    pub OH_AudioRenderer_OnInterruptEvent: ::core::option::Option<
795        unsafe extern "C" fn(
796            renderer: *mut OH_AudioRenderer,
797            userData: *mut ::core::ffi::c_void,
798            type_: OH_AudioInterrupt_ForceType,
799            hint: OH_AudioInterrupt_Hint,
800        ) -> i32,
801    >,
802    /// This function pointer will point to the callback function that
803    /// is used to handle audio error result.
804    ///
805    ///
806    /// **Deprecated** since 20
807    ///
808    /// **Use instead:** OH_AudioRenderer_OnErrorCallback.
809    ///
810    /// Available since API-level: 10
811    pub OH_AudioRenderer_OnError: ::core::option::Option<
812        unsafe extern "C" fn(
813            renderer: *mut OH_AudioRenderer,
814            userData: *mut ::core::ffi::c_void,
815            error: OH_AudioStream_Result,
816        ) -> i32,
817    >,
818}
819/// Declaring the callback struct for renderer stream.
820///
821///
822/// **Deprecated** since 20
823///
824/// **Use instead:** Use the callback type: OH_AudioRenderer_OnWriteDataCallback, OH_AudioRenderer_OutputDeviceChangeCallback,
825/// OH_AudioRenderer_OnInterruptEvent, OH_AudioRenderer_OnErrorCallback separately.
826///
827/// Available since API-level: 10
828#[deprecated(
829    since = "20",
830    note = "Use instead: Use the callback type: OH_AudioRenderer_OnWriteDataCallback, OH_AudioRenderer_OutputDeviceChangeCallback, OH_AudioRenderer_OnInterruptEvent, OH_AudioRenderer_OnErrorCallback separately"
831)]
832pub type OH_AudioRenderer_Callbacks = OH_AudioRenderer_Callbacks_Struct;
833/// Declaring the callback struct for capturer stream.
834///
835///
836/// **Deprecated** since 20
837///
838/// **Use instead:** Use the callback type: OH_AudioCapturer_OnReadDataCallback, OH_AudioCapturer_OnDeviceChangeCallback,
839/// OH_AudioCapturer_OnInterruptCallback and OH_AudioCapturer_OnErrorCallback separately.
840///
841/// Available since API-level: 10
842#[deprecated(
843    since = "20",
844    note = "Use instead: Use the callback type: OH_AudioCapturer_OnReadDataCallback, OH_AudioCapturer_OnDeviceChangeCallback, OH_AudioCapturer_OnInterruptCallback and OH_AudioCapturer_OnErrorCallback separately"
845)]
846#[repr(C)]
847#[derive(Debug, Copy, Clone)]
848pub struct OH_AudioCapturer_Callbacks_Struct {
849    /// This function pointer will point to the callback function that
850    /// is used to read audio data.
851    ///
852    ///
853    /// **Deprecated** since 20
854    ///
855    /// **Use instead:** OH_AudioCapturer_OnReadDataCallback
856    ///
857    /// Available since API-level: 10
858    pub OH_AudioCapturer_OnReadData: ::core::option::Option<
859        unsafe extern "C" fn(
860            capturer: *mut OH_AudioCapturer,
861            userData: *mut ::core::ffi::c_void,
862            buffer: *mut ::core::ffi::c_void,
863            length: i32,
864        ) -> i32,
865    >,
866    /// This function pointer will point to the callback function that
867    /// is used to handle audio capturer stream events.
868    ///
869    ///
870    /// **Deprecated** since 20
871    ///
872    /// **Use instead:** OH_AudioRenderer_OutputDeviceChangeCallback
873    ///
874    /// Available since API-level: 10
875    pub OH_AudioCapturer_OnStreamEvent: ::core::option::Option<
876        unsafe extern "C" fn(
877            capturer: *mut OH_AudioCapturer,
878            userData: *mut ::core::ffi::c_void,
879            event: OH_AudioStream_Event,
880        ) -> i32,
881    >,
882    /// This function pointer will point to the callback function that
883    /// is used to handle audio interrupt events.
884    ///
885    ///
886    /// **Deprecated** since 20
887    ///
888    /// **Use instead:** OH_AudioCapturer_OnInterruptCallback
889    ///
890    /// Available since API-level: 10
891    pub OH_AudioCapturer_OnInterruptEvent: ::core::option::Option<
892        unsafe extern "C" fn(
893            capturer: *mut OH_AudioCapturer,
894            userData: *mut ::core::ffi::c_void,
895            type_: OH_AudioInterrupt_ForceType,
896            hint: OH_AudioInterrupt_Hint,
897        ) -> i32,
898    >,
899    /// This function pointer will point to the callback function that
900    /// is used to handle audio error result.
901    ///
902    ///
903    /// **Deprecated** since 20
904    ///
905    /// **Use instead:** OH_AudioCapturer_OnErrorCallback
906    ///
907    /// Available since API-level: 10
908    pub OH_AudioCapturer_OnError: ::core::option::Option<
909        unsafe extern "C" fn(
910            capturer: *mut OH_AudioCapturer,
911            userData: *mut ::core::ffi::c_void,
912            error: OH_AudioStream_Result,
913        ) -> i32,
914    >,
915}
916/// Declaring the callback struct for capturer stream.
917///
918///
919/// **Deprecated** since 20
920///
921/// **Use instead:** Use the callback type: OH_AudioCapturer_OnReadDataCallback, OH_AudioCapturer_OnDeviceChangeCallback,
922/// OH_AudioCapturer_OnInterruptCallback and OH_AudioCapturer_OnErrorCallback separately.
923///
924/// Available since API-level: 10
925#[deprecated(
926    since = "20",
927    note = "Use instead: Use the callback type: OH_AudioCapturer_OnReadDataCallback, OH_AudioCapturer_OnDeviceChangeCallback, OH_AudioCapturer_OnInterruptCallback and OH_AudioCapturer_OnErrorCallback separately"
928)]
929pub type OH_AudioCapturer_Callbacks = OH_AudioCapturer_Callbacks_Struct;
930#[cfg(feature = "api-11")]
931#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
932impl OH_AudioStream_DeviceChangeReason {
933    pub const REASON_UNKNOWN: OH_AudioStream_DeviceChangeReason =
934        OH_AudioStream_DeviceChangeReason(0);
935    pub const REASON_NEW_DEVICE_AVAILABLE: OH_AudioStream_DeviceChangeReason =
936        OH_AudioStream_DeviceChangeReason(1);
937    pub const REASON_OLD_DEVICE_UNAVAILABLE: OH_AudioStream_DeviceChangeReason =
938        OH_AudioStream_DeviceChangeReason(2);
939    pub const REASON_OVERRODE: OH_AudioStream_DeviceChangeReason =
940        OH_AudioStream_DeviceChangeReason(3);
941    /// Device information when the audio session is activated.
942    ///
943    ///
944    /// Available since API-level: 20
945    #[cfg(feature = "api-20")]
946    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
947    pub const REASON_SESSION_ACTIVATED: OH_AudioStream_DeviceChangeReason =
948        OH_AudioStream_DeviceChangeReason(4);
949    /// There is a higher-priority stream, causing the system device to change.
950    ///
951    ///
952    /// Available since API-level: 20
953    #[cfg(feature = "api-20")]
954    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
955    pub const REASON_STREAM_PRIORITY_CHANGED: OH_AudioStream_DeviceChangeReason =
956        OH_AudioStream_DeviceChangeReason(5);
957}
958#[repr(transparent)]
959/// Defines reason for device changes of one audio stream.
960///
961///
962/// Available since API-level: 11
963#[cfg(feature = "api-11")]
964#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
965#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
966pub struct OH_AudioStream_DeviceChangeReason(pub ::core::ffi::c_uint);
967/// Callback when the output device of an audio renderer changed.
968///
969/// # Arguments
970///
971/// * `renderer` - AudioRenderer where this event occurs.
972///
973/// * `userData` - User data which is passed by user.
974///
975/// * `reason` - Indicates that why does the output device changes.
976///
977/// Available since API-level: 11
978#[cfg(feature = "api-11")]
979#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
980pub type OH_AudioRenderer_OutputDeviceChangeCallback = ::core::option::Option<
981    unsafe extern "C" fn(
982        renderer: *mut OH_AudioRenderer,
983        userData: *mut ::core::ffi::c_void,
984        reason: OH_AudioStream_DeviceChangeReason,
985    ),
986>;
987/// Callback when the mark position reached.
988///
989/// # Arguments
990///
991/// * `renderer` - AudioRenderer where this event occurs.
992///
993/// * `samplePos` - Mark position in samples.
994///
995/// * `userData` - User data which is passed by user.
996///
997/// Available since API-level: 12
998#[cfg(feature = "api-12")]
999#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1000pub type OH_AudioRenderer_OnMarkReachedCallback = ::core::option::Option<
1001    unsafe extern "C" fn(
1002        renderer: *mut OH_AudioRenderer,
1003        samplePos: u32,
1004        userData: *mut ::core::ffi::c_void,
1005    ),
1006>;
1007/// This function pointer will point to the callback function that
1008/// is used to write audio data with metadata
1009///
1010/// # Arguments
1011///
1012/// * `renderer` - AudioRenderer where this event occurs.
1013///
1014/// * `userData` - User data which is passed by user.
1015///
1016/// * `audioData` - Audio data which is written by user.
1017///
1018/// * `audioDataSize` - Audio data size which is the size of audio data written by user.
1019///
1020/// * `metadata` - Metadata which is written by user.
1021///
1022/// * `metadataSize` - Metadata size which is the size of metadata written by user.
1023///
1024/// # Returns
1025///
1026/// * Error code of the callback function returned by user.
1027///
1028/// Available since API-level: 12
1029#[cfg(feature = "api-12")]
1030#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1031pub type OH_AudioRenderer_WriteDataWithMetadataCallback = ::core::option::Option<
1032    unsafe extern "C" fn(
1033        renderer: *mut OH_AudioRenderer,
1034        userData: *mut ::core::ffi::c_void,
1035        audioData: *mut ::core::ffi::c_void,
1036        audioDataSize: i32,
1037        metadata: *mut ::core::ffi::c_void,
1038        metadataSize: i32,
1039    ) -> i32,
1040>;
1041#[cfg(feature = "api-12")]
1042#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1043impl OH_AudioStream_PrivacyType {
1044    /// Privacy type that stream can be captured by third party applications.
1045    ///
1046    /// Available since API-level: 12
1047    #[cfg(feature = "api-12")]
1048    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1049    pub const AUDIO_STREAM_PRIVACY_TYPE_PUBLIC: OH_AudioStream_PrivacyType =
1050        OH_AudioStream_PrivacyType(0);
1051    /// Privacy type that stream can not be captured.
1052    ///
1053    /// Available since API-level: 12
1054    #[cfg(feature = "api-12")]
1055    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1056    pub const AUDIO_STREAM_PRIVACY_TYPE_PRIVATE: OH_AudioStream_PrivacyType =
1057        OH_AudioStream_PrivacyType(1);
1058    /// Privacy type that stream can be safely captured and screen casting.
1059    /// For example,[`OH_AudioStream_Usage#AUDIOSTREAM_USAGE_VOICE_COMMUNICATION`] will not be
1060    /// captured or screen casted by third party applications under AUDIO_STREAM_PRIVACY_TYPE_PUBLIC policy.
1061    /// However, the internal capture is allowed under the AUDIO_STREAM_PRIVACY_TYPE_SHARED policy.
1062    ///
1063    /// Available since API-level: 21
1064    #[cfg(feature = "api-21")]
1065    #[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
1066    pub const AUDIO_STREAM_PRIVACY_TYPE_SHARED: OH_AudioStream_PrivacyType =
1067        OH_AudioStream_PrivacyType(2);
1068}
1069#[repr(transparent)]
1070/// Defines Enumeration of audio stream privacy type for playback capture.
1071///
1072///
1073/// Available since API-level: 12
1074#[cfg(feature = "api-12")]
1075#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1076#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1077pub struct OH_AudioStream_PrivacyType(pub ::core::ffi::c_uint);
1078#[cfg(feature = "api-12")]
1079#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1080impl OH_AudioData_Callback_Result {
1081    /// Result of audio data callabck is invalid.
1082    pub const AUDIO_DATA_CALLBACK_RESULT_INVALID: OH_AudioData_Callback_Result =
1083        OH_AudioData_Callback_Result(-1);
1084    /// Result of audio data callabck is valid.
1085    pub const AUDIO_DATA_CALLBACK_RESULT_VALID: OH_AudioData_Callback_Result =
1086        OH_AudioData_Callback_Result(0);
1087}
1088#[repr(transparent)]
1089/// Defines enumeration of audio data callback result.
1090///
1091///
1092/// Available since API-level: 12
1093#[cfg(feature = "api-12")]
1094#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1095#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1096pub struct OH_AudioData_Callback_Result(pub ::core::ffi::c_int);
1097/// Callback function of write data.
1098///
1099/// This function is similar with OH_AudioRenderer_Callbacks_Struct.OH_AudioRenderer_OnWriteData instead of the return
1100/// value. The return result of this function indicates whether the data filled in the buffer is valid or invalid. If
1101/// result is invalid, the data filled by user will not be played.
1102///
1103/// # Arguments
1104///
1105/// * `renderer` - AudioRenderer where this callback occurs.
1106///
1107/// * `userData` - User data which is passed by user.
1108///
1109/// * `audioData` - Audio data pointer, where user should fill in audio data.
1110///
1111/// * `audioDataSize` - Size of audio data that user should fill in.
1112///
1113/// # Returns
1114///
1115/// * Audio Data callback result.
1116/// [`OH_AudioRenderer_Callbacks_Struct.OH_AudioRenderer_OnWriteData`]
1117/// Available since API-level: 12
1118#[cfg(feature = "api-12")]
1119#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
1120pub type OH_AudioRenderer_OnWriteDataCallback = ::core::option::Option<
1121    unsafe extern "C" fn(
1122        renderer: *mut OH_AudioRenderer,
1123        userData: *mut ::core::ffi::c_void,
1124        audioData: *mut ::core::ffi::c_void,
1125        audioDataSize: i32,
1126    ) -> OH_AudioData_Callback_Result,
1127>;
1128#[cfg(feature = "api-19")]
1129#[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1130impl OH_AudioStream_VolumeMode {
1131    /// Indicates this audio stream volume will be affected by system volume, also the default behavior.
1132    ///
1133    ///
1134    /// Available since API-level: 19
1135    #[cfg(feature = "api-19")]
1136    #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1137    pub const AUDIOSTREAM_VOLUMEMODE_SYSTEM_GLOBAL: OH_AudioStream_VolumeMode =
1138        OH_AudioStream_VolumeMode(0);
1139    /// Indicates this audio stream volume will be affected by app's individual volume percentage which set by yourself
1140    /// using the app volume api.
1141    ///
1142    ///
1143    /// Available since API-level: 19
1144    #[cfg(feature = "api-19")]
1145    #[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1146    pub const AUDIOSTREAM_VOLUMEMODE_APP_INDIVIDUAL: OH_AudioStream_VolumeMode =
1147        OH_AudioStream_VolumeMode(1);
1148}
1149#[repr(transparent)]
1150/// Define the audio stream volume mode.
1151///
1152///
1153/// Available since API-level: 19
1154#[cfg(feature = "api-19")]
1155#[cfg_attr(docsrs, doc(cfg(feature = "api-19")))]
1156#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1157pub struct OH_AudioStream_VolumeMode(pub ::core::ffi::c_uint);
1158#[cfg(feature = "api-23")]
1159#[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
1160impl OH_AudioStream_LatencyType {
1161    /// Type to get latency of all audio processing units, including software and hardware.
1162    ///
1163    ///
1164    /// Available since API-level: 23
1165    #[cfg(feature = "api-23")]
1166    #[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
1167    pub const AUDIOSTREAM_LATENCY_TYPE_ALL: OH_AudioStream_LatencyType =
1168        OH_AudioStream_LatencyType(0);
1169    /// Type to get latency of software part, including audio effects in software.
1170    ///
1171    ///
1172    /// Available since API-level: 23
1173    #[cfg(feature = "api-23")]
1174    #[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
1175    pub const AUDIOSTREAM_LATENCY_TYPE_SOFTWARE: OH_AudioStream_LatencyType =
1176        OH_AudioStream_LatencyType(1);
1177    /// Type to get latency of hardware part, including audio effects in hal, driver and hardware.
1178    ///
1179    ///
1180    /// Available since API-level: 23
1181    #[cfg(feature = "api-23")]
1182    #[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
1183    pub const AUDIOSTREAM_LATENCY_TYPE_HARDWARE: OH_AudioStream_LatencyType =
1184        OH_AudioStream_LatencyType(2);
1185}
1186#[repr(transparent)]
1187/// Defines audio latency types.
1188///
1189///
1190/// Available since API-level: 23
1191#[cfg(feature = "api-23")]
1192#[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
1193#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1194pub struct OH_AudioStream_LatencyType(pub ::core::ffi::c_uint);
1195#[cfg(feature = "api-23")]
1196#[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
1197impl OH_AudioStream_PlaybackCaptureMode {
1198    /// Default mode. Capture most of the audio streams, except tone streams and privacy streams.
1199    ///
1200    /// Available since API-level: 23
1201    #[cfg(feature = "api-23")]
1202    #[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
1203    pub const AUDIOSTREAM_PLAYBACKCAPTURE_MODE_DEFAULT: OH_AudioStream_PlaybackCaptureMode =
1204        OH_AudioStream_PlaybackCaptureMode(0);
1205    /// Media mode. Capture media, voice message and also unknown streams.
1206    ///
1207    /// Available since API-level: 23
1208    #[cfg(feature = "api-23")]
1209    #[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
1210    pub const AUDIOSTREAM_PLAYBACKCAPTURE_MODE_MEDIA: OH_AudioStream_PlaybackCaptureMode =
1211        OH_AudioStream_PlaybackCaptureMode(1);
1212    /// Excluding self mode. Capture streams excluding the audio played by application itself.
1213    ///
1214    /// Available since API-level: 23
1215    #[cfg(feature = "api-23")]
1216    #[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
1217    pub const AUDIOSTREAM_PLAYBACKCAPTURE_MODE_EXCLUDING_SELF: OH_AudioStream_PlaybackCaptureMode =
1218        OH_AudioStream_PlaybackCaptureMode(32768);
1219}
1220#[repr(transparent)]
1221/// Defines mode for playback capture, each mode means different target
1222/// streams to capture.
1223///
1224///
1225/// Available since API-level: 23
1226#[cfg(feature = "api-23")]
1227#[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
1228#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1229pub struct OH_AudioStream_PlaybackCaptureMode(pub ::core::ffi::c_uint);
1230#[cfg(feature = "api-23")]
1231#[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
1232impl OH_AudioStream_PlaybackCaptureStartState {
1233    /// Start playback capture success state.
1234    ///
1235    /// Available since API-level: 23
1236    #[cfg(feature = "api-23")]
1237    #[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
1238    pub const AUDIOSTREAM_PLAYBACKCAPTURE_START_STATE_SUCCESS:
1239        OH_AudioStream_PlaybackCaptureStartState = OH_AudioStream_PlaybackCaptureStartState(0);
1240    /// Start playback capture failed state, because the request for interrupt is denied
1241    /// or meet system internal error.
1242    ///
1243    /// Available since API-level: 23
1244    #[cfg(feature = "api-23")]
1245    #[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
1246    pub const AUDIOSTREAM_PLAYBACKCAPTURE_START_STATE_FAILED:
1247        OH_AudioStream_PlaybackCaptureStartState = OH_AudioStream_PlaybackCaptureStartState(1);
1248    /// Start playback capture but user not authorized state.
1249    ///
1250    /// Available since API-level: 23
1251    #[cfg(feature = "api-23")]
1252    #[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
1253    pub const AUDIOSTREAM_PLAYBACKCAPTURE_START_STATE_NOT_AUTHORIZED:
1254        OH_AudioStream_PlaybackCaptureStartState = OH_AudioStream_PlaybackCaptureStartState(2);
1255}
1256#[repr(transparent)]
1257/// Defines the playback capture start state, which is returned asynchronously
1258/// after calling [`#OH_AudioCapturer_RequestPlaybackCaptureStart`] function.
1259///
1260///
1261/// Available since API-level: 23
1262#[cfg(feature = "api-23")]
1263#[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
1264#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1265pub struct OH_AudioStream_PlaybackCaptureStartState(pub ::core::ffi::c_uint);