1#![allow(non_snake_case)]
4#![allow(non_upper_case_globals)]
5#![allow(non_camel_case_types)]
6#![allow(clippy::missing_safety_doc)]
7
8#[link(name = "ohaudio")]
9unsafe extern "C" {}
10
11pub type clockid_t = ::std::os::raw::c_int;
12#[doc = " Channel set For FRONT-LEFT position"]
13pub const OH_AudioChannelSet_CH_SET_FRONT_LEFT: OH_AudioChannelSet = 1;
14#[doc = " Channel set For FRONT_RIGHT position"]
15pub const OH_AudioChannelSet_CH_SET_FRONT_RIGHT: OH_AudioChannelSet = 2;
16#[doc = " Channel set For FRONT_CENTER position"]
17pub const OH_AudioChannelSet_CH_SET_FRONT_CENTER: OH_AudioChannelSet = 4;
18#[doc = " Channel set For LOW_FREQUENCY position"]
19pub const OH_AudioChannelSet_CH_SET_LOW_FREQUENCY: OH_AudioChannelSet = 8;
20#[doc = " Channel set For BACK_LEFT position"]
21pub const OH_AudioChannelSet_CH_SET_BACK_LEFT: OH_AudioChannelSet = 16;
22#[doc = " Channel set For BACK_RIGHT position"]
23pub const OH_AudioChannelSet_CH_SET_BACK_RIGHT: OH_AudioChannelSet = 32;
24#[doc = " Channel set For FRONT_LEFT_OF_CENTER position"]
25pub const OH_AudioChannelSet_CH_SET_FRONT_LEFT_OF_CENTER: OH_AudioChannelSet = 64;
26#[doc = " Channel set For FRONT_RIGHT_OF_CENTER position"]
27pub const OH_AudioChannelSet_CH_SET_FRONT_RIGHT_OF_CENTER: OH_AudioChannelSet = 128;
28#[doc = " Channel set For BACK_CENTER position"]
29pub const OH_AudioChannelSet_CH_SET_BACK_CENTER: OH_AudioChannelSet = 256;
30#[doc = " Channel set For SIDE_LEFT position"]
31pub const OH_AudioChannelSet_CH_SET_SIDE_LEFT: OH_AudioChannelSet = 512;
32#[doc = " Channel set For SIDE_RIGHT position"]
33pub const OH_AudioChannelSet_CH_SET_SIDE_RIGHT: OH_AudioChannelSet = 1024;
34#[doc = " Channel set For TOP_CENTER position"]
35pub const OH_AudioChannelSet_CH_SET_TOP_CENTER: OH_AudioChannelSet = 2048;
36#[doc = " Channel set For TOP_FRONT_LEFT position"]
37pub const OH_AudioChannelSet_CH_SET_TOP_FRONT_LEFT: OH_AudioChannelSet = 4096;
38#[doc = " Channel set For TOP_FRONT_CENTER position"]
39pub const OH_AudioChannelSet_CH_SET_TOP_FRONT_CENTER: OH_AudioChannelSet = 8192;
40#[doc = " Channel set For TOP_FRONT_RIGHT position"]
41pub const OH_AudioChannelSet_CH_SET_TOP_FRONT_RIGHT: OH_AudioChannelSet = 16384;
42#[doc = " Channel set For TOP_BACK_LEFT position"]
43pub const OH_AudioChannelSet_CH_SET_TOP_BACK_LEFT: OH_AudioChannelSet = 32768;
44#[doc = " Channel set For TOP_BACK_CENTER position"]
45pub const OH_AudioChannelSet_CH_SET_TOP_BACK_CENTER: OH_AudioChannelSet = 65536;
46#[doc = " Channel set For TOP_BACK_RIGHT position"]
47pub const OH_AudioChannelSet_CH_SET_TOP_BACK_RIGHT: OH_AudioChannelSet = 131072;
48#[doc = " Channel set For STEREO_LEFT position"]
49pub const OH_AudioChannelSet_CH_SET_STEREO_LEFT: OH_AudioChannelSet = 536870912;
50#[doc = " Channel set For STEREO_RIGHT position"]
51pub const OH_AudioChannelSet_CH_SET_STEREO_RIGHT: OH_AudioChannelSet = 1073741824;
52#[doc = " Channel set For WIDE_LEFT position"]
53pub const OH_AudioChannelSet_CH_SET_WIDE_LEFT: OH_AudioChannelSet = 2147483648;
54#[doc = " Channel set For WIDE_RIGHT position"]
55pub const OH_AudioChannelSet_CH_SET_WIDE_RIGHT: OH_AudioChannelSet = 4294967296;
56#[doc = " Channel set For SURROUND_DIRECT_LEFT position"]
57pub const OH_AudioChannelSet_CH_SET_SURROUND_DIRECT_LEFT: OH_AudioChannelSet = 8589934592;
58#[doc = " Channel set For SURROUND_DIRECT_RIGHT position"]
59pub const OH_AudioChannelSet_CH_SET_SURROUND_DIRECT_RIGHT: OH_AudioChannelSet = 17179869184;
60#[doc = " Channel set For LOW_FREQUENCY_2 position"]
61pub const OH_AudioChannelSet_CH_SET_LOW_FREQUENCY_2: OH_AudioChannelSet = 34359738368;
62#[doc = " Channel set For TOP_SIDE_LEFT position"]
63pub const OH_AudioChannelSet_CH_SET_TOP_SIDE_LEFT: OH_AudioChannelSet = 68719476736;
64#[doc = " Channel set For TOP_SIDE_RIGHT position"]
65pub const OH_AudioChannelSet_CH_SET_TOP_SIDE_RIGHT: OH_AudioChannelSet = 137438953472;
66#[doc = " Channel set For BOTTOM_FRONT_CENTER position"]
67pub const OH_AudioChannelSet_CH_SET_BOTTOM_FRONT_CENTER: OH_AudioChannelSet = 274877906944;
68#[doc = " Channel set For BOTTOM_FRONT_LEFT position"]
69pub const OH_AudioChannelSet_CH_SET_BOTTOM_FRONT_LEFT: OH_AudioChannelSet = 549755813888;
70#[doc = " Channel set For BOTTOM_FRONT_RIGHT position"]
71pub const OH_AudioChannelSet_CH_SET_BOTTOM_FRONT_RIGHT: OH_AudioChannelSet = 1099511627776;
72#[doc = " @brief Audio Channel Set\n\n A 64-bit integer with bits set for each channel.\n @syscap SystemCapability.Multimedia.Media.Core\n @since 11"]
73pub type OH_AudioChannelSet = u64;
74#[doc = " Ambisonic attribute: order 1"]
75pub const OH_AmbAttributeSet_AMB_ORD_1: OH_AmbAttributeSet = 1;
76#[doc = " Ambisonic attribute: order 2"]
77pub const OH_AmbAttributeSet_AMB_ORD_2: OH_AmbAttributeSet = 2;
78#[doc = " Ambisonic attribute: order 3"]
79pub const OH_AmbAttributeSet_AMB_ORD_3: OH_AmbAttributeSet = 3;
80#[doc = " Ambisonic attribute: ACN Component Ordering"]
81pub const OH_AmbAttributeSet_AMB_COM_ACN: OH_AmbAttributeSet = 0;
82#[doc = " Ambisonic attribute: FUMA Component Ordering"]
83pub const OH_AmbAttributeSet_AMB_COM_FUMA: OH_AmbAttributeSet = 256;
84#[doc = " Ambisonic attribute: N3D Normalization"]
85pub const OH_AmbAttributeSet_AMB_NOR_N3D: OH_AmbAttributeSet = 0;
86#[doc = " Ambisonic attribute: SN3D Normalization"]
87pub const OH_AmbAttributeSet_AMB_NOR_SN3D: OH_AmbAttributeSet = 4096;
88#[doc = " Channel layout: Ambisonic mode"]
89pub const OH_AmbAttributeSet_AMB_MODE: OH_AmbAttributeSet = 17592186044416;
90#[doc = " @brief Ambisonic attribute set.\n\n A set of 64-bit integers indicate the ambisonic attributes.\n @syscap SystemCapability.Multimedia.Media.Core\n @since 11"]
91pub type OH_AmbAttributeSet = u64;
92#[doc = " Unknown Channel Layout"]
93pub const OH_AudioChannelLayout_CH_LAYOUT_UNKNOWN: OH_AudioChannelLayout = 0;
94#[doc = " Channel Layout For Mono, 1 channel in total"]
95pub const OH_AudioChannelLayout_CH_LAYOUT_MONO: OH_AudioChannelLayout = 4;
96#[doc = " Channel Layout For Stereo, 2 channels in total"]
97pub const OH_AudioChannelLayout_CH_LAYOUT_STEREO: OH_AudioChannelLayout = 3;
98#[doc = " Channel Layout For Stereo-Downmix, 2 channels in total"]
99pub const OH_AudioChannelLayout_CH_LAYOUT_STEREO_DOWNMIX: OH_AudioChannelLayout = 1610612736;
100#[doc = " Channel Layout For 2.1, 3 channels in total"]
101pub const OH_AudioChannelLayout_CH_LAYOUT_2POINT1: OH_AudioChannelLayout = 11;
102#[doc = " Channel Layout For 3.0, 3 channels in total"]
103pub const OH_AudioChannelLayout_CH_LAYOUT_3POINT0: OH_AudioChannelLayout = 259;
104#[doc = " Channel Layout For Surround, 3 channels in total"]
105pub const OH_AudioChannelLayout_CH_LAYOUT_SURROUND: OH_AudioChannelLayout = 7;
106#[doc = " Channel Layout For 3.1, 4 channels in total"]
107pub const OH_AudioChannelLayout_CH_LAYOUT_3POINT1: OH_AudioChannelLayout = 15;
108#[doc = " Channel Layout For 4.0, 4 channels in total"]
109pub const OH_AudioChannelLayout_CH_LAYOUT_4POINT0: OH_AudioChannelLayout = 263;
110#[doc = " Channel Layout For Quad-Side, 4 channels in total"]
111pub const OH_AudioChannelLayout_CH_LAYOUT_QUAD_SIDE: OH_AudioChannelLayout = 1539;
112#[doc = " Channel Layout For Quad, 4 channels in total"]
113pub const OH_AudioChannelLayout_CH_LAYOUT_QUAD: OH_AudioChannelLayout = 51;
114#[doc = " Channel Layout For 2.0.2, 4 channels in total"]
115pub const OH_AudioChannelLayout_CH_LAYOUT_2POINT0POINT2: OH_AudioChannelLayout = 206158430211;
116#[doc = " Channel Layout For ORDER1-ACN-N3D First Order Ambisonic(FOA), 4 channels in total"]
117pub const OH_AudioChannelLayout_CH_LAYOUT_AMB_ORDER1_ACN_N3D: OH_AudioChannelLayout =
118 17592186044417;
119#[doc = " Channel Layout For ORDER1-ACN-SN3D FOA, 4 channels in total"]
120pub const OH_AudioChannelLayout_CH_LAYOUT_AMB_ORDER1_ACN_SN3D: OH_AudioChannelLayout =
121 17592186048513;
122#[doc = " Channel Layout For ORDER1-FUMA FOA, 4 channels in total"]
123pub const OH_AudioChannelLayout_CH_LAYOUT_AMB_ORDER1_FUMA: OH_AudioChannelLayout = 17592186044673;
124#[doc = " Channel Layout For 4.1, 5 channels in total"]
125pub const OH_AudioChannelLayout_CH_LAYOUT_4POINT1: OH_AudioChannelLayout = 271;
126#[doc = " Channel Layout For 5.0, 5 channels in total"]
127pub const OH_AudioChannelLayout_CH_LAYOUT_5POINT0: OH_AudioChannelLayout = 1543;
128#[doc = " Channel Layout For 5.0-Back, 5 channels in total"]
129pub const OH_AudioChannelLayout_CH_LAYOUT_5POINT0_BACK: OH_AudioChannelLayout = 55;
130#[doc = " Channel Layout For 2.1.2, 5 channels in total"]
131pub const OH_AudioChannelLayout_CH_LAYOUT_2POINT1POINT2: OH_AudioChannelLayout = 206158430219;
132#[doc = " Channel Layout For 3.0.2, 5 channels in total"]
133pub const OH_AudioChannelLayout_CH_LAYOUT_3POINT0POINT2: OH_AudioChannelLayout = 206158430215;
134#[doc = " Channel Layout For 5.1, 6 channels in total"]
135pub const OH_AudioChannelLayout_CH_LAYOUT_5POINT1: OH_AudioChannelLayout = 1551;
136#[doc = " Channel Layout For 5.1-Back, 6 channels in total"]
137pub const OH_AudioChannelLayout_CH_LAYOUT_5POINT1_BACK: OH_AudioChannelLayout = 63;
138#[doc = " Channel Layout For 6.0, 6 channels in total"]
139pub const OH_AudioChannelLayout_CH_LAYOUT_6POINT0: OH_AudioChannelLayout = 1799;
140#[doc = " Channel Layout For 3.1.2, 6 channels in total"]
141pub const OH_AudioChannelLayout_CH_LAYOUT_3POINT1POINT2: OH_AudioChannelLayout = 20495;
142#[doc = " Channel Layout For 6.0-Front, 6 channels in total"]
143pub const OH_AudioChannelLayout_CH_LAYOUT_6POINT0_FRONT: OH_AudioChannelLayout = 1731;
144#[doc = " Channel Layout For Hexagonal, 6 channels in total"]
145pub const OH_AudioChannelLayout_CH_LAYOUT_HEXAGONAL: OH_AudioChannelLayout = 311;
146#[doc = " Channel Layout For 6.1, 7 channels in total"]
147pub const OH_AudioChannelLayout_CH_LAYOUT_6POINT1: OH_AudioChannelLayout = 1807;
148#[doc = " Channel Layout For 6.1-Back, 7 channels in total"]
149pub const OH_AudioChannelLayout_CH_LAYOUT_6POINT1_BACK: OH_AudioChannelLayout = 319;
150#[doc = " Channel Layout For 6.1-Front, 7 channels in total"]
151pub const OH_AudioChannelLayout_CH_LAYOUT_6POINT1_FRONT: OH_AudioChannelLayout = 1739;
152#[doc = " Channel Layout For 7.0, 7 channels in total"]
153pub const OH_AudioChannelLayout_CH_LAYOUT_7POINT0: OH_AudioChannelLayout = 1591;
154#[doc = " Channel Layout For 7.0-Front, 7 channels in total"]
155pub const OH_AudioChannelLayout_CH_LAYOUT_7POINT0_FRONT: OH_AudioChannelLayout = 1735;
156#[doc = " Channel Layout For 7.1, 8 channels in total"]
157pub const OH_AudioChannelLayout_CH_LAYOUT_7POINT1: OH_AudioChannelLayout = 1599;
158#[doc = " Channel Layout For Octagonal, 8 channels in total"]
159pub const OH_AudioChannelLayout_CH_LAYOUT_OCTAGONAL: OH_AudioChannelLayout = 1847;
160#[doc = " Channel Layout For 5.1.2, 8 channels in total"]
161pub const OH_AudioChannelLayout_CH_LAYOUT_5POINT1POINT2: OH_AudioChannelLayout = 206158431759;
162#[doc = " Channel Layout For 7.1-Wide, 8 channels in total"]
163pub const OH_AudioChannelLayout_CH_LAYOUT_7POINT1_WIDE: OH_AudioChannelLayout = 1743;
164#[doc = " Channel Layout For 7.1-Wide-Back, 8 channels in total"]
165pub const OH_AudioChannelLayout_CH_LAYOUT_7POINT1_WIDE_BACK: OH_AudioChannelLayout = 255;
166#[doc = " Channel Layout For ORDER2-ACN-N3D Higher Order Ambisonics(HOA), 9 channels in total"]
167pub const OH_AudioChannelLayout_CH_LAYOUT_AMB_ORDER2_ACN_N3D: OH_AudioChannelLayout =
168 17592186044418;
169#[doc = " Channel Layout For ORDER2-ACN-SN3D HOA, 9 channels in total"]
170pub const OH_AudioChannelLayout_CH_LAYOUT_AMB_ORDER2_ACN_SN3D: OH_AudioChannelLayout =
171 17592186048514;
172#[doc = " Channel Layout For ORDER2-FUMA HOA, 9 channels in total"]
173pub const OH_AudioChannelLayout_CH_LAYOUT_AMB_ORDER2_FUMA: OH_AudioChannelLayout = 17592186044674;
174#[doc = " Channel Layout For 5.1.4, 10 channels in total"]
175pub const OH_AudioChannelLayout_CH_LAYOUT_5POINT1POINT4: OH_AudioChannelLayout = 185871;
176#[doc = " Channel Layout For 7.1.2, 10 channels in total"]
177pub const OH_AudioChannelLayout_CH_LAYOUT_7POINT1POINT2: OH_AudioChannelLayout = 206158431807;
178#[doc = " Channel Layout For 7.1.4, 12 channels in total"]
179pub const OH_AudioChannelLayout_CH_LAYOUT_7POINT1POINT4: OH_AudioChannelLayout = 185919;
180#[doc = " Channel Layout For 10.2, 12 channels in total"]
181pub const OH_AudioChannelLayout_CH_LAYOUT_10POINT2: OH_AudioChannelLayout = 6442473271;
182#[doc = " Channel Layout For 9.1.4, 14 channels in total"]
183pub const OH_AudioChannelLayout_CH_LAYOUT_9POINT1POINT4: OH_AudioChannelLayout = 6442636863;
184#[doc = " Channel Layout For 9.1.6, 16 channels in total"]
185pub const OH_AudioChannelLayout_CH_LAYOUT_9POINT1POINT6: OH_AudioChannelLayout = 212601067071;
186#[doc = " Channel Layout For Hexadecagonal, 16 channels in total"]
187pub const OH_AudioChannelLayout_CH_LAYOUT_HEXADECAGONAL: OH_AudioChannelLayout = 6442710839;
188#[doc = " Channel Layout For ORDER3-ACN-N3D HOA, 16 channels in total"]
189pub const OH_AudioChannelLayout_CH_LAYOUT_AMB_ORDER3_ACN_N3D: OH_AudioChannelLayout =
190 17592186044419;
191#[doc = " Channel Layout For ORDER3-ACN-SN3D HOA, 16 channels in total"]
192pub const OH_AudioChannelLayout_CH_LAYOUT_AMB_ORDER3_ACN_SN3D: OH_AudioChannelLayout =
193 17592186048515;
194#[doc = " Channel Layout For ORDER3-FUMA HOA, 16 channels in total"]
195pub const OH_AudioChannelLayout_CH_LAYOUT_AMB_ORDER3_FUMA: OH_AudioChannelLayout = 17592186044675;
196#[doc = " Channel Layout For 22.2, 24 channels in total"]
197pub const OH_AudioChannelLayout_CH_LAYOUT_22POINT2: OH_AudioChannelLayout = 2164663779327;
198#[doc = " @brief Audio Channel Layout\n\n A 64-bit integer indicates that the appearance and order of the speakers for recording or playback.\n @syscap SystemCapability.Multimedia.Media.Core\n @since 11"]
199pub type OH_AudioChannelLayout = u64;
200#[doc = " @error The call was successful.\n\n @since 10"]
201pub const OH_AudioStream_Result_AUDIOSTREAM_SUCCESS: OH_AudioStream_Result = 0;
202#[doc = " @error This means that the function was executed with an invalid input parameter.\n\n @since 10"]
203pub const OH_AudioStream_Result_AUDIOSTREAM_ERROR_INVALID_PARAM: OH_AudioStream_Result = 1;
204#[doc = " @error Execution status exception.\n\n @since 10"]
205pub const OH_AudioStream_Result_AUDIOSTREAM_ERROR_ILLEGAL_STATE: OH_AudioStream_Result = 2;
206#[doc = " @error An system error has occurred.\n\n @since 10"]
207pub const OH_AudioStream_Result_AUDIOSTREAM_ERROR_SYSTEM: OH_AudioStream_Result = 3;
208#[cfg(feature = "api-19")]
209#[doc = " @error Unsupported audio format, such as unsupported encoding type, sample format etc.\n\n @since 19"]
210pub const OH_AudioStream_Result_AUDIOSTREAM_ERROR_UNSUPPORTED_FORMAT: OH_AudioStream_Result = 4;
211#[doc = " @brief Define the result of the function execution.\n\n @since 10"]
212pub type OH_AudioStream_Result = u32;
213#[doc = " The type for audio stream is renderer.\n\n @since 10"]
214pub const OH_AudioStream_Type_AUDIOSTREAM_TYPE_RENDERER: OH_AudioStream_Type = 1;
215#[doc = " The type for audio stream is capturer.\n\n @since 10"]
216pub const OH_AudioStream_Type_AUDIOSTREAM_TYPE_CAPTURER: OH_AudioStream_Type = 2;
217#[doc = " @brief Define the audio stream type.\n\n @since 10"]
218pub type OH_AudioStream_Type = u32;
219#[doc = " Unsigned 8 format.\n\n @since 10"]
220pub const OH_AudioStream_SampleFormat_AUDIOSTREAM_SAMPLE_U8: OH_AudioStream_SampleFormat = 0;
221#[doc = " Signed 16 bit integer, little endian.\n\n @since 10"]
222pub const OH_AudioStream_SampleFormat_AUDIOSTREAM_SAMPLE_S16LE: OH_AudioStream_SampleFormat = 1;
223#[doc = " Signed 24 bit integer, little endian.\n\n @since 10"]
224pub const OH_AudioStream_SampleFormat_AUDIOSTREAM_SAMPLE_S24LE: OH_AudioStream_SampleFormat = 2;
225#[doc = " Signed 32 bit integer, little endian.\n\n @since 10"]
226pub const OH_AudioStream_SampleFormat_AUDIOSTREAM_SAMPLE_S32LE: OH_AudioStream_SampleFormat = 3;
227#[cfg(feature = "api-17")]
228#[doc = " Float 32, little endian.\n\n @since 17"]
229pub const OH_AudioStream_SampleFormat_AUDIOSTREAM_SAMPLE_F32LE: OH_AudioStream_SampleFormat = 4;
230#[doc = " @brief Define the audio stream sample format.\n\n @since 10"]
231pub type OH_AudioStream_SampleFormat = u32;
232#[doc = " PCM encoding type.\n\n @since 10"]
233pub const OH_AudioStream_EncodingType_AUDIOSTREAM_ENCODING_TYPE_RAW: OH_AudioStream_EncodingType =
234 0;
235#[doc = " AudioVivid encoding type.\n\n @since 12"]
236pub const OH_AudioStream_EncodingType_AUDIOSTREAM_ENCODING_TYPE_AUDIOVIVID:
237 OH_AudioStream_EncodingType = 1;
238#[cfg(feature = "api-19")]
239#[doc = " E_AC3 encoding type.\n\n @since 19"]
240pub const OH_AudioStream_EncodingType_AUDIOSTREAM_ENCODING_TYPE_E_AC3: OH_AudioStream_EncodingType =
241 2;
242#[doc = " @brief Define the audio encoding type.\n\n @since 10"]
243pub type OH_AudioStream_EncodingType = u32;
244#[cfg(feature = "api-19")]
245#[doc = " @brief Define the audio stream info structure, used to describe basic audio format.\n\n @since 19"]
246#[repr(C)]
247#[derive(Debug, Copy, Clone)]
248pub struct OH_AudioStreamInfo {
249 #[cfg(feature = "api-19")]
250 #[doc = " @brief Audio sampling rate.\n\n @since 19"]
251 pub samplingRate: i32,
252 #[cfg(feature = "api-19")]
253 #[doc = " @brief Audio channel layout.\n\n @since 19"]
254 pub channelLayout: OH_AudioChannelLayout,
255 #[cfg(feature = "api-19")]
256 #[doc = " @brief Audio encoding format type.\n\n @since 19"]
257 pub encodingType: OH_AudioStream_EncodingType,
258 #[cfg(feature = "api-19")]
259 #[doc = " @brief Audio sample format.\n\n @since 19"]
260 pub sampleFormat: OH_AudioStream_SampleFormat,
261}
262#[doc = " Unknown usage.\n\n @since 10"]
263pub const OH_AudioStream_Usage_AUDIOSTREAM_USAGE_UNKNOWN: OH_AudioStream_Usage = 0;
264#[doc = " Music usage.\n\n @since 10"]
265pub const OH_AudioStream_Usage_AUDIOSTREAM_USAGE_MUSIC: OH_AudioStream_Usage = 1;
266#[doc = " Voice communication usage.\n\n @since 10"]
267pub const OH_AudioStream_Usage_AUDIOSTREAM_USAGE_VOICE_COMMUNICATION: OH_AudioStream_Usage = 2;
268#[doc = " Voice assistant usage.\n\n @since 10"]
269pub const OH_AudioStream_Usage_AUDIOSTREAM_USAGE_VOICE_ASSISTANT: OH_AudioStream_Usage = 3;
270#[doc = " Alarm usage.\n\n @since 10"]
271pub const OH_AudioStream_Usage_AUDIOSTREAM_USAGE_ALARM: OH_AudioStream_Usage = 4;
272#[doc = " Voice message usage.\n\n @since 10"]
273pub const OH_AudioStream_Usage_AUDIOSTREAM_USAGE_VOICE_MESSAGE: OH_AudioStream_Usage = 5;
274#[doc = " Ringtone usage.\n\n @since 10"]
275pub const OH_AudioStream_Usage_AUDIOSTREAM_USAGE_RINGTONE: OH_AudioStream_Usage = 6;
276#[doc = " Notification usage.\n\n @since 10"]
277pub const OH_AudioStream_Usage_AUDIOSTREAM_USAGE_NOTIFICATION: OH_AudioStream_Usage = 7;
278#[doc = " Accessibility usage, such as screen reader.\n\n @since 10"]
279pub const OH_AudioStream_Usage_AUDIOSTREAM_USAGE_ACCESSIBILITY: OH_AudioStream_Usage = 8;
280#[doc = " Movie or video usage.\n\n @since 10"]
281pub const OH_AudioStream_Usage_AUDIOSTREAM_USAGE_MOVIE: OH_AudioStream_Usage = 10;
282#[doc = " Game sound effect usage.\n\n @since 10"]
283pub const OH_AudioStream_Usage_AUDIOSTREAM_USAGE_GAME: OH_AudioStream_Usage = 11;
284#[doc = " Audiobook usage.\n\n @since 10"]
285pub const OH_AudioStream_Usage_AUDIOSTREAM_USAGE_AUDIOBOOK: OH_AudioStream_Usage = 12;
286#[doc = " Navigation usage.\n\n @since 10"]
287pub const OH_AudioStream_Usage_AUDIOSTREAM_USAGE_NAVIGATION: OH_AudioStream_Usage = 13;
288#[doc = " Video call usage.\n\n @since 12"]
289pub const OH_AudioStream_Usage_AUDIOSTREAM_USAGE_VIDEO_COMMUNICATION: OH_AudioStream_Usage = 17;
290#[doc = " @brief Define the audio stream usage.\n Audio stream usage is used to describe what work scenario\n the current stream is used for.\n\n @since 10"]
291pub type OH_AudioStream_Usage = u32;
292#[doc = " This is a normal audio scene.\n\n @since 10"]
293pub const OH_AudioStream_LatencyMode_AUDIOSTREAM_LATENCY_MODE_NORMAL: OH_AudioStream_LatencyMode =
294 0;
295#[doc = " This is a low latency audio scene.\n\n @since 10"]
296pub const OH_AudioStream_LatencyMode_AUDIOSTREAM_LATENCY_MODE_FAST: OH_AudioStream_LatencyMode = 1;
297#[doc = " @brief Define the audio latency mode.\n\n @since 10"]
298pub type OH_AudioStream_LatencyMode = u32;
299#[cfg(feature = "api-19")]
300#[doc = " Direct playback is not supported.\n\n @since 19"]
301pub const OH_AudioStream_DirectPlaybackMode_AUDIOSTREAM_DIRECT_PLAYBACK_NOT_SUPPORTED:
302 OH_AudioStream_DirectPlaybackMode = 0;
303#[cfg(feature = "api-19")]
304#[doc = " Direct playback mode which is bitstream pass-through such as compressed pass-through.\n\n @since 19"]
305pub const OH_AudioStream_DirectPlaybackMode_AUDIOSTREAM_DIRECT_PLAYBACK_BITSTREAM_SUPPORTED:
306 OH_AudioStream_DirectPlaybackMode = 1;
307#[cfg(feature = "api-19")]
308#[doc = " Direct playback mode of pcm.\n\n @since 19"]
309pub const OH_AudioStream_DirectPlaybackMode_AUDIOSTREAM_DIRECT_PLAYBACK_PCM_SUPPORTED:
310 OH_AudioStream_DirectPlaybackMode = 2;
311#[cfg(feature = "api-19")]
312#[doc = " @brief Enumerates audio direct playback modes.\n\n @since 19"]
313pub type OH_AudioStream_DirectPlaybackMode = u32;
314#[doc = " The routing of the audio has changed.\n\n @deprecated since 20\n @useinstead OH_AudioRenderer_OutputDeviceChangeCallback.\n @since 10"]
315pub const OH_AudioStream_Event_AUDIOSTREAM_EVENT_ROUTING_CHANGED: OH_AudioStream_Event = 0;
316#[doc = " @brief Define the audio event.\n\n @deprecated since 20\n @useinstead OH_AudioRenderer_OutputDeviceChangeCallback.\n @since 10"]
317pub type OH_AudioStream_Event = u32;
318#[doc = " The invalid state.\n\n @since 10"]
319pub const OH_AudioStream_State_AUDIOSTREAM_STATE_INVALID: OH_AudioStream_State = -1;
320#[doc = " Create new instance state.\n\n @since 10"]
321pub const OH_AudioStream_State_AUDIOSTREAM_STATE_NEW: OH_AudioStream_State = 0;
322#[doc = " The prepared state.\n\n @since 10"]
323pub const OH_AudioStream_State_AUDIOSTREAM_STATE_PREPARED: OH_AudioStream_State = 1;
324#[doc = " The stream is running.\n\n @since 10"]
325pub const OH_AudioStream_State_AUDIOSTREAM_STATE_RUNNING: OH_AudioStream_State = 2;
326#[doc = " The stream is stopped.\n\n @since 10"]
327pub const OH_AudioStream_State_AUDIOSTREAM_STATE_STOPPED: OH_AudioStream_State = 3;
328#[doc = " The stream is released.\n\n @since 10"]
329pub const OH_AudioStream_State_AUDIOSTREAM_STATE_RELEASED: OH_AudioStream_State = 4;
330#[doc = " The stream is paused.\n\n @since 10"]
331pub const OH_AudioStream_State_AUDIOSTREAM_STATE_PAUSED: OH_AudioStream_State = 5;
332#[doc = " @brief The audio stream states\n\n @since 10"]
333pub type OH_AudioStream_State = i32;
334#[doc = " Force type, system change audio state.\n\n @since 10"]
335pub const OH_AudioInterrupt_ForceType_AUDIOSTREAM_INTERRUPT_FORCE: OH_AudioInterrupt_ForceType = 0;
336#[doc = " Share type, application change audio state.\n\n @since 10"]
337pub const OH_AudioInterrupt_ForceType_AUDIOSTREAM_INTERRUPT_SHARE: OH_AudioInterrupt_ForceType = 1;
338#[doc = " @brief Defines the audio interrupt type.\n\n @since 10"]
339pub type OH_AudioInterrupt_ForceType = u32;
340#[doc = " None.\n\n @since 10"]
341pub const OH_AudioInterrupt_Hint_AUDIOSTREAM_INTERRUPT_HINT_NONE: OH_AudioInterrupt_Hint = 0;
342#[doc = " Resume the stream.\n\n @since 10"]
343pub const OH_AudioInterrupt_Hint_AUDIOSTREAM_INTERRUPT_HINT_RESUME: OH_AudioInterrupt_Hint = 1;
344#[doc = " Pause the stream.\n\n @since 10"]
345pub const OH_AudioInterrupt_Hint_AUDIOSTREAM_INTERRUPT_HINT_PAUSE: OH_AudioInterrupt_Hint = 2;
346#[doc = " Stop the stream.\n\n @since 10"]
347pub const OH_AudioInterrupt_Hint_AUDIOSTREAM_INTERRUPT_HINT_STOP: OH_AudioInterrupt_Hint = 3;
348#[doc = " Ducked the stream.\n\n @since 10"]
349pub const OH_AudioInterrupt_Hint_AUDIOSTREAM_INTERRUPT_HINT_DUCK: OH_AudioInterrupt_Hint = 4;
350#[doc = " Unducked the stream.\n\n @since 10"]
351pub const OH_AudioInterrupt_Hint_AUDIOSTREAM_INTERRUPT_HINT_UNDUCK: OH_AudioInterrupt_Hint = 5;
352#[cfg(feature = "api-20")]
353#[doc = " Mute the stream.\n\n @since 20"]
354pub const OH_AudioInterrupt_Hint_AUDIOSTREAM_INTERRUPT_HINT_MUTE: OH_AudioInterrupt_Hint = 6;
355#[cfg(feature = "api-20")]
356#[doc = " Unmute the stream.\n\n @since 20"]
357pub const OH_AudioInterrupt_Hint_AUDIOSTREAM_INTERRUPT_HINT_UNMUTE: OH_AudioInterrupt_Hint = 7;
358#[doc = " @brief Defines the audio interrupt hint type.\n\n @since 10"]
359pub type OH_AudioInterrupt_Hint = u32;
360#[doc = " Invalid type.\n\n @since 10"]
361pub const OH_AudioStream_SourceType_AUDIOSTREAM_SOURCE_TYPE_INVALID: OH_AudioStream_SourceType = -1;
362#[doc = " Mic source type.\n\n @since 10"]
363pub const OH_AudioStream_SourceType_AUDIOSTREAM_SOURCE_TYPE_MIC: OH_AudioStream_SourceType = 0;
364#[doc = " Voice recognition source type.\n\n @since 10"]
365pub const OH_AudioStream_SourceType_AUDIOSTREAM_SOURCE_TYPE_VOICE_RECOGNITION:
366 OH_AudioStream_SourceType = 1;
367#[doc = " Playback capture source type.\n\n @deprecated since 12\n @useinstead OH_AVScreenCapture in native interface.\n @since 10"]
368pub const OH_AudioStream_SourceType_AUDIOSTREAM_SOURCE_TYPE_PLAYBACK_CAPTURE:
369 OH_AudioStream_SourceType = 2;
370#[doc = " Voice communication source type.\n\n @since 10"]
371pub const OH_AudioStream_SourceType_AUDIOSTREAM_SOURCE_TYPE_VOICE_COMMUNICATION:
372 OH_AudioStream_SourceType = 7;
373#[doc = " Voice message source type.\n\n @since 12"]
374pub const OH_AudioStream_SourceType_AUDIOSTREAM_SOURCE_TYPE_VOICE_MESSAGE:
375 OH_AudioStream_SourceType = 10;
376#[cfg(feature = "api-13")]
377#[doc = " Camcorder source type.\n\n @since 13"]
378pub const OH_AudioStream_SourceType_AUDIOSTREAM_SOURCE_TYPE_CAMCORDER: OH_AudioStream_SourceType =
379 13;
380#[cfg(feature = "api-14")]
381#[doc = " Unprocessed source type.\n\n @since 14"]
382pub const OH_AudioStream_SourceType_AUDIOSTREAM_SOURCE_TYPE_UNPROCESSED: OH_AudioStream_SourceType =
383 14;
384#[cfg(feature = "api-20")]
385#[doc = " Live Broadcast source type.\n\n @since 20"]
386pub const OH_AudioStream_SourceType_AUDIOSTREAM_SOURCE_TYPE_LIVE: OH_AudioStream_SourceType = 17;
387#[doc = " @brief Defines the audio source type.\n\n @since 10"]
388pub type OH_AudioStream_SourceType = i32;
389#[doc = " Share mode"]
390pub const OH_AudioInterrupt_Mode_AUDIOSTREAM_INTERRUPT_MODE_SHARE: OH_AudioInterrupt_Mode = 0;
391#[doc = " Independent mode"]
392pub const OH_AudioInterrupt_Mode_AUDIOSTREAM_INTERRUPT_MODE_INDEPENDENT: OH_AudioInterrupt_Mode = 1;
393#[doc = " @brief Defines the audio interrupt mode.\n\n @since 12"]
394pub type OH_AudioInterrupt_Mode = u32;
395#[doc = " Audio Effect Mode effect none.\n\n @since 12"]
396pub const OH_AudioStream_AudioEffectMode_EFFECT_NONE: OH_AudioStream_AudioEffectMode = 0;
397#[doc = " Audio Effect Mode effect default.\n\n @since 12"]
398pub const OH_AudioStream_AudioEffectMode_EFFECT_DEFAULT: OH_AudioStream_AudioEffectMode = 1;
399#[doc = " @brief Defines the audio effect mode.\n\n @since 12"]
400pub type OH_AudioStream_AudioEffectMode = u32;
401#[doc = " normal status"]
402#[cfg(feature = "api-20")]
403pub const OH_AudioStream_FastStatus_AUDIOSTREAM_FASTSTATUS_NORMAL: OH_AudioStream_FastStatus = 0;
404#[doc = " fast status"]
405#[cfg(feature = "api-20")]
406pub const OH_AudioStream_FastStatus_AUDIOSTREAM_FASTSTATUS_FAST: OH_AudioStream_FastStatus = 1;
407#[cfg(feature = "api-20")]
408#[doc = " @brief Defines the fast status.\n\n @since 20"]
409pub type OH_AudioStream_FastStatus = u32;
410#[repr(C)]
411#[derive(Debug, Copy, Clone)]
412pub struct OH_AudioStreamBuilderStruct {
413 _unused: [u8; 0],
414}
415#[doc = " @brief Declaring the audio stream builder.\n The instance of builder is used for creating audio stream.\n\n @since 10"]
416pub type OH_AudioStreamBuilder = OH_AudioStreamBuilderStruct;
417#[repr(C)]
418#[derive(Debug, Copy, Clone)]
419pub struct OH_AudioRendererStruct {
420 _unused: [u8; 0],
421}
422#[doc = " @brief Declaring the audio renderer stream.\n The instance of renderer stream is used for playing audio data.\n\n @since 10"]
423pub type OH_AudioRenderer = OH_AudioRendererStruct;
424#[repr(C)]
425#[derive(Debug, Copy, Clone)]
426pub struct OH_AudioCapturerStruct {
427 _unused: [u8; 0],
428}
429#[doc = " @brief Declaring the audio capturer stream.\n The instance of renderer stream is used for capturing audio data.\n\n @since 10"]
430pub type OH_AudioCapturer = OH_AudioCapturerStruct;
431#[doc = " @brief Declaring the callback struct for renderer stream.\n\n @deprecated since 20\n @useinstead Use the callback type: OH_AudioRenderer_OnWriteDataCallback, OH_AudioRenderer_OutputDeviceChangeCallback,\n OH_AudioRenderer_OnInterruptEvent, OH_AudioRenderer_OnErrorCallback separately.\n @since 10"]
432#[repr(C)]
433#[derive(Debug, Copy, Clone)]
434pub struct OH_AudioRenderer_Callbacks_Struct {
435 #[doc = " This function pointer will point to the callback function that\n is used to write audio data\n\n @deprecated since 20\n @useinstead OH_AudioRenderer_OnWriteDataCallback.\n @since 10"]
436 pub OH_AudioRenderer_OnWriteData: ::std::option::Option<
437 unsafe extern "C" fn(
438 renderer: *mut OH_AudioRenderer,
439 userData: *mut ::std::os::raw::c_void,
440 buffer: *mut ::std::os::raw::c_void,
441 length: i32,
442 ) -> i32,
443 >,
444 #[doc = " This function pointer will point to the callback function that\n is used to handle audio renderer stream events.\n\n @deprecated since 20\n @useinstead OH_AudioRenderer_OutputDeviceChangeCallback.\n @since 10"]
445 pub OH_AudioRenderer_OnStreamEvent: ::std::option::Option<
446 unsafe extern "C" fn(
447 renderer: *mut OH_AudioRenderer,
448 userData: *mut ::std::os::raw::c_void,
449 event: OH_AudioStream_Event,
450 ) -> i32,
451 >,
452 #[doc = " This function pointer will point to the callback function that\n is used to handle audio interrupt events.\n\n @deprecated since 20\n @useinstead OH_AudioRenderer_OnInterruptCallback.\n @since 10"]
453 pub OH_AudioRenderer_OnInterruptEvent: ::std::option::Option<
454 unsafe extern "C" fn(
455 renderer: *mut OH_AudioRenderer,
456 userData: *mut ::std::os::raw::c_void,
457 type_: OH_AudioInterrupt_ForceType,
458 hint: OH_AudioInterrupt_Hint,
459 ) -> i32,
460 >,
461 #[doc = " This function pointer will point to the callback function that\n is used to handle audio error result.\n\n @deprecated since 20\n @useinstead OH_AudioRenderer_OnErrorCallback.\n @since 10"]
462 pub OH_AudioRenderer_OnError: ::std::option::Option<
463 unsafe extern "C" fn(
464 renderer: *mut OH_AudioRenderer,
465 userData: *mut ::std::os::raw::c_void,
466 error: OH_AudioStream_Result,
467 ) -> i32,
468 >,
469}
470#[doc = " @brief Declaring the callback struct for renderer stream.\n\n @deprecated since 20\n @useinstead Use the callback type: OH_AudioRenderer_OnWriteDataCallback, OH_AudioRenderer_OutputDeviceChangeCallback,\n OH_AudioRenderer_OnInterruptEvent, OH_AudioRenderer_OnErrorCallback separately.\n @since 10"]
471pub type OH_AudioRenderer_Callbacks = OH_AudioRenderer_Callbacks_Struct;
472#[doc = " @brief Declaring the callback struct for capturer stream.\n\n @deprecated since 20\n @useinstead Use the callback type: OH_AudioCapturer_OnReadDataCallback, OH_AudioCapturer_OnDeviceChangeCallback,\n OH_AudioCapturer_OnInterruptCallback and OH_AudioCapturer_OnErrorCallback separately.\n @since 10"]
473#[repr(C)]
474#[derive(Debug, Copy, Clone)]
475pub struct OH_AudioCapturer_Callbacks_Struct {
476 #[doc = " This function pointer will point to the callback function that\n is used to read audio data.\n\n @deprecated since 20\n @useinstead OH_AudioCapturer_OnReadDataCallback\n @since 10"]
477 pub OH_AudioCapturer_OnReadData: ::std::option::Option<
478 unsafe extern "C" fn(
479 capturer: *mut OH_AudioCapturer,
480 userData: *mut ::std::os::raw::c_void,
481 buffer: *mut ::std::os::raw::c_void,
482 length: i32,
483 ) -> i32,
484 >,
485 #[doc = " This function pointer will point to the callback function that\n is used to handle audio capturer stream events.\n\n @deprecated since 20\n @useinstead OH_AudioRenderer_OutputDeviceChangeCallback\n @since 10"]
486 pub OH_AudioCapturer_OnStreamEvent: ::std::option::Option<
487 unsafe extern "C" fn(
488 capturer: *mut OH_AudioCapturer,
489 userData: *mut ::std::os::raw::c_void,
490 event: OH_AudioStream_Event,
491 ) -> i32,
492 >,
493 #[doc = " This function pointer will point to the callback function that\n is used to handle audio interrupt events.\n\n @deprecated since 20\n @useinstead OH_AudioCapturer_OnInterruptCallback\n @since 10"]
494 pub OH_AudioCapturer_OnInterruptEvent: ::std::option::Option<
495 unsafe extern "C" fn(
496 capturer: *mut OH_AudioCapturer,
497 userData: *mut ::std::os::raw::c_void,
498 type_: OH_AudioInterrupt_ForceType,
499 hint: OH_AudioInterrupt_Hint,
500 ) -> i32,
501 >,
502 #[doc = " This function pointer will point to the callback function that\n is used to handle audio error result.\n\n @deprecated since 20\n @useinstead OH_AudioCapturer_OnErrorCallback\n @since 10"]
503 pub OH_AudioCapturer_OnError: ::std::option::Option<
504 unsafe extern "C" fn(
505 capturer: *mut OH_AudioCapturer,
506 userData: *mut ::std::os::raw::c_void,
507 error: OH_AudioStream_Result,
508 ) -> i32,
509 >,
510}
511#[doc = " @brief Declaring the callback struct for capturer stream.\n\n @deprecated since 20\n @useinstead Use the callback type: OH_AudioCapturer_OnReadDataCallback, OH_AudioCapturer_OnDeviceChangeCallback,\n OH_AudioCapturer_OnInterruptCallback and OH_AudioCapturer_OnErrorCallback separately.\n @since 10"]
512pub type OH_AudioCapturer_Callbacks = OH_AudioCapturer_Callbacks_Struct;
513pub const OH_AudioStream_DeviceChangeReason_REASON_UNKNOWN: OH_AudioStream_DeviceChangeReason = 0;
514pub const OH_AudioStream_DeviceChangeReason_REASON_NEW_DEVICE_AVAILABLE:
515 OH_AudioStream_DeviceChangeReason = 1;
516pub const OH_AudioStream_DeviceChangeReason_REASON_OLD_DEVICE_UNAVAILABLE:
517 OH_AudioStream_DeviceChangeReason = 2;
518pub const OH_AudioStream_DeviceChangeReason_REASON_OVERRODE: OH_AudioStream_DeviceChangeReason = 3;
519#[cfg(feature = "api-20")]
520#[doc = " @brief Device information when the audio session is activated.\n\n @since 20"]
521pub const OH_AudioStream_DeviceChangeReason_REASON_SESSION_ACTIVATED:
522 OH_AudioStream_DeviceChangeReason = 4;
523#[cfg(feature = "api-20")]
524#[doc = " @brief There is a higher-priority stream, causing the system device to change.\n\n @since 20"]
525pub const OH_AudioStream_DeviceChangeReason_REASON_STREAM_PRIORITY_CHANGED:
526 OH_AudioStream_DeviceChangeReason = 5;
527#[doc = " @brief Defines reason for device changes of one audio stream.\n\n @since 11"]
528pub type OH_AudioStream_DeviceChangeReason = u32;
529#[doc = " @brief Callback when the output device of an audio renderer changed.\n\n @param renderer AudioRenderer where this event occurs.\n @param userData User data which is passed by user.\n @param reason Indicates that why does the output device changes.\n @since 11"]
530pub type OH_AudioRenderer_OutputDeviceChangeCallback = ::std::option::Option<
531 unsafe extern "C" fn(
532 renderer: *mut OH_AudioRenderer,
533 userData: *mut ::std::os::raw::c_void,
534 reason: OH_AudioStream_DeviceChangeReason,
535 ),
536>;
537#[doc = " @brief Callback when the mark position reached.\n\n @param renderer AudioRenderer where this event occurs.\n @param samplePos Mark position in samples.\n @param userData User data which is passed by user.\n @since 12"]
538pub type OH_AudioRenderer_OnMarkReachedCallback = ::std::option::Option<
539 unsafe extern "C" fn(
540 renderer: *mut OH_AudioRenderer,
541 samplePos: u32,
542 userData: *mut ::std::os::raw::c_void,
543 ),
544>;
545#[doc = " @brief This function pointer will point to the callback function that\n is used to write audio data with metadata\n\n @param renderer AudioRenderer where this event occurs.\n @param userData User data which is passed by user.\n @param audioData Audio data which is written by user.\n @param audioDataSize Audio data size which is the size of audio data written by user.\n @param metadata Metadata which is written by user.\n @param metadataSize Metadata size which is the size of metadata written by user.\n @return Error code of the callback function returned by user.\n @since 12"]
546pub type OH_AudioRenderer_WriteDataWithMetadataCallback = ::std::option::Option<
547 unsafe extern "C" fn(
548 renderer: *mut OH_AudioRenderer,
549 userData: *mut ::std::os::raw::c_void,
550 audioData: *mut ::std::os::raw::c_void,
551 audioDataSize: i32,
552 metadata: *mut ::std::os::raw::c_void,
553 metadataSize: i32,
554 ) -> i32,
555>;
556#[doc = " Privacy type that stream can be captured by third party applications.\n @since 12"]
557pub const OH_AudioStream_PrivacyType_AUDIO_STREAM_PRIVACY_TYPE_PUBLIC: OH_AudioStream_PrivacyType =
558 0;
559#[doc = " Privacy type that stream can not be captured.\n @since 12"]
560pub const OH_AudioStream_PrivacyType_AUDIO_STREAM_PRIVACY_TYPE_PRIVATE: OH_AudioStream_PrivacyType =
561 1;
562#[doc = " @brief Defines Enumeration of audio stream privacy type for playback capture.\n\n @since 12"]
563pub type OH_AudioStream_PrivacyType = u32;
564#[doc = " Result of audio data callabck is invalid."]
565pub const OH_AudioData_Callback_Result_AUDIO_DATA_CALLBACK_RESULT_INVALID:
566 OH_AudioData_Callback_Result = -1;
567#[doc = " Result of audio data callabck is valid."]
568pub const OH_AudioData_Callback_Result_AUDIO_DATA_CALLBACK_RESULT_VALID:
569 OH_AudioData_Callback_Result = 0;
570#[doc = " @brief Defines enumeration of audio data callback result.\n\n @since 12"]
571pub type OH_AudioData_Callback_Result = i32;
572#[doc = " @brief Callback function of write data.\n\n This function is similar with OH_AudioRenderer_Callbacks_Struct.OH_AudioRenderer_OnWriteData instead of the return\n value. The return result of this function indicates whether the data filled in the buffer is valid or invalid. If\n result is invalid, the data filled by user will not be played.\n\n @param renderer AudioRenderer where this callback occurs.\n @param userData User data which is passed by user.\n @param audioData Audio data pointer, where user should fill in audio data.\n @param audioDataSize Size of audio data that user should fill in.\n @return Audio Data callback result.\n @see OH_AudioRenderer_Callbacks_Struct.OH_AudioRenderer_OnWriteData\n @since 12"]
573pub type OH_AudioRenderer_OnWriteDataCallback = ::std::option::Option<
574 unsafe extern "C" fn(
575 renderer: *mut OH_AudioRenderer,
576 userData: *mut ::std::os::raw::c_void,
577 audioData: *mut ::std::os::raw::c_void,
578 audioDataSize: i32,
579 ) -> OH_AudioData_Callback_Result,
580>;
581#[cfg(feature = "api-19")]
582#[doc = " Indicates this audio stream volume will be affected by system volume, also the default behavior.\n\n @since 19"]
583pub const OH_AudioStream_VolumeMode_AUDIOSTREAM_VOLUMEMODE_SYSTEM_GLOBAL:
584 OH_AudioStream_VolumeMode = 0;
585#[cfg(feature = "api-19")]
586#[doc = " Indicates this audio stream volume will be affected by app's individual volume percentage which set by yourself\n using the app volume api.\n\n @since 19"]
587pub const OH_AudioStream_VolumeMode_AUDIOSTREAM_VOLUMEMODE_APP_INDIVIDUAL:
588 OH_AudioStream_VolumeMode = 1;
589#[cfg(feature = "api-19")]
590#[doc = " @brief Define the audio stream volume mode.\n\n @since 19"]
591pub type OH_AudioStream_VolumeMode = u32;
592#[doc = " @error The call was successful."]
593pub const OH_AudioCommon_Result_AUDIOCOMMON_RESULT_SUCCESS: OH_AudioCommon_Result = 0;
594#[doc = " @error This means that the input parameter is invalid."]
595pub const OH_AudioCommon_Result_AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM: OH_AudioCommon_Result =
596 6800101;
597#[doc = " @error This means there is no memory left."]
598pub const OH_AudioCommon_Result_AUDIOCOMMON_RESULT_ERROR_NO_MEMORY: OH_AudioCommon_Result = 6800102;
599#[doc = " @error Execution status exception."]
600pub const OH_AudioCommon_Result_AUDIOCOMMON_RESULT_ERROR_ILLEGAL_STATE: OH_AudioCommon_Result =
601 6800103;
602#[doc = " @error This means the operation is unsupported."]
603pub const OH_AudioCommon_Result_AUDIOCOMMON_RESULT_ERROR_UNSUPPORTED: OH_AudioCommon_Result =
604 6800104;
605#[doc = " @error This means the operation is timeout."]
606pub const OH_AudioCommon_Result_AUDIOCOMMON_RESULT_ERROR_TIMEOUT: OH_AudioCommon_Result = 6800105;
607#[doc = " @error This means reached stream limit."]
608pub const OH_AudioCommon_Result_AUDIOCOMMON_RESULT_ERROR_STREAM_LIMIT: OH_AudioCommon_Result =
609 6800201;
610#[doc = " @error An system error has occurred."]
611pub const OH_AudioCommon_Result_AUDIOCOMMON_RESULT_ERROR_SYSTEM: OH_AudioCommon_Result = 6800301;
612#[doc = " @brief Define the result of the function execution.\n\n @since 12"]
613pub type OH_AudioCommon_Result = u32;
614#[doc = " Default audio scene.\n\n @since 12"]
615pub const OH_AudioScene_AUDIO_SCENE_DEFAULT: OH_AudioScene = 0;
616#[doc = " Ringing scene.\n\n @since 12"]
617pub const OH_AudioScene_AUDIO_SCENE_RINGING: OH_AudioScene = 1;
618#[doc = " Phone call scene.\n\n @since 12"]
619pub const OH_AudioScene_AUDIO_SCENE_PHONE_CALL: OH_AudioScene = 2;
620#[doc = " Voice chat scene.\n\n @since 12"]
621pub const OH_AudioScene_AUDIO_SCENE_VOICE_CHAT: OH_AudioScene = 3;
622#[doc = " @brief Defines the audio scene.\n\n @since 12"]
623pub type OH_AudioScene = u32;
624#[cfg(feature = "api-20")]
625#[doc = " Silent ringer mode.\n\n @since 20"]
626pub const OH_AudioRingerMode_AUDIO_RINGER_MODE_SILENT: OH_AudioRingerMode = 0;
627#[cfg(feature = "api-20")]
628#[doc = " Vibrate ringer mode.\n\n @since 20"]
629pub const OH_AudioRingerMode_AUDIO_RINGER_MODE_VIBRATE: OH_AudioRingerMode = 1;
630#[cfg(feature = "api-20")]
631#[doc = " Normal ringer mode.\n\n @since 20"]
632pub const OH_AudioRingerMode_AUDIO_RINGER_MODE_NORMAL: OH_AudioRingerMode = 2;
633#[cfg(feature = "api-20")]
634#[doc = " @brief Defines the ringer mode.\n\n @since 20"]
635pub type OH_AudioRingerMode = u32;
636#[doc = " @brief Device connection."]
637pub const OH_AudioDevice_ChangeType_AUDIO_DEVICE_CHANGE_TYPE_CONNECT: OH_AudioDevice_ChangeType = 0;
638#[doc = " @brief Device disconnection."]
639pub const OH_AudioDevice_ChangeType_AUDIO_DEVICE_CHANGE_TYPE_DISCONNECT: OH_AudioDevice_ChangeType =
640 1;
641#[doc = " @brief Defines the audio device change type.\n\n @since 12"]
642pub type OH_AudioDevice_ChangeType = u32;
643#[doc = " @brief Input role."]
644pub const OH_AudioDevice_Role_AUDIO_DEVICE_ROLE_INPUT: OH_AudioDevice_Role = 1;
645#[doc = " @brief Output role."]
646pub const OH_AudioDevice_Role_AUDIO_DEVICE_ROLE_OUTPUT: OH_AudioDevice_Role = 2;
647#[doc = " @brief Defines the audio device device role.\n\n @since 12"]
648pub type OH_AudioDevice_Role = u32;
649#[doc = " @brief Invalid device."]
650pub const OH_AudioDevice_Type_AUDIO_DEVICE_TYPE_INVALID: OH_AudioDevice_Type = 0;
651#[doc = " @brief Built-in earpiece."]
652pub const OH_AudioDevice_Type_AUDIO_DEVICE_TYPE_EARPIECE: OH_AudioDevice_Type = 1;
653#[doc = " @brief Built-in speaker."]
654pub const OH_AudioDevice_Type_AUDIO_DEVICE_TYPE_SPEAKER: OH_AudioDevice_Type = 2;
655#[doc = " @brief Wired headset, which is a combination of a pair of earpieces and a microphone."]
656pub const OH_AudioDevice_Type_AUDIO_DEVICE_TYPE_WIRED_HEADSET: OH_AudioDevice_Type = 3;
657#[doc = " @brief A pair of wired headphones."]
658pub const OH_AudioDevice_Type_AUDIO_DEVICE_TYPE_WIRED_HEADPHONES: OH_AudioDevice_Type = 4;
659#[doc = " @brief Bluetooth device using the synchronous connection oriented link (SCO)."]
660pub const OH_AudioDevice_Type_AUDIO_DEVICE_TYPE_BLUETOOTH_SCO: OH_AudioDevice_Type = 7;
661#[doc = " @brief Bluetooth device using advanced audio distibution profile (A2DP)."]
662pub const OH_AudioDevice_Type_AUDIO_DEVICE_TYPE_BLUETOOTH_A2DP: OH_AudioDevice_Type = 8;
663#[doc = " @brief Built-in microphone."]
664pub const OH_AudioDevice_Type_AUDIO_DEVICE_TYPE_MIC: OH_AudioDevice_Type = 15;
665#[doc = " @brief USB audio headset."]
666pub const OH_AudioDevice_Type_AUDIO_DEVICE_TYPE_USB_HEADSET: OH_AudioDevice_Type = 22;
667#[doc = " @brief Display port device."]
668pub const OH_AudioDevice_Type_AUDIO_DEVICE_TYPE_DISPLAY_PORT: OH_AudioDevice_Type = 23;
669#[doc = " @brief Device type for rerouting audio to other remote devices by system application."]
670pub const OH_AudioDevice_Type_AUDIO_DEVICE_TYPE_REMOTE_CAST: OH_AudioDevice_Type = 24;
671#[cfg(feature = "api-18")]
672#[doc = " @brief Usb audio device.\n\n @since 18"]
673pub const OH_AudioDevice_Type_AUDIO_DEVICE_TYPE_USB_DEVICE: OH_AudioDevice_Type = 25;
674#[cfg(feature = "api-19")]
675#[doc = " @brief Accessory device, such as the microphone on a remote control.\n @since 19"]
676pub const OH_AudioDevice_Type_AUDIO_DEVICE_TYPE_ACCESSORY: OH_AudioDevice_Type = 26;
677#[cfg(feature = "api-19")]
678#[doc = " @brief HDMI device, such as a device connected through an HDMI, ARC, or eARC interface.\n @since 19"]
679pub const OH_AudioDevice_Type_AUDIO_DEVICE_TYPE_HDMI: OH_AudioDevice_Type = 27;
680#[cfg(feature = "api-19")]
681#[doc = " @brief Line-connected, digital audio output device, such as an S/PDIF device.\n @since 19"]
682pub const OH_AudioDevice_Type_AUDIO_DEVICE_TYPE_LINE_DIGITAL: OH_AudioDevice_Type = 28;
683#[cfg(feature = "api-20")]
684#[doc = " @brief Hearing aid device.\n @since 20"]
685pub const OH_AudioDevice_Type_AUDIO_DEVICE_TYPE_HEARING_AID: OH_AudioDevice_Type = 30;
686#[cfg(feature = "api-20")]
687#[doc = " @brief Nearlink device.\n @since 20"]
688pub const OH_AudioDevice_Type_AUDIO_DEVICE_TYPE_NEARLINK: OH_AudioDevice_Type = 31;
689#[doc = " @brief Default device type."]
690pub const OH_AudioDevice_Type_AUDIO_DEVICE_TYPE_DEFAULT: OH_AudioDevice_Type = 1000;
691#[doc = " @brief Defines the audio device device type.\n\n @since 12"]
692pub type OH_AudioDevice_Type = u32;
693#[doc = " @brief None device."]
694pub const OH_AudioDevice_Flag_AUDIO_DEVICE_FLAG_NONE: OH_AudioDevice_Flag = 0;
695#[doc = " @brief Output device."]
696pub const OH_AudioDevice_Flag_AUDIO_DEVICE_FLAG_OUTPUT: OH_AudioDevice_Flag = 1;
697#[doc = " @brief Input device."]
698pub const OH_AudioDevice_Flag_AUDIO_DEVICE_FLAG_INPUT: OH_AudioDevice_Flag = 2;
699#[doc = " @brief All device."]
700pub const OH_AudioDevice_Flag_AUDIO_DEVICE_FLAG_ALL: OH_AudioDevice_Flag = 3;
701#[doc = " @brief Defines the audio device flag.\n\n @since 12"]
702pub type OH_AudioDevice_Flag = u32;
703#[doc = " @brief Device used for media ouput.\n\n @since 12"]
704pub const OH_AudioDevice_Usage_AUDIO_DEVICE_USAGE_MEDIA_OUTPUT: OH_AudioDevice_Usage = 1;
705#[doc = " @brief Device used for media input.\n\n @since 12"]
706pub const OH_AudioDevice_Usage_AUDIO_DEVICE_USAGE_MEDIA_INPUT: OH_AudioDevice_Usage = 2;
707#[doc = " @brief Device used for media, including input and output.\n\n @since 12"]
708pub const OH_AudioDevice_Usage_AUDIO_DEVICE_USAGE_MEDIA_ALL: OH_AudioDevice_Usage = 3;
709#[doc = " @brief Device used for call output.\n\n @since 12"]
710pub const OH_AudioDevice_Usage_AUDIO_DEVICE_USAGE_CALL_OUTPUT: OH_AudioDevice_Usage = 4;
711#[doc = " @brief Device used for call input.\n\n @since 12"]
712pub const OH_AudioDevice_Usage_AUDIO_DEVICE_USAGE_CALL_INPUT: OH_AudioDevice_Usage = 8;
713#[doc = " @brief Device used for call, including input and output.\n\n @since 12"]
714pub const OH_AudioDevice_Usage_AUDIO_DEVICE_USAGE_CALL_ALL: OH_AudioDevice_Usage = 12;
715#[doc = " @brief Defines the audio device usage.\n\n @since 12"]
716pub type OH_AudioDevice_Usage = u32;
717#[repr(C)]
718#[derive(Debug, Copy, Clone)]
719pub struct OH_AudioDeviceDescriptor {
720 _unused: [u8; 0],
721}
722#[doc = " @brief Declaring the audio device descriptor array.\n\n @since 12"]
723#[repr(C)]
724#[derive(Debug, Copy, Clone)]
725pub struct OH_AudioDeviceDescriptorArray {
726 #[doc = " @brief Audio device descriptor array size."]
727 pub size: u32,
728 #[doc = " @brief Audio device descriptor array."]
729 pub descriptors: *mut *mut OH_AudioDeviceDescriptor,
730}
731#[cfg(feature = "api-13")]
732#[doc = " @brief Audio device is unblocked.\n\n @since 13"]
733pub const OH_AudioDevice_BlockStatus_AUDIO_DEVICE_UNBLOCKED: OH_AudioDevice_BlockStatus = 0;
734#[cfg(feature = "api-13")]
735#[doc = " @brief Audio Device is blocked.\n\n @since 13"]
736pub const OH_AudioDevice_BlockStatus_AUDIO_DEVICE_BLOCKED: OH_AudioDevice_BlockStatus = 1;
737#[cfg(feature = "api-13")]
738#[doc = " @brief Declaring the audio device blocked status. By default, the audio device is considered as unbloked.\n\n @since 13"]
739pub type OH_AudioDevice_BlockStatus = u32;
740extern "C" {
741 #[doc = " @brief Query the device role of the target audio device descriptor.\n\n @param audioDeviceDescriptor reference returned by {@link OH_AudioRoutingManager_GetDevices} or\n {@link OH_AudioRouterManager_OnDeviceChangedCallback}.\n @param deviceRole the pointer {@link OH_AudioDevice_DeviceRole} variable that will be set the device role value.\n @return {@link #AUDIOCOMMON_RESULT_SUCCESS} or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}.\n @since 12"]
742 pub fn OH_AudioDeviceDescriptor_GetDeviceRole(
743 audioDeviceDescriptor: *mut OH_AudioDeviceDescriptor,
744 deviceRole: *mut OH_AudioDevice_Role,
745 ) -> OH_AudioCommon_Result;
746}
747extern "C" {
748 #[doc = " @brief Query the device type of the target audio device descriptor.\n\n @param audioDeviceDescriptor reference returned by {@link OH_AudioRoutingManager_GetDevices} or\n {@link OH_AudioRouterManager_OnDeviceChangedCallback}.\n @param deviceType the pointer {@link OH_AudioDevice_DeviceType}\n pointer variable that will be set the device type value.\n @return {@link #AUDIOCOMMON_RESULT_SUCCESS} or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}.\n @since 12"]
749 pub fn OH_AudioDeviceDescriptor_GetDeviceType(
750 audioDeviceDescriptor: *mut OH_AudioDeviceDescriptor,
751 deviceType: *mut OH_AudioDevice_Type,
752 ) -> OH_AudioCommon_Result;
753}
754extern "C" {
755 #[doc = " @brief Query the device id of the target audio device descriptor.\n\n @param audioDeviceDescriptor reference returned by {@link OH_AudioRoutingManager_GetDevices} or\n {@link OH_AudioRouterManager_OnDeviceChangedCallback}.\n @param id pointer variable that will be set the device id value.\n @return {@link #AUDIODEVICE_SUCCESS} or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}.\n @since 12"]
756 pub fn OH_AudioDeviceDescriptor_GetDeviceId(
757 audioDeviceDescriptor: *mut OH_AudioDeviceDescriptor,
758 id: *mut u32,
759 ) -> OH_AudioCommon_Result;
760}
761extern "C" {
762 #[doc = " @brief Query the device name of the target audio device descriptor.\n\n @param audioDeviceDescriptor reference returned by {@link OH_AudioRoutingManager_GetDevices} or\n {@link OH_AudioRouterManager_OnDeviceChangedCallback}.\n @param name pointer variable that will be set the device name value.\n Do not release the name pointer separately\n instead call {@link OH_AudioRoutingManager_ReleaseDevices} to release the DeviceDescriptor array\n when it is no use anymore.\n @return {@link #AUDIOCOMMON_RESULT_SUCCESS} or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}.\n @since 12"]
763 pub fn OH_AudioDeviceDescriptor_GetDeviceName(
764 audioDeviceDescriptor: *mut OH_AudioDeviceDescriptor,
765 name: *mut *mut ::std::os::raw::c_char,
766 ) -> OH_AudioCommon_Result;
767}
768extern "C" {
769 #[doc = " @brief Query the device address of the target audio device descriptor.\n\n @param audioDeviceDescriptor reference returned by {@link OH_AudioRoutingManager_GetDevices} or\n {@link OH_AudioRouterManager_OnDeviceChangedCallback}.\n @param address pointer variable that will be set the device address value.\n Do not release the address pointer separately\n instead call {@link OH_AudioRoutingManager_ReleaseDevices} to release the DeviceDescriptor array\n when it is no use anymore.\n @return {@link #AUDIOCOMMON_RESULT_SUCCESS} or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}.\n @since 12"]
770 pub fn OH_AudioDeviceDescriptor_GetDeviceAddress(
771 audioDeviceDescriptor: *mut OH_AudioDeviceDescriptor,
772 address: *mut *mut ::std::os::raw::c_char,
773 ) -> OH_AudioCommon_Result;
774}
775extern "C" {
776 #[doc = " @brief Query the sample rate array of the target audio device descriptor.\n\n @param audioDeviceDescriptor reference returned by {@link OH_AudioRoutingManager_GetDevices} or\n {@link OH_AudioRouterManager_OnDeviceChangedCallback}.\n @param sampleRates array pointer variable that will be set the sample rate array value.\n Do not release the sampleRates pointer separately\n instead call {@link OH_AudioRoutingManager_ReleaseDevices} to release the DeviceDescriptor array\n when it is no use anymore.\n @param size pointer variable that will be set the sample rate size value.\n @return {@link #AUDIOCOMMON_RESULT_SUCCESS} or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}.\n @since 12"]
777 pub fn OH_AudioDeviceDescriptor_GetDeviceSampleRates(
778 audioDeviceDescriptor: *mut OH_AudioDeviceDescriptor,
779 sampleRates: *mut *mut u32,
780 size: *mut u32,
781 ) -> OH_AudioCommon_Result;
782}
783extern "C" {
784 #[doc = " @brief Query the device channel count array of the target audio device descriptor.\n\n @param audioDeviceDescriptor reference returned by {@link OH_AudioRoutingManager_GetDevices} or\n {@link OH_AudioRouterManager_OnDeviceChangedCallback}.\n @param channelCounts array pointer variable that will be set the channel count array value.\n Do not release the channelCounts pointer separately\n instead call {@link OH_AudioRoutingManager_ReleaseDevices} to release the DeviceDescriptor array\n when it is no use anymore.\n @param size pointer variable that will be set the channel count size value.\n @return {@link #AUDIOCOMMON_RESULT_SUCCESS} or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}.\n @since 12"]
785 pub fn OH_AudioDeviceDescriptor_GetDeviceChannelCounts(
786 audioDeviceDescriptor: *mut OH_AudioDeviceDescriptor,
787 channelCounts: *mut *mut u32,
788 size: *mut u32,
789 ) -> OH_AudioCommon_Result;
790}
791extern "C" {
792 #[doc = " @brief Query the display name of the target audio device descriptor.\n\n @param audioDeviceDescriptor reference returned by {@link OH_AudioRoutingManager_GetDevices} or\n {@link OH_AudioRouterManager_OnDeviceChangedCallback}.\n @param displayName pointer variable that will be set the display name value.\n Do not release the displayName pointer separately\n instead call {@link OH_AudioRoutingManager_ReleaseDevices} to release the DeviceDescriptor array\n when it is no use anymore.\n @return {@link #AUDIOCOMMON_RESULT_SUCCESS} or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}.\n @since 12"]
793 pub fn OH_AudioDeviceDescriptor_GetDeviceDisplayName(
794 audioDeviceDescriptor: *mut OH_AudioDeviceDescriptor,
795 displayName: *mut *mut ::std::os::raw::c_char,
796 ) -> OH_AudioCommon_Result;
797}
798extern "C" {
799 #[doc = " @brief Query the encoding type array of the target audio device descriptor.\n\n @param audioDeviceDescriptor reference returned by {@link OH_AudioRoutingManager_GetDevices} or\n {@link OH_AudioRouterManager_OnDeviceChangedCallback}.\n @param encodingTypes the {@link OH_AudioStream_EncodingType}\n Do not release the encodingTypes pointer separately\n instead call {@link OH_AudioRoutingManager_ReleaseDevices} to release the DeviceDescriptor array\n when it is no use anymore.\n @param size pointer variable that will be set the encoding type size value.\n @return {@link #AUDIOCOMMON_RESULT_SUCCESS} or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}.\n @since 12"]
800 pub fn OH_AudioDeviceDescriptor_GetDeviceEncodingTypes(
801 audioDeviceDescriptor: *mut OH_AudioDeviceDescriptor,
802 encodingTypes: *mut *mut OH_AudioStream_EncodingType,
803 size: *mut u32,
804 ) -> OH_AudioCommon_Result;
805}
806extern "C" {
807 #[doc = " Request to release the capturer stream.\n\n @since 10\n @permission ohos.permission.MICROPHONE\n\n @param capturer reference created by OH_AudioStreamBuilder_GenerateCapturer()\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of capturer is nullptr.\n {@link AUDIOSTREAM_ERROR_ILLEGAL_STATE} Execution status exception."]
808 pub fn OH_AudioCapturer_Release(capturer: *mut OH_AudioCapturer) -> OH_AudioStream_Result;
809}
810extern "C" {
811 #[doc = " Request to start the capturer stream.\n\n @since 10\n @permission ohos.permission.MICROPHONE\n\n @param capturer reference created by OH_AudioStreamBuilder_GenerateCapturer()\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of capturer is nullptr.\n {@link AUDIOSTREAM_ERROR_ILLEGAL_STATE} Execution status exception."]
812 pub fn OH_AudioCapturer_Start(capturer: *mut OH_AudioCapturer) -> OH_AudioStream_Result;
813}
814extern "C" {
815 #[doc = " Request to pause the capturer stream.\n\n @since 10\n @permission ohos.permission.MICROPHONE\n\n @param capturer reference created by OH_AudioStreamBuilder_GenerateCapturer()\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of capturer is nullptr.\n {@link AUDIOSTREAM_ERROR_ILLEGAL_STATE} Execution status exception."]
816 pub fn OH_AudioCapturer_Pause(capturer: *mut OH_AudioCapturer) -> OH_AudioStream_Result;
817}
818extern "C" {
819 #[doc = " Request to stop the capturer stream.\n\n @since 10\n @permission ohos.permission.MICROPHONE\n\n @param capturer reference created by OH_AudioStreamBuilder_GenerateCapturer()\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of capturer is nullptr.\n {@link AUDIOSTREAM_ERROR_ILLEGAL_STATE} Execution status exception."]
820 pub fn OH_AudioCapturer_Stop(capturer: *mut OH_AudioCapturer) -> OH_AudioStream_Result;
821}
822extern "C" {
823 #[doc = " Request to flush the capturer stream.\n\n @since 10\n\n @param capturer reference created by OH_AudioStreamBuilder_GenerateCapturer()\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of capturer is nullptr.\n {@link AUDIOSTREAM_ERROR_ILLEGAL_STATE} Execution status exception."]
824 pub fn OH_AudioCapturer_Flush(capturer: *mut OH_AudioCapturer) -> OH_AudioStream_Result;
825}
826extern "C" {
827 #[doc = " Query the current state of the capturer client.\n\n This function will return the capturer state without updating the state.\n\n @since 10\n\n @param capturer Reference created by OH_AudioStreamBuilder_GenerateCapturer()\n @param state Pointer to a variable that will be set for the state value.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of capturer is nullptr."]
828 pub fn OH_AudioCapturer_GetCurrentState(
829 capturer: *mut OH_AudioCapturer,
830 state: *mut OH_AudioStream_State,
831 ) -> OH_AudioStream_Result;
832}
833extern "C" {
834 #[doc = " Query the latency mode of the capturer client.\n\n @since 10\n\n @param capturer Reference created by OH_AudioStreamBuilder_GenerateCapturer()\n @param latencyMode Pointer to a variable that will be set for the latency mode.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of capturer is nullptr."]
835 pub fn OH_AudioCapturer_GetLatencyMode(
836 capturer: *mut OH_AudioCapturer,
837 latencyMode: *mut OH_AudioStream_LatencyMode,
838 ) -> OH_AudioStream_Result;
839}
840extern "C" {
841 #[doc = " Query the stream id of the capturer client.\n\n @since 10\n\n @param capturer Reference created by OH_AudioStreamBuilder_GenerateCapturer()\n @param streamId Pointer to a variable that will be set for the stream id.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of capturer is nullptr."]
842 pub fn OH_AudioCapturer_GetStreamId(
843 capturer: *mut OH_AudioCapturer,
844 streamId: *mut u32,
845 ) -> OH_AudioStream_Result;
846}
847extern "C" {
848 #[doc = " Query the sample rate value of the capturer client.\n\n This function will return the capturer sample rate value without updating the state.\n\n @since 10\n\n @param capturer Reference created by OH_AudioStreamBuilder_GenerateCapturer()\n @param rate The state value to be updated\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of capturer is nullptr."]
849 pub fn OH_AudioCapturer_GetSamplingRate(
850 capturer: *mut OH_AudioCapturer,
851 rate: *mut i32,
852 ) -> OH_AudioStream_Result;
853}
854extern "C" {
855 #[doc = " Query the channel count of the capturer client.\n\n @since 10\n\n @param capturer Reference created by OH_AudioStreamBuilder_GenerateCapturer()\n @param channelCount Pointer to a variable that will be set for the channel count.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of capturer is nullptr."]
856 pub fn OH_AudioCapturer_GetChannelCount(
857 capturer: *mut OH_AudioCapturer,
858 channelCount: *mut i32,
859 ) -> OH_AudioStream_Result;
860}
861extern "C" {
862 #[doc = " Query the sample format of the capturer client.\n\n @since 10\n\n @param capturer Reference created by OH_AudioStreamBuilder_GenerateCapturer()\n @param sampleFormat Pointer to a variable that will be set for the sample format.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of capturer is nullptr."]
863 pub fn OH_AudioCapturer_GetSampleFormat(
864 capturer: *mut OH_AudioCapturer,
865 sampleFormat: *mut OH_AudioStream_SampleFormat,
866 ) -> OH_AudioStream_Result;
867}
868extern "C" {
869 #[doc = " Query the encoding type of the capturer client.\n\n @since 10\n\n @param capturer Reference created by OH_AudioStreamBuilder_GenerateCapturer()\n @param encodingType Pointer to a variable that will be set for the encoding type.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of capturer is nullptr."]
870 pub fn OH_AudioCapturer_GetEncodingType(
871 capturer: *mut OH_AudioCapturer,
872 encodingType: *mut OH_AudioStream_EncodingType,
873 ) -> OH_AudioStream_Result;
874}
875extern "C" {
876 #[doc = " Query the capturer info of the capturer client.\n\n @since 10\n\n @param capturer Reference created by OH_AudioStreamBuilder_GenerateCapturer()\n @param sourceType Pointer to a variable that will be set for the stream sourceType.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of capturer is nullptr."]
877 pub fn OH_AudioCapturer_GetCapturerInfo(
878 capturer: *mut OH_AudioCapturer,
879 sourceType: *mut OH_AudioStream_SourceType,
880 ) -> OH_AudioStream_Result;
881}
882extern "C" {
883 #[doc = " Query the frame size in callback, it is a fixed length of the buffer returned by each callback.\n\n @since 10\n\n @param capturer Reference created by OH_AudioStreamBuilder_GenerateCapturer()\n @param frameSize Pointer to a variable that will be set for the frame size.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of capturer is nullptr.\n {@link AUDIOSTREAM_ERROR_ILLEGAL_STATE} Execution status exception."]
884 pub fn OH_AudioCapturer_GetFrameSizeInCallback(
885 capturer: *mut OH_AudioCapturer,
886 frameSize: *mut i32,
887 ) -> OH_AudioStream_Result;
888}
889extern "C" {
890 #[doc = " Query the the time at which a particular frame was presented\n\n @since 10\n\n @param capturer Reference created by OH_AudioStreamBuilder_GenerateCapturer()\n @param clockId {@link #CLOCK_MONOTONIC}\n @param framePosition Pointer to a variable to receive the position\n @param timestamp Pointer to a variable to receive the timestamp\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM}:\n 1.The param of capturer is nullptr;\n 2.The param of clockId invalid.\n {@link AUDIOSTREAM_ERROR_ILLEGAL_STATE} Execution status exception."]
891 pub fn OH_AudioCapturer_GetTimestamp(
892 capturer: *mut OH_AudioCapturer,
893 clockId: clockid_t,
894 framePosition: *mut i64,
895 timestamp: *mut i64,
896 ) -> OH_AudioStream_Result;
897}
898extern "C" {
899 #[doc = " Query the the number of frames that have been read since the stream was created.\n\n @since 10\n\n @param capturer Reference created by OH_AudioStreamBuilder_GenerateCapturer()\n @param frames Pointer to a variable that will be set for the frame count number.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of capturer is nullptr."]
900 pub fn OH_AudioCapturer_GetFramesRead(
901 capturer: *mut OH_AudioCapturer,
902 frames: *mut i64,
903 ) -> OH_AudioStream_Result;
904}
905extern "C" {
906 #[doc = " @brief Gets the overflow count on this stream.\n\n @since 12\n\n @param capturer Capturer generated by OH_AudioStreamBuilder_GenerateCapturer()\n @param count Pointer to a variable that will be set for the overflow count number.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of capturer is nullptr."]
907 pub fn OH_AudioCapturer_GetOverflowCount(
908 capturer: *mut OH_AudioCapturer,
909 count: *mut u32,
910 ) -> OH_AudioStream_Result;
911}
912#[cfg(feature = "api-20")]
913#[doc = " @brief Called when audio data is available to read. This function is similar to\n OH_AudioCapturer_Callbacks_Struct.OH_AudioCapturer_OnReadData.\n\n @param capturer Pointer to the AudioCapturer instance that triggers the callback.\n @param userData Pointer to the user data passed when setting the callback via\n OH_AudioStreamBuilder_SetCapturerReadDataCallback.\n @param audioData Pointer to the available audio data.\n @param audioDataSize Size of the available audio data.\n @see OH_AudioCapturer_Callbacks_Struct.OH_AudioCapturer_OnReadData\n @since 20"]
914pub type OH_AudioCapturer_OnReadDataCallback = ::std::option::Option<
915 unsafe extern "C" fn(
916 capturer: *mut OH_AudioCapturer,
917 userData: *mut ::std::os::raw::c_void,
918 audioData: *mut ::std::os::raw::c_void,
919 audioDataSize: i32,
920 ),
921>;
922#[cfg(feature = "api-20")]
923#[doc = " @brief Called when the input device of an AudioCapturer instance changes.\n This function is similar to OH_AudioCapturer_Callbacks_Struct.OH_AudioCapturer_OnStreamEvent.\n\n @param capturer Pointer to the AudioCapturer instance that triggers the callback.\n @param userData Pointer to the user data passed when setting the callback via\n OH_AudioStreamBuilder_SetCapturerDeviceChangeCallback.\n @param deviceArray Pointer to an array of the new input devices.\n @see OH_AudioCapturer_Callbacks_Struct.OH_AudioCapturer_OnStreamEvent\n @since 20"]
924pub type OH_AudioCapturer_OnDeviceChangeCallback = ::std::option::Option<
925 unsafe extern "C" fn(
926 capturer: *mut OH_AudioCapturer,
927 userData: *mut ::std::os::raw::c_void,
928 deviceArray: *mut OH_AudioDeviceDescriptorArray,
929 ),
930>;
931#[cfg(feature = "api-20")]
932#[doc = " @brief Called when an interrupt event occurs in an AudioCapturer instance.\n This function is similar to OH_AudioCapturer_Callbacks_Struct.OH_AudioCapturer_OnInterruptEvent.\n\n @param capturer Pointer to the AudioCapturer instance that triggers the callback.\n @param userData Pointer to the user data passed when setting the callback via\n OH_AudioStreamBuilder_SetCapturerInterruptCallback.\n @param type Type of force that causes the interrupt event.\n @param hint Hint provided along with the interrupt event.\n @see OH_AudioCapturer_Callbacks_Struct.OH_AudioCapturer_OnInterruptEvent.\n @since 20"]
933pub type OH_AudioCapturer_OnInterruptCallback = ::std::option::Option<
934 unsafe extern "C" fn(
935 capturer: *mut OH_AudioCapturer,
936 userData: *mut ::std::os::raw::c_void,
937 type_: OH_AudioInterrupt_ForceType,
938 hint: OH_AudioInterrupt_Hint,
939 ),
940>;
941#[cfg(feature = "api-20")]
942#[doc = " @brief Called when an error event occurs in an AudioCapturer instance.\n This function is similar to OH_AudioCapturer_Callbacks_Struct.OH_AudioCapturer_OnError.\n\n @param capturer Pointer to the AudioCapturer instance that triggers the callback.\n @param userData Pointer to the user data passed when setting the callback via\n OH_AudioStreamBuilder_SetCapturerErrorCallback.\n @param error Specific error information.\n @see OH_AudioCapturer_Callbacks_Struct.OH_AudioCapturer_OnError\n @since 20"]
943pub type OH_AudioCapturer_OnErrorCallback = ::std::option::Option<
944 unsafe extern "C" fn(
945 capturer: *mut OH_AudioCapturer,
946 userData: *mut ::std::os::raw::c_void,
947 error: OH_AudioStream_Result,
948 ),
949>;
950extern "C" {
951 #[cfg(feature = "api-20")]
952 #[doc = " @brief Gets audio capturer running status, check if it works in fast status.\n\n @param capturer Reference created by OH_AudioStreamBuilder_GenerateCapturer.\n @param status Pointer to a variable to receive the status.\n @return\n {@link AUDIOSTREAM_SUCCESS} if the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} the param of capturer is nullptr.\n {@link AUDIOSTREAM_ERROR_ILLEGAL_STATE} function called in invalid state, only available before release state.\n @since 20"]
953 pub fn OH_AudioCapturer_GetFastStatus(
954 capturer: *mut OH_AudioCapturer,
955 status: *mut OH_AudioStream_FastStatus,
956 ) -> OH_AudioStream_Result;
957}
958#[cfg(feature = "api-20")]
959#[doc = " @brief Callback function of fast status change event for audio capturer.\n\n @param capturer Pointer to an audio capturer instance for which this callback occurs.\n @param userData Userdata which is passed by register.\n @param status Current fast status.\n @since 20"]
960pub type OH_AudioCapturer_OnFastStatusChange = ::std::option::Option<
961 unsafe extern "C" fn(
962 capturer: *mut OH_AudioCapturer,
963 userData: *mut ::std::os::raw::c_void,
964 status: OH_AudioStream_FastStatus,
965 ),
966>;
967extern "C" {
968 #[doc = " Request to release the renderer stream.\n\n @since 10\n\n @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer()\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of renderer is nullptr.\n {@link AUDIOSTREAM_ERROR_ILLEGAL_STATE} Execution status exception."]
969 pub fn OH_AudioRenderer_Release(renderer: *mut OH_AudioRenderer) -> OH_AudioStream_Result;
970}
971extern "C" {
972 #[doc = " Request to start the renderer stream.\n\n @since 10\n\n @param renderer reference created by OH_AudioStreamBuilder\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of renderer is nullptr.\n {@link AUDIOSTREAM_ERROR_ILLEGAL_STATE} Execution status exception."]
973 pub fn OH_AudioRenderer_Start(renderer: *mut OH_AudioRenderer) -> OH_AudioStream_Result;
974}
975extern "C" {
976 #[doc = " Request to pause the renderer stream.\n\n @since 10\n\n @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer()\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of renderer is nullptr.\n {@link AUDIOSTREAM_ERROR_ILLEGAL_STATE} Execution status exception."]
977 pub fn OH_AudioRenderer_Pause(renderer: *mut OH_AudioRenderer) -> OH_AudioStream_Result;
978}
979extern "C" {
980 #[doc = " Request to stop renderer stream.\n\n @since 10\n\n @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer()\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of renderer is nullptr.\n {@link AUDIOSTREAM_ERROR_ILLEGAL_STATE} Execution status exception."]
981 pub fn OH_AudioRenderer_Stop(renderer: *mut OH_AudioRenderer) -> OH_AudioStream_Result;
982}
983extern "C" {
984 #[doc = " Request to flush the renderer stream.\n\n @since 10\n\n @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer()\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of renderer is nullptr.\n {@link AUDIOSTREAM_ERROR_ILLEGAL_STATE} Execution status exception."]
985 pub fn OH_AudioRenderer_Flush(renderer: *mut OH_AudioRenderer) -> OH_AudioStream_Result;
986}
987extern "C" {
988 #[doc = " Query the current state of the renderer client.\n\n This function will return the renderer state without updating the state.\n\n @since 10\n\n @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer()\n @param state Pointer to a variable that will be set for the state value.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of renderer is nullptr."]
989 pub fn OH_AudioRenderer_GetCurrentState(
990 renderer: *mut OH_AudioRenderer,
991 state: *mut OH_AudioStream_State,
992 ) -> OH_AudioStream_Result;
993}
994extern "C" {
995 #[doc = " Query the sample rate value of the renderer client\n\n This function will return the renderer sample rate value without updating the state.\n\n @since 10\n\n @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer()\n @param rate The state value to be updated\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of renderer is nullptr."]
996 pub fn OH_AudioRenderer_GetSamplingRate(
997 renderer: *mut OH_AudioRenderer,
998 rate: *mut i32,
999 ) -> OH_AudioStream_Result;
1000}
1001extern "C" {
1002 #[doc = " Query the stream id of the renderer client.\n\n @since 10\n\n @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer()\n @param streamId Pointer to a variable that will be set for the stream id.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of renderer is nullptr."]
1003 pub fn OH_AudioRenderer_GetStreamId(
1004 renderer: *mut OH_AudioRenderer,
1005 streamId: *mut u32,
1006 ) -> OH_AudioStream_Result;
1007}
1008extern "C" {
1009 #[doc = " Query the channel count of the renderer client.\n\n @since 10\n\n @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer()\n @param channelCount Pointer to a variable that will be set for the channel count.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of renderer is nullptr."]
1010 pub fn OH_AudioRenderer_GetChannelCount(
1011 renderer: *mut OH_AudioRenderer,
1012 channelCount: *mut i32,
1013 ) -> OH_AudioStream_Result;
1014}
1015extern "C" {
1016 #[doc = " Query the sample format of the renderer client.\n\n @since 10\n\n @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer()\n @param sampleFormat Pointer to a variable that will be set for the sample format.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of renderer is nullptr."]
1017 pub fn OH_AudioRenderer_GetSampleFormat(
1018 renderer: *mut OH_AudioRenderer,
1019 sampleFormat: *mut OH_AudioStream_SampleFormat,
1020 ) -> OH_AudioStream_Result;
1021}
1022extern "C" {
1023 #[doc = " Query the latency mode of the renderer client.\n\n @since 10\n\n @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer()\n @param latencyMode Pointer to a variable that will be set for the latency mode.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of renderer is nullptr."]
1024 pub fn OH_AudioRenderer_GetLatencyMode(
1025 renderer: *mut OH_AudioRenderer,
1026 latencyMode: *mut OH_AudioStream_LatencyMode,
1027 ) -> OH_AudioStream_Result;
1028}
1029extern "C" {
1030 #[doc = " Query the renderer info of the renderer client.\n\n The rendere info includes {@link OH_AudioStream_Usage} value.\n\n @since 10\n\n @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer()\n @param usage Pointer to a variable that will be set for the stream usage.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of renderer is nullptr."]
1031 pub fn OH_AudioRenderer_GetRendererInfo(
1032 renderer: *mut OH_AudioRenderer,
1033 usage: *mut OH_AudioStream_Usage,
1034 ) -> OH_AudioStream_Result;
1035}
1036extern "C" {
1037 #[doc = " Query the encoding type of the renderer client.\n\n @since 10\n\n @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer()\n @param encodingType Pointer to a variable that will be set for the encoding type.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of renderer is nullptr."]
1038 pub fn OH_AudioRenderer_GetEncodingType(
1039 renderer: *mut OH_AudioRenderer,
1040 encodingType: *mut OH_AudioStream_EncodingType,
1041 ) -> OH_AudioStream_Result;
1042}
1043extern "C" {
1044 #[doc = " Query the the number of frames that have been written since the stream was created.\n\n @since 10\n\n @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer()\n @param frames Pointer to a variable that will be set for the frame count number.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of renderer is nullptr."]
1045 pub fn OH_AudioRenderer_GetFramesWritten(
1046 renderer: *mut OH_AudioRenderer,
1047 frames: *mut i64,
1048 ) -> OH_AudioStream_Result;
1049}
1050extern "C" {
1051 #[doc = " Query the the time at which a particular frame was presented.\n\n It is recommended to use new api {@link OH_AudioRenderer_GetAudioTimestampInfo}\n because it adapts to playback speed change, but current api does not. The\n increasing speed for position will not change when speed become fast.\n\n @since 10\n\n @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer()\n @param clockId {@link #CLOCK_MONOTONIC}\n @param framePosition Pointer to a variable to receive the position\n @param timestamp Pointer to a variable to receive the timestamp\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM}:\n 1.The param of renderer is nullptr;\n 2.The param of clockId invalid.\n {@link AUDIOSTREAM_ERROR_ILLEGAL_STATE} Execution status exception."]
1052 pub fn OH_AudioRenderer_GetTimestamp(
1053 renderer: *mut OH_AudioRenderer,
1054 clockId: clockid_t,
1055 framePosition: *mut i64,
1056 timestamp: *mut i64,
1057 ) -> OH_AudioStream_Result;
1058}
1059extern "C" {
1060 #[doc = " Query the frame size in callback, it is a fixed length that the stream want to be filled for each callback.\n\n @since 10\n\n @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer()\n @param frameSize Pointer to a variable that will be set for the frame size.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of renderer is nullptr."]
1061 pub fn OH_AudioRenderer_GetFrameSizeInCallback(
1062 renderer: *mut OH_AudioRenderer,
1063 frameSize: *mut i32,
1064 ) -> OH_AudioStream_Result;
1065}
1066extern "C" {
1067 #[doc = " Query the playback speed of the stream client\n\n @since 11\n\n @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer()\n @param speed Pointer to a variable to receive the playback speed.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of renderer is nullptr."]
1068 pub fn OH_AudioRenderer_GetSpeed(
1069 renderer: *mut OH_AudioRenderer,
1070 speed: *mut f32,
1071 ) -> OH_AudioStream_Result;
1072}
1073extern "C" {
1074 #[doc = " Set the playback speed of the stream client\n\n @since 11\n\n @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer()\n @param speed The playback speed, form 0.25 to 4.0.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of renderer is nullptr."]
1075 pub fn OH_AudioRenderer_SetSpeed(
1076 renderer: *mut OH_AudioRenderer,
1077 speed: f32,
1078 ) -> OH_AudioStream_Result;
1079}
1080extern "C" {
1081 #[doc = " Set volume of current renderer.\n\n @since 12\n\n @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer()\n @param volume Volume to set which changes from 0.0 to 1.0.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM}:\n 1.The param of renderer is nullptr;\n 2.The param of volume invalid.\n {@link AUDIOSTREAM_ERROR_ILLEGAL_STATE} Execution status exception.\n {@link AUDIOSTREAM_ERROR_SYSTEM} An system error has occurred."]
1082 pub fn OH_AudioRenderer_SetVolume(
1083 renderer: *mut OH_AudioRenderer,
1084 volume: f32,
1085 ) -> OH_AudioStream_Result;
1086}
1087extern "C" {
1088 #[doc = " Changes the volume with ramp for a duration.\n\n @since 12\n\n @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer()\n @param volume Volume to set which changes from 0.0 to 1.0.\n @param durationMs Duration for volume ramp, in millisecond.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM}:\n 1.The param of renderer is nullptr;\n 2.The param of volume invalid.\n {@link AUDIOSTREAM_ERROR_ILLEGAL_STATE} Execution status exception.\n {@link AUDIOSTREAM_ERROR_SYSTEM} An system error has occurred."]
1089 pub fn OH_AudioRenderer_SetVolumeWithRamp(
1090 renderer: *mut OH_AudioRenderer,
1091 volume: f32,
1092 durationMs: i32,
1093 ) -> OH_AudioStream_Result;
1094}
1095extern "C" {
1096 #[doc = " Get Volume of current renderer.\n\n @since 12\n\n @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer()\n @param volume Pointer to a variable to receive the volume.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM}:\n 1.The param of renderer is nullptr;\n 2.The param of volume is nullptr."]
1097 pub fn OH_AudioRenderer_GetVolume(
1098 renderer: *mut OH_AudioRenderer,
1099 volume: *mut f32,
1100 ) -> OH_AudioStream_Result;
1101}
1102extern "C" {
1103 #[doc = " @brief Set mark position on current renderer. Calling this function will overwrite the mark postion which has already\n set.\n\n @since 12\n\n @param renderer Renderer generated by OH_AudioStreamBuilder_GenerateRenderer()\n @param samplePos Mark position in samples.\n @param callback Callback used when the samplePos has reached.\n @param userData User data which is passed by user.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM}:\n 1.The param of renderer is nullptr;\n 2.The param of samplePos invalid.\n {@link AUDIOSTREAM_ERROR_ILLEGAL_STATE} Execution status exception.\n {@link AUDIOSTREAM_ERROR_SYSTEM} An system error has occurred."]
1104 pub fn OH_AudioRenderer_SetMarkPosition(
1105 renderer: *mut OH_AudioRenderer,
1106 samplePos: u32,
1107 callback: OH_AudioRenderer_OnMarkReachedCallback,
1108 userData: *mut ::std::os::raw::c_void,
1109 ) -> OH_AudioStream_Result;
1110}
1111extern "C" {
1112 #[doc = " @brief Cancel mark which has set by {@link #OH_AudioRenderer_SetMarkPosition}.\n\n @since 12\n\n @param renderer Renderer generated by OH_AudioStreamBuilder_GenerateRenderer()\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of renderer is nullptr."]
1113 pub fn OH_AudioRenderer_CancelMark(renderer: *mut OH_AudioRenderer) -> OH_AudioStream_Result;
1114}
1115extern "C" {
1116 #[doc = " @brief Gets the underflow count on this stream.\n\n @since 12\n\n @param renderer Renderer generated by OH_AudioStreamBuilder_GenerateRenderer()\n @param count Pointer to a variable to receive the underflow count number.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM}:\n 1.The param of renderer is nullptr;\n 2.The param of count is nullptr."]
1117 pub fn OH_AudioRenderer_GetUnderflowCount(
1118 renderer: *mut OH_AudioRenderer,
1119 count: *mut u32,
1120 ) -> OH_AudioStream_Result;
1121}
1122extern "C" {
1123 #[doc = " @brief Query the channel layout of the renderer client.\n\n @since 12\n\n @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer()\n @param channelLayout Pointer to a variable to receive the channel layout\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of renderer is nullptr."]
1124 pub fn OH_AudioRenderer_GetChannelLayout(
1125 renderer: *mut OH_AudioRenderer,
1126 channelLayout: *mut OH_AudioChannelLayout,
1127 ) -> OH_AudioStream_Result;
1128}
1129extern "C" {
1130 #[doc = " @brief Query current audio effect mode.\n\n @since 12\n\n @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer()\n @param effectMode Pointer to a variable to receive current audio effect mode\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of renderer is nullptr."]
1131 pub fn OH_AudioRenderer_GetEffectMode(
1132 renderer: *mut OH_AudioRenderer,
1133 effectMode: *mut OH_AudioStream_AudioEffectMode,
1134 ) -> OH_AudioStream_Result;
1135}
1136extern "C" {
1137 #[doc = " @brief Set current audio effect mode.\n\n @since 12\n\n @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer()\n @param effectMode Audio effect mode that will be set for the stream\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of renderer is nullptr."]
1138 pub fn OH_AudioRenderer_SetEffectMode(
1139 renderer: *mut OH_AudioRenderer,
1140 effectMode: OH_AudioStream_AudioEffectMode,
1141 ) -> OH_AudioStream_Result;
1142}
1143extern "C" {
1144 #[doc = " @brief Get the privacy of this stream.\n\n @since 12\n\n @param renderer Renderer generated by OH_AudioStreamBuilder_GenerateRenderer()\n @param privacy Pointer to a variable which receives the results.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of renderer is nullptr."]
1145 pub fn OH_AudioRenderer_GetRendererPrivacy(
1146 renderer: *mut OH_AudioRenderer,
1147 privacy: *mut OH_AudioStream_PrivacyType,
1148 ) -> OH_AudioStream_Result;
1149}
1150extern "C" {
1151 #[doc = " @brief Set silent and mix with other streams for this stream.\n\n @param renderer Renderer generated by OH_AudioStreamBuilder_GenerateRenderer()\n @param on The silent and mix with other streams mode.\n true: set the slient mode and mix with other streams.\n false: unset the slient mode, current stream will trigger the audio focus internally.\n @return result code for this function.\n {@link #AUDIOSTREAM_SUCCESS} succeed in setting to the silent and mix with other streams.\n {@link #AUDIOSTREAM_ERROR_ILLEGAL_STATE} this stream is not allowed to set/unset the silent mode.\n @since 12"]
1152 pub fn OH_AudioRenderer_SetSilentModeAndMixWithOthers(
1153 renderer: *mut OH_AudioRenderer,
1154 on: bool,
1155 ) -> OH_AudioStream_Result;
1156}
1157extern "C" {
1158 #[doc = " @brief Query silent and mix with other streams status for this stream.\n\n @param renderer Renderer generated by OH_AudioStreamBuilder_GenerateRenderer()\n @param on Pointer to the silent and mix with other streams status.\n @return result code for this function.\n {@link #AUDIOSTREAM_SUCCESS} succeed in getting silent and mix with other streams status\n {@link #AUDIOSTREAM_ERROR_SYSTEM} system error when calling this function.\n @since 12"]
1159 pub fn OH_AudioRenderer_GetSilentModeAndMixWithOthers(
1160 renderer: *mut OH_AudioRenderer,
1161 on: *mut bool,
1162 ) -> OH_AudioStream_Result;
1163}
1164extern "C" {
1165 #[doc = " @brief Temporarily changes the current audio device\n This function applys on audiorenderers whose StreamUsage are\n STREAM_USAGE_VOICE_COMMUNICATIN/STREAM_USAGE_VIDEO_COMMUNICATION/STREAM_USAGE_VOICE_MESSAGE.\n Setting the device will only takes effect if no other accessory such as headphones are in use.\n\n @param renderer Renderer generated by OH_AudioStreamBuilder_GenerateRenderer()\n @param deviceType The target device. The available deviceTypes are:\n EARPIECE: Built-in earpiece\n SPEAKER: Built-in speaker\n DEFAULT: System default output device\n @return result code for this function.\n {@link #AUDIOSTREAM_SUCCESS} succeed in setting the default output device\n {@link #AUDIOSTREAM_ERROR_INVALID_PARAM}:\n 1.The param of renderer is nullptr;\n 2.The param of deviceType is not valid\n {@link #AUDIOSTREAM_ERROR_ILLEGAL_STATE} This audiorenderer can not reset the output device\n {@link #AUDIOSTREAM_ERROR_SYSTEM} system error when calling this function.\n @since 12"]
1166 pub fn OH_AudioRenderer_SetDefaultOutputDevice(
1167 renderer: *mut OH_AudioRenderer,
1168 deviceType: OH_AudioDevice_Type,
1169 ) -> OH_AudioStream_Result;
1170}
1171extern "C" {
1172 #[cfg(feature = "api-15")]
1173 #[doc = " @brief Query the timestamp at which a particular frame was presented in clock monotonic timebase,\n the frame at the returned position was just committed to hardware. This is often used in\n video synchronization and recording stream alignment.\n\n Position is 0 and timestamp is fixed until stream really runs and frame is committed. Position\n will also be reset while flush function is called. When a audio route change happens, like in\n device or output type change situations, the position may also be reset but timestamp remains\n monotonically increasing.\n So it is better to use the values until they becomes regularly after the change.\n This interface also adapts to playback speed change. For example, the increseing speed for\n position will be double for 2x speed playback.\n\n For video synchronization usage, there is a best practice document for developer to refer\n **AV Synchronization**.\n\n @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer()\n @param framePosition Pointer to a variable to receive the position\n @param timestamp Pointer to a variable to receive the timestamp\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM}:\n 1.The param of renderer is nullptr;\n 2.The param of framePosition or timestamp is nullptr;\n {@link AUDIOSTREAM_ERROR_ILLEGAL_STATE}:\n 1.Only running state is legal for getting audio timestamp.\n {@link AUDIOSTREAM_ERROR_SYSTEM}:\n 1.Crash or blocking occurs in system process.\n 2.Other unexpected error from internal system.\n @since 15"]
1174 pub fn OH_AudioRenderer_GetAudioTimestampInfo(
1175 renderer: *mut OH_AudioRenderer,
1176 framePosition: *mut i64,
1177 timestamp: *mut i64,
1178 ) -> OH_AudioStream_Result;
1179}
1180#[cfg(feature = "api-20")]
1181#[doc = " @brief Called when an interrupt event occurs in an AudioRenderer instance.\n This function is similar to OH_AudioRenderer_Callbacks_Struct.OH_AudioRenderer_OnInterruptEvent.\n\n @param renderer Pointer to the AudioRenderer instance that triggers the callback.\n @param userData Pointer to the user data passed when setting the callback via\n OH_AudioStreamBuilder_SetRendererInterruptCallback.\n @param type Type of force that causes the interrupt event.\n @param hint Hint provided along with the interrupt event.\n @see OH_AudioRenderer_Callbacks_Struct.OH_AudioRenderer_OnInterruptEvent.\n @since 20"]
1182pub type OH_AudioRenderer_OnInterruptCallback = ::std::option::Option<
1183 unsafe extern "C" fn(
1184 renderer: *mut OH_AudioRenderer,
1185 userData: *mut ::std::os::raw::c_void,
1186 type_: OH_AudioInterrupt_ForceType,
1187 hint: OH_AudioInterrupt_Hint,
1188 ),
1189>;
1190#[cfg(feature = "api-20")]
1191#[doc = " @brief Called when an error event occurs in an AudioRenderer instance.\n This function is similar to OH_AudioRenderer_Callbacks_Struct.OH_AudioRenderer_OnError.\n\n @param renderer Pointer to the AudioRenderer instance that triggers the callback.\n @param userData Pointer to the user data passed when setting the callback via\n OH_AudioStreamBuilder_SetRendererErrorCallback.\n @param error Specific error information.\n @see OH_AudioRenderer_Callbacks_Struct.OH_AudioRenderer_OnError\n @since 20"]
1192pub type OH_AudioRenderer_OnErrorCallback = ::std::option::Option<
1193 unsafe extern "C" fn(
1194 renderer: *mut OH_AudioRenderer,
1195 userData: *mut ::std::os::raw::c_void,
1196 error: OH_AudioStream_Result,
1197 ),
1198>;
1199extern "C" {
1200 #[cfg(feature = "api-20")]
1201 #[doc = " @brief Gets audio renderer running status, check if it works in fast status.\n\n @param renderer Reference created by OH_AudioStreamBuilder_GenerateRenderer.\n @param status Pointer to a variable to receive the status.\n @return\n {@link AUDIOSTREAM_SUCCESS} if the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} the param of renderer is nullptr.\n {@link AUDIOSTREAM_ERROR_ILLEGAL_STATE} function called in invalid state, only available before release state.\n @since 20"]
1202 pub fn OH_AudioRenderer_GetFastStatus(
1203 renderer: *mut OH_AudioRenderer,
1204 status: *mut OH_AudioStream_FastStatus,
1205 ) -> OH_AudioStream_Result;
1206}
1207#[cfg(feature = "api-20")]
1208#[doc = " @brief Callback function of fast status change event for audio renderer.\n\n @param renderer Pointer to an audio renderer instance for which this callback occurs.\n @param userData Userdata which is passed by register.\n @param status Current fast status.\n @since 20"]
1209pub type OH_AudioRenderer_OnFastStatusChange = ::std::option::Option<
1210 unsafe extern "C" fn(
1211 renderer: *mut OH_AudioRenderer,
1212 userData: *mut ::std::os::raw::c_void,
1213 status: OH_AudioStream_FastStatus,
1214 ),
1215>;
1216extern "C" {
1217 #[cfg(feature = "api-20")]
1218 #[doc = " @brief Sets the loudness gain of current renderer.\n The default loudness gain is 0.0dB. The stream usage of the audio renderer must be\n {@link OH_AudioStream_Usage#AUDIOSTREAM_USAGE_MUSIC}, {@link OH_AudioStream_Usage#AUDIOSTREAM_USAGE_MOVIE}\n or {@link OH_AudioStream_Usage#AUDIOSTREAM_USAGE_AUDIOBOOK}.\n The latency mode of the audio renderer must be {@link OH_AudioStream_LatencyMode#AUDIOSTREAM_LATENCY_MODE_NORMAL}.\n If AudioRenderer is played through the high-resolution pipe, this operation is not supported.\n\n @param renderer AudioRender created by OH_AudioStreamBuilder_GenerateRenderer()\n @param loudnessGain Loudness gain to set which changes from -90.0 to 24.0, expressing in dB.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM}:\n 1.The param of renderer is nullptr or not supported to set gain;\n 2.The param of loudnessGain is invalid.\n @since 20"]
1219 pub fn OH_AudioRenderer_SetLoudnessGain(
1220 renderer: *mut OH_AudioRenderer,
1221 loudnessGain: f32,
1222 ) -> OH_AudioStream_Result;
1223}
1224extern "C" {
1225 #[cfg(feature = "api-20")]
1226 #[doc = " @brief Get the loudness gain of current renderer.\n\n @param renderer AudioRender created by OH_AudioStreamBuilder_GenerateRenderer()\n @param loudnessGain Pointer to a variable to receive the loudness gain.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM}:\n 1.The param of renderer is nullptr;\n 2.The param of loudnessGain is nullptr.\n @since 20"]
1227 pub fn OH_AudioRenderer_GetLoudnessGain(
1228 renderer: *mut OH_AudioRenderer,
1229 loudnessGain: *mut f32,
1230 ) -> OH_AudioStream_Result;
1231}
1232#[cfg(feature = "api-20")]
1233#[doc = " @brief Callback function of write data on Render.\n\n Different with OH_AudioRenderer_OnWriteDataCallback, this function allows the caller to write partial data which\n ranges from 0 to the callback buffer size. If 0 is returned, the callback thread will sleep for a while. Otherwise,\n the system may callback again immediately.\n\n @param renderer AudioRenderer where this callback occurs.\n @param userData User data which is passed by user.\n @param audioData Audio data pointer, where user should fill in audio data.\n @param audioDataSize Size of audio data that user should fill in.\n @return Length of the valid data that has written into audioData buffer. The return value must be in range of\n [0, audioDataSize]. If the return value is less than 0, the system changes it to 0. And, if the return value is\n greater than audioDataSize, the system changes it to audioDataSize. Note that the length of the returned buffer\n must be an integer multiple of the length of the single sample data. For example, for 2 channels and S16 format\n audio data, it must be an integer multiple of 4(2*16/8). Otherwise, it may cause noise during playback.\n @see OH_AudioRenderer_OnWriteDataCallback\n @since 20"]
1234pub type OH_AudioRenderer_OnWriteDataCallbackAdvanced = ::std::option::Option<
1235 unsafe extern "C" fn(
1236 renderer: *mut OH_AudioRenderer,
1237 userData: *mut ::std::os::raw::c_void,
1238 audioData: *mut ::std::os::raw::c_void,
1239 audioDataSize: i32,
1240 ) -> i32,
1241>;
1242extern "C" {
1243 #[doc = " Create a stremBuilder can be used to open a renderer or capturer client.\n\n OH_AudioStreamBuilder_Destroy() must be called when you are done using the builder.\n\n @since 10\n\n @param builder The builder reference to the created result.\n @param type The stream type to be created. {@link #AUDIOSTREAM_TYPE_RENDERER} or {@link #AUDIOSTREAM_TYPE_CAPTURER}\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful."]
1244 pub fn OH_AudioStreamBuilder_Create(
1245 builder: *mut *mut OH_AudioStreamBuilder,
1246 type_: OH_AudioStream_Type,
1247 ) -> OH_AudioStream_Result;
1248}
1249extern "C" {
1250 #[doc = " Destroy a streamBulder.\n\n This function must be called when you are done using the builder.\n\n @since 10\n\n @param builder Reference provided by OH_AudioStreamBuilder_Create()\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of builder is nullptr.\n {@link AUDIOSTREAM_ERROR_ILLEGAL_STATE} Execution status exception."]
1251 pub fn OH_AudioStreamBuilder_Destroy(
1252 builder: *mut OH_AudioStreamBuilder,
1253 ) -> OH_AudioStream_Result;
1254}
1255extern "C" {
1256 #[doc = " Set the channel count of the capturer client\n\n @since 10\n\n @param builder Reference created by OH_AudioStreamBuilder\n @param rate Pointer to a variable that will be set for the channel count.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM}:\n 1.The param of builder is nullptr;\n 2.The param of rate invalid."]
1257 pub fn OH_AudioStreamBuilder_SetSamplingRate(
1258 builder: *mut OH_AudioStreamBuilder,
1259 rate: i32,
1260 ) -> OH_AudioStream_Result;
1261}
1262extern "C" {
1263 #[doc = " Set the channel count of the stream client\n\n @since 10\n\n @param builder Reference provided by OH_AudioStreamBuilder_Create()\n @param channelCount The channel count.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM}:\n 1.The param of builder is nullptr;\n 2.The param of channelCount invalid."]
1264 pub fn OH_AudioStreamBuilder_SetChannelCount(
1265 builder: *mut OH_AudioStreamBuilder,
1266 channelCount: i32,
1267 ) -> OH_AudioStream_Result;
1268}
1269extern "C" {
1270 #[doc = " Set the sample format of the stream client\n\n @since 10\n\n @param builder Reference provided by OH_AudioStreamBuilder_Create()\n @param format Sample data format.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of builder is nullptr."]
1271 pub fn OH_AudioStreamBuilder_SetSampleFormat(
1272 builder: *mut OH_AudioStreamBuilder,
1273 format: OH_AudioStream_SampleFormat,
1274 ) -> OH_AudioStream_Result;
1275}
1276extern "C" {
1277 #[doc = " Set the encoding type of the stream client\n\n @since 10\n\n @param builder Reference provided by OH_AudioStreamBuilder_Create()\n @param encodingType Encoding type for the stream client, {@link #AUDIOSTREAM_ENCODING_PCM}\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of builder is nullptr."]
1278 pub fn OH_AudioStreamBuilder_SetEncodingType(
1279 builder: *mut OH_AudioStreamBuilder,
1280 encodingType: OH_AudioStream_EncodingType,
1281 ) -> OH_AudioStream_Result;
1282}
1283extern "C" {
1284 #[doc = " Set the latency mode of the stream client\n\n @since 10\n\n @param builder Reference provided by OH_AudioStreamBuilder_Create()\n @param latencyMode Latency mode for the stream client.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of builder is nullptr."]
1285 pub fn OH_AudioStreamBuilder_SetLatencyMode(
1286 builder: *mut OH_AudioStreamBuilder,
1287 latencyMode: OH_AudioStream_LatencyMode,
1288 ) -> OH_AudioStream_Result;
1289}
1290extern "C" {
1291 #[doc = " @brief Set the channel layout to the stream client\n\n @since 12\n\n @param builder Reference provided by OH_AudioStreamBuilder_Create()\n @param channelLayout is the layout of the speaker.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of builder is nullptr."]
1292 pub fn OH_AudioStreamBuilder_SetChannelLayout(
1293 builder: *mut OH_AudioStreamBuilder,
1294 channelLayout: OH_AudioChannelLayout,
1295 ) -> OH_AudioStream_Result;
1296}
1297extern "C" {
1298 #[doc = " Set the renderer information of the stream client\n\n @since 10\n\n @param builder Reference provided by OH_AudioStreamBuilder_Create()\n @param usage Set the stream usage for the renderer client.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM}:\n 1.The param of builder is nullptr;\n 2.The param of usage invalid."]
1299 pub fn OH_AudioStreamBuilder_SetRendererInfo(
1300 builder: *mut OH_AudioStreamBuilder,
1301 usage: OH_AudioStream_Usage,
1302 ) -> OH_AudioStream_Result;
1303}
1304extern "C" {
1305 #[doc = " Set the capturer information of the stream client\n\n @since 10\n\n @param builder Reference provided by OH_AudioStreamBuilder_Create()\n @param sourceType Set the source type for the capturer client.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM}:\n 1.The param of builder is nullptr;\n 2.The param of sourceType invalid."]
1306 pub fn OH_AudioStreamBuilder_SetCapturerInfo(
1307 builder: *mut OH_AudioStreamBuilder,
1308 sourceType: OH_AudioStream_SourceType,
1309 ) -> OH_AudioStream_Result;
1310}
1311extern "C" {
1312 #[doc = " Set the callbacks for the renderer client\n\n @deprecated since 20\n @useinstead Set the callback functions separately using OH_AudioStreamBuilder_SetRendererWriteDataCallback,\n OH_AudioStreamBuilder_SetRendererInterruptCallback, OH_AudioStreamBuilder_SetRendererOutputDeviceChangeCallback\n and OH_AudioStreamBuilder_SetRendererErrorCallback.\n @since 10\n\n @param builder Reference provided by OH_AudioStreamBuilder_Create()\n @param callbacks Callbacks to the functions that will process renderer stream.\n @param userData Pointer to an application data structure that will be passed to the callback functions.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM}:\n 1.The param of builder is nullptr;\n 2.StreamType invalid."]
1313 pub fn OH_AudioStreamBuilder_SetRendererCallback(
1314 builder: *mut OH_AudioStreamBuilder,
1315 callbacks: OH_AudioRenderer_Callbacks,
1316 userData: *mut ::std::os::raw::c_void,
1317 ) -> OH_AudioStream_Result;
1318}
1319extern "C" {
1320 #[doc = " @brief Set the callback when the output device of an audio renderer changed.\n\n @since 11\n\n @param builder Reference provided by OH_AudioStreamBuilder_Create()\n @param callback Callback to the function that will process this device change event.\n @param userData Pointer to an application data structure that will be passed to the callback functions.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM}:\n 1.The param of builder is nullptr;\n 2.StreamType invalid."]
1321 pub fn OH_AudioStreamBuilder_SetRendererOutputDeviceChangeCallback(
1322 builder: *mut OH_AudioStreamBuilder,
1323 callback: OH_AudioRenderer_OutputDeviceChangeCallback,
1324 userData: *mut ::std::os::raw::c_void,
1325 ) -> OH_AudioStream_Result;
1326}
1327extern "C" {
1328 #[doc = " @brief Set the privacy of audio render.\n\n @since 12\n\n @param builder Builder provided by OH_AudioStreamBuilder_Create()\n @param privacy Privacy type.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM}:\n 1.The param of builder is nullptr;\n 2.StreamType invalid."]
1329 pub fn OH_AudioStreamBuilder_SetRendererPrivacy(
1330 builder: *mut OH_AudioStreamBuilder,
1331 privacy: OH_AudioStream_PrivacyType,
1332 ) -> OH_AudioStream_Result;
1333}
1334extern "C" {
1335 #[doc = " Set the callbacks for the capturer client\n\n @deprecated since 20\n @useinstead Set the callback functions separately using OH_AudioStreamBuilder_SetCapturerReadDataCallback,\n OH_AudioStreamBuilder_SetCapturerDeviceChangeCallback, OH_AudioStreamBuilder_SetCapturerInterruptCallback\n and OH_AudioStreamBuilder_SetCapturerErrorCallback.\n @since 10\n\n @param builder Reference provided by OH_AudioStreamBuilder_Create()\n @param callbacks Callbacks to the functions that will process capturer stream.\n @param userData Pointer to an application data structure that will be passed to the callback functions.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM}:\n 1.The param of builder is nullptr;\n 2.StreamType invalid."]
1336 pub fn OH_AudioStreamBuilder_SetCapturerCallback(
1337 builder: *mut OH_AudioStreamBuilder,
1338 callbacks: OH_AudioCapturer_Callbacks,
1339 userData: *mut ::std::os::raw::c_void,
1340 ) -> OH_AudioStream_Result;
1341}
1342extern "C" {
1343 #[doc = " Create the audio renderer client.\n\n The AudioRenderer instance is used to play streaming audio data.\n When using AudioRenderer apis, there are many instructions for application\n to achieve better performance and lower power consumption:\n In music or audiobook background playback situation, you can have low power\n consumption by following this best practices document **Low-Power Rules in Music Playback Scenarios**.\n And for navigation situation, you can follow **Low-Power Rules in Navigation and Positioning Scenarios**.\n\n Application developer should also be careful when app goes to background, please check if your audio playback\n is still needed, see **Audio Resources** in best practices document.\n And avoiding to send silence audio data continuously to waste system resources, otherwise system will take\n control measures when this behavior is detected, see **Audio Playback** in best practices document.\n\n If you want to use AudioRenderer api to implement a music playback application, there are also many interactive\n scenes to consider, see **Developing an Audio Application** in best practices document.\n\n @since 10\n\n @param builder Reference provided by OH_AudioStreamBuilder_Create()\n @param audioRenderer Pointer to a viriable to receive the stream client.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM}:\n 1.The param of builder is nullptr;\n 2.StreamType invalid;\n 3.Create OHAudioRenderer failed."]
1344 pub fn OH_AudioStreamBuilder_GenerateRenderer(
1345 builder: *mut OH_AudioStreamBuilder,
1346 audioRenderer: *mut *mut OH_AudioRenderer,
1347 ) -> OH_AudioStream_Result;
1348}
1349extern "C" {
1350 #[doc = " Create the audio capturer client.\n\n @since 10\n\n @param builder Reference provided by OH_AudioStreamBuilder_Create()\n @param audioCapturer Pointer to a viriable to receive the stream client.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM}:\n 1.The param of builder is nullptr;\n 2.StreamType invalid;\n 3.Create OHAudioCapturer failed."]
1351 pub fn OH_AudioStreamBuilder_GenerateCapturer(
1352 builder: *mut OH_AudioStreamBuilder,
1353 audioCapturer: *mut *mut OH_AudioCapturer,
1354 ) -> OH_AudioStream_Result;
1355}
1356extern "C" {
1357 #[doc = " Set the data frame size for each callback, use this function if the application requires a specific number\n of frames for processing.\n The frame size should be at least the size device process at one time, and less than half the internal\n buffer capacity.\n\n @since 11\n\n @param builder Reference provided by OH_AudioStreamBuilder_Create()\n @param frameSize The data frame size for each callback.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} The param of builder is nullptr."]
1358 pub fn OH_AudioStreamBuilder_SetFrameSizeInCallback(
1359 builder: *mut OH_AudioStreamBuilder,
1360 frameSize: i32,
1361 ) -> OH_AudioStream_Result;
1362}
1363extern "C" {
1364 #[doc = " @brief Set the callback of writing metadata to the renderer client\n\n @since 12\n\n @param builder Reference provided by OH_AudioStreamBuilder_Create()\n @param callback Callback to the functions that will write audio data with metadata to the renderer.\n @param userData Pointer to an application data structure that will be passed to the callback functions.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM}:\n 1.The param of builder is nullptr;\n 2.StreamType invalid."]
1365 pub fn OH_AudioStreamBuilder_SetWriteDataWithMetadataCallback(
1366 builder: *mut OH_AudioStreamBuilder,
1367 callback: OH_AudioRenderer_WriteDataWithMetadataCallback,
1368 userData: *mut ::std::os::raw::c_void,
1369 ) -> OH_AudioStream_Result;
1370}
1371extern "C" {
1372 #[doc = " @brief Set the interrupt mode of the stream client\n\n @since 12\n\n @param builder Reference provided by OH_AudioStreamBuilder_Create()\n @param mode The audio interrupt mode\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM}:\n 1.The param of builder is nullptr;\n 2.The param of mode invalid;\n 3.StreamType invalid."]
1373 pub fn OH_AudioStreamBuilder_SetRendererInterruptMode(
1374 builder: *mut OH_AudioStreamBuilder,
1375 mode: OH_AudioInterrupt_Mode,
1376 ) -> OH_AudioStream_Result;
1377}
1378extern "C" {
1379 #[doc = " @brief Set the callback of writing data to renderer client.\n\n This function is similar with {@link OH_AudioStreamBuilder_SetRendererCallback}. Only the last callback set by\n OH_AudioStreamBuilder_SetRendererCallback or this function will become effective.\n\n @param builder Builder provided by OH_AudioStreamBuilder_Create()\n @param callback Callback to functions that will write audio data to renderer client.\n @param userData Pointer to an application data structure that will be passed to the callback functions.\n @return Result code.\n {@link AUDIOSTREAM_SUCCESS} Success.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} Parameter is invalid, e.g. builder is nullptr, e.t.c.\n @since 12"]
1380 pub fn OH_AudioStreamBuilder_SetRendererWriteDataCallback(
1381 builder: *mut OH_AudioStreamBuilder,
1382 callback: OH_AudioRenderer_OnWriteDataCallback,
1383 userData: *mut ::std::os::raw::c_void,
1384 ) -> OH_AudioStream_Result;
1385}
1386extern "C" {
1387 #[cfg(feature = "api-20")]
1388 #[doc = " @brief Set the callback of writing data to renderer client.\n\n This function is similar with {@link OH_AudioStreamBuilder_SetRendererWriteDataCallback}. Only the last callback set\n by OH_AudioStreamBuilder_SetRendererWriteDataCallback or this function will become effective. Different with\n OH_AudioStreamBuilder_SetRendererWriteDataCallback, the callback in this function can return audio data of any\n length.\n\n @param builder Builder provided by OH_AudioStreamBuilder_Create()\n @param callback Callback to functions that will write audio data to renderer client.\n @param userData Pointer to an application data structure that will be passed to the callback functions.\n @return Result code.\n {@link AUDIOSTREAM_SUCCESS} Success.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} Parameter is invalid, e.g. builder is nullptr, e.t.c.\n @since 20"]
1389 pub fn OH_AudioStreamBuilder_SetRendererWriteDataCallbackAdvanced(
1390 builder: *mut OH_AudioStreamBuilder,
1391 callback: OH_AudioRenderer_OnWriteDataCallbackAdvanced,
1392 userData: *mut ::std::os::raw::c_void,
1393 ) -> OH_AudioStream_Result;
1394}
1395extern "C" {
1396 #[cfg(feature = "api-19")]
1397 #[doc = " Set the renderer volume mode of the stream client\n\n @param builder Reference provided by OH_AudioStreamBuilder_Create()\n @param volumeMode Set the volume mode for the renderer client.\n @return Function result code:\n {@link AUDIOSTREAM_SUCCESS} If the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM}:\n 1.The param of builder is nullptr;\n 2.The param of volumeMode invalid.\n @since 19"]
1398 pub fn OH_AudioStreamBuilder_SetVolumeMode(
1399 builder: *mut OH_AudioStreamBuilder,
1400 volumeMode: OH_AudioStream_VolumeMode,
1401 ) -> OH_AudioStream_Result;
1402}
1403extern "C" {
1404 #[cfg(feature = "api-20")]
1405 #[doc = " @brief Sets a callback to handle interrupt events for an AudioRenderer instance. This function is similar to\n {@link OH_AudioStreamBuilder_SetRendererCallback}. If both OH_AudioStreamBuilder_SetRendererCallback and this\n function are called, the most recently set callback takes effect.\n\n @param builder Builder instance, which is generated by OH_AudioStreamBuilder_Create().\n @param callback Callback used to handle the interrupt events.\n @param userData Pointer to user-defined data, which will be passed back to the application in the callback.\n @return Result code.\n {@link AUDIOSTREAM_SUCCESS} is returned if the operation is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} is returned if a parameter is invalid, for example, if builder\n is nullptr.\n @since 20"]
1406 pub fn OH_AudioStreamBuilder_SetRendererInterruptCallback(
1407 builder: *mut OH_AudioStreamBuilder,
1408 callback: OH_AudioRenderer_OnInterruptCallback,
1409 userData: *mut ::std::os::raw::c_void,
1410 ) -> OH_AudioStream_Result;
1411}
1412extern "C" {
1413 #[cfg(feature = "api-20")]
1414 #[doc = " @brief Sets a callback to handle error events for an AudioRenderer instance.\n This function is similar to {@link OH_AudioStreamBuilder_SetRendererCallback}. If both\n OH_AudioStreamBuilder_SetRendererCallback and this function are called, the most recently set callback takes\n effect.\n\n @param builder Builder instance, which is generated by OH_AudioStreamBuilder_Create().\n @param callback Callback used to handle the error events.\n @param userData Pointer to user-defined data, which will be passed back to the application in the callback.\n @return Result code.\n {@link AUDIOSTREAM_SUCCESS} is returned if the operation is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} is returned if a parameter is invalid, for example, if builder\n is nullptr.\n @since 20"]
1415 pub fn OH_AudioStreamBuilder_SetRendererErrorCallback(
1416 builder: *mut OH_AudioStreamBuilder,
1417 callback: OH_AudioRenderer_OnErrorCallback,
1418 userData: *mut ::std::os::raw::c_void,
1419 ) -> OH_AudioStream_Result;
1420}
1421extern "C" {
1422 #[cfg(feature = "api-20")]
1423 #[doc = " @brief Sets a callback to handle audio data read events for an AudioCapturer instance. This function is\n similar to {@link OH_AudioStreamBuilder_SetCapturerCallback}. If both {@link\n OH_AudioStreamBuilder_SetCapturerCallback} and this function are called, the most recently set callback takes\n effect.\n\n @param builder Builder instance, which is generated by OH_AudioStreamBuilder_Create().\n @param callback Callback used to handle incoming audio data.\n @param userData Pointer to user-defined data, which will be passed back to the application in the callback.\n @return Result code.\n {@link AUDIOSTREAM_SUCCESS} is returned if the operation is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} is returned if a parameter is invalid, for example, if builder\n is nullptr.\n @since 20"]
1424 pub fn OH_AudioStreamBuilder_SetCapturerReadDataCallback(
1425 builder: *mut OH_AudioStreamBuilder,
1426 callback: OH_AudioCapturer_OnReadDataCallback,
1427 userData: *mut ::std::os::raw::c_void,
1428 ) -> OH_AudioStream_Result;
1429}
1430extern "C" {
1431 #[cfg(feature = "api-20")]
1432 #[doc = " @brief Sets a callback to handle device change events for an AudioCapturer instance. This function is\n similar to {@link OH_AudioStreamBuilder_SetCapturerCallback}. If both OH_AudioStreamBuilder_SetCapturerCallback\n and this function are called, the most recently set callback takes effect.\n\n @param builder Builder instance, which is generated by OH_AudioStreamBuilder_Create().\n @param callback Callback used to handle the device change events.\n @param userData Pointer to user-defined data, which will be passed back to the application in the callback.\n @return Result code.\n {@link AUDIOSTREAM_SUCCESS} is returned if the operation is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} is returned if a parameter is invalid, for example, if builder\n is nullptr.\n @since 20"]
1433 pub fn OH_AudioStreamBuilder_SetCapturerDeviceChangeCallback(
1434 builder: *mut OH_AudioStreamBuilder,
1435 callback: OH_AudioCapturer_OnDeviceChangeCallback,
1436 userData: *mut ::std::os::raw::c_void,
1437 ) -> OH_AudioStream_Result;
1438}
1439extern "C" {
1440 #[cfg(feature = "api-20")]
1441 #[doc = " @brief Sets a callback to handle interrupt events for an AudioCapturer instance.\n This function is similar to {@link OH_AudioStreamBuilder_SetCapturerCallback}. If both\n OH_AudioStreamBuilder_SetCapturerCallback and this function are called, the most recently set callback takes\n effect.\n\n @param builder Builder instance, which is generated by OH_AudioStreamBuilder_Create().\n @param callback Callback used to handle the interrupt events.\n @param userData Pointer to user-defined data, which will be passed back to the application in the callback.\n @return Result code.\n {@link AUDIOSTREAM_SUCCESS} is returned if the operation is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} is returned if a parameter is invalid, for example, if builder\n is nullptr.\n @since 20"]
1442 pub fn OH_AudioStreamBuilder_SetCapturerInterruptCallback(
1443 builder: *mut OH_AudioStreamBuilder,
1444 callback: OH_AudioCapturer_OnInterruptCallback,
1445 userData: *mut ::std::os::raw::c_void,
1446 ) -> OH_AudioStream_Result;
1447}
1448extern "C" {
1449 #[cfg(feature = "api-20")]
1450 #[doc = " @brief Sets a callback to handle error events for an AudioCapturer instance. This function is similar to\n {@link OH_AudioStreamBuilder_SetCapturerCallback}. If both OH_AudioStreamBuilder_SetCapturerCallback and this\n function are called, the most recently set callback takes effect.\n\n @param builder Builder instance, which is generated by OH_AudioStreamBuilder_Create().\n @param callback Callback used to handle the error events.\n @param userData Pointer to user-defined data, which will be passed back to the application in the callback.\n @return Result code.\n {@link AUDIOSTREAM_SUCCESS} is returned if the operation is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} is returned if a parameter is invalid, for example, if builder\n is nullptr.\n @since 20"]
1451 pub fn OH_AudioStreamBuilder_SetCapturerErrorCallback(
1452 builder: *mut OH_AudioStreamBuilder,
1453 callback: OH_AudioCapturer_OnErrorCallback,
1454 userData: *mut ::std::os::raw::c_void,
1455 ) -> OH_AudioStream_Result;
1456}
1457extern "C" {
1458 #[cfg(feature = "api-20")]
1459 #[doc = " @brief Set audio capturer configuration, if app want its recorder only to be muted instead of interrupted.\n\n @param builder reference provided by OH_AudioStreamBuilder_Create()\n @param muteWhenInterrupted use {@code true} if application want to be muted instead of interrupted.\n @return function result code:\n {@link AUDIOSTREAM_SUCCESS} if the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} the param of builder is nullptr.\n @since 20"]
1460 pub fn OH_AudioStreamBuilder_SetCapturerWillMuteWhenInterrupted(
1461 builder: *mut OH_AudioStreamBuilder,
1462 muteWhenInterrupted: bool,
1463 ) -> OH_AudioStream_Result;
1464}
1465extern "C" {
1466 #[cfg(feature = "api-20")]
1467 #[doc = " @brief Set the callback of fast status change event for audio renderer.\n\n @param builder Builder provided by OH_AudioStreamBuilder_Create()\n @param callback Callback function that will recevie the fast status change event.\n @param userData Pointer to an application data structure that will be passed to the callback functions.\n @return\n {@link AUDIOSTREAM_SUCCESS} if the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} the param of builder or callback is nullptr.\n @since 20"]
1468 pub fn OH_AudioStreamBuilder_SetRendererFastStatusChangeCallback(
1469 builder: *mut OH_AudioStreamBuilder,
1470 callback: OH_AudioRenderer_OnFastStatusChange,
1471 userData: *mut ::std::os::raw::c_void,
1472 ) -> OH_AudioStream_Result;
1473}
1474extern "C" {
1475 #[cfg(feature = "api-20")]
1476 #[doc = " @brief Set the callback of fast status change event for audio capturer.\n\n @param builder Builder provided by OH_AudioStreamBuilder_Create()\n @param callback Callback function that will recevie the fast status change event.\n @param userData Pointer to an application data structure that will be passed to the callback functions.\n @return\n {@link AUDIOSTREAM_SUCCESS} if the execution is successful.\n {@link AUDIOSTREAM_ERROR_INVALID_PARAM} the param of builder or callback is nullptr.\n @since 20"]
1477 pub fn OH_AudioStreamBuilder_SetCapturerFastStatusChangeCallback(
1478 builder: *mut OH_AudioStreamBuilder,
1479 callback: OH_AudioCapturer_OnFastStatusChange,
1480 userData: *mut ::std::os::raw::c_void,
1481 ) -> OH_AudioStream_Result;
1482}
1483#[repr(C)]
1484#[derive(Debug, Copy, Clone)]
1485pub struct OH_AudioManager {
1486 _unused: [u8; 0],
1487}
1488#[cfg(feature = "api-20")]
1489#[doc = " @brief Prototype for the audio scene change function that is passed to\n {@link OH_AudioManager_RegisterAudioSceneChangeCallback}.\n\n @param userData userdata which is passed by register.\n @param scene the latest audio scene.\n @since 20"]
1490pub type OH_AudioManager_OnAudioSceneChangeCallback = ::std::option::Option<
1491 unsafe extern "C" fn(userData: *mut ::std::os::raw::c_void, scene: OH_AudioScene),
1492>;
1493extern "C" {
1494 #[doc = " @brief Get audio manager handle.\n\n @param audioManager the {@link OH_AudioManager} handle received from this function.\n @return Function result code:\n {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful.\n {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}:\n 1.The param of audioManager is nullptr;\n @since 12"]
1495 pub fn OH_GetAudioManager(audioManager: *mut *mut OH_AudioManager) -> OH_AudioCommon_Result;
1496}
1497extern "C" {
1498 #[doc = " @brief Get audio scene.\n\n @param manager the {@link OH_AudioManager} handle received from {@link OH_GetAudioManager}.\n @param scene the {@link OH_AudioScene} pointer to receive the result.\n @return Function result code:\n {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful.\n {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}:\n 1.The param of audioManager is nullptr;\n 2.The param of scene is nullptr.\n @since 12"]
1499 pub fn OH_GetAudioScene(
1500 manager: *mut OH_AudioManager,
1501 scene: *mut OH_AudioScene,
1502 ) -> OH_AudioCommon_Result;
1503}
1504extern "C" {
1505 #[cfg(feature = "api-20")]
1506 #[doc = " @brief Register callback to receive audio scene changed events.\n\n @param manager {@link OH_AudioManager} handle received from {@link OH_GetAudioManager}.\n @param callback callback function which will be called when audio scene changed.\n @param userData pointer to a data structure that will be passed to the callback functions.\n @return\n {@link AUDIOCOMMON_RESULT_SUCCESS} if the execution is successful\n {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}\n 1.param of manager is nullptr\n 2.param of callback is nullptr\n {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} system process error occurs\n @since 20"]
1507 pub fn OH_AudioManager_RegisterAudioSceneChangeCallback(
1508 manager: *mut OH_AudioManager,
1509 callback: OH_AudioManager_OnAudioSceneChangeCallback,
1510 userData: *mut ::std::os::raw::c_void,
1511 ) -> OH_AudioCommon_Result;
1512}
1513extern "C" {
1514 #[cfg(feature = "api-20")]
1515 #[doc = " @brief Unregister audio scene change callback.\n\n @param manager {@link OH_AudioManager} handle received from {@link OH_GetAudioManager}.\n @param callback callback function which registered in {@link OH_AudioManager_RegisterAudioSceneChangeCallback}.\n @return\n {@link AUDIOCOMMON_RESULT_SUCCESS} if the execution is successful\n {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}\n 1.param of manager is nullptr\n 2.param of callback is nullptr\n {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} system process error occurs\n @since 20"]
1516 pub fn OH_AudioManager_UnregisterAudioSceneChangeCallback(
1517 manager: *mut OH_AudioManager,
1518 callback: OH_AudioManager_OnAudioSceneChangeCallback,
1519 ) -> OH_AudioCommon_Result;
1520}
1521#[repr(C)]
1522#[derive(Debug, Copy, Clone)]
1523pub struct OH_AudioResourceManager {
1524 _unused: [u8; 0],
1525}
1526extern "C" {
1527 #[cfg(feature = "api-20")]
1528 #[doc = " @brief Fetch the audio resource manager handle, which is a singleton.\n\n @param resourceManager output parameter to get {@link #OH_AudioResourceManager}.\n @return\n {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if input param is nullptr\n @since 20"]
1529 pub fn OH_AudioManager_GetAudioResourceManager(
1530 resourceManager: *mut *mut OH_AudioResourceManager,
1531 ) -> OH_AudioCommon_Result;
1532}
1533#[repr(C)]
1534#[derive(Debug, Copy, Clone)]
1535pub struct OH_AudioWorkgroup {
1536 _unused: [u8; 0],
1537}
1538extern "C" {
1539 #[cfg(feature = "api-20")]
1540 #[doc = " @brief Create a workgroup for audio data processing threads in application.\n System manages cpu resources by workgroup configuration.\n\n @param resourceManager {@link OH_AudioResourceManager} handle\n provided by {@link OH_AudioManager_GetAudioRoutingManager}.\n @param name workgroup name\n @param group {@link OH_AudioWorkgroup} handle for managing audio data processing threads.\n @return\n {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if input param is nullptr\n {@link #AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} out of workgroup resources\n {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} system process error occurs\n @since 20"]
1541 pub fn OH_AudioResourceManager_CreateWorkgroup(
1542 resourceManager: *mut OH_AudioResourceManager,
1543 name: *const ::std::os::raw::c_char,
1544 group: *mut *mut OH_AudioWorkgroup,
1545 ) -> OH_AudioCommon_Result;
1546}
1547extern "C" {
1548 #[cfg(feature = "api-20")]
1549 #[doc = " @brief Release the workgroup created before.\n\n @param resourceManager {@link OH_AudioResourceManager} handle\n provided by {@link OH_AudioManager_GetAudioRoutingManager}.\n @param group {@link OH_AudioWorkgroup} handle provided by {@link OH_AudioResourceManager_CreateWorkgroup}.\n @return\n {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if input param is nullptr\n {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} system process error occurs\n @since 20"]
1550 pub fn OH_AudioResourceManager_ReleaseWorkgroup(
1551 resourceManager: *mut OH_AudioResourceManager,
1552 group: *mut OH_AudioWorkgroup,
1553 ) -> OH_AudioCommon_Result;
1554}
1555extern "C" {
1556 #[cfg(feature = "api-20")]
1557 #[doc = " @brief Add current thread into a specified audio workgroup as audio data processing thread.\n\n @param group {@link OH_AudioWorkgroup} handle provided by {@link OH_AudioResourceManager_CreateWorkgroup}.\n @param tokenId a token id that represent the thread added.\n @return\n {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if input param is nullptr\n {@link #AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} out of resources for the new thread\n {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} system process error occurs\n @since 20"]
1558 pub fn OH_AudioWorkgroup_AddCurrentThread(
1559 group: *mut OH_AudioWorkgroup,
1560 tokenId: *mut i32,
1561 ) -> OH_AudioCommon_Result;
1562}
1563extern "C" {
1564 #[cfg(feature = "api-20")]
1565 #[doc = " @brief Remove the thread from a specified audio workgroup.\n\n @param group {@link OH_AudioWorkgroup} handle provided by {@link OH_AudioResourceManager_CreateWorkgroup}.\n @param tokenId id for thread returned by {link OH_AudioWorkgroup_AddCurrentThread}\n @return\n {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if input param is nullptr or token id is invalid\n {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} system process error occurs\n @since 20"]
1566 pub fn OH_AudioWorkgroup_RemoveThread(
1567 group: *mut OH_AudioWorkgroup,
1568 tokenId: i32,
1569 ) -> OH_AudioCommon_Result;
1570}
1571extern "C" {
1572 #[cfg(feature = "api-20")]
1573 #[doc = " @brief Notify system the audio workgroup start working. Call this function before processing the audio frame.\n\n @param group {@link OH_AudioWorkgroup} handle provided by {@link OH_AudioResourceManager_CreateWorkgroup}.\n @param startTime the time when audio thread start working, using system time. The unit of time is milliseconds.\n @param deadlineTime the time before which audio work should be finished, otherwise underrun may happens.\n The unit of time is milliseconds.\n @return\n {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if input param is nullptr, or time is invalid\n {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} system process error occurs\n @since 20"]
1574 pub fn OH_AudioWorkgroup_Start(
1575 group: *mut OH_AudioWorkgroup,
1576 startTime: u64,
1577 deadlineTime: u64,
1578 ) -> OH_AudioCommon_Result;
1579}
1580extern "C" {
1581 #[cfg(feature = "api-20")]
1582 #[doc = " @brief Notify system the audio workgroup stop working. Call this function after the audio frame processing\n is completed.\n\n @param group {@link OH_AudioWorkgroup} handle provided by {@link OH_AudioResourceManager_CreateWorkgroup}.\n @return\n {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if input param is nullptr\n {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} system process error occurs\n @since 20"]
1583 pub fn OH_AudioWorkgroup_Stop(group: *mut OH_AudioWorkgroup) -> OH_AudioCommon_Result;
1584}
1585#[repr(C)]
1586#[derive(Debug, Copy, Clone)]
1587pub struct OH_AudioRoutingManager {
1588 _unused: [u8; 0],
1589}
1590#[doc = " @brief This function pointer will point to the callback function that\n is used to return the changing audio device descriptors.\n There may be more than one audio device descriptor returned.\n\n @param type the {@link OH_AudioDevice_ChangeType} is connect or disconnect.\n @param audioDeviceDescriptorArray the {@link OH_AudioDeviceDescriptorArray}\n pointer variable which will be set the audio device descriptors value.\n Do not release the audioDeviceDescriptorArray pointer separately\n instead call {@link OH_AudioRoutingManager_ReleaseDevices} to release the DeviceDescriptor array\n when it is no use anymore.\n @since 12"]
1591pub type OH_AudioRoutingManager_OnDeviceChangedCallback = ::std::option::Option<
1592 unsafe extern "C" fn(
1593 type_: OH_AudioDevice_ChangeType,
1594 audioDeviceDescriptorArray: *mut OH_AudioDeviceDescriptorArray,
1595 ) -> i32,
1596>;
1597extern "C" {
1598 #[doc = " @brief Query the audio routing manager handle.\n which should be set as the first parameter in routing releated functions.\n\n @param audioRoutingManager the {@link OH_AudioRoutingManager}\n handle returned by {@link OH_AudioManager_GetAudioRoutingManager}.\n @return Function result code:\n {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful.\n @since 12"]
1599 pub fn OH_AudioManager_GetAudioRoutingManager(
1600 audioRoutingManager: *mut *mut OH_AudioRoutingManager,
1601 ) -> OH_AudioCommon_Result;
1602}
1603extern "C" {
1604 #[doc = " @brief Query the available devices according to the input deviceFlag.\n\n @param audioRoutingManager the {@link OH_AudioRoutingManager}\n handle returned by {@link OH_AudioManager_GetAudioRoutingManager}.\n @param deviceFlag the {@link OH_AudioDevice_DeviceFlag} which is used as\n the filter parameter for selecting the target devices.\n @param audioDeviceDescriptorArray the {@link OH_AudioDeviceDescriptorArray}\n pointer variable which will be set the audio device descriptors value\n Do not release the audioDeviceDescriptorArray pointer separately\n instead call {@link OH_AudioRoutingManager_ReleaseDevices} to release the DeviceDescriptor array\n when it is no use anymore.\n @return Function result code:\n {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful.\n {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}:\n 1.The param of audioRoutingManager is nullptr;\n 2.The param of deviceFlag invalid;\n 3.The param of audioDeviceDescriptorArray is nullptr.\n {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} The param of audioDeviceDescriptorArray is nullptr.\n @since 12"]
1605 pub fn OH_AudioRoutingManager_GetDevices(
1606 audioRoutingManager: *mut OH_AudioRoutingManager,
1607 deviceFlag: OH_AudioDevice_Flag,
1608 audioDeviceDescriptorArray: *mut *mut OH_AudioDeviceDescriptorArray,
1609 ) -> OH_AudioCommon_Result;
1610}
1611extern "C" {
1612 #[doc = " @brief Get available devices by device usage.\n\n @param audioRoutingManager the {@link OH_AudioRoutingManager} handle returned\n by {@link OH_AudioManager_GetAudioRoutingManager}.\n @param deviceUsage the {@link OH_AudioDevice_Usage}.\n @param audioDeviceDescriptorArray the {@link OH_AudioDeviceDescriptorArray}\n pointer variable which will be set the audio device descriptors value\n Do not release the audioDeviceDescriptorArray pointer separately\n instead call {@link OH_AudioRoutingManager_ReleaseDevices} to release the DeviceDescriptor array\n when it is no use anymore.\n @return Function result code:\n {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful.\n {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}:\n 1.The param of audioRoutingManager is nullptr;\n 2.The param of deviceUsage is invalid;\n 3.The param of audioDeviceDescriptorArray is nullptr.\n {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error.\n @since 12"]
1613 pub fn OH_AudioRoutingManager_GetAvailableDevices(
1614 audioRoutingManager: *mut OH_AudioRoutingManager,
1615 deviceUsage: OH_AudioDevice_Usage,
1616 audioDeviceDescriptorArray: *mut *mut OH_AudioDeviceDescriptorArray,
1617 ) -> OH_AudioCommon_Result;
1618}
1619extern "C" {
1620 #[doc = " @brief Get preferred ouput devices by audio usage.\n\n @param audioRoutingManager the {@link OH_AudioRoutingManager} handle returned\n by {@link OH_AudioManager_GetAudioRoutingManager}.\n @param streamUsage the {@link OH_AudioStream_Usage}.\n @param audioDeviceDescriptorArray the {@link OH_AudioDeviceDescriptorArray}\n pointer variable which will be set the audio device descriptors value\n Do not release the audioDeviceDescriptorArray pointer separately\n instead call {@link OH_AudioRoutingManager_ReleaseDevices} to release the DeviceDescriptor array\n when it is no use anymore.\n @return Function result code:\n {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful.\n {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}:\n 1.The param of audioRoutingManager is nullptr;\n 2.The param of streamUsage is invalid;\n 3.The param of audioDeviceDescriptorArray is nullptr.\n {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error.\n @since 12"]
1621 pub fn OH_AudioRoutingManager_GetPreferredOutputDevice(
1622 audioRoutingManager: *mut OH_AudioRoutingManager,
1623 streamUsage: OH_AudioStream_Usage,
1624 audioDeviceDescriptorArray: *mut *mut OH_AudioDeviceDescriptorArray,
1625 ) -> OH_AudioCommon_Result;
1626}
1627extern "C" {
1628 #[doc = " @brief Get preferred input devices by audio source type.\n @param audioRoutingManager the {@link OH_AudioRoutingManager} handle returned\n by {@link OH_AudioManager_GetAudioRoutingManager}.\n @param sourceType the {@link OH_AudioStream_SourceType}.\n @param audioDeviceDescriptorArray the {@link OH_AudioDeviceDescriptorArray}\n pointer variable which will be set the audio device descriptors value\n Do not release the audioDeviceDescriptorArray pointer separately\n instead call {@link OH_AudioRoutingManager_ReleaseDevices} to release the DeviceDescriptor array\n when it is no use anymore.\n @return Function result code:\n {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful.\n {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}:\n 1.The param of audioRoutingManager is nullptr;\n 2.The param of sourceType is invalid;\n 3.The param of audioDeviceDescriptorArray is nullptr.\n {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error.\n @since 12"]
1629 pub fn OH_AudioRoutingManager_GetPreferredInputDevice(
1630 audioRoutingManager: *mut OH_AudioRoutingManager,
1631 sourceType: OH_AudioStream_SourceType,
1632 audioDeviceDescriptorArray: *mut *mut OH_AudioDeviceDescriptorArray,
1633 ) -> OH_AudioCommon_Result;
1634}
1635extern "C" {
1636 #[doc = " @brief Register the device change callback of the audio routing manager.\n\n @param audioRoutingManager the {@link OH_AudioRoutingManager}\n handle returned by {@link OH_AudioManager_GetAudioRoutingManager}.\n @param deviceFlag the {@link OH_AudioDevice_DeviceFlag} which is used to register callback.\n @param callback the {@link OH_AudioRoutingManager_OnDeviceChangedCallback}\n Callback function which will be called when devices changed.\n @return Function result code:\n {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful.\n {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}:\n 1.The param of audioRoutingManager is nullptr;\n 2.The param of deviceFlag invalid;\n 3.The param of callback is nullptr.\n @since 12"]
1637 pub fn OH_AudioRoutingManager_RegisterDeviceChangeCallback(
1638 audioRoutingManager: *mut OH_AudioRoutingManager,
1639 deviceFlag: OH_AudioDevice_Flag,
1640 callback: OH_AudioRoutingManager_OnDeviceChangedCallback,
1641 ) -> OH_AudioCommon_Result;
1642}
1643extern "C" {
1644 #[doc = " @brief Unregister the device change callback of the audio routing manager.\n\n @param audioRoutingManager the {@link OH_AudioRoutingManager}\n handle returned by {@link OH_AudioManager_GetAudioRoutingManager}.\n @param callback the {@link OH_AudioRoutingManager_OnDeviceChangedCallback}\n Callback function which will be called when devices changed.\n @return Function result code:\n {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful.\n {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}:\n 1.The param of audioRoutingManager is nullptr;\n 2.The param of callback is nullptr.\n @since 12"]
1645 pub fn OH_AudioRoutingManager_UnregisterDeviceChangeCallback(
1646 audioRoutingManager: *mut OH_AudioRoutingManager,
1647 callback: OH_AudioRoutingManager_OnDeviceChangedCallback,
1648 ) -> OH_AudioCommon_Result;
1649}
1650extern "C" {
1651 #[doc = " @brief Release the audio device descriptor array object.\n\n @param audioRoutingManager the {@link OH_AudioRoutingManager}\n handle returned by {@link OH_AudioManager_GetAudioRoutingManager}.\n @param audioDeviceDescriptorArray Audio device descriptors should be released.\n and get from {@link OH_AudioRoutingManager_GetDevices}\n @return Function result code:\n {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful.\n {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}:\n 1.The param of audioRoutingManager is nullptr;\n 2.The param of audioDeviceDescriptorArray is nullptr.\n @since 12"]
1652 pub fn OH_AudioRoutingManager_ReleaseDevices(
1653 audioRoutingManager: *mut OH_AudioRoutingManager,
1654 audioDeviceDescriptorArray: *mut OH_AudioDeviceDescriptorArray,
1655 ) -> OH_AudioCommon_Result;
1656}
1657#[cfg(feature = "api-13")]
1658#[doc = " @brief This type defines the callback function that is used to receive the audio devices' block status.\n\n @param audioDeviceDescriptorArray The {@link OH_AudioDeviceDescriptorArray}\n pointer variable which will be set the audio device descriptors value.\n Do not release the audioDeviceDescriptorArray pointer separately instead of calling\n {@link OH_AudioRoutingManager_ReleaseDevices} to release the DeviceDescriptor array when it is no use anymore.\n @param status The {@link OH_AudioDevice_BlockStatus} is the block status.\n @param userData User data which is passed by user.\n @since 13"]
1659pub type OH_AudioRoutingManager_OnDeviceBlockStatusCallback = ::std::option::Option<
1660 unsafe extern "C" fn(
1661 audioDeviceDescriptorArray: *mut OH_AudioDeviceDescriptorArray,
1662 status: OH_AudioDevice_BlockStatus,
1663 userData: *mut ::std::os::raw::c_void,
1664 ),
1665>;
1666extern "C" {
1667 #[cfg(feature = "api-13")]
1668 #[doc = " @brief Query whether microphone block detection is supported on current device.\n\n @param audioRoutingManager the {@link OH_AudioRoutingManager} handle returned by\n {@link OH_AudioManager_GetAudioRoutingManager}.\n @param supported query result.\n @return Function result code:\n {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful.\n {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}:\n 1.The param of audioRoutingManager is nullptr;\n 2.The param of supported is nullptr.\n @since 13"]
1669 pub fn OH_AudioRoutingManager_IsMicBlockDetectionSupported(
1670 audioRoutingManager: *mut OH_AudioRoutingManager,
1671 supported: *mut bool,
1672 ) -> OH_AudioCommon_Result;
1673}
1674extern "C" {
1675 #[cfg(feature = "api-13")]
1676 #[doc = " @brief Set the microphone block status callback. Before using this function, users should query whether block\n detection is supported on current device. The caller will receive the callback only when it is recording\n and the used microphones' block status have changed. Currently, block detecting is only support for microphones\n located on the local device.\n\n @param audioRoutingManager The {@link OH_AudioRoutingManager} handle returned by\n {@link OH_AudioManager_GetAudioRoutingManager}.\n @param callback The function pointer will point to the callback function that is used to receive the block status.\n @param userData User data which is passed by user.\n @return Function result code:\n {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful.\n {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}:\n 1.The param of audioRoutingManager is nullptr;\n 2.The param of callback is nullptr.\n @since 13"]
1677 pub fn OH_AudioRoutingManager_SetMicBlockStatusCallback(
1678 audioRoutingManager: *mut OH_AudioRoutingManager,
1679 callback: OH_AudioRoutingManager_OnDeviceBlockStatusCallback,
1680 userData: *mut ::std::os::raw::c_void,
1681 ) -> OH_AudioCommon_Result;
1682}
1683#[repr(C)]
1684#[derive(Debug, Copy, Clone)]
1685pub struct OH_AudioSessionManager {
1686 _unused: [u8; 0],
1687}
1688#[doc = " @brief default mode"]
1689pub const OH_AudioSession_ConcurrencyMode_CONCURRENCY_DEFAULT: OH_AudioSession_ConcurrencyMode = 0;
1690#[doc = " @brief mix with others mode"]
1691pub const OH_AudioSession_ConcurrencyMode_CONCURRENCY_MIX_WITH_OTHERS:
1692 OH_AudioSession_ConcurrencyMode = 1;
1693#[doc = " @brief duck others mode"]
1694pub const OH_AudioSession_ConcurrencyMode_CONCURRENCY_DUCK_OTHERS: OH_AudioSession_ConcurrencyMode =
1695 2;
1696#[doc = " @brief pause others mode"]
1697pub const OH_AudioSession_ConcurrencyMode_CONCURRENCY_PAUSE_OTHERS:
1698 OH_AudioSession_ConcurrencyMode = 3;
1699#[doc = " @brief Declare the audio concurrency modes.\n\n @since 12"]
1700pub type OH_AudioSession_ConcurrencyMode = u32;
1701#[doc = " @brief scene for media"]
1702#[cfg(feature = "api-20")]
1703pub const OH_AudioSession_Scene_AUDIO_SESSION_SCENE_MEDIA: OH_AudioSession_Scene = 0;
1704#[doc = " @brief scene for game"]
1705#[cfg(feature = "api-20")]
1706pub const OH_AudioSession_Scene_AUDIO_SESSION_SCENE_GAME: OH_AudioSession_Scene = 1;
1707#[doc = " @brief scene for voice communication"]
1708#[cfg(feature = "api-20")]
1709pub const OH_AudioSession_Scene_AUDIO_SESSION_SCENE_VOICE_COMMUNICATION: OH_AudioSession_Scene = 2;
1710#[cfg(feature = "api-20")]
1711#[doc = " @brief Declare the audio session scene.\n\n @since 20"]
1712pub type OH_AudioSession_Scene = u32;
1713#[doc = " @brief Resume the playback"]
1714#[cfg(feature = "api-20")]
1715pub const OH_AudioSession_StateChangeHint_AUDIO_SESSION_STATE_CHANGE_HINT_RESUME:
1716 OH_AudioSession_StateChangeHint = 0;
1717#[doc = " @brief paused/pause the playback"]
1718#[cfg(feature = "api-20")]
1719pub const OH_AudioSession_StateChangeHint_AUDIO_SESSION_STATE_CHANGE_HINT_PAUSE:
1720 OH_AudioSession_StateChangeHint = 1;
1721#[doc = " @brief stopped/stop the playback."]
1722#[cfg(feature = "api-20")]
1723pub const OH_AudioSession_StateChangeHint_AUDIO_SESSION_STATE_CHANGE_HINT_STOP:
1724 OH_AudioSession_StateChangeHint = 2;
1725#[doc = " @brief stopped/stop the playback due to no audio stream for a long time."]
1726#[cfg(feature = "api-20")]
1727pub const OH_AudioSession_StateChangeHint_AUDIO_SESSION_STATE_CHANGE_HINT_TIME_OUT_STOP:
1728 OH_AudioSession_StateChangeHint = 3;
1729#[doc = " @brief Ducked the playback. (In ducking, the audio volume is reduced, but not silenced.)"]
1730#[cfg(feature = "api-20")]
1731pub const OH_AudioSession_StateChangeHint_AUDIO_SESSION_STATE_CHANGE_HINT_DUCK:
1732 OH_AudioSession_StateChangeHint = 4;
1733#[doc = " @brief Unducked the playback."]
1734#[cfg(feature = "api-20")]
1735pub const OH_AudioSession_StateChangeHint_AUDIO_SESSION_STATE_CHANGE_HINT_UNDUCK:
1736 OH_AudioSession_StateChangeHint = 5;
1737#[cfg(feature = "api-20")]
1738#[doc = " @brief Declare the audio session state change hints.\n\n @since 20"]
1739pub type OH_AudioSession_StateChangeHint = u32;
1740#[doc = " @brief Recommend to continue the playback."]
1741#[cfg(feature = "api-20")]
1742pub const OH_AudioSession_OutputDeviceChangeRecommendedAction_DEVICE_CHANGE_RECOMMEND_TO_CONTINUE : OH_AudioSession_OutputDeviceChangeRecommendedAction = 0 ;
1743#[doc = " @brief recommend to stop the playback."]
1744#[cfg(feature = "api-20")]
1745pub const OH_AudioSession_OutputDeviceChangeRecommendedAction_DEVICE_CHANGE_RECOMMEND_TO_STOP:
1746 OH_AudioSession_OutputDeviceChangeRecommendedAction = 1;
1747#[cfg(feature = "api-20")]
1748#[doc = " @brief Declare the recommend action when device change.\n\n @since 20"]
1749pub type OH_AudioSession_OutputDeviceChangeRecommendedAction = u32;
1750#[doc = " @brief deactivated because of lower priority"]
1751pub const OH_AudioSession_DeactivatedReason_DEACTIVATED_LOWER_PRIORITY:
1752 OH_AudioSession_DeactivatedReason = 0;
1753#[doc = " @brief deactivated because of timing out"]
1754pub const OH_AudioSession_DeactivatedReason_DEACTIVATED_TIMEOUT: OH_AudioSession_DeactivatedReason =
1755 1;
1756#[doc = " @brief Declare the audio deactivated reasons.\n\n @since 12"]
1757pub type OH_AudioSession_DeactivatedReason = u32;
1758#[doc = " @brief declare the audio session strategy\n\n @since 12"]
1759#[repr(C)]
1760#[derive(Debug, Copy, Clone)]
1761pub struct OH_AudioSession_Strategy {
1762 #[doc = " @brief audio session concurrency mode"]
1763 pub concurrencyMode: OH_AudioSession_ConcurrencyMode,
1764}
1765#[doc = " @brief declare the audio session deactivated event\n\n @since 12"]
1766#[repr(C)]
1767#[derive(Debug, Copy, Clone)]
1768pub struct OH_AudioSession_DeactivatedEvent {
1769 #[doc = " @brief audio session deactivated reason"]
1770 pub reason: OH_AudioSession_DeactivatedReason,
1771}
1772#[cfg(feature = "api-20")]
1773#[doc = " @brief declare the audio session state change event\n\n @since 20"]
1774#[repr(C)]
1775#[derive(Debug, Copy, Clone)]
1776pub struct OH_AudioSession_StateChangedEvent {
1777 #[doc = " @brief audio session state change hints."]
1778 pub stateChangeHint: OH_AudioSession_StateChangeHint,
1779}
1780#[cfg(feature = "api-20")]
1781#[doc = " @brief This function pointer will point to the callback function that\n is used to return the audio session state change event.\n\n @param event the {@link #OH_AudioSession_StateChangedEvent} state change triggering event.\n @since 20"]
1782pub type OH_AudioSession_StateChangedCallback =
1783 ::std::option::Option<unsafe extern "C" fn(event: OH_AudioSession_StateChangedEvent)>;
1784#[cfg(feature = "api-20")]
1785#[doc = " @brief This function pointer will point to the callback function that\n is used to return the audio session device change event.\n\n @param audioDeviceDescriptorArray the {@link OH_AudioDeviceDescriptorArray}\n pointer variable which will be set the audio device descriptors value.\n Do not release the audioDeviceDescriptorArray pointer separately\n instead call {@link OH_AudioSessionManager_ReleaseDevices}\n to release the DeviceDescriptor array when it is no use anymore.\n @param changeReason the {@link #OH_AudioStream_DeviceChangeReason} indicates that why does the device changes.\n @param recommendedAction the {@link #OH_AudioSession_OutputDeviceChangeRecommendedAction}\n recommend action when device change.\n @since 20"]
1786pub type OH_AudioSession_CurrentOutputDeviceChangedCallback = ::std::option::Option<
1787 unsafe extern "C" fn(
1788 devices: *mut OH_AudioDeviceDescriptorArray,
1789 changeReason: OH_AudioStream_DeviceChangeReason,
1790 recommendedAction: OH_AudioSession_OutputDeviceChangeRecommendedAction,
1791 ),
1792>;
1793#[doc = " @brief This function pointer will point to the callback function that\n is used to return the audio session deactivated event.\n\n @param event the {@link #OH_AudioSession_DeactivatedEvent} deactivated triggering event.\n @since 12"]
1794pub type OH_AudioSession_DeactivatedCallback =
1795 ::std::option::Option<unsafe extern "C" fn(event: OH_AudioSession_DeactivatedEvent) -> i32>;
1796extern "C" {
1797 #[doc = " @brief Fetch the audio session manager handle.\n The audio session manager handle should be the first parameter in audio session related functions\n\n @param audioSessionManager the {@link #OH_AudioSessionManager}\n which will be returned as the output parameter\n @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error\n @since 12"]
1798 pub fn OH_AudioManager_GetAudioSessionManager(
1799 audioSessionManager: *mut *mut OH_AudioSessionManager,
1800 ) -> OH_AudioCommon_Result;
1801}
1802extern "C" {
1803 #[doc = " @brief Activate the audio session for the current pid application.\n If {@link #OH_AudioSessionManager_SetScene} is called, it will take focus when calling this method.\n\n @param audioSessionManager the {@link #OH_AudioSessionManager}\n returned by the {@link #OH_AudioManager_GetAudioSessionManager}\n @param strategy pointer of {@link #OH_AudioSession_Strategy}\n which is used for setting audio session strategy\n @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n or {@link #AUDIOCOMMON_REULT_INVALID_PARAM} if parameter validation fails\n or {@link #AUDIOCOMMON_RESULT_ERROR_ILLEGAL_STATE} if system illegal state\n @since 12"]
1804 pub fn OH_AudioSessionManager_ActivateAudioSession(
1805 audioSessionManager: *mut OH_AudioSessionManager,
1806 strategy: *const OH_AudioSession_Strategy,
1807 ) -> OH_AudioCommon_Result;
1808}
1809extern "C" {
1810 #[doc = " @brief Deactivate the audio session for the current pid application.\n\n @param audioSessionManager the {@link #OH_AudioSessionManager}\n returned by the {@link #OH_AudioManager_GetAudioSessionManager}\n @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n or {@link #AUDIOCOMMON_REULT_INVALID_PARAM} if parameter validation fails\n or {@link #AUDIOCOMMON_RESULT_ERROR_ILLEGAL_STATE} if system illegal state\n @since 12"]
1811 pub fn OH_AudioSessionManager_DeactivateAudioSession(
1812 audioSessionManager: *mut OH_AudioSessionManager,
1813 ) -> OH_AudioCommon_Result;
1814}
1815extern "C" {
1816 #[doc = " @brief Querying whether the current pid application has an activated audio session.\n\n @param audioSessionManager the {@link #OH_AudioSessionManager}\n returned by the {@link #OH_AudioManager_GetAudioSessionManager}\n @return True when the current pid application has an activated audio session\n False when it does not\n @since 12"]
1817 pub fn OH_AudioSessionManager_IsAudioSessionActivated(
1818 audioSessionManager: *mut OH_AudioSessionManager,
1819 ) -> bool;
1820}
1821extern "C" {
1822 #[doc = " @brief Register the audio session deactivated event callback.\n\n @param audioSessionManager the {@link #OH_AudioSessionManager}\n returned by the {@link #OH_AudioManager_GetAudioSessionManager}\n @param callback the {@link #OH_AudioSession_DeactivatedCallback} which is used\n to receive the deactivated event\n @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails\n @since 12"]
1823 pub fn OH_AudioSessionManager_RegisterSessionDeactivatedCallback(
1824 audioSessionManager: *mut OH_AudioSessionManager,
1825 callback: OH_AudioSession_DeactivatedCallback,
1826 ) -> OH_AudioCommon_Result;
1827}
1828extern "C" {
1829 #[doc = " @brief Unregister the audio session deactivated event callback.\n\n @param audioSessionManager the {@link #OH_AudioSessionManager}\n returned by the {@link #OH_AudioManager_GetAudioSessionManager}\n @param callback the {@link #OH_AudioSession_DeactivatedCallback} which is used\n to receive the deactivated event\n @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails\n @since 12"]
1830 pub fn OH_AudioSessionManager_UnregisterSessionDeactivatedCallback(
1831 audioSessionManager: *mut OH_AudioSessionManager,
1832 callback: OH_AudioSession_DeactivatedCallback,
1833 ) -> OH_AudioCommon_Result;
1834}
1835extern "C" {
1836 #[cfg(feature = "api-20")]
1837 #[doc = " @brief Set scene for audio session.\n\n @param audioSessionManager the {@link #OH_AudioSessionManager}\n returned by the {@link #OH_AudioManager_GetAudioSessionManager}\n @param scene the {@link #OH_AudioSession_Scene}\n @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails\n or {@link #AUDIOCOMMON_RESULT_ERROR_ILLEGAL_STATE} if system illegal state\n or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error\n @since 20"]
1838 pub fn OH_AudioSessionManager_SetScene(
1839 audioSessionManager: *mut OH_AudioSessionManager,
1840 scene: OH_AudioSession_Scene,
1841 ) -> OH_AudioCommon_Result;
1842}
1843extern "C" {
1844 #[cfg(feature = "api-20")]
1845 #[doc = " @brief Register the audio session state change event callback.\n\n @param audioSessionManager the {@link #OH_AudioSessionManager}\n returned by the {@link #OH_AudioManager_GetAudioSessionManager}\n @param callback the {@link #OH_AudioSession_StateChangedCallback} which is used\n to receive the state change event\n @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails\n or {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error\n or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error\n @since 20"]
1846 pub fn OH_AudioSessionManager_RegisterStateChangeCallback(
1847 audioSessionManager: *mut OH_AudioSessionManager,
1848 callback: OH_AudioSession_StateChangedCallback,
1849 ) -> OH_AudioCommon_Result;
1850}
1851extern "C" {
1852 #[cfg(feature = "api-20")]
1853 #[doc = " @brief Unregister the audio session state change event callback.\n\n @param audioSessionManager the {@link #OH_AudioSessionManager}\n returned by the {@link #OH_AudioManager_GetAudioSessionManager}\n @param callback the {@link #OH_AudioSession_StateChangedCallback} which is used\n to receive the state change event\n @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails\n or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error\n @since 20"]
1854 pub fn OH_AudioSessionManager_UnregisterStateChangeCallback(
1855 audioSessionManager: *mut OH_AudioSessionManager,
1856 callback: OH_AudioSession_StateChangedCallback,
1857 ) -> OH_AudioCommon_Result;
1858}
1859extern "C" {
1860 #[cfg(feature = "api-20")]
1861 #[doc = " @brief Sets the default output device.\n This function applys on audiorenderers whose StreamUsage are\n STREAM_USAGE_VOICE_COMMUNICATION/STREAM_USAGE_VIDEO_COMMUNICATION/STREAM_USAGE_VOICE_MESSAGE.\n Setting the device will only takes effect if no other accessory such as headphones are in use\n @param audioSessionManager the {@link #OH_AudioSessionManager}\n returned by the {@link #OH_AudioManager_GetAudioSessionManager}\n @param deviceType The target device. The available deviceTypes are:\n EARPIECE: Built-in earpiece\n SPEAKER: Built-in speaker\n DEFAULT: System default output device\n @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails\n or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error\n @since 20"]
1862 pub fn OH_AudioSessionManager_SetDefaultOutputDevice(
1863 audioSessionManager: *mut OH_AudioSessionManager,
1864 deviceType: OH_AudioDevice_Type,
1865 ) -> OH_AudioCommon_Result;
1866}
1867extern "C" {
1868 #[cfg(feature = "api-20")]
1869 #[doc = " @brief Gets the default output device.\n\n @param audioSessionManager the {@link #OH_AudioSessionManager}\n returned by the {@link #OH_AudioManager_GetAudioSessionManager}\n @param deviceType The target device.The available deviceTypes are:\n EARPIECE: Built-in earpiece\n SPEAKER: Built-in speaker\n DEFAULT: System default output device\n @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails\n or {@link #AUDIOCOMMON_RESULT_ERROR_ILLEGAL_STATE} if system illegal state\n @since 20"]
1870 pub fn OH_AudioSessionManager_GetDefaultOutputDevice(
1871 audioSessionManager: *mut OH_AudioSessionManager,
1872 deviceType: *mut OH_AudioDevice_Type,
1873 ) -> OH_AudioCommon_Result;
1874}
1875extern "C" {
1876 #[cfg(feature = "api-20")]
1877 #[doc = " @brief Release the audio device descriptor array object.\n\n @param audioSessionManager the {@link OH_AudioSessionManager}\n returned by the {@link #OH_AudioManager_GetAudioSessionManager}\n @param audioDeviceDescriptorArray Audio device descriptors should be released.\n @return {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful.\n or {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails\n 1.The param of audioSessionManager is nullptr;\n 2.The param of audioDeviceDescriptorArray is nullptr.\n @since 20"]
1878 pub fn OH_AudioSessionManager_ReleaseDevices(
1879 audioSessionManager: *mut OH_AudioSessionManager,
1880 audioDeviceDescriptorArray: *mut OH_AudioDeviceDescriptorArray,
1881 ) -> OH_AudioCommon_Result;
1882}
1883extern "C" {
1884 #[cfg(feature = "api-20")]
1885 #[doc = " @brief Register the audio session device change event callback.\n\n @param audioSessionManager the {@link #OH_AudioSessionManager}\n returned by the {@link #OH_AudioManager_GetAudioSessionManager}\n @param callback the {@link #OH_AudioSession_CurrentOutputDeviceChangedCallback} which is used\n to receive the device change event\n @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails\n or {@link AUDIOCOMMON_RESULT_ERROR_NO_MEMORY} No memory error\n or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error\n @since 20"]
1886 pub fn OH_AudioSessionManager_RegisterCurrentOutputDeviceChangeCallback(
1887 audioSessionManager: *mut OH_AudioSessionManager,
1888 callback: OH_AudioSession_CurrentOutputDeviceChangedCallback,
1889 ) -> OH_AudioCommon_Result;
1890}
1891extern "C" {
1892 #[cfg(feature = "api-20")]
1893 #[doc = " @brief Unregister the audio session device change event callback.\n\n @param audioSessionManager the {@link #OH_AudioSessionManager}\n returned by the {@link #OH_AudioManager_GetAudioSessionManager}\n @param callback the {@link #OH_AudioSession_CurrentOutputDeviceChangedCallback} which is used\n to receive the device change event\n @return {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n or {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if parameter validation fails\n or {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error\n @since 20"]
1894 pub fn OH_AudioSessionManager_UnregisterCurrentOutputDeviceChangeCallback(
1895 audioSessionManager: *mut OH_AudioSessionManager,
1896 callback: OH_AudioSession_CurrentOutputDeviceChangedCallback,
1897 ) -> OH_AudioCommon_Result;
1898}
1899#[repr(C)]
1900#[derive(Debug, Copy, Clone)]
1901pub struct OH_AudioStreamManager {
1902 _unused: [u8; 0],
1903}
1904extern "C" {
1905 #[cfg(feature = "api-19")]
1906 #[doc = " @brief Fetch the audio streammanager handle, which is a singleton.\n\n @param streamManager output parameter to get the {@link #OH_AudioStreamManager}.\n @return\n {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} if system state error\n @since 19"]
1907 pub fn OH_AudioManager_GetAudioStreamManager(
1908 streamManager: *mut *mut OH_AudioStreamManager,
1909 ) -> OH_AudioCommon_Result;
1910}
1911extern "C" {
1912 #[cfg(feature = "api-19")]
1913 #[doc = " @brief Gets the mode of direct playback available for a given audio format with current active device.\n\n @param audioStreamManager the {@link OH_AudioStreamManager} handle provided by\n {@link OH_AudioManager_GetAudioStreamManager}.\n @param streamInfo the {@link OH_AudioStreamInfo}.\n @param usage the {@link OH_AudioStream_Usage}.\n @param directPlaybackMode the {@link OH_AudioStream_DirectPlaybackMode} pointer to a variable which receives the\n result.\n @return Function result code:\n {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful.\n {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}:\n 1.The param of audioStreamManager is nullptr;\n 2.The param of streamInfo is nullptr;\n 3.The param of usage invalid;\n 4.The param of directPlaybackMode is nullptr.\n @since 19"]
1914 pub fn OH_AudioStreamManager_GetDirectPlaybackSupport(
1915 audioStreamManager: *mut OH_AudioStreamManager,
1916 streamInfo: *mut OH_AudioStreamInfo,
1917 usage: OH_AudioStream_Usage,
1918 directPlaybackMode: *mut OH_AudioStream_DirectPlaybackMode,
1919 ) -> OH_AudioCommon_Result;
1920}
1921extern "C" {
1922 #[cfg(feature = "api-20")]
1923 #[doc = " @brief Query whether acoustic echo canceler is supported by input source.\n\n @param streamManager The {@link OH_AudioStreamManager} handle provided\n by {@link OH_AudioManager_GetAudioStreamManager}.\n @param sourceType Related source type.\n @param supported Pointer to get the result.\n @return Function result code:\n {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful.\n {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}:\n 1.The input param streamManager is nullptr;\n 2.Source type is invalid.\n 3.The input param supported is nullptr.\n @since 20"]
1924 pub fn OH_AudioStreamManager_IsAcousticEchoCancelerSupported(
1925 streamManager: *mut OH_AudioStreamManager,
1926 sourceType: OH_AudioStream_SourceType,
1927 supported: *mut bool,
1928 ) -> OH_AudioCommon_Result;
1929}
1930extern "C" {
1931 #[cfg(feature = "api-20")]
1932 #[doc = " @brief Return if fast playback is supported for the specific audio stream info and usage type\n in current device situation.\n\n @param streamManager {@link OH_AudioStreamManager} handle\n provided by {@link OH_AudioManager_GetAudioStreamManager}.\n @param streamInfo reference of stream info structure to describe basic audio format.\n @param usage stream usage type used to decide the audio device and pipe type selection result.\n @return {@code true} if fast playback is supported in this situation.\n @since 20"]
1933 pub fn OH_AudioStreamManager_IsFastPlaybackSupported(
1934 streamManager: *mut OH_AudioStreamManager,
1935 streamInfo: *mut OH_AudioStreamInfo,
1936 usage: OH_AudioStream_Usage,
1937 ) -> bool;
1938}
1939extern "C" {
1940 #[cfg(feature = "api-20")]
1941 #[doc = " @brief Return if fast recording is supported for the specific audio stream info and source type\n in current device situation.\n\n @param streamManager {@link OH_AudioStreamManager} handle\n provided by {@link OH_AudioManager_GetAudioStreamManager}.\n @param streamInfo reference of stream info structure to describe basic audio format.\n @param source stream source type used to decide the audio device and pipe type selection result.\n @return {@code true} if fast recording is supported in this situation.\n @since 20"]
1942 pub fn OH_AudioStreamManager_IsFastRecordingSupported(
1943 streamManager: *mut OH_AudioStreamManager,
1944 streamInfo: *mut OH_AudioStreamInfo,
1945 source: OH_AudioStream_SourceType,
1946 ) -> bool;
1947}
1948#[repr(C)]
1949#[derive(Debug, Copy, Clone)]
1950pub struct OH_AudioVolumeManager {
1951 _unused: [u8; 0],
1952}
1953#[cfg(feature = "api-20")]
1954#[doc = " @brief Prototype for the volume change function that is passed to\n {@link OH_AudioVolumeManager_RegisterStreamVolumeChangeCallback}.\n\n @param userData userdata which is passed by register.\n @param usage the stream usage type for which volume changed.\n @param volumeLevel the latest volume level.\n @param updateUi whether to show the volume change in UI.\n\n @since 20"]
1955pub type OH_AudioVolumeManager_OnStreamVolumeChangeCallback = ::std::option::Option<
1956 unsafe extern "C" fn(
1957 userData: *mut ::std::os::raw::c_void,
1958 usage: OH_AudioStream_Usage,
1959 volumeLevel: i32,
1960 updateUi: bool,
1961 ),
1962>;
1963#[cfg(feature = "api-20")]
1964#[doc = " @brief Prototype for the volume change function that is passed to\n {@link OH_AudioVolumeManager_RegisterStreamVolumeChangeCallback}.\n\n @param userData userdata which is passed by register.\n @param ringerMode the latest ringer mode.\n\n @since 20"]
1965pub type OH_AudioVolumeManager_OnRingerModeChangeCallback = ::std::option::Option<
1966 unsafe extern "C" fn(userData: *mut ::std::os::raw::c_void, ringerMode: OH_AudioRingerMode),
1967>;
1968extern "C" {
1969 #[cfg(feature = "api-20")]
1970 #[doc = " @brief Fetch the audio volume manager handle, which is a singleton.\n\n @param volumeManager output parameter to get {@link OH_AudioVolumeManager} instance.\n @return\n {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if input param is nullptr\n\n @since 20"]
1971 pub fn OH_AudioManager_GetAudioVolumeManager(
1972 volumeManager: *mut *mut OH_AudioVolumeManager,
1973 ) -> OH_AudioCommon_Result;
1974}
1975extern "C" {
1976 #[cfg(feature = "api-20")]
1977 #[doc = " @brief Obtains the maximum volume level for a specific stream usage type.\n\n @param volumeManager {@link OH_AudioVolumeManager} handle\n provided by {@link OH_AudioManager_GetAudioVolumeManager}.\n @param usage the stream usage type used to map a specific volume type.\n @param maxVolumeLevel output parameter to get maximum volume level.\n @return\n {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if input param is nullptr or invalid\n {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} system process error occurs\n\n @since 20"]
1978 pub fn OH_AudioVolumeManager_GetMaxVolumeByUsage(
1979 volumeManager: *mut OH_AudioVolumeManager,
1980 usage: OH_AudioStream_Usage,
1981 maxVolumeLevel: *mut i32,
1982 ) -> OH_AudioCommon_Result;
1983}
1984extern "C" {
1985 #[cfg(feature = "api-20")]
1986 #[doc = " @brief Obtains the minimum volume level for a specific stream usage type.\n\n @param volumeManager {@link OH_AudioVolumeManager} handle\n provided by {@link OH_AudioManager_GetAudioVolumeManager}.\n @param usage the stream usage type used to map a specific volume type.\n @param minVolumeLevel output parameter to get minimum volume level.\n @return\n {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if input param is nullptr or invalid\n {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} system process error occurs\n\n @since 20"]
1987 pub fn OH_AudioVolumeManager_GetMinVolumeByUsage(
1988 volumeManager: *mut OH_AudioVolumeManager,
1989 usage: OH_AudioStream_Usage,
1990 minVolumeLevel: *mut i32,
1991 ) -> OH_AudioCommon_Result;
1992}
1993extern "C" {
1994 #[cfg(feature = "api-20")]
1995 #[doc = " @brief Obtains the system volume level for a specific stream usage type.\n\n @param volumeManager {@link OH_AudioVolumeManager} handle\n provided by {@link OH_AudioManager_GetAudioVolumeManager}.\n @param usage the stream usage type used to map a specific volume type.\n @param volumeLevel output parameter to get system volume level.\n @return\n {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if input param is nullptr or invalid\n {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} system process error occurs\n\n @since 20"]
1996 pub fn OH_AudioVolumeManager_GetVolumeByUsage(
1997 volumeManager: *mut OH_AudioVolumeManager,
1998 usage: OH_AudioStream_Usage,
1999 volumeLevel: *mut i32,
2000 ) -> OH_AudioCommon_Result;
2001}
2002extern "C" {
2003 #[cfg(feature = "api-20")]
2004 #[doc = " @brief Checks whether a stream is muted for a specific stream usage type.\n\n @param volumeManager {@link OH_AudioVolumeManager} handle\n provided by {@link OH_AudioManager_GetAudioVolumeManager}.\n @param usage the stream usage type used to map a specific volume type.\n @param muted output parameter to get whether the stream of this usage is muted.\n @return\n {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if input param is nullptr or invalid\n {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} system process error occurs\n\n @since 20"]
2005 pub fn OH_AudioVolumeManager_IsMuteByUsage(
2006 volumeManager: *mut OH_AudioVolumeManager,
2007 usage: OH_AudioStream_Usage,
2008 muted: *mut bool,
2009 ) -> OH_AudioCommon_Result;
2010}
2011extern "C" {
2012 #[cfg(feature = "api-20")]
2013 #[doc = " @brief Register callback to receive stream volume changed events.\n\n @param volumeManager {@link OH_AudioVolumeManager} handle\n provided by {@link OH_AudioManager_GetAudioVolumeManager}.\n @param usage the stream usage type used to map a specific volume type which caller want to listen.\n @param callback callback function which will be called when stream volume changed.\n @param userData pointer to a data structure that will be passed to the callback functions.\n @return\n {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if input param is nullptr or invalid\n {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} system process error occurs\n\n @since 20"]
2014 pub fn OH_AudioVolumeManager_RegisterStreamVolumeChangeCallback(
2015 volumeManager: *mut OH_AudioVolumeManager,
2016 usage: OH_AudioStream_Usage,
2017 callback: OH_AudioVolumeManager_OnStreamVolumeChangeCallback,
2018 userData: *mut ::std::os::raw::c_void,
2019 ) -> OH_AudioCommon_Result;
2020}
2021extern "C" {
2022 #[cfg(feature = "api-20")]
2023 #[doc = " @brief Unregister stream volume change callback.\n\n @param volumeManager {@link OH_AudioVolumeManager} handle\n provided by {@link OH_AudioManager_GetAudioVolumeManager}.\n @param callback callback function which registered in\n {@link OH_AudioVolumeManager_RegisterStreamVolumeChangeCallback}.\n @return\n {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if input param is nullptr\n {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} system process error occurs\n\n @since 20"]
2024 pub fn OH_AudioVolumeManager_UnregisterStreamVolumeChangeCallback(
2025 volumeManager: *mut OH_AudioVolumeManager,
2026 callback: OH_AudioVolumeManager_OnStreamVolumeChangeCallback,
2027 ) -> OH_AudioCommon_Result;
2028}
2029extern "C" {
2030 #[cfg(feature = "api-20")]
2031 #[doc = " @brief Get current ringer mode.\n\n @param volumeManager {@link OH_AudioVolumeManager} handle\n provided by {@link OH_AudioManager_GetAudioVolumeManager}.\n @param ringerMode output parameter to get the ringer mode.\n @return\n {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if input param is nullptr\n {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} system process error occurs\n\n @since 20"]
2032 pub fn OH_AudioVolumeManager_GetRingerMode(
2033 volumeManager: *mut OH_AudioVolumeManager,
2034 ringerMode: *mut OH_AudioRingerMode,
2035 ) -> OH_AudioCommon_Result;
2036}
2037extern "C" {
2038 #[cfg(feature = "api-20")]
2039 #[doc = " @brief Register callback to receive ringer mode changed events.\n\n @param volumeManager {@link OH_AudioVolumeManager} handle\n provided by {@link OH_AudioManager_GetAudioVolumeManager}.\n @param callback callback function which will be called when ringer mode changed.\n @param userData pointer to a data structure that will be passed to the callback functions.\n @return\n {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if input param is nullptr\n {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} system process error occurs\n\n @since 20"]
2040 pub fn OH_AudioVolumeManager_RegisterRingerModeChangeCallback(
2041 volumeManager: *mut OH_AudioVolumeManager,
2042 callback: OH_AudioVolumeManager_OnRingerModeChangeCallback,
2043 userData: *mut ::std::os::raw::c_void,
2044 ) -> OH_AudioCommon_Result;
2045}
2046extern "C" {
2047 #[cfg(feature = "api-20")]
2048 #[doc = " @brief Unregister ringer mode change callback.\n\n @param volumeManager {@link OH_AudioVolumeManager} handle\n provided by {@link OH_AudioManager_GetAudioVolumeManager}.\n @param callback callback function which registered in\n {@link OH_AudioVolumeManager_RegisterRingerModeChangeCallback}.\n @return\n {@link #AUDIOCOMMON_RESULT_SUCCESS} if execution succeeds\n {@link #AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM} if input param is nullptr\n {@link #AUDIOCOMMON_RESULT_ERROR_SYSTEM} system process error occurs\n\n @since 20"]
2049 pub fn OH_AudioVolumeManager_UnregisterRingerModeChangeCallback(
2050 volumeManager: *mut OH_AudioVolumeManager,
2051 callback: OH_AudioVolumeManager_OnRingerModeChangeCallback,
2052 ) -> OH_AudioCommon_Result;
2053}