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