1# Multimedia Subsystem Changelog
2
3## cl.multimedia.1 Stream Type Enum Declaration in Audio C APIs Changed
4
5For the audio APIs of API version 10 in C, the audio output stream type is changed from **AUDIOSTREAM_TYPE_RERNDERER** to **AUDIOSTREAM_TYPE_RENDERER**.
6
7**Change Impact**
8
9Applications that use the involved APIs may have compatibility issues.
10
11**Key API/Component Changes**
12
13Before change:
14
15 ```C
16enum OH_AudioStream_Type {
17    /**
18     * The type for audio stream is renderer.
19     */
20    AUDIOSTREAM_TYPE_RERNDERER = 1,
21
22    /**
23     * The type for audio stream is capturer.
24     */
25    AUDIOSTREAM_TYPE_CAPTURER = 2
26};
27 ```
28
29After change:
30
31 ```C
32enum OH_AudioStream_Type {
33    /**
34     * The type for audio stream is renderer.
35     */
36    AUDIOSTREAM_TYPE_RENDERER = 1,
37
38    /**
39     * The type for audio stream is capturer.
40     */
41    AUDIOSTREAM_TYPE_CAPTURER = 2
42};
43 ```
44
45**Adaptation Guide**
46
47Change **AUDIOSTREAM_TYPE_RERNDERER** to **AUDIOSTREAM_TYPE_RENDERER** in your code. Example:
48
49Before change:
50
51```C
52OH_AudioStreamBuilder* builder;
53OH_AudioStreamBuilder_Create(&builder, AUDIOSTREAM_TYPE_RERNDERER);
54```
55
56After change:
57
58```C
59OH_AudioStreamBuilder* builder;
60OH_AudioStreamBuilder_Create(&builder, AUDIOSTREAM_TYPE_RENDERER);
61```
62
63## cl.multimedia.2 OH_AudioStream_Content Removed
64
65For the audio APIs of API version 10 in C, **OH_AudioStream_Content** is removed for the audio output stream attributes.
66
67**Change Impact**
68
69Applications that use the involved APIs may have compatibility issues.
70
71**Key API/Component Changes**
72
73- In the **native_audiostream_base.h** file
74
75  Before change:
76
77  ```C
78  typedef enum {
79      AUDIOSTREAM_CONTENT_TYPE_UNKNOWN = 0,
80      AUDIOSTREAM_CONTENT_TYPE_SPEECH = 1,
81      AUDIOSTREAM_CONTENT_TYPE_MUSIC = 2,
82      AUDIOSTREAM_CONTENT_TYPE_MOVIE = 3,
83  } OH_AudioStream_Content;
84  ```
85
86  After change: **OH_AudioStream_Content** is removed.
87
88- In the **native_audiostreambuilder.h** file
89
90  Before change:
91
92  ```C
93  OH_AudioStream_Result OH_AudioStreamBuilder_SetRendererInfo(OH_AudioStreamBuilder* builder,
94      OH_AudioStream_Usage usage, OH_AudioStream_Content content);
95  ```
96
97  After change:
98
99  ```C
100  OH_AudioStream_Result OH_AudioStreamBuilder_SetRendererInfo(OH_AudioStreamBuilder* builder,
101      OH_AudioStream_Usage usage);
102  ```
103
104- In the **native_audiorenderer.h** file
105
106  Before change:
107
108  ```C
109  OH_AudioStream_Result OH_AudioRenderer_GetRendererInfo(OH_AudioRenderer* renderer,
110      OH_AudioStream_Usage* usage, OH_AudioStream_Content* content);
111  ```
112
113  After change:
114
115  ```C
116  OH_AudioStream_Result OH_AudioRenderer_GetRendererInfo(OH_AudioRenderer* renderer,
117      OH_AudioStream_Usage* usage);
118  ```
119
120**Adaptation Guide**
121
122When using **OH_AudioStreamBuilder_SetRendererInfo**, check the original **OH_AudioStream_Content** type against the following table and use the corresponding **OH_AudioStream_Usage** type based on the scenario.
123
124| OH_AudioStream_Content          | OH_AudioStream_Usage                  |
125| ------------------------------- | ------------------------------------- |
126| AUDIOSTREAM_CONTENT_TYPE_SPEECH | AUDIOSTREAM_USAGE_VOICE_COMMUNICATION |
127| AUDIOSTREAM_CONTENT_TYPE_MUSIC  | AUDIOSTREAM_USAGE_MUSIC               |
128| AUDIOSTREAM_CONTENT_TYPE_MOVIE  | AUDIOSTREAM_USAGE_MOVIE               |
129
130**OH_AudioRenderer_GetRendererInfo** can be used to obtain the **OH_AudioStream_Usage** attribute but not the **OH_AudioStream_Content** attribute.
131
132## cl.multimedia.3 OH_AudioStream_Usage Changed
133
134In the **native_audiostream_base.h** file of the audio interfaces of API version 10 in C, for the **OH_AudioStream_Usage** enum, the enumerated value **AUDIOSTREAM_USAGE_MEDIA** is deleted, and **AUDIOSTREAM_USAGE_COMMUNICATION** is changed to **AUDIOSTREAM_USAGE_VOICE_COMMUNICATION** and **AUDIOSTREAM_USAGE_VOICE_ASSISTANT**.
135
136**Change Impact**
137
138Applications that use the involved APIs may have compatibility issues.
139
140**Key API/Component Changes**
141
142Before change:
143
144```C
145typedef enum {
146    AUDIOSTREAM_USAGE_UNKNOWN = 0,
147    AUDIOSTREAM_USAGE_MEDIA = 1,
148    AUDIOSTREAM_USAGE_COMMUNICATION = 2,
149} OH_AudioStream_Usage;
150```
151
152After change:
153```C
154typedef enum {
155    /**
156     * Unknown usage.
157     */
158    AUDIOSTREAM_USAGE_UNKNOWN = 0,
159    /**
160     * Music usage.
161     */
162    AUDIOSTREAM_USAGE_MUSIC = 1,
163    /**
164     * Voice communication usage.
165     */
166    AUDIOSTREAM_USAGE_VOICE_COMMUNICATION = 2,
167    /**
168     * Voice assistant usage.
169     */
170    AUDIOSTREAM_USAGE_VOICE_ASSISTANT = 3,
171    /**
172     * Movie or video usage.
173     */
174    AUDIOSTREAM_USAGE_MOVIE = 10,
175
176} OH_AudioStream_Usage;
177```
178
179**Adaptation Guide**
180
181When using **OH_AudioStreamBuilder_SetRendererInfo**, set **OH_AudioStream_Usage** to **AUDIOSTREAM_USAGE_MUSIC** or **AUDIOSTREAM_USAGE_MOVIE**, rather than **AUDIOSTREAM_USAGE_MEDIA**.
182
183Before change:
184
185```C
186OH_AudioStreamBuilder_SetRendererInfo(builder, AUDIOSTREAM_USAGE_MEDIA);
187```
188
189After change:
190
191```C
192OH_AudioStreamBuilder_SetRendererInfo(builder, AUDIOSTREAM_USAGE_MUSIC); // Music scene
193```
194
195Or:
196
197```C
198OH_AudioStreamBuilder_SetRendererInfo(builder, AUDIOSTREAM_USAGE_MOVIE); // Video scene
199```
200
201When using **OH_AudioStreamBuilder_SetRendererInfo**, set **OH_AudioStream_Usage** to **AUDIOSTREAM_USAGE_VOICE_COMMUNICATION** or **AUDIOSTREAM_USAGE_VOICE_ASSISTANT**, rather than **AUDIOSTREAM_USAGE_COMMUNICATION**.
202
203Before change:
204
205```C
206OH_AudioStreamBuilder_SetRendererInfo(builder, AUDIOSTREAM_USAGE_COMMUNICATION);
207```
208
209After change:
210
211```C
212OH_AudioStreamBuilder_SetRendererInfo(builder, AUDIOSTREAM_USAGE_VOICE_COMMUNICATION); // Communication scene
213```
214
215Or:
216
217```C
218OH_AudioStreamBuilder_SetRendererInfo(builder, AUDIOSTREAM_USAGE_VOICE_ASSISTANT); // Voice assistant scene
219```
220
221## cl.multimedia.4 AUDIOSTREAM_SAMPLE_F32LE Deleted for **OH_AudioStream_SampleFormat**
222
223In the **native_audiostream_base.h** file of the audio interfaces of API version 10 in C, the enumerated value **AUDIOSTREAM_SAMPLE_F32LE** is deleted for the **OH_AudioStream_SampleFormat** enum.
224
225**Change Impact**
226
227Applications that use the involved APIs may have compatibility issues.
228
229**Key API/Component Changes**
230
231Before change:
232
233```C
234typedef enum {
235    AUDIOSTREAM_SAMPLE_U8 = 0,
236    AUDIOSTREAM_SAMPLE_S16LE = 1,
237    AUDIOSTREAM_SAMPLE_S24LE = 2,
238    AUDIOSTREAM_SAMPLE_S32LE = 3,
239    AUDIOSTREAM_SAMPLE_F32LE = 4,
240} OH_AudioStream_SampleFormat;
241```
242
243After change:
244```C
245typedef enum {
246    /**
247     * Unsigned 8 format.
248     */
249    AUDIOSTREAM_SAMPLE_U8 = 0,
250    /**
251     * Signed 16 bit integer, little endian.
252     */
253    AUDIOSTREAM_SAMPLE_S16LE = 1,
254    /**
255     * Signed 24 bit integer, little endian.
256     */
257    AUDIOSTREAM_SAMPLE_S24LE = 2,
258    /**
259     * Signed 32 bit integer, little endian.
260     */
261    AUDIOSTREAM_SAMPLE_S32LE = 3,
262} OH_AudioStream_SampleFormat;
263```
264
265**Adaptation Guide**
266
267Do not use **AUDIOSTREAM_SAMPLE_F32LE** for **OH_AudioStream_SampleFormat**.
268
269## cl.multimedia.5 Enumerated Values Added for OH_AudioStream_Result
270
271In the **native_audiostream_base.h** file of the audio interfaces of API version 10 in C, new enumerated values are added for the **OH_AudioStream_Result** enum.
272
273**Change Impact**
274
275None.
276
277**Key API/Component Changes**
278
279Before change:
280
281```C
282typedef enum {
283    /**
284     * The call was successful.
285     */
286    AUDIOSTREAM_SUCCESS,
287
288    /**
289     * This means that the function was executed with an invalid input parameter.
290     */
291    AUDIOSTREAM_ERROR_INVALID_PARAM,
292
293    /**
294     * Execution status exception.
295     */
296    AUDIOSTREAM_ERROR_ILLEGAL_STATE,
297
298    /**
299     * An system error has occurred.
300     */
301    AUDIOSTREAM_ERROR_SYSTEM
302} OH_AudioStream_Result;
303```
304
305After change:
306```C
307typedef enum {
308    /**
309     * The call was successful.
310     */
311    AUDIOSTREAM_SUCCESS = 0,
312
313    /**
314     * This means that the function was executed with an invalid input parameter.
315     */
316    AUDIOSTREAM_ERROR_INVALID_PARAM = 1,
317
318    /**
319     * Execution status exception.
320     */
321    AUDIOSTREAM_ERROR_ILLEGAL_STATE = 2,
322
323    /**
324     * An system error has occurred.
325     */
326    AUDIOSTREAM_ERROR_SYSTEM = 3
327} OH_AudioStream_Result;
328```
329
330**Adaptation Guide**
331
332No adaptation is required.
333