1# Multimedia Subsystem ChangeLog 2 3Compared with OpenHarmony 3.2 Beta4, OpenHarmony3.2.10.3 has the following changes in APIs of the camera component in the multimedia subsystem. 4 5## cl.subsystemname.1 Camera API Changed 61. All the APIs of the camera component are changed to system APIs in the API version 9. 72. Some functional APIs are added and some others are deprecated to: 8 9- Improve the usability of camera APIs. 10- Help you quickly understand camera APIs and use them for development. 11- Facilitate expansion of framework functions in later versions, and reduce coupling between framework modules. 12 13You need to refer to the following change description to adapt your application. 14 15**Change Impacts** 16 17JS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement features in the SDK environment of the new version. 18 19**Key API/Component Changes** 20 21| Module | Class | Method/Attribute/Enum/Constant | Is System API| Change Type| 22| ---------------------- | ----------------------- | ------------------------------------------------------------ | --------------- | -------- | 23| ohos.multimedia.camera | camera | function getCameraManager(context: Context): CameraManager; | Yes | Added | 24| ohos.multimedia.camera | camera | function getCameraManager(context: Context, callback: AsyncCallback<CameraManager>): void;<br>function getCameraManager(context: Context): Promise<CameraManager>; | Yes | Deprecated | 25| ohos.multimedia.camera | CameraErrorCode | INVALID_ARGUMENT = 7400101,<br>OPERATION_NOT_ALLOWED = 7400102,<br>SESSION_NOT_CONFIG = 7400103,<br>SESSION_NOT_RUNNING = 7400104,<br>SESSION_CONFIG_LOCKED = 7400105,<br>DEVICE_SETTING_LOCKED = 7400106,<br>CONFILICT_CAMERA = 7400107,<br>DEVICE_DISABLED = 7400108,<br>SERVICE_FATAL_ERROR = 7400201 | Yes | Added | 26| ohos.multimedia.camera | CameraManager | getSupportedCameras(): Array<CameraDevice>;<br>getSupportedOutputCapability(camera: CameraDevice): CameraOutputCapability;<br>createCameraInput(camera: CameraDevice): CameraInput;<br>createCameraInput(position: CameraPosition, type: CameraType): CameraInput;<br>createPreviewOutput(profile: Profile, surfaceId: string): PreviewOutput;<br>createPhotoOutput(profile: Profile, surfaceId: string): PhotoOutput;<br>createVideoOutput(profile: VideoProfile, surfaceId: string): VideoOutput;<br>createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>): MetadataOutput;<br>createCaptureSession(): CaptureSession; | Yes | Added | 27| ohos.multimedia.camera | CameraManager | getSupportedCameras(callback: AsyncCallback<Array<CameraDevice>>): void;<br>getSupportedCameras(): Promise<Array<CameraDevice>>;<br>getSupportedOutputCapability(camera: CameraDevice, callback: AsyncCallback<CameraOutputCapability>): void;<br>getSupportedOutputCapability(camera: CameraDevice): Promise<CameraOutputCapability>;<br>createCameraInput(camera: CameraDevice, callback: AsyncCallback<CameraInput>): void;<br>createCameraInput(camera: CameraDevice): Promise<CameraInput>;<br>createCameraInput(position: CameraPosition, type: CameraType, callback: AsyncCallback<CameraInput>): void;<br>createCameraInput(position: CameraPosition, type: CameraType): Promise<CameraInput>;<br>createPreviewOutput(profile: Profile, surfaceId: string, callback: AsyncCallback<PreviewOutput>): void;<br>createPreviewOutput(profile: Profile, surfaceId: string): Promise<PreviewOutput>;<br>createPhotoOutput(profile: Profile, surfaceId: string, callback: AsyncCallback<PhotoOutput>): void;<br>createPhotoOutput(profile: Profile, surfaceId: string): Promise<PhotoOutput>;<br>createVideoOutput(profile: VideoProfile, surfaceId: string, callback: AsyncCallback<VideoOutput>): void;<br>createVideoOutput(profile: VideoProfile, surfaceId: string): Promise<VideoOutput>;<br>createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>, callback: AsyncCallback<MetadataOutput>): void;<br>createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>): Promise<MetadataOutput>;<br>createCaptureSession(callback: AsyncCallback<CaptureSession>): void;<br>createCaptureSession(): Promise<CaptureSession>; | Yes | Deprecated | 28| ohos.multimedia.camera | CameraType | CAMERA_TYPE_DEFAULT = 0 | Yes | Added | 29| ohos.multimedia.camera | CameraType | CAMERA_TYPE_UNSPECIFIED = 0 | Yes | Deprecated | 30| ohos.multimedia.camera | CameraInput | on(type: 'error', camera: CameraDevice, callback: ErrorCallback<BusinessError>): void; | Yes | Added | 31| ohos.multimedia.camera | CameraInput | release(callback: AsyncCallback<void>): void;<br>release(): Promise<void>;<br>on(type: 'error', camera: CameraDevice, callback: ErrorCallback<CameraInputError>): void; | Yes | Deprecated | 32| ohos.multimedia.camera | CameraInputErrorCode | ERROR_UNKNOWN = -1<br>ERROR_NO_PERMISSION = 0<br>ERROR_DEVICE_PREEMPTED = 1<br>ERROR_DEVICE_DISCONNECTED = 2<br>ERROR_DEVICE_IN_USE = 3<br>ERROR_DRIVER_ERROR = 4 | Yes | Deprecated | 33| ohos.multimedia.camera | CameraInputError | code: CameraInputErrorCode | Yes | Deprecated | 34| ohos.multimedia.camera | CaptureSession | beginConfig(): void;<br>addInput(cameraInput: CameraInput): void;<br>removeInput(cameraInput: CameraInput): void;<br>addOutput(cameraOutput: CameraOutput): void;<br>removeOutput(cameraOutput: CameraOutput): void;<br>hasFlash(): boolean;<br>isFlashModeSupported(flashMode: FlashMode): boolean;<br>getFlashMode(): FlashMode;<br>setFlashMode(flashMode: FlashMode): void;<br>isExposureModeSupported(aeMode: ExposureMode): boolean;<br>getExposureMode(): ExposureMode;<br>setExposureMode(aeMode: ExposureMode): void;<br>getMeteringPoint(): Point;<br>setMeteringPoint(point: Point): void;<br>getExposureBiasRange(): Array<number>;<br>setExposureBias(exposureBias: number): void;<br>getExposureValue(): number;<br>isFocusModeSupported(afMode: FocusMode): boolean;<br>getFocusMode(): FocusMode;<br>setFocusMode(afMode: FocusMode): void;<br>setFocusPoint(point: Point): void;<br>getFocusPoint(): Point;<br>getFocalLength(): number;<br>getZoomRatioRange(): Array<number>;<br>getZoomRatio(): number;<br>setZoomRatio(zoomRatio: number): void;<br>isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): boolean;<br>getActiveVideoStabilizationMode(): VideoStabilizationMode;<br>setVideoStabilizationMode(mode: VideoStabilizationMode): void;<br>on(type: 'error', callback: ErrorCallback<BusinessError>): void; | Yes | Added | 35| ohos.multimedia.camera | CaptureSession | beginConfig(callback: AsyncCallback<void>): void;<br>beginConfig(): Promise<void>;<br>addInput(cameraInput: CameraInput, callback: AsyncCallback<void>): void;<br>addInput(cameraInput: CameraInput): Promise<void>;<br>removeInput(cameraInput: CameraInput, callback: AsyncCallback<void>): void;<br>removeInput(cameraInput: CameraInput): Promise<void>;<br>addOutput(cameraOutput: CameraOutput, callback: AsyncCallback<void>): void;<br>addOutput(cameraOutput: CameraOutput): Promise<void>;<br>removeOutput(cameraOutput: CameraOutput, callback: AsyncCallback<void>): void;<br>removeOutput(cameraOutput: CameraOutput): Promise<void>;<br>hasFlash(callback: AsyncCallback<boolean>): void;<br>hasFlash(): Promise<boolean>;<br>isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback<boolean>): void;<br>isFlashModeSupported(flashMode: FlashMode): Promise<boolean>;<br>getFlashMode(callback: AsyncCallback<FlashMode>): void;<br>getFlashMode(): Promise<FlashMode>;<br>setFlashMode(flashMode: FlashMode, callback: AsyncCallback<void>): void;<br>setFlashMode(flashMode: FlashMode): Promise<void>;<br>isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback<boolean>): void;<br>isExposureModeSupported(aeMode: ExposureMode): Promise<boolean>;<br>getExposureMode(callback: AsyncCallback<ExposureMode>): void;<br>getExposureMode(): Promise<ExposureMode>;<br>setExposureMode(aeMode: ExposureMode, callback: AsyncCallback<void>): void;<br>setExposureMode(aeMode: ExposureMode): Promise<void>;<br>getMeteringPoint(callback: AsyncCallback<Point>): void;<br>getMeteringPoint(): Promise<Point>;<br>setMeteringPoint(point: Point, callback: AsyncCallback<void>): void;<br>setMeteringPoint(point: Point): Promise<void>;<br>getExposureBiasRange(callback: AsyncCallback<Array<number>>): void;<br>getExposureBiasRange(): Promise<Array<number>>;<br>setExposureBias(exposureBias: number, callback: AsyncCallback<void>): void;<br>setExposureBias(exposureBias: number): Promise<void>;<br>getExposureValue(callback: AsyncCallback<number>): void;<br>getExposureValue(): Promise<number>;<br>isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback<boolean>): void;<br>isFocusModeSupported(afMode: FocusMode): Promise<boolean>;<br>getFocusMode(callback: AsyncCallback<FocusMode>): void;<br>getFocusMode(): Promise<FocusMode>;<br>setFocusMode(afMode: FocusMode, callback: AsyncCallback<void>): void;<br>setFocusMode(afMode: FocusMode): Promise<void>;<br>setFocusPoint(point: Point, callback: AsyncCallback<void>): void;<br>setFocusPoint(point: Point): Promise<void>;<br>getFocusPoint(callback: AsyncCallback<Point>): void;<br>getFocusPoint(): Promise<Point>;<br>getFocalLength(callback: AsyncCallback<number>): void;<br>getFocalLength(): Promise<number>;<br>getZoomRatioRange(callback: AsyncCallback<Array<number>>): void;<br>getZoomRatioRange(): Promise<Array<number>>;<br>getZoomRatio(callback: AsyncCallback<number>): void;<br>getZoomRatio(): Promise<number>;<br>setZoomRatio(zoomRatio: number, callback: AsyncCallback<void>): void;<br>setZoomRatio(zoomRatio: number): Promise<void>;<br>isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode, callback: AsyncCallback<boolean>): void;<br>isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): Promise<boolean>;<br>getActiveVideoStabilizationMode(callback: AsyncCallback<VideoStabilizationMode>): void;<br>getActiveVideoStabilizationMode(): Promise<VideoStabilizationMode>;<br>setVideoStabilizationMode(mode: VideoStabilizationMode, callback: AsyncCallback<void>): void;<br>setVideoStabilizationMode(mode: VideoStabilizationMode): Promise<void>;<br>on(type: 'error', callback: ErrorCallback<CaptureSessionError>): void; | Yes | Deprecated | 36| ohos.multimedia.camera | CaptureSessionErrorCode | ERROR_UNKNOWN = -1<br>ERROR_INSUFFICIENT_RESOURCES = 0<br>ERROR_TIMEOUT = 1 | Yes | Deprecated | 37| ohos.multimedia.camera | CaptureSessionError | code: CaptureSessionErrorCode | Yes | Deprecated | 38| ohos.multimedia.camera | PreviewOutput | on(type: 'error', callback: ErrorCallback<BusinessError>): void; | Yes | Added | 39| ohos.multimedia.camera | PreviewOutput | on(type: 'error', callback: ErrorCallback<PreviewOutputError>): void; | Yes | Deprecated | 40| ohos.multimedia.camera | PreviewOutputErrorCode | ERROR_UNKNOWN = -1 | Yes | Deprecated | 41| ohos.multimedia.camera | PreviewOutputError | code: PreviewOutputErrorCode | Yes | Deprecated | 42| ohos.multimedia.camera | PhotoOutput | capture(): Promise<void>;<br>isMirrorSupported(): boolean;<br>on(type: 'error', callback: ErrorCallback<BusinessError>): void; | Yes | Added | 43| ohos.multimedia.camera | PhotoOutput | isMirrorSupported(callback: AsyncCallback<boolean>): void;<br>isMirrorSupported(): Promise<boolean>;<br>on(type: 'error', callback: ErrorCallback<PhotoOutputError>): void; | Yes | Deprecated | 44| ohos.multimedia.camera | PhotoOutputErrorCode | ERROR_UNKNOWN = -1<br>ERROR_DRIVER_ERROR = 0<br>ERROR_INSUFFICIENT_RESOURCES = 1<br>ERROR_TIMEOUT = 2 | Yes | Deprecated | 45| ohos.multimedia.camera | PhotoOutputError | code: PhotoOutputErrorCode | Yes | Deprecated | 46| ohos.multimedia.camera | VideoOutput | on(type: 'error', callback: ErrorCallback<BusinessError>): void; | Yes | Added | 47| ohos.multimedia.camera | VideoOutput | on(type: 'error', callback: ErrorCallback<VideoOutputError>): void; | Yes | Deprecated | 48| ohos.multimedia.camera | VideoOutputErrorCode | ERROR_UNKNOWN = -1<br>ERROR_DRIVER_ERROR = 0 | Yes | Deprecated | 49| ohos.multimedia.camera | VideoOutputError | code: VideoOutputErrorCode | Yes | Deprecated | 50| ohos.multimedia.camera | MetadataObject | readonly type: MetadataObjectType;<br>readonly timestamp: number; | Yes | Added | 51| ohos.multimedia.camera | MetadataObject | getType(callback: AsyncCallback<MetadataObjectType>): void;<br>getType(): Promise<MetadataObjectType>;<br>getTimestamp(callback: AsyncCallback<number>): void;<br>getTimestamp(): Promise<number>;<br>getBoundingBox(callback: AsyncCallback<Rect>): void;<br>getBoundingBox(): Promise<Rect>; | Yes | Deprecated | 52| ohos.multimedia.camera | MetadataFaceObject | readonly boundingBox: Rect | Yes | Added | 53| ohos.multimedia.camera | MetadataOutput | on(type: 'error', callback: ErrorCallback<BusinessError>): void; | Yes | Added | 54| ohos.multimedia.camera | MetadataOutput | on(type: 'error', callback: ErrorCallback<BusinessError>): void; | Yes | Deprecated | 55| ohos.multimedia.camera | MetadataOutputErrorCode | ERROR_UNKNOWN = -1<br>ERROR_INSUFFICIENT_RESOURCES = 0 | Yes | Deprecated | 56| ohos.multimedia.camera | MetadataOutputError | code: MetadataOutputErrorCode | Yes | Deprecated | 57 58**Adaptation Guide** 59 60In addition to the new APIs and deprecated APIs, you need to adapt your application to the changed APIs. 61 62In Beta4 and later versions, the following APIs are changed. 63 64**New APIs** 65 661. **CameraErrorCode** enums 67 68 Enum: INVALID_ARGUMENT; value: 7400101 69 70 Enum: OPERATION_NOT_ALLOWED; value: 7400102 71 72 Enum: SESSION_NOT_CONFIG; value: 7400103 73 74 Enum: SESSION_NOT_RUNNING; value: 7400104 75 76 Enum: SESSION_CONFIG_LOCKED; value: 7400105 77 78 Enum: DEVICE_SETTING_LOCKED; value: 7400106 79 80 Enum: CONFILICT_CAMERA; value: 7400107 81 82 Enum: DEVICE_DISABLED; value: 7400108 83 84 Enum: SERVICE_FATAL_ERROR; value: 7400201 85 862. Added **capture(): Promise<void>** to the **PhotoOutput** API. 87 883. Added the readonly type **MetadataObjectType** to the **MetadataObject** API. 89 904. Added **readonly timestamp: number** to the **MetadataObject** API. 91 925. Added **readonly boundingBox: Rect** to the **MetadataObject** API. 93 94**Deprecated APIs** 95 961. Deprecated the **release(callback: AsyncCallback<void>): void** and **release(): Promise<void>** APIs in **CameraInput**. 97 982. Deprecated the **CameraInputErrorCode** enums and all their values: **ERROR_UNKNOWN** = **-1**, **ERROR_NO_PERMISSION** = **0**, **ERROR_DEVICE_PREEMPTED** = **1**, **ERROR_DEVICE_DISCONNECTED** = **2**, **ERROR_DEVICE_IN_USE** = **3**, **ERROR_DRIVER_ERROR** = **4** 99 1003. Deprecated the **CameraInputError** API and its attribute **CameraInputErrorCode**. 101 1024. Deprecated the **CaptureSessionErrorCode** enums and all their values: **ERROR_UNKNOWN** = **-1**, **ERROR_INSUFFICIENT_RESOURCES** = **0**, **ERROR_TIMEOUT** = **1** 103 1045. Deprecated the **CaptureSessionError** API and its attribute **CaptureSessionErrorCode**. 105 1066. Deprecated the **PreviewOutputErrorCode** enum and its value: **ERROR_UNKNOWN** = **-1** 107 1087. Deprecated the **PreviewOutputError** API and its attribute **PreviewOutputErrorCode**. 109 1108. Deprecated the **PhotoOutputErrorCode** enums and all their values: **ERROR_UNKNOWN** = **-1**, **ERROR_DRIVER_ERROR** = **0**, **ERROR_INSUFFICIENT_RESOURCES** = **1**, **ERROR_TIMEOUT** = **2** 111 1129. Deprecated the **PhotoOutputError** API and its attribute **PhotoOutputErrorCode**. 113 11410. Deprecated the **VideoOutputErrorCode** enums and all their values: **ERROR_UNKNOWN** = **-1**, **ERROR_DRIVER_ERROR** = **0** 115 11611. Deprecated the **VideoOutputError** API and its attribute **VideoOutputErrorCode**. 117 11812. Deprecated **getType(callback: AsyncCallback<MetadataObjectType>): void** in the **MetadataObject** API. 119 12013. Deprecated **getType(): Promise<MetadataObjectType>** in the **MetadataObject** API. 121 12214. Deprecated **getTimestamp(callback: AsyncCallback<number>): void** in the **MetadataObject** API. 123 12415. Deprecated **getTimestamp(): Promise<number>** in the **MetadataObject** API. 125 12616. Deprecated **getBoundingBox(callback: AsyncCallback<Rect>): void** in the **MetadataObject** API. 127 12817. Deprecated **getBoundingBox(): Promise<Rect>** in the **MetadataObject** API. 129 13018. Deprecated the **MetadataOutputErrorCode** enums and all their values: **ERROR_UNKNOWN** = **-1**, **ERROR_INSUFFICIENT_RESOURCES** = **0** 131 13219. Deprecated the **MetadataOutputError** API and its attribute **MetadataOutputErrorCode**. 133 134**Changed APIs** 135 1361. Changed the return modes of the **getCameraManager** API in the camera module from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getCameraManager(context: Context, callback: AsyncCallback<CameraManager>): void** and **getCameraManager(context: Context): Promise<CameraManager>** are changed to **getCameraManager(context: Context): CameraManager**. 137 138 The sample code is as follows: 139 140 ``` 141 let cameraManager = camera.getCameraManager(context); 142 ``` 143 1442. Changed the return modes of the **getSupportedCameras** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getSupportedCameras(callback: AsyncCallback<Array<CameraDevice>>): void** and **getSupportedCameras(): Promise<Array<CameraDevice>>** are changed to **getSupportedCameras(): Array<CameraDevice>**. 145 146 The sample code is as follows: 147 148 ``` 149 let cameras = cameraManager.getSupportedCameras(); 150 ``` 151 1523. Changed the return modes of the **getSupportedOutputCapability** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getSupportedOutputCapability(camera: CameraDevice, callback: AsyncCallback<CameraOutputCapability>): void** and **getSupportedOutputCapability(camera: CameraDevice): Promise<CameraOutputCapability>** are changed to **getSupportedOutputCapability(camera: CameraDevice): CameraOutputCapability**. 153 154 The sample code is as follows: 155 156 ``` 157 let cameraDevice = cameras[0]; 158 let CameraOutputCapability = cameraManager.getSupportedOutputCapability(cameraDevice); 159 ``` 160 1614. Changed the return modes of the **createCameraInput(camera: CameraDevice)** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createCameraInput(camera: CameraDevice, callback: AsyncCallback<CameraInput>): void** and **createCameraInput(camera: CameraDevice): Promise<CameraInput>** are changed to **createCameraInput(camera: CameraDevice): CameraInput**. 162 163 The sample code is as follows: 164 165 ``` 166 let cameraDevice = cameras[0]; 167 let cameraInput = cameraManager.createCameraInput(cameraDevice); 168 ``` 169 1705. Changed the return modes of the **createCameraInput(position: CameraPosition, type: CameraType)** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createCameraInput(position: CameraPosition, type: CameraType, callback: AsyncCallback<CameraInput>): void** and **createCameraInput(position: CameraPosition, type: CameraType): Promise<CameraInput>** are changed to **createCameraInput(position: CameraPosition, type: CameraType): CameraInput**. 171 172 The sample code is as follows: 173 174 ``` 175 let cameraDevice = cameras[0]; 176 let position = cameraDevice.cameraPosition; 177 let type = cameraDevice.cameraType; 178 let cameraInput = cameraManager.createCameraInput(position, type); 179 ``` 180 1816. Changed the return modes of the **createPreviewOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createPreviewOutput(profile: Profile, surfaceId: string, callback: AsyncCallback<PreviewOutput>): void** and **createPreviewOutput(profile: Profile, surfaceId: string): Promise<PreviewOutput>** are changed to **createPreviewOutput(profile: Profile, surfaceId: string): PreviewOutput**. 182 183 The sample code is as follows: 184 185 ``` 186 let profile = cameraoutputcapability.previewProfiles[0]; 187 let previewOutput = cameraManager.createPreviewOutput(profile, surfaceId); 188 ``` 189 1907. Changed the return modes of the **createPhotoOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createPhotoOutput(profile: Profile, surfaceId: string, callback: AsyncCallback<PhotoOutput>): void** and **createPhotoOutput(profile: Profile, surfaceId: string): Promise<PhotoOutput>** are changed to **createPhotoOutput(profile: Profile, surfaceId: string): PhotoOutput**. 191 192 The sample code is as follows: 193 194 ``` 195 let profile = cameraoutputcapability.photoProfiles[0]; 196 let photoOutput = cameraManager.createPhotoOutput(profile, surfaceId); 197 ``` 198 1998. Changed the return modes of the **createVideoOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createVideoOutput(profile: VideoProfile, surfaceId: string, callback: AsyncCallback<VideoOutput>): void** and **createVideoOutput(profile: VideoProfile, surfaceId: string): Promise<VideoOutput>** are changed to **createVideoOutput(profile: VideoProfile, surfaceId: string): VideoOutput**. 200 201 The sample code is as follows: 202 203 ``` 204 let profile = cameraoutputcapability.videoProfiles[0]; 205 let videoOutput = cameraManager.createVideoOutput(profile, surfaceId); 206 ``` 207 2089. Changed the return modes of the **createMetadataOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>, callback: AsyncCallback<MetadataOutput>): void** and **createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>): Promise<MetadataOutput>** are changed to **createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>): MetadataOutput**. 209 210 The sample code is as follows: 211 212 ``` 213 let metadataObjectTypes = cameraoutputcapability.supportedMetadataObjectTypes; 214 let metadataOutput = cameraManager.createMetadataOutput(metadataObjectTypes); 215 ``` 216 21710. Changed the return modes of the **createCaptureSession** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createCaptureSession(callback: AsyncCallback<CaptureSession>): void** and **createCaptureSession(): Promise<CaptureSession>** are changed to **createCaptureSession(): CaptureSession**. 218 219 The sample code is as follows: 220 221 ``` 222 let captureSession = cameraManager.createCaptureSession(); 223 ``` 224 22511. Changed the enum **CAMERA_TYPE_UNSPECIFIED** of **CameraType** to **CAMERA_TYPE_DEFAULT**. 226 22712. Changed the return value type of the **on** API in CameraInput from **CameraInputError** to **BusinessError**. Therefore, the original API **on(type: 'error', camera: CameraDevice, callback: ErrorCallback<CameraInputError>): void** is changed to **on(type: 'error', camera: CameraDevice, callback: ErrorCallback<BusinessError>): void**. 228 229 The sample code is as follows: 230 231 ``` 232 let cameraDevice = cameras[0]; 233 cameraInput.on('error', cameraDevice, (BusinessError) => { 234 235 }) 236 ``` 237 23813. Changed the return modes of the **beginConfig** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **beginConfig(callback: AsyncCallback<void>): void** and **beginConfig(): Promise<void>** are changed to **beginConfig(): void**. 239 240 The sample code is as follows: 241 242 ``` 243 captureSession.beginConfig(); 244 ``` 245 24614. Changed the return modes of the **addInput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **addInput(cameraInput: CameraInput, callback: AsyncCallback<void>): void** and **addInput(cameraInput: CameraInput): Promise<void>** are changed to **addInput(cameraInput: CameraInput): void**. 247 248 The sample code is as follows: 249 250 ``` 251 captureSession.addInput(cameraInput); 252 ``` 253 25415. Changed the return modes of the **removeInput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **removeInput(cameraInput: CameraInput, callback: AsyncCallback<void>): void** and **removeInput(cameraInput: CameraInput): Promise<void>** are changed to **removeInput(cameraInput: CameraInput): void**. 255 256 The sample code is as follows: 257 258 ``` 259 captureSession.removeInput(cameraInput); 260 ``` 261 26216. Changed the return modes of the **addOutput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **addOutput(cameraOutput: CameraOutput, callback: AsyncCallback<void>): void** and **addOutput(cameraOutput: CameraOutput): Promise<void>** are changed to **addOutput(cameraOutput: CameraOutput): void**. 263 264 The sample code is as follows: 265 266 ``` 267 captureSession.addOutput(previewOutput); 268 ``` 269 27017. Changed the return modes of the **removeOutput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **removeOutput(cameraOutput: CameraOutput, callback: AsyncCallback<void>): void** and **removeOutput(cameraOutput: CameraOutput): Promise<void>** are changed to **removeOutput(cameraOutput: CameraOutput): void**. 271 272 The sample code is as follows: 273 274 ``` 275 captureSession.removeOutput(previewOutput); 276 ``` 277 27818. Changed the return modes of the **hasFlash** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **hasFlash(callback: AsyncCallback<boolean>): void** and **hasFlash(): Promise<boolean>** are changed to **hasFlash(): boolean**. 279 280 The sample code is as follows: 281 282 ``` 283 let status = captureSession.hasFlash(); 284 ``` 285 28619. Changed the return modes of the **isFlashModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback<boolean>): void** and **isFlashModeSupported(flashMode: FlashMode): Promise<boolean>** are changed to **isFlashModeSupported(flashMode: FlashMode): boolean**. 287 288 The sample code is as follows: 289 290 ``` 291 let status = captureSession.isFlashModeSupported(camera.FlashMode.FLASH_MODE_AUTO); 292 ``` 293 29420. Changed the return modes of the **getFlashMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFlashMode(callback: AsyncCallback<FlashMode>): void** and **getFlashMode(): Promise<FlashMode>** are changed to **getFlashMode(): FlashMode**. 295 296 The sample code is as follows: 297 298 ``` 299 let flashMode = captureSession.getFlashMode(); 300 ``` 301 30221. Changed the return modes of the **isExposureModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback<boolean>): void** and **isExposureModeSupported(aeMode: ExposureMode): Promise<boolean>** are changed to **isExposureModeSupported(aeMode: ExposureMode): boolean**. 303 304 The sample code is as follows: 305 306 ``` 307 let isSupported = captureSession.isExposureModeSupported(camera.ExposureMode.EXPOSURE_MODE_LOCKED); 308 ``` 309 31022. Changed the return modes of the **getExposureMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getExposureMode(callback: AsyncCallback<ExposureMode>): void** and **getExposureMode(): Promise<ExposureMode>** are changed to **getExposureMode(): ExposureMode**. 311 312 The sample code is as follows: 313 314 ``` 315 let exposureMode = captureSession.getExposureMode(); 316 ``` 317 31823. Changed the return modes of the **setExposureMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setExposureMode(aeMode: ExposureMode, callback: AsyncCallback<void>): void** and **setExposureMode(aeMode: ExposureMode): Promise<void>** are changed to **setExposureMode(aeMode: ExposureMode): void**. 319 320 The sample code is as follows: 321 322 ``` 323 captureSession.setExposureMode(camera.ExposureMode.EXPOSURE_MODE_LOCKED); 324 ``` 325 32624. Changed the return modes of the **getMeteringPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getMeteringPoint(callback: AsyncCallback<Point>): void** and **getMeteringPoint(): Promise<Point>** are changed to **getMeteringPoint(): Point**. 327 328 The sample code is as follows: 329 330 ``` 331 let exposurePoint = captureSession.getMeteringPoint(); 332 ``` 333 33425. Changed the return modes of the **setMeteringPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setMeteringPoint(point: Point, callback: AsyncCallback<void>): void** and **setMeteringPoint(point: Point): Promise<void>** are changed to **setMeteringPoint(point: Point): void**. 335 336 The sample code is as follows: 337 338 ``` 339 let Point2 = {x: 2, y: 2}; 340 captureSession.setMeteringPoint(Point2); 341 ``` 342 34326. Changed the return modes of the **getExposureBiasRange** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getExposureBiasRange(callback: AsyncCallback<Array<number>>): void** and **getExposureBiasRange(): Promise<Array<number>>** are changed to **getExposureBiasRange(): Array<number>**. 344 345 The sample code is as follows: 346 347 ``` 348 let biasRangeArray = captureSession.getExposureBiasRange(); 349 ``` 350 35127. Changed the return modes of the **setExposureBias** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setExposureBias(exposureBias: number, callback: AsyncCallback<void>): void** and **setExposureBias(exposureBias: number): Promise<void>** are changed to **setExposureBias(exposureBias: number): void**. 352 353 The sample code is as follows: 354 355 ``` 356 let exposureBias = biasRangeArray[0]; 357 captureSession.setExposureBias(exposureBias); 358 ``` 359 36028. Changed the return modes of the **getExposureValue** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getExposureValue(callback: AsyncCallback<number>): void** and **getExposureValue(): Promise<number>** are changed to **getExposureValue(): number**. 361 362 The sample code is as follows: 363 364 ``` 365 let exposureValue = captureSession.getExposureValue(); 366 ``` 367 36829. Changed the return modes of the **isFocusModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback<boolean>): void** and **isFocusModeSupported(afMode: FocusMode): Promise<boolean>** are changed to **isFocusModeSupported(afMode: FocusMode): boolean**. 369 370 The sample code is as follows: 371 372 ``` 373 let status = captureSession.isFocusModeSupported(camera.FocusMode.FOCUS_MODE_AUTO); 374 ``` 375 37630. Changed the return modes of the **getFocusMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFocusMode(callback: AsyncCallback<FocusMode>): void** and **getFocusMode(): Promise<FocusMode>** are changed to **getFocusMode(): FocusMode**. 377 378 The sample code is as follows: 379 380 ``` 381 let afMode = captureSession.getFocusMode(); 382 ``` 383 38431. Changed the return modes of the **setFocusMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setFocusMode(afMode: FocusMode, callback: AsyncCallback<void>): void** and **setFocusMode(afMode: FocusMode): Promise<void>** are changed to **setFocusMode(afMode: FocusMode): void**. 385 386 The sample code is as follows: 387 388 ``` 389 captureSession.setFocusMode(camera.FocusMode.FOCUS_MODE_AUTO); 390 ``` 391 39232. Changed the return modes of the **setFocusPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setFocusPoint(point: Point, callback: AsyncCallback<void>): void** and **setFocusPoint(point: Point): Promise<void>** are changed to **setFocusPoint(point: Point): void**. 393 394 The sample code is as follows: 395 396 ``` 397 let Point2 = {x: 2, y: 2}; 398 captureSession.setFocusPoint(Point2); 399 ``` 400 40133. Changed the return modes of the **getFocusPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFocusPoint(callback: AsyncCallback<Point>): void** and **getFocusPoint(): Promise<Point>** are changed to **getFocusPoint(): Point**. 402 403 The sample code is as follows: 404 405 ``` 406 let point = captureSession.getFocusPoint(); 407 ``` 408 40934. Changed the return modes of the **getFocalLength** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFocalLength(callback: AsyncCallback<number>): void** and **getFocalLength(): Promise<number>** are changed to **getFocalLength(): number**. 410 411 The sample code is as follows: 412 413 ``` 414 let focalLength = captureSession.getFocalLength(); 415 ``` 416 41735. Changed the return modes of the **getZoomRatioRange** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getZoomRatioRange(callback: AsyncCallback<Array<number>>): void** and **getZoomRatioRange(): Promise<Array<number>>** are changed to **getZoomRatioRange(): Array<number>**. 418 419 The sample code is as follows: 420 421 ``` 422 let zoomRatioRange = captureSession.getZoomRatioRange(); 423 ``` 424 42536. Changed the return modes of the **getZoomRatio** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getZoomRatio(callback: AsyncCallback<number>): void** and **getZoomRatio(): Promise<number>** are changed to **getZoomRatio(): number**. 426 427 The sample code is as follows: 428 429 ``` 430 let zoomRatio = captureSession.getZoomRatio(); 431 ``` 432 43337. Changed the return modes of the **setZoomRatio** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setZoomRatio(zoomRatio: number, callback: AsyncCallback<void>): void** and **setZoomRatio(zoomRatio: number): Promise<void>** are changed to **setZoomRatio(zoomRatio: number): void**. 434 435 The sample code is as follows: 436 437 ``` 438 let zoomRatio = zoomRatioRange[0]; 439 captureSession.setZoomRatio(zoomRatio); 440 ``` 441 44238. Changed the return modes of the **isVideoStabilizationModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode, callback: AsyncCallback<boolean>): void** and **isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): Promise<boolean>** are changed to **isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): boolean**. 443 444 The sample code is as follows: 445 446 ``` 447 let isSupported = captureSession.isVideoStabilizationModeSupported(camera.VideoStabilizationMode.OFF); 448 ``` 449 45039. Changed the return modes of the **getActiveVideoStabilizationMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getActiveVideoStabilizationMode(callback: AsyncCallback<VideoStabilizationMode>): void** and **getActiveVideoStabilizationMode(): Promise<VideoStabilizationMode>** are changed to **getActiveVideoStabilizationMode(): VideoStabilizationMode**. 451 452 The sample code is as follows: 453 454 ``` 455 let vsMode = captureSession.getActiveVideoStabilizationMode(); 456 ``` 457 45840. Changed the return modes of the **setVideoStabilizationMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setVideoStabilizationMode(mode: VideoStabilizationMode, callback: AsyncCallback<void>): void** and **setVideoStabilizationMode(mode: VideoStabilizationMode): Promise<void>** are changed to **setVideoStabilizationMode(mode: VideoStabilizationMode): void**. 459 460 The sample code is as follows: 461 462 ``` 463 captureSession.setVideoStabilizationMode(camera.VideoStabilizationMode.OFF); 464 ``` 465 46641. Changed the **on(type:'error') callback** type in CaptureSession from **ErrorCallback<CaptureSessionError>** to **ErrorCallback<BusinessError>**. Therefore, the original API **on(type: 'error', callback: ErrorCallback<CaptureSessionError>): void** is changed to **on(type: 'error', callback: ErrorCallback<BusinessError>): void**. 467 468 The sample code is as follows: 469 470 ``` 471 captureSession.on('error', (BusinessError) => { 472 473 }) 474 ``` 475 47642. Changed the **on(type:'error') callback** type in PreviewOutput, from **ErrorCallback<PreviewOutputError>** to **ErrorCallback<BusinessError>**. Therefore, the original API **on(type: 'error', callback: ErrorCallback<PreviewOutputError>): void** is changed to **on(type: 'error', callback: ErrorCallback<BusinessError>): void**. 477 478 The sample code is as follows: 479 480 ``` 481 previewOutput.on('error', (BusinessError) => { 482 483 }) 484 ``` 485 48643. Changed the return modes of the **isMirrorSupported** API in PhotoOutput from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isMirrorSupported(callback: AsyncCallback<boolean>): void** and **isMirrorSupported(): Promise<boolean>** are changed to **isMirrorSupported(): boolean**. 487 488 The sample code is as follows: 489 490 ``` 491 let isSupported = photoOutput.isMirrorSupported(); 492 ``` 493 49444. Changed the **on(type:'error') callback** type in PhotoOutput, from **ErrorCallback<PhotoOutputError>** to **ErrorCallback<BusinessError>**. Therefore, the original API **on(type: 'error', callback: ErrorCallback<PhotoOutputError>): void** is changed to **on(type: 'error', callback: ErrorCallback<BusinessError>): void**. 495 496 The sample code is as follows: 497 498 ``` 499 PhotoOutput.on('error', (BusinessError) => { 500 501 }) 502 ``` 503 50445. Changed the **on(type:'error') callback** type in VideoOutput, from **ErrorCallback<VideoOutputError>** to **ErrorCallback<BusinessError>**. Therefore, the original API **on(type: 'error', callback: ErrorCallback<VideoOutputError>): void** is changed to **on(type: 'error', callback: ErrorCallback<BusinessError>): void**. 505 506 The sample code is as follows: 507 508 ``` 509 VideoOutput.on('error', (BusinessError) => { 510 511 }) 512 ``` 513 51446. Changed the **on(type:'error') callback** type in MetadataOutput, from **ErrorCallback<MetadataOutputError>** to **ErrorCallback<BusinessError>**. Therefore, the original API **on(type: 'error', callback: ErrorCallback<MetadataOutputError>): void** is changed to **on(type: 'error', callback: ErrorCallback<BusinessError>): void**. 515 516 The sample code is as follows: 517 518 ``` 519 MetadataOutput.on('error', (BusinessError) => { 520 521 }) 522 ```