changelogs-multimedia.md 7.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332
# Multimedia Subsystem Changelog

## cl.multimedia.1 Stream Type Enum Declaration in Audio C APIs Changed

For the audio APIs of API version 10 in C, the audio output stream type is changed from **AUDIOSTREAM_TYPE_RERNDERER** to **AUDIOSTREAM_TYPE_RENDERER**.

**Change Impact**

Applications that use the involved APIs may have compatibility issues.

**Key API/Component Changes**

Before change:

 ```C
enum OH_AudioStream_Type {
    /**
     * The type for audio stream is renderer.
     */
    AUDIOSTREAM_TYPE_RERNDERER = 1,

    /**
     * The type for audio stream is capturer.
     */
    AUDIOSTREAM_TYPE_CAPTURER = 2
};
 ```

After change:

 ```C
enum OH_AudioStream_Type {
    /**
     * The type for audio stream is renderer.
     */
    AUDIOSTREAM_TYPE_RENDERER = 1,

    /**
     * The type for audio stream is capturer.
     */
    AUDIOSTREAM_TYPE_CAPTURER = 2
};
 ```

**Adaptation Guide**

Change **AUDIOSTREAM_TYPE_RERNDERER** to **AUDIOSTREAM_TYPE_RENDERER** in your code. Example:

Before change:

```C
OH_AudioStreamBuilder* builder;
OH_AudioStreamBuilder_Create(&builder, AUDIOSTREAM_TYPE_RERNDERER);
```

After change:

```C
OH_AudioStreamBuilder* builder;
OH_AudioStreamBuilder_Create(&builder, AUDIOSTREAM_TYPE_RENDERER);
```

## cl.multimedia.2 OH_AudioStream_Content Removed

For the audio APIs of API version 10 in C, **OH_AudioStream_Content** is removed for the audio output stream attributes.

**Change Impact**

Applications that use the involved APIs may have compatibility issues.

**Key API/Component Changes**

- In the **native_audiostream_base.h** file

  Before change:

  ```C
  typedef enum {
      AUDIOSTREAM_CONTENT_TYPE_UNKNOWN = 0,
      AUDIOSTREAM_CONTENT_TYPE_SPEECH = 1,
      AUDIOSTREAM_CONTENT_TYPE_MUSIC = 2,
      AUDIOSTREAM_CONTENT_TYPE_MOVIE = 3,
  } OH_AudioStream_Content;
  ```

  After change: **OH_AudioStream_Content** is removed.

- In the **native_audiostreambuilder.h** file

  Before change:

  ```C
  OH_AudioStream_Result OH_AudioStreamBuilder_SetRendererInfo(OH_AudioStreamBuilder* builder,
      OH_AudioStream_Usage usage, OH_AudioStream_Content content);
  ```

  After change:

  ```C
  OH_AudioStream_Result OH_AudioStreamBuilder_SetRendererInfo(OH_AudioStreamBuilder* builder,
      OH_AudioStream_Usage usage);
  ```

- In the **native_audiorenderer.h** file

  Before change:

  ```C
  OH_AudioStream_Result OH_AudioRenderer_GetRendererInfo(OH_AudioRenderer* renderer,
      OH_AudioStream_Usage* usage, OH_AudioStream_Content* content);
  ```

  After change:

  ```C
  OH_AudioStream_Result OH_AudioRenderer_GetRendererInfo(OH_AudioRenderer* renderer,
      OH_AudioStream_Usage* usage);
  ```

**Adaptation Guide**

When 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.

| OH_AudioStream_Content          | OH_AudioStream_Usage                  |
| ------------------------------- | ------------------------------------- |
| AUDIOSTREAM_CONTENT_TYPE_SPEECH | AUDIOSTREAM_USAGE_VOICE_COMMUNICATION |
| AUDIOSTREAM_CONTENT_TYPE_MUSIC  | AUDIOSTREAM_USAGE_MUSIC               |
| AUDIOSTREAM_CONTENT_TYPE_MOVIE  | AUDIOSTREAM_USAGE_MOVIE               |

**OH_AudioRenderer_GetRendererInfo** can be used to obtain the **OH_AudioStream_Usage** attribute but not the **OH_AudioStream_Content** attribute.

## cl.multimedia.3 OH_AudioStream_Usage Changed

In 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**.

**Change Impact**

Applications that use the involved APIs may have compatibility issues.  

**Key API/Component Changes**

Before change:

```C
typedef enum {
    AUDIOSTREAM_USAGE_UNKNOWN = 0,
    AUDIOSTREAM_USAGE_MEDIA = 1,
    AUDIOSTREAM_USAGE_COMMUNICATION = 2,
} OH_AudioStream_Usage;
```

After change:
```C
typedef enum {
    /**
     * Unknown usage.
     */
    AUDIOSTREAM_USAGE_UNKNOWN = 0,
    /**
     * Music usage.
     */
    AUDIOSTREAM_USAGE_MUSIC = 1,
    /**
     * Voice communication usage.
     */
    AUDIOSTREAM_USAGE_VOICE_COMMUNICATION = 2,
    /**
     * Voice assistant usage.
     */
    AUDIOSTREAM_USAGE_VOICE_ASSISTANT = 3,
    /**
     * Movie or video usage.
     */
    AUDIOSTREAM_USAGE_MOVIE = 10,

} OH_AudioStream_Usage;
```

**Adaptation Guide**

When using **OH_AudioStreamBuilder_SetRendererInfo**, set **OH_AudioStream_Usage** to **AUDIOSTREAM_USAGE_MUSIC** or **AUDIOSTREAM_USAGE_MOVIE**, rather than **AUDIOSTREAM_USAGE_MEDIA**.

Before change:

```C
OH_AudioStreamBuilder_SetRendererInfo(builder, AUDIOSTREAM_USAGE_MEDIA);
```

After change:

```C
OH_AudioStreamBuilder_SetRendererInfo(builder, AUDIOSTREAM_USAGE_MUSIC); // Music scene
```

Or:

```C
OH_AudioStreamBuilder_SetRendererInfo(builder, AUDIOSTREAM_USAGE_MOVIE); // Video scene
```

When using **OH_AudioStreamBuilder_SetRendererInfo**, set **OH_AudioStream_Usage** to **AUDIOSTREAM_USAGE_VOICE_COMMUNICATION** or **AUDIOSTREAM_USAGE_VOICE_ASSISTANT**, rather than **AUDIOSTREAM_USAGE_COMMUNICATION**.

Before change:

```C
OH_AudioStreamBuilder_SetRendererInfo(builder, AUDIOSTREAM_USAGE_COMMUNICATION);
```

After change:

```C
OH_AudioStreamBuilder_SetRendererInfo(builder, AUDIOSTREAM_USAGE_VOICE_COMMUNICATION); // Communication scene
```

Or:

```C
OH_AudioStreamBuilder_SetRendererInfo(builder, AUDIOSTREAM_USAGE_VOICE_ASSISTANT); // Voice assistant scene
```

## cl.multimedia.4 AUDIOSTREAM_SAMPLE_F32LE Deleted for **OH_AudioStream_SampleFormat**

In 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.

**Change Impact**

Applications that use the involved APIs may have compatibility issues.

**Key API/Component Changes**

Before change:

```C
typedef enum {
    AUDIOSTREAM_SAMPLE_U8 = 0,
    AUDIOSTREAM_SAMPLE_S16LE = 1,
    AUDIOSTREAM_SAMPLE_S24LE = 2,
    AUDIOSTREAM_SAMPLE_S32LE = 3,
    AUDIOSTREAM_SAMPLE_F32LE = 4,
} OH_AudioStream_SampleFormat;
```

After change:
```C
typedef enum {
    /**
     * Unsigned 8 format.
     */
    AUDIOSTREAM_SAMPLE_U8 = 0,
    /**
     * Signed 16 bit integer, little endian.
     */
    AUDIOSTREAM_SAMPLE_S16LE = 1,
    /**
     * Signed 24 bit integer, little endian.
     */
    AUDIOSTREAM_SAMPLE_S24LE = 2,
    /**
     * Signed 32 bit integer, little endian.
     */
    AUDIOSTREAM_SAMPLE_S32LE = 3,
} OH_AudioStream_SampleFormat;
```

**Adaptation Guide**

Do not use **AUDIOSTREAM_SAMPLE_F32LE** for **OH_AudioStream_SampleFormat**.

## cl.multimedia.5 Enumerated Values Added for OH_AudioStream_Result

In 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.

**Change Impact**

None.

**Key API/Component Changes**

Before change:

```C
typedef enum {
    /**
     * The call was successful.
     */
    AUDIOSTREAM_SUCCESS,

    /**
     * This means that the function was executed with an invalid input parameter.
     */
    AUDIOSTREAM_ERROR_INVALID_PARAM,

    /**
     * Execution status exception.
     */
    AUDIOSTREAM_ERROR_ILLEGAL_STATE,

    /**
     * An system error has occurred.
     */
    AUDIOSTREAM_ERROR_SYSTEM
} OH_AudioStream_Result;
```

After change:
```C
typedef enum {
    /**
     * The call was successful.
     */
    AUDIOSTREAM_SUCCESS = 0,

    /**
     * This means that the function was executed with an invalid input parameter.
     */
    AUDIOSTREAM_ERROR_INVALID_PARAM = 1,

    /**
     * Execution status exception.
     */
    AUDIOSTREAM_ERROR_ILLEGAL_STATE = 2,

    /**
     * An system error has occurred.
     */
    AUDIOSTREAM_ERROR_SYSTEM = 3
} OH_AudioStream_Result;
```

**Adaptation Guide**

No adaptation is required.