1e41f4b71Sopenharmony_ci# Media Subsystem Changelog 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci## cl.multimedia.1 OH_AVPlayerOnError Deprecated 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci**Access Level** 6e41f4b71Sopenharmony_ci 7e41f4b71Sopenharmony_ciPublic API 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ci**Reason for Change** 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ciThe NDK interface is optimized, and the **userData** parameter is added to the callback. 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ci**Change Impact** 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ciThis change is a non-compatible change. 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ciBefore change: Applications call **OH_AVPlayerOnError** to receive errors through a callback. 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ciAfter change: Applications call **OH_AVPlayerOnErrorCallback** to receive errors through a callback. 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ci**Start API Level** 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ci11 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ci**Change Since** 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ciOpenHarmony SDK 5.0.0.38 28e41f4b71Sopenharmony_ci 29e41f4b71Sopenharmony_ci**Adaptation Guide** 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ciRefer to the following example of **OH_AVPlayerOnErrorCallback** for adaptation. 32e41f4b71Sopenharmony_ci``` 33e41f4b71Sopenharmony_cistruct MyPlayer 34e41f4b71Sopenharmony_ci{ 35e41f4b71Sopenharmony_ci const char* url; 36e41f4b71Sopenharmony_ci int32_t errorCode; 37e41f4b71Sopenharmony_ci} 38e41f4b71Sopenharmony_ci 39e41f4b71Sopenharmony_civoid PlayerErrorCallback(OH_AVPlayer *player, int32_t errorCode, const char *errorMsg, void *userData) 40e41f4b71Sopenharmony_ci{ 41e41f4b71Sopenharmony_ci MyPlayer* myPlayer = (MyPlayer*)userData; 42e41f4b71Sopenharmony_ci myPlayer->errorCode = errorCode; 43e41f4b71Sopenharmony_ci} 44e41f4b71Sopenharmony_ci 45e41f4b71Sopenharmony_civoid PlayerInfoCallback(OH_AVPlayer *player, AVPlayerOnInfoType type, OH_AVFormat* infoBody, void *userData) 46e41f4b71Sopenharmony_ci{ 47e41f4b71Sopenharmony_ci if (type == AV_INFO_TYPE_STATE_CHANGE) { 48e41f4b71Sopenharmony_ci int32_t state, reason; 49e41f4b71Sopenharmony_ci OH_AVFormat_GetIntValue(infoBody, OH_PLAYER_STATE, &state); 50e41f4b71Sopenharmony_ci OH_AVFormat_GetIntValue(infoBody, OH_PLAYER_STATE_CHANGED_REASON, &reason); 51e41f4b71Sopenharmony_ci // use state reason 52e41f4b71Sopenharmony_ci } 53e41f4b71Sopenharmony_ci} 54e41f4b71Sopenharmony_ci 55e41f4b71Sopenharmony_ciint main() 56e41f4b71Sopenharmony_ci{ 57e41f4b71Sopenharmony_ci MyPlayer myPlayer; 58e41f4b71Sopenharmony_ci myPlayer.url = "http://localhost/test.mp4"; 59e41f4b71Sopenharmony_ci OH_AVPlayer* player = OH_AVPlayer_Create(); 60e41f4b71Sopenharmony_ci OH_AVPlayer_SetOnErrorCallback(player, PlayerErrorCallback, &myPlayer); 61e41f4b71Sopenharmony_ci OH_AVPlayer_SetOnInfoCallback(player, PlayerInfoCallback, &myPlayer); 62e41f4b71Sopenharmony_ci OH_AVPlayer_SetURLSource(player, myPlayer.url); 63e41f4b71Sopenharmony_ci OH_AVPlayer_Prepare(player); 64e41f4b71Sopenharmony_ci OH_AVPlayer_Play(player); 65e41f4b71Sopenharmony_ci Sleep(10000); 66e41f4b71Sopenharmony_ci OH_AVPlayer_Stop(player); 67e41f4b71Sopenharmony_ci OH_AVPlayer_Release(player); 68e41f4b71Sopenharmony_ci} 69e41f4b71Sopenharmony_ci 70e41f4b71Sopenharmony_ci``` 71e41f4b71Sopenharmony_ci## cl.multimedia.2 OH_AVPlayerOnInfo Deprecated 72e41f4b71Sopenharmony_ci 73e41f4b71Sopenharmony_ci**Access Level** 74e41f4b71Sopenharmony_ci 75e41f4b71Sopenharmony_ciPublic API 76e41f4b71Sopenharmony_ci 77e41f4b71Sopenharmony_ci**Reason for Change** 78e41f4b71Sopenharmony_ci 79e41f4b71Sopenharmony_ciThe original callback can pass only **extra** of the int32_t type. Some information, such as the width, height, and available bit rate array, cannot be reported. A new callback is introduced to report **infoBody** of the OH_AVFormat type. More information now can be passed. 80e41f4b71Sopenharmony_ci 81e41f4b71Sopenharmony_ci**Change Impact** 82e41f4b71Sopenharmony_ci 83e41f4b71Sopenharmony_ciThis change is a non-compatible change. 84e41f4b71Sopenharmony_ci 85e41f4b71Sopenharmony_ciBefore change: Applications call **OH_AVPlayerOnInfo** to receive information through a callback. 86e41f4b71Sopenharmony_ci 87e41f4b71Sopenharmony_ciAfter change: Applications call **OH_AVPlayerOnInfoCallback** to receive information through a callback. 88e41f4b71Sopenharmony_ci 89e41f4b71Sopenharmony_ci**Start API Level** 90e41f4b71Sopenharmony_ci 91e41f4b71Sopenharmony_ci11 92e41f4b71Sopenharmony_ci 93e41f4b71Sopenharmony_ci**Change Since** 94e41f4b71Sopenharmony_ci 95e41f4b71Sopenharmony_ciOpenHarmony SDK 5.0.0.38 96e41f4b71Sopenharmony_ci 97e41f4b71Sopenharmony_ci**Adaptation Guide** 98e41f4b71Sopenharmony_ci 99e41f4b71Sopenharmony_ciUse **OH_AVPlayerOnInfoCallback** and **OH_AVPlayer_SetOnInfoCallback** to replace the original information callback. 100e41f4b71Sopenharmony_ci 101e41f4b71Sopenharmony_ciFor details about the sample code, see **Adaptation Guide** in [OH_AVPlayerOnError Deprecated](#clmultimedia1-oh_avplayeronerror-deprecated). 102e41f4b71Sopenharmony_ci 103e41f4b71Sopenharmony_ci## cl.multimedia.3 AVPlayerCallback Deprecated 104e41f4b71Sopenharmony_ci 105e41f4b71Sopenharmony_ci**Access Level** 106e41f4b71Sopenharmony_ci 107e41f4b71Sopenharmony_ciPublic API 108e41f4b71Sopenharmony_ci 109e41f4b71Sopenharmony_ci**Reason for Change** 110e41f4b71Sopenharmony_ci 111e41f4b71Sopenharmony_ciFor **AVPlayerCallback**, its two members (**OH_AVPlayerOnInfo** and **OH_AVPlayerOnError**) are deprecated. Therefore, **AVPlayerCallback** is no longer needed. 112e41f4b71Sopenharmony_ci 113e41f4b71Sopenharmony_ci**Change Impact** 114e41f4b71Sopenharmony_ci 115e41f4b71Sopenharmony_ciThis change is a non-compatible change. 116e41f4b71Sopenharmony_ci 117e41f4b71Sopenharmony_ciBefore change: Applications use **OH_AVPlayerOnInfo**, **OH_AVPlayerOnError**, **AVPlayerCallback**, and **OH_AVPlayer_SetPlayerCallback** to receive information and errors through callbacks. 118e41f4b71Sopenharmony_ci 119e41f4b71Sopenharmony_ciAfter change: Applications use **OH_AVPlayerOnInfoCallback**, **OH_AVPlayerOnErrorCallback**, **OH_AVPlayer_SetOnInfoCallback**, and **OH_AVPlayer_SetOnErrorCallback** to receive information and errors through callbacks. 120e41f4b71Sopenharmony_ci 121e41f4b71Sopenharmony_ci**Start API Level** 122e41f4b71Sopenharmony_ci 123e41f4b71Sopenharmony_ci11 124e41f4b71Sopenharmony_ci 125e41f4b71Sopenharmony_ci**Change Since** 126e41f4b71Sopenharmony_ci 127e41f4b71Sopenharmony_ciOpenHarmony SDK 5.0.0.38 128e41f4b71Sopenharmony_ci 129e41f4b71Sopenharmony_ci**Adaptation Guide** 130e41f4b71Sopenharmony_ci 131e41f4b71Sopenharmony_ciUse **OH_AVPlayerOnInfoCallback** and **OH_AVPlayer_SetOnInfoCallback** to replace the original information callbacks. 132e41f4b71Sopenharmony_ci 133e41f4b71Sopenharmony_ciFor details about the sample code, see **Adaptation Guide** in [OH_AVPlayerOnError Deprecated](#clmultimedia1-oh_avplayeronerror-deprecated). 134e41f4b71Sopenharmony_ci 135e41f4b71Sopenharmony_ci## cl.multimedia.4 OH_AVPlayer_SetPlayerCallback Deprecated 136e41f4b71Sopenharmony_ci 137e41f4b71Sopenharmony_ci**Access Level** 138e41f4b71Sopenharmony_ci 139e41f4b71Sopenharmony_ciPublic API 140e41f4b71Sopenharmony_ci 141e41f4b71Sopenharmony_ci**Reason for Change** 142e41f4b71Sopenharmony_ci 143e41f4b71Sopenharmony_ciThe original callback can pass only **extra** of the int32_t type. Some information, such as the width, height, and available bit rate array, cannot be reported. A new callback is introduced to report **infoBody** of the OH_AVFormat type. More information now can be passed. 144e41f4b71Sopenharmony_ci 145e41f4b71Sopenharmony_ci**OH_AVPlayerOnInfo**, **OH_AVPlayerOnError**, and **AVPlayerCallback** are deprecated, and therefore **OH_AVPlayer_SetPlayerCallback** is no longer needed. 146e41f4b71Sopenharmony_ci 147e41f4b71Sopenharmony_ci**Change Impact** 148e41f4b71Sopenharmony_ci 149e41f4b71Sopenharmony_ciThis change is a non-compatible change. 150e41f4b71Sopenharmony_ci 151e41f4b71Sopenharmony_ciBefore change: Applications use **OH_AVPlayerOnInfo**, **OH_AVPlayerOnError**, **AVPlayerCallback**, and **OH_AVPlayer_SetPlayerCallback** to receive information and errors. 152e41f4b71Sopenharmony_ci 153e41f4b71Sopenharmony_ciAfter change: Applications use **OH_AVPlayerOnInfoCallback**, **OH_AVPlayerOnErrorCallback**, **OH_AVPlayer_SetOnInfoCallback**, and **OH_AVPlayer_SetOnErrorCallback** to receive information and errors. 154e41f4b71Sopenharmony_ci 155e41f4b71Sopenharmony_ci**Start API Level** 156e41f4b71Sopenharmony_ci 157e41f4b71Sopenharmony_ci11 158e41f4b71Sopenharmony_ci 159e41f4b71Sopenharmony_ci**Change Since** 160e41f4b71Sopenharmony_ci 161e41f4b71Sopenharmony_ciOpenHarmony SDK 5.0.0.38 162e41f4b71Sopenharmony_ci 163e41f4b71Sopenharmony_ci**Adaptation Guide** 164e41f4b71Sopenharmony_ci 165e41f4b71Sopenharmony_ciUse **OH_AVPlayerOnInfoCallback** and **OH_AVPlayer_SetOnInfoCallback** to replace the original information callbacks. 166e41f4b71Sopenharmony_ci 167e41f4b71Sopenharmony_ciFor details about the sample code, see **Adaptation Guide** in [OH_AVPlayerOnError Deprecated](#clmultimedia1-oh_avplayeronerror-deprecated). 168e41f4b71Sopenharmony_ci 169e41f4b71Sopenharmony_ci## cl.multimedia.5 Event Names in ProfessionalPhotoSession.on/off Changed 170e41f4b71Sopenharmony_ci 171e41f4b71Sopenharmony_ci**Access Level** 172e41f4b71Sopenharmony_ci 173e41f4b71Sopenharmony_ciSystem API 174e41f4b71Sopenharmony_ci 175e41f4b71Sopenharmony_ci**Reason for Change** 176e41f4b71Sopenharmony_ci 177e41f4b71Sopenharmony_ciThe event names are changed to comply with the HAMS specifications. 178e41f4b71Sopenharmony_ci 179e41f4b71Sopenharmony_ci**Change Impact** 180e41f4b71Sopenharmony_ci 181e41f4b71Sopenharmony_ciThis change is a non-compatible change. 182e41f4b71Sopenharmony_ci 183e41f4b71Sopenharmony_ciIf any of the following event listeners is used in the code, an error is reported during compilation: 184e41f4b71Sopenharmony_ci 185e41f4b71Sopenharmony_cion(type: 'isoInfo', callback: AsyncCallback\<IsoInfo>): void 186e41f4b71Sopenharmony_cioff(type: 'isoInfo', callback?: AsyncCallback\<IsoInfo>): void 187e41f4b71Sopenharmony_cion(type: 'exposureInfo', callback: AsyncCallback\<ExposureInfo>): void 188e41f4b71Sopenharmony_cioff(type: 'exposureInfo', callback?: AsyncCallback\<ExposureInfo>): void 189e41f4b71Sopenharmony_cion(type: 'apertureInfo', callback: AsyncCallback\<ApertureInfo>): void 190e41f4b71Sopenharmony_cioff(type: 'apertureInfo', callback?: AsyncCallback\<ApertureInfo>): void 191e41f4b71Sopenharmony_cion(type: 'luminationInfo', callback: AsyncCallback\<LuminationInfo>): void 192e41f4b71Sopenharmony_cioff(type: 'luminationInfo', callback?: AsyncCallback\<LuminationInfo>): void 193e41f4b71Sopenharmony_ci 194e41f4b71Sopenharmony_ci 195e41f4b71Sopenharmony_ci**Start API Level** 196e41f4b71Sopenharmony_ci 197e41f4b71Sopenharmony_ci12 198e41f4b71Sopenharmony_ci 199e41f4b71Sopenharmony_ci**Change Since** 200e41f4b71Sopenharmony_ci 201e41f4b71Sopenharmony_ciOpenHarmony SDK 5.0.0.38 202e41f4b71Sopenharmony_ci 203e41f4b71Sopenharmony_ci**Key API/Component Changes** 204e41f4b71Sopenharmony_ci 205e41f4b71Sopenharmony_ci| API | Before Change | After Change | 206e41f4b71Sopenharmony_ci| :----------------------------: | :----------------------------------: | :---------------------------: | 207e41f4b71Sopenharmony_ci| on(type: 'isoInfo', callback: AsyncCallback\<IsoInfo>): void | type: 'isoInfo' | type: 'isoInfoChange' | 208e41f4b71Sopenharmony_ci| off(type: 'isoInfo', callback?: AsyncCallback\<IsoInfo>): void | type: 'isoInfo' | type: 'isoInfoChange' | 209e41f4b71Sopenharmony_ci| on(type: 'exposureInfo', callback: AsyncCallback\<ExposureInfo>): void | type: 'exposureInfo' | type: 'exposureInfoChange' | 210e41f4b71Sopenharmony_ci| off(type: 'exposureInfo', callback?: AsyncCallback\<ExposureInfo>): void | type: 'exposureInfo' | type: 'exposureInfoChange' | 211e41f4b71Sopenharmony_ci| on(type: 'apertureInfo', callback: AsyncCallback\<ApertureInfo>): void | type: 'apertureInfo' | type: 'apertureInfoChange' | 212e41f4b71Sopenharmony_ci| off(type: 'apertureInfo', callback?: AsyncCallback\<ApertureInfo>): void | type: 'apertureInfo' | type: 'apertureInfoChange' | 213e41f4b71Sopenharmony_ci| on(type: 'luminationInfo', callback: AsyncCallback\<LuminationInfo>): void | type: 'luminationInfo' | type: 'luminationInfoChange' | 214e41f4b71Sopenharmony_ci| off(type: 'luminationInfo', callback?: AsyncCallback\<LuminationInfo>): void | type: 'luminationInfo' | type: 'luminationInfoChange' | 215e41f4b71Sopenharmony_ci 216e41f4b71Sopenharmony_ci**Adaptation Guide** 217e41f4b71Sopenharmony_ci 218e41f4b71Sopenharmony_ciChange the value of the **type** parameter to adapt to the new event names. 219e41f4b71Sopenharmony_ci 220e41f4b71Sopenharmony_ci## cl.multimedia.6 Event Names in ProfessionalVideoSession.on/off Changed 221e41f4b71Sopenharmony_ci 222e41f4b71Sopenharmony_ci**Access Level** 223e41f4b71Sopenharmony_ci 224e41f4b71Sopenharmony_ciSystem API 225e41f4b71Sopenharmony_ci 226e41f4b71Sopenharmony_ci**Reason for Change** 227e41f4b71Sopenharmony_ci 228e41f4b71Sopenharmony_ciThe event names are changed to comply with the HAMS specifications. 229e41f4b71Sopenharmony_ci 230e41f4b71Sopenharmony_ci**Change Impact** 231e41f4b71Sopenharmony_ci 232e41f4b71Sopenharmony_ciThis change is a non-compatible change. 233e41f4b71Sopenharmony_ci 234e41f4b71Sopenharmony_ciIf any of the following event listeners is used in the code, an error is reported during compilation: 235e41f4b71Sopenharmony_ci 236e41f4b71Sopenharmony_cion(type: 'isoInfo', callback: AsyncCallback\<IsoInfo>): void 237e41f4b71Sopenharmony_cioff(type: 'isoInfo', callback?: AsyncCallback\<IsoInfo>): void 238e41f4b71Sopenharmony_cion(type: 'exposureInfo', callback: AsyncCallback\<ExposureInfo>): void 239e41f4b71Sopenharmony_cioff(type: 'exposureInfo', callback?: AsyncCallback\<ExposureInfo>): void 240e41f4b71Sopenharmony_cion(type: 'apertureInfo', callback: AsyncCallback\<ApertureInfo>): void 241e41f4b71Sopenharmony_cioff(type: 'apertureInfo', callback?: AsyncCallback\<ApertureInfo>): void 242e41f4b71Sopenharmony_cion(type: 'luminationInfo', callback: AsyncCallback\<LuminationInfo>): void 243e41f4b71Sopenharmony_cioff(type: 'luminationInfo', callback?: AsyncCallback\<LuminationInfo>): void 244e41f4b71Sopenharmony_ci 245e41f4b71Sopenharmony_ci 246e41f4b71Sopenharmony_ci**Start API Level** 247e41f4b71Sopenharmony_ci 248e41f4b71Sopenharmony_ci12 249e41f4b71Sopenharmony_ci 250e41f4b71Sopenharmony_ci**Change Since** 251e41f4b71Sopenharmony_ci 252e41f4b71Sopenharmony_ciOpenHarmony SDK 5.0.0.38 253e41f4b71Sopenharmony_ci 254e41f4b71Sopenharmony_ci**Key API/Component Changes** 255e41f4b71Sopenharmony_ci 256e41f4b71Sopenharmony_ci| API | Before Change | After Change | 257e41f4b71Sopenharmony_ci| :----------------------------: | :----------------------------------: | :---------------------------: | 258e41f4b71Sopenharmony_ci| on(type: 'isoInfo', callback: AsyncCallback\<IsoInfo>): void | type: 'isoInfo' | type: 'isoInfoChange' | 259e41f4b71Sopenharmony_ci| off(type: 'isoInfo', callback?: AsyncCallback\<IsoInfo>): void | type: 'isoInfo' | type: 'isoInfoChange' | 260e41f4b71Sopenharmony_ci| on(type: 'exposureInfo', callback: AsyncCallback\<ExposureInfo>): void | type: 'exposureInfo' | type: 'exposureInfoChange' | 261e41f4b71Sopenharmony_ci| off(type: 'exposureInfo', callback?: AsyncCallback\<ExposureInfo>): void | type: 'exposureInfo' | type: 'exposureInfoChange' | 262e41f4b71Sopenharmony_ci| on(type: 'apertureInfo', callback: AsyncCallback\<ApertureInfo>): void | type: 'apertureInfo' | type: 'apertureInfoChange' | 263e41f4b71Sopenharmony_ci| off(type: 'apertureInfo', callback?: AsyncCallback\<ApertureInfo>): void | type: 'apertureInfo' | type: 'apertureInfoChange' | 264e41f4b71Sopenharmony_ci| on(type: 'luminationInfo', callback: AsyncCallback\<LuminationInfo>): void | type: 'luminationInfo' | type: 'luminationInfoChange' | 265e41f4b71Sopenharmony_ci| off(type: 'luminationInfo', callback?: AsyncCallback\<LuminationInfo>): void | type: 'luminationInfo' | type: 'luminationInfoChange' | 266e41f4b71Sopenharmony_ci 267e41f4b71Sopenharmony_ci**Adaptation Guide** 268e41f4b71Sopenharmony_ci 269e41f4b71Sopenharmony_ciChange the value of the **type** parameter to adapt to the new event names. 270