1e41f4b71Sopenharmony_ci# Multimedia Subsystem ChangeLog
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci## cl.multimedia.audio.001 Call Mode Change of getRoutingManager()
4e41f4b71Sopenharmony_ci
5e41f4b71Sopenharmony_ci**getRoutingManager()** is changed from asynchronous to synchronous.
6e41f4b71Sopenharmony_ci
7e41f4b71Sopenharmony_ci**Change Impacts**
8e41f4b71Sopenharmony_ci
9e41f4b71Sopenharmony_ciIf the new mode is not used, an error will be reported during compilation.
10e41f4b71Sopenharmony_ci
11e41f4b71Sopenharmony_ci**Key API/Component Changes**
12e41f4b71Sopenharmony_ci
13e41f4b71Sopenharmony_ciBefore change:
14e41f4b71Sopenharmony_ci```js
15e41f4b71Sopenharmony_cigetRoutingManager(callback: AsyncCallback<AudioRoutingManager>): void;
16e41f4b71Sopenharmony_cigetRoutingManager(): Promise<AudioRoutingManager>;
17e41f4b71Sopenharmony_ci```
18e41f4b71Sopenharmony_ciAfter change:
19e41f4b71Sopenharmony_ci```js
20e41f4b71Sopenharmony_cigetRoutingManager(): AudioRoutingManager;
21e41f4b71Sopenharmony_ci```
22e41f4b71Sopenharmony_ci
23e41f4b71Sopenharmony_ci
24e41f4b71Sopenharmony_ci## cl.multimedia.audio.002 Call Mode Change of getStreamManager()
25e41f4b71Sopenharmony_ci
26e41f4b71Sopenharmony_ci**getStreamManager()** is changed from asynchronous to synchronous.
27e41f4b71Sopenharmony_ci
28e41f4b71Sopenharmony_ci**Change Impacts**
29e41f4b71Sopenharmony_ci
30e41f4b71Sopenharmony_ciIf the new mode is not used, an error will be reported during compilation.
31e41f4b71Sopenharmony_ci
32e41f4b71Sopenharmony_ci**Key API/Component Changes**
33e41f4b71Sopenharmony_ci
34e41f4b71Sopenharmony_ciBefore change:
35e41f4b71Sopenharmony_ci```js
36e41f4b71Sopenharmony_cigetStreamManager(callback: AsyncCallback<AudioStreamManager>): void;
37e41f4b71Sopenharmony_cigetStreamManager(): Promise<AudioStreamManager>;
38e41f4b71Sopenharmony_ci```
39e41f4b71Sopenharmony_ciAfter change:
40e41f4b71Sopenharmony_ci```js
41e41f4b71Sopenharmony_cigetStreamManager(): AudioStreamManager;
42e41f4b71Sopenharmony_ci```
43e41f4b71Sopenharmony_ci
44e41f4b71Sopenharmony_ci
45e41f4b71Sopenharmony_ci## cl.multimedia.audio.003 Registration Mode Change of micStateChange
46e41f4b71Sopenharmony_ci
47e41f4b71Sopenharmony_ciIn the original **AudioRoutingManager**, the registration mode of the **micStateChange** listener of the **on()** function is changed.
48e41f4b71Sopenharmony_ci
49e41f4b71Sopenharmony_ci**Change Impacts**
50e41f4b71Sopenharmony_ci
51e41f4b71Sopenharmony_ciIf the new mode is not used, an error will be reported during compilation.
52e41f4b71Sopenharmony_ci
53e41f4b71Sopenharmony_ci**Key API/Component Changes**
54e41f4b71Sopenharmony_ci
55e41f4b71Sopenharmony_ciBefore change:
56e41f4b71Sopenharmony_ci
57e41f4b71Sopenharmony_ci```js
58e41f4b71Sopenharmony_ciinterface AudioRoutingManager {
59e41f4b71Sopenharmony_ci   on(type: 'micStateChange', callback: Callback<MicStateChangeEvent>): void;
60e41f4b71Sopenharmony_ci}
61e41f4b71Sopenharmony_ci```
62e41f4b71Sopenharmony_ciAfter change:
63e41f4b71Sopenharmony_ci```js
64e41f4b71Sopenharmony_ciinterface AudioVolumeGroupManager {
65e41f4b71Sopenharmony_ci  on(type: 'micStateChange', callback: Callback<MicStateChangeEvent>): void;
66e41f4b71Sopenharmony_ci}
67e41f4b71Sopenharmony_ci```
68e41f4b71Sopenharmony_ci
69e41f4b71Sopenharmony_ci
70e41f4b71Sopenharmony_ci## cl.multimedia.audio.004 Call Mode Change of getVolumeGroups()
71e41f4b71Sopenharmony_ci
72e41f4b71Sopenharmony_ciThe call mode of **getVolumeGroups()** is changed.
73e41f4b71Sopenharmony_ci
74e41f4b71Sopenharmony_ci**Change Impacts**
75e41f4b71Sopenharmony_ci
76e41f4b71Sopenharmony_ciIf the new mode is not used, an error will be reported during compilation.
77e41f4b71Sopenharmony_ci
78e41f4b71Sopenharmony_ci**Key API/Component Changes**
79e41f4b71Sopenharmony_ci
80e41f4b71Sopenharmony_ciBefore change:
81e41f4b71Sopenharmony_ci```js
82e41f4b71Sopenharmony_cigetVolumeGroups(networkId: string, callback:AsyncCallback<VolumeGroupInfos>): void;
83e41f4b71Sopenharmony_cigetVolumeGroups(networkId: string): Promise<VolumeGroupInfos>;
84e41f4b71Sopenharmony_ci```
85e41f4b71Sopenharmony_ciAfter change:
86e41f4b71Sopenharmony_ci```js
87e41f4b71Sopenharmony_cigetVolumeManager(): AudioVolumeManager;
88e41f4b71Sopenharmony_ciinterface AudioVolumeManager{
89e41f4b71Sopenharmony_ci  getVolumeGroupInfos(networkId: string, callback: AsyncCallback<VolumeGroupInfos>): void;
90e41f4b71Sopenharmony_ci  getVolumeGroupInfos(networkId: string): Promise<VolumeGroupInfos>;
91e41f4b71Sopenharmony_ci}
92e41f4b71Sopenharmony_ci```
93e41f4b71Sopenharmony_ci
94e41f4b71Sopenharmony_ci
95e41f4b71Sopenharmony_ci## cl.multimedia.audio.005 Call Mode Change of getGroupManager()
96e41f4b71Sopenharmony_ci
97e41f4b71Sopenharmony_ciThe call mode of **getGroupManager()** is changed.
98e41f4b71Sopenharmony_ci
99e41f4b71Sopenharmony_ci**Change Impacts**
100e41f4b71Sopenharmony_ci
101e41f4b71Sopenharmony_ciIf the new mode is not used, an error will be reported during compilation.
102e41f4b71Sopenharmony_ci
103e41f4b71Sopenharmony_ci**Key API/Component Changes**
104e41f4b71Sopenharmony_ci
105e41f4b71Sopenharmony_ciBefore change:
106e41f4b71Sopenharmony_ci```js
107e41f4b71Sopenharmony_cigetGroupManager(groupId: number, callback: AsyncCallback<AudioGroupManager>): void;
108e41f4b71Sopenharmony_cigetGroupManager(groupId: number): Promise<AudioGroupManager>;
109e41f4b71Sopenharmony_ci```
110e41f4b71Sopenharmony_ciAfter change:
111e41f4b71Sopenharmony_ci```js
112e41f4b71Sopenharmony_cigetVolumeManager(): AudioVolumeManager;
113e41f4b71Sopenharmony_ciinterface AudioVolumeManager{
114e41f4b71Sopenharmony_ci  getVolumeGroupManager(groupId: number, callback: AsyncCallback<AudioVolumeGroupManager>): void;
115e41f4b71Sopenharmony_ci  getVolumeGroupManager(groupId: number): Promise<AudioVolumeGroupManager>;
116e41f4b71Sopenharmony_ci}
117e41f4b71Sopenharmony_ci```
118e41f4b71Sopenharmony_ci
119e41f4b71Sopenharmony_ci
120e41f4b71Sopenharmony_ci## cl.multimedia.audio.006 FocusType Member Name Change
121e41f4b71Sopenharmony_ci
122e41f4b71Sopenharmony_ci**FOCUS_TYPE_RECORDING** of **FocusType** is renamed as **FOCUS_TYPE_DEFAULT**.
123e41f4b71Sopenharmony_ci
124e41f4b71Sopenharmony_ci**Change Impacts**
125e41f4b71Sopenharmony_ci
126e41f4b71Sopenharmony_ciIf the new name is not used, an error will be reported during compilation.
127e41f4b71Sopenharmony_ci
128e41f4b71Sopenharmony_ci**Key API/Component Changes**
129e41f4b71Sopenharmony_ci
130e41f4b71Sopenharmony_ciBefore change:
131e41f4b71Sopenharmony_ci```js
132e41f4b71Sopenharmony_cienum FocusType {
133e41f4b71Sopenharmony_ci  FOCUS_TYPE_RECORDING = 0,
134e41f4b71Sopenharmony_ci}
135e41f4b71Sopenharmony_ci```
136e41f4b71Sopenharmony_ciAfter change:
137e41f4b71Sopenharmony_ci```js
138e41f4b71Sopenharmony_cienum InterruptRequestType {
139e41f4b71Sopenharmony_ci  INTERRUPT_REQUEST_TYPE_DEFAULT = 0,
140e41f4b71Sopenharmony_ci}
141e41f4b71Sopenharmony_ci```
142e41f4b71Sopenharmony_ci
143e41f4b71Sopenharmony_ci
144e41f4b71Sopenharmony_ci## cl.multimedia.audio.007 Listener Registration Name Change of interrupt
145e41f4b71Sopenharmony_ci
146e41f4b71Sopenharmony_ciThe listener registration name of **interrupt** of the **on()** function in **AudioRenderer** is changed.
147e41f4b71Sopenharmony_ci
148e41f4b71Sopenharmony_ci**Change Impacts**
149e41f4b71Sopenharmony_ci
150e41f4b71Sopenharmony_ciIf the new name is not used, an error will be reported during compilation.
151e41f4b71Sopenharmony_ci
152e41f4b71Sopenharmony_ci**Key API/Component Changes**
153e41f4b71Sopenharmony_ci
154e41f4b71Sopenharmony_ciBefore change:
155e41f4b71Sopenharmony_ci```js
156e41f4b71Sopenharmony_ciinterface AudioRenderer {
157e41f4b71Sopenharmony_ci    on(type: 'interrupt', callback: Callback<InterruptEvent>): void;
158e41f4b71Sopenharmony_ci}
159e41f4b71Sopenharmony_ci```
160e41f4b71Sopenharmony_ciAfter change:
161e41f4b71Sopenharmony_ci```js
162e41f4b71Sopenharmony_ciinterface AudioRenderer {
163e41f4b71Sopenharmony_ci    on(type: 'audioInterrupt', callback: Callback<InterruptEvent>): void;
164e41f4b71Sopenharmony_ci}
165e41f4b71Sopenharmony_ci```
166e41f4b71Sopenharmony_ci
167e41f4b71Sopenharmony_ci
168e41f4b71Sopenharmony_ci## cl.multimedia.media.001 Change of VideoRecorder APIs to System APIs
169e41f4b71Sopenharmony_ci
170e41f4b71Sopenharmony_ciIn the MR version, the formal **AVRecorder** APIs (integrating audio and video) will be provided for external use.
171e41f4b71Sopenharmony_ci**VideoRecorder** APIs in API version 9 are changed to system APIs, which are available only to system users. In the future, **VideoRecorder** APIs will be deprecated after system users switch to **AVRecorder**.
172e41f4b71Sopenharmony_ci
173e41f4b71Sopenharmony_ci**Change Impacts**
174e41f4b71Sopenharmony_ci
175e41f4b71Sopenharmony_ciIf the **VideoRecorder** caller is not a system user, the call will fail.
176e41f4b71Sopenharmony_ci
177e41f4b71Sopenharmony_ciInvolved APIs and enumerations:
178e41f4b71Sopenharmony_ci
179e41f4b71Sopenharmony_cifunction createVideoRecorder(callback: AsyncCallback<VideoRecorder>): void;
180e41f4b71Sopenharmony_ci
181e41f4b71Sopenharmony_cifunction createVideoRecorder(): Promise<VideoRecorder>;
182e41f4b71Sopenharmony_ci
183e41f4b71Sopenharmony_citype VideoRecordState = 'idle' | 'prepared' | 'playing' | 'paused' | 'stopped' | 'error';
184e41f4b71Sopenharmony_ci
185e41f4b71Sopenharmony_ciinterface VideoRecorder{
186e41f4b71Sopenharmony_ci
187e41f4b71Sopenharmony_ci​    prepare(config: VideoRecorderConfig, callback: AsyncCallback<void>): void;
188e41f4b71Sopenharmony_ci
189e41f4b71Sopenharmony_ci​    prepare(config: VideoRecorderConfig): Promise<void>;
190e41f4b71Sopenharmony_ci
191e41f4b71Sopenharmony_ci​    getInputSurface(callback: AsyncCallback<string>): void;
192e41f4b71Sopenharmony_ci
193e41f4b71Sopenharmony_ci​    getInputSurface(): Promise<string>;
194e41f4b71Sopenharmony_ci
195e41f4b71Sopenharmony_ci​    start(callback: AsyncCallback<void>): void;
196e41f4b71Sopenharmony_ci
197e41f4b71Sopenharmony_ci​    start(): Promise<void>;
198e41f4b71Sopenharmony_ci
199e41f4b71Sopenharmony_ci​    pause(callback: AsyncCallback<void>): void;
200e41f4b71Sopenharmony_ci
201e41f4b71Sopenharmony_ci​    pause(): Promise<void>;
202e41f4b71Sopenharmony_ci
203e41f4b71Sopenharmony_ci​    resume(callback: AsyncCallback<void>): void;
204e41f4b71Sopenharmony_ci
205e41f4b71Sopenharmony_ci​    resume(): Promise<void>;
206e41f4b71Sopenharmony_ci
207e41f4b71Sopenharmony_ci​    stop(callback: AsyncCallback<void>): void;
208e41f4b71Sopenharmony_ci
209e41f4b71Sopenharmony_ci​    stop(): Promise<void>;
210e41f4b71Sopenharmony_ci
211e41f4b71Sopenharmony_ci​    release(callback: AsyncCallback<void>): void;
212e41f4b71Sopenharmony_ci
213e41f4b71Sopenharmony_ci​    release(): Promise<void>;
214e41f4b71Sopenharmony_ci
215e41f4b71Sopenharmony_ci​    reset(callback: AsyncCallback<void>): void;
216e41f4b71Sopenharmony_ci
217e41f4b71Sopenharmony_ci​    reset(): Promise<void>;
218e41f4b71Sopenharmony_ci
219e41f4b71Sopenharmony_ci​    on(type: 'error', callback: ErrorCallback): void;
220e41f4b71Sopenharmony_ci
221e41f4b71Sopenharmony_ci​    readonly state: VideoRecordState;
222e41f4b71Sopenharmony_ci
223e41f4b71Sopenharmony_ci}
224e41f4b71Sopenharmony_ci
225e41f4b71Sopenharmony_ciinterface VideoRecorderProfile {
226e41f4b71Sopenharmony_ci
227e41f4b71Sopenharmony_ci​    readonly audioBitrate: number;
228e41f4b71Sopenharmony_ci
229e41f4b71Sopenharmony_ci​    readonly audioChannels: number;
230e41f4b71Sopenharmony_ci
231e41f4b71Sopenharmony_ci​    readonly audioCodec: CodecMimeType;
232e41f4b71Sopenharmony_ci
233e41f4b71Sopenharmony_ci​    readonly audioSampleRate: number;
234e41f4b71Sopenharmony_ci
235e41f4b71Sopenharmony_ci​    readonly fileFormat: ContainerFormatType;
236e41f4b71Sopenharmony_ci
237e41f4b71Sopenharmony_ci​    readonly videoBitrate: number;
238e41f4b71Sopenharmony_ci
239e41f4b71Sopenharmony_ci​    readonly videoCodec: CodecMimeType;
240e41f4b71Sopenharmony_ci
241e41f4b71Sopenharmony_ci​    readonly videoFrameWidth: number;
242e41f4b71Sopenharmony_ci
243e41f4b71Sopenharmony_ci​    readonly videoFrameHeight: number;
244e41f4b71Sopenharmony_ci
245e41f4b71Sopenharmony_ci​    readonly videoFrameRate: number; 
246e41f4b71Sopenharmony_ci
247e41f4b71Sopenharmony_ci}
248e41f4b71Sopenharmony_ci
249e41f4b71Sopenharmony_cienum AudioSourceType {
250e41f4b71Sopenharmony_ci
251e41f4b71Sopenharmony_ci​    AUDIO_SOURCE_TYPE_DEFAULT = 0,
252e41f4b71Sopenharmony_ci
253e41f4b71Sopenharmony_ci​    AUDIO_SOURCE_TYPE_MIC = 1,
254e41f4b71Sopenharmony_ci
255e41f4b71Sopenharmony_ci}
256e41f4b71Sopenharmony_ci
257e41f4b71Sopenharmony_cienum VideoSourceType {
258e41f4b71Sopenharmony_ci
259e41f4b71Sopenharmony_ci​    VIDEO_SOURCE_TYPE_SURFACE_YUV = 0,
260e41f4b71Sopenharmony_ci
261e41f4b71Sopenharmony_ci​    VIDEO_SOURCE_TYPE_SURFACE_ES = 1,
262e41f4b71Sopenharmony_ci
263e41f4b71Sopenharmony_ci}
264e41f4b71Sopenharmony_ci
265e41f4b71Sopenharmony_cienum VideoRecorderConfig {
266e41f4b71Sopenharmony_ci
267e41f4b71Sopenharmony_ci​    audioSourceType?: AudioSourceType;
268e41f4b71Sopenharmony_ci
269e41f4b71Sopenharmony_ci​    videoSourceType: VideoSourceType;
270e41f4b71Sopenharmony_ci
271e41f4b71Sopenharmony_ci​    profile: VideoRecorderProfile;
272e41f4b71Sopenharmony_ci
273e41f4b71Sopenharmony_ci​    url: string;
274e41f4b71Sopenharmony_ci
275e41f4b71Sopenharmony_ci​    rotation?: number;
276e41f4b71Sopenharmony_ci
277e41f4b71Sopenharmony_ci​    location?: Location;
278e41f4b71Sopenharmony_ci
279e41f4b71Sopenharmony_ci}
280e41f4b71Sopenharmony_ci
281e41f4b71Sopenharmony_ci## cl.multimedia.media.002 No Externally Provided Bit Rate Selection API in VideoPlayer
282e41f4b71Sopenharmony_ci
283e41f4b71Sopenharmony_ciIn API version 9, **VideoPlayer** does not externally provide the bit rate selection API. Such an API will be provided by **AVPlayer** in the MR version.
284e41f4b71Sopenharmony_ci
285e41f4b71Sopenharmony_ci**Change Impacts**
286e41f4b71Sopenharmony_ci
287e41f4b71Sopenharmony_ciBit rate selection cannot be performed in the multi-bit rate scenario of **VideoPlayer**. Relevant functions will be provided by **AVPlayer**.
288e41f4b71Sopenharmony_ci
289e41f4b71Sopenharmony_ci**Key API/Component Changes**
290e41f4b71Sopenharmony_ci
291e41f4b71Sopenharmony_ciDeleted APIs:
292e41f4b71Sopenharmony_ci
293e41f4b71Sopenharmony_ciinterface VideoPlayer {
294e41f4b71Sopenharmony_ci
295e41f4b71Sopenharmony_ci​    selectBitrate(bitrate: number): Promise<number>;
296e41f4b71Sopenharmony_ci
297e41f4b71Sopenharmony_ci​    selectBitrate(bitrate: number, callback: AsyncCallback<number>): void;
298e41f4b71Sopenharmony_ci
299e41f4b71Sopenharmony_ci​    on(type: 'availableBitratesCollect', callback: (bitrates: Array<number>) => void): void;
300e41f4b71Sopenharmony_ci
301e41f4b71Sopenharmony_ci}
302e41f4b71Sopenharmony_ci
303e41f4b71Sopenharmony_ci## cl.multimedia.media.003 Error Information Change of VideoRecorder
304e41f4b71Sopenharmony_ci
305e41f4b71Sopenharmony_ciOriginal error codes of **VideoRecorder** are changed because they do not comply with the error code specifications.
306e41f4b71Sopenharmony_ci
307e41f4b71Sopenharmony_ci**Change Impacts**
308e41f4b71Sopenharmony_ci
309e41f4b71Sopenharmony_ciError codes returned from **VideoRecorder** are changed.
310e41f4b71Sopenharmony_ci
311e41f4b71Sopenharmony_ci**Key API/Component Changes**
312e41f4b71Sopenharmony_ci
313e41f4b71Sopenharmony_ci**VideoRecorder** APIs remain unchanged, but the returned error codes are changed.
314e41f4b71Sopenharmony_ci
315e41f4b71Sopenharmony_ci**Adaptation Guide**
316e41f4b71Sopenharmony_ci
317e41f4b71Sopenharmony_ciFor details about exception handling, see the following documents:
318e41f4b71Sopenharmony_ci[Media](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-media.md)
319e41f4b71Sopenharmony_ci[Media Error Codes](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/errorcodes/errorcode-media.md)
320