1# ChangeLog of JS API Changes in the Multimedia Subsystem 2 3Compared with OpenHarmony 3.2 Beta3, OpenHarmony 3.2 Beta4 has the following changes in APIs of the camera component in the multimedia subsystem. 4 5## Camera API Changes 6Some functional APIs are added and some others are deprecated to: 71. Improve the usability of camera APIs. 82. Help you quickly understand camera APIs and use them for development. 93. Facilitate expansion of framework functions in later versions, and reduce coupling between framework modules. 10 11You need to refer to the following change description to adapt your application. 12 13**Change Impacts** 14 15JS APIs in API version 9 are affected. Your application needs to adapt these APIs so that it can properly implement functions in the SDK environment of the new version. 16 17**Key API/Component Changes** 18 19| Module | Class | Method/Attribute/Enumeration/Constant | Change Type| 20| ---------------------- | ----------------------- | ------------------------------------------------------------ | -------- | 21| ohos.multimedia.camera | Profile | readonly format:CameraFormat; | Added | 22| ohos.multimedia.camera | Profile | readonly size: Size; | Added | 23| ohos.multimedia.camera | FrameRateRange | readonly min: number; | Added | 24| ohos.multimedia.camera | FrameRateRange | readonly max: number; | Added | 25| ohos.multimedia.camera | VideoProfile | readonly frameRateRange: FrameRateRange; | Added | 26| ohos.multimedia.camera | CameraOutputCapability | readonly previewProfiles: Array<Profile>; | Added | 27| ohos.multimedia.camera | CameraOutputCapability | readonly photoProfiles: Array<Profile>; | Added | 28| ohos.multimedia.camera | CameraOutputCapability | readonly videoProfiles: Array<VideoProfile>; | Added | 29| ohos.multimedia.camera | CameraOutputCapability | readonly supportedMetadataObjectTypes: Array<MetadataObjectType>; | Added | 30| ohos.multimedia.camera | CameraManager | getSupportedCameras(callback: AsyncCallback<Array<CameraDevice>>): void;<br>getSupportedCameras(): Promise<Array<CameraDevice>>; | Added | 31| ohos.multimedia.camera | CameraManager | getSupportedOutputCapability(camera: CameraDevice, callback: AsyncCallback<CameraOutputCapability>): void;<br>getSupportedOutputCapability(camera: CameraDevice): Promise<CameraOutputCapability>; | Added | 32| ohos.multimedia.camera | CameraManager | isCameraMuted(): boolean; | Added | 33| ohos.multimedia.camera | CameraManager | isCameraMuteSupported(): boolean; | Added | 34| ohos.multimedia.camera | CameraManager | muteCamera(mute: boolean): void; | Added | 35| ohos.multimedia.camera | CameraManager | createCameraInput(camera: CameraDevice, callback: AsyncCallback<CameraInput>): void;<br>createCameraInput(camera: CameraDevice): Promise<CameraInput>; | Added | 36| ohos.multimedia.camera | CameraManager | createPreviewOutput(profile: Profile, surfaceId: string, callback: AsyncCallback<PreviewOutput>): void;<br>createPreviewOutput(profile: Profile, surfaceId: string): Promise<PreviewOutput>; | Added | 37| ohos.multimedia.camera | CameraManager | createPhotoOutput(profile: Profile, surfaceId: string, callback: AsyncCallback<PhotoOutput>): void;<br>createPhotoOutput(profile: Profile, surfaceId: string): Promise<PhotoOutput>; | Added | 38| ohos.multimedia.camera | CameraManager | createVideoOutput(profile: VideoProfile, surfaceId: string, callback: AsyncCallback<VideoOutput>): void;<br>createVideoOutput(profile: VideoProfile, surfaceId: string): Promise<VideoOutput>; | Added | 39| ohos.multimedia.camera | CameraManager | createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>, callback: AsyncCallback<MetadataOutput>): void;<br>createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>): Promise<MetadataOutput>; | Added | 40| ohos.multimedia.camera | CameraManager | createCaptureSession(callback: AsyncCallback<CaptureSession>): void;<br>createCaptureSession(): Promise<CaptureSession>; | Added | 41| ohos.multimedia.camera | CameraManager | on(type: 'cameraMute', callback: AsyncCallback<boolean>): void; | Added | 42| ohos.multimedia.camera | CameraManager | getCameras(callback: AsyncCallback<Array<Camera>>): void;<br>getCameras(): Promise<Array<Camera>>; | Deprecated | 43| ohos.multimedia.camera | CameraManager | createCameraInput(cameraId: string, callback: AsyncCallback<CameraInput>): void;<br>createCameraInput(cameraId: string): Promise<CameraInput>; | Deprecated | 44| ohos.multimedia.camera | CameraManager | createCaptureSession(context: Context, callback: AsyncCallback<CaptureSession>): void;<br>createCaptureSession(context: Context): Promise<CaptureSession>; | Deprecated | 45| ohos.multimedia.camera | CameraManager | createPreviewOutput(surfaceId: string, callback: AsyncCallback<PreviewOutput>): void;<br>createPreviewOutput(surfaceId: string): Promise<PreviewOutput>; | Deprecated | 46| ohos.multimedia.camera | CameraManager | CreatePhotoOutput(surfaceId: string, callback: AsyncCallback<PhotoOutput>): void;<br>CreatePhotoOutput(surfaceId: string): Promise<PhotoOutput>; | Deprecated | 47| ohos.multimedia.camera | CameraManager | createVideoOutput(surfaceId: string, callback: AsyncCallback<VideoOutput>): void;<br>createVideoOutput(surfaceId: string): Promise<VideoOutput>; | Deprecated | 48| ohos.multimedia.camera | CameraManager | createMetadataOutput(callback: AsyncCallback<MetadataOutput>): void;<br>createVideoOutput(): Promise<MetadataOutput>; | Deprecated | 49| ohos.multimedia.camera | CameraStatusInfo | camera: CameraDevice; | Added | 50| ohos.multimedia.camera | CameraStatusInfo | camera: Camera; | Deprecated | 51| ohos.multimedia.camera | CameraDevice | interface CameraDevice | Added | 52| ohos.multimedia.camera | Camera | interface Camera | Deprecated | 53| ohos.multimedia.camera | CameraInput | open(callback: AsyncCallback<void>): void;<br>open(): Promise<void>; | Added | 54| ohos.multimedia.camera | CameraInput | close(callback: AsyncCallback<void>): void;<br>close(): Promise<void>; | Added | 55| ohos.multimedia.camera | CameraInput | on(type: 'error', camera: CameraDevice, callback: ErrorCallback<CameraInputError>): void; | Added | 56| ohos.multimedia.camera | CameraInput | isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback<boolean>): void;<br>isFocusModeSupported(afMode: FocusMode): Promise<boolean>; | Deprecated | 57| ohos.multimedia.camera | CameraInput | getFocusMode(callback: AsyncCallback<FocusMode>): void;<br>getFocusMode(): Promise<FocusMode>; | Deprecated | 58| ohos.multimedia.camera | CameraInput | setFocusMode(afMode: FocusMode, callback: AsyncCallback<void>): void;<br>setFocusMode(afMode: FocusMode): Promise<void>; | Deprecated | 59| ohos.multimedia.camera | CameraInput | getZoomRatioRange(callback: AsyncCallback<Array<number>>): void;<br>getZoomRatioRange(): Promise<Array<number>>; | Deprecated | 60| ohos.multimedia.camera | CameraInput | getZoomRatio(callback: AsyncCallback<number>): void;<br>getZoomRatio(): Promise<number>; | Deprecated | 61| ohos.multimedia.camera | CameraInput | setZoomRatio(zoomRatio: number, callback: AsyncCallback<void>): void;<br>setZoomRatio(zoomRatio: number): Promise<void>; | Deprecated | 62| ohos.multimedia.camera | CameraInput | getCameraId(callback: AsyncCallback<string>): void;<br>getCameraId(): Promise<string>; | Deprecated | 63| ohos.multimedia.camera | CameraInput | getExposurePoint(callback: AsyncCallback<Point>): void;<br>getExposurePoint(): Promise<Point>; | Deprecated | 64| ohos.multimedia.camera | CameraInput | setExposurePoint(exposurePoint: Point, callback: AsyncCallback<void>): void;<br>setExposurePoint(exposurePoint: Point): Promise<void>; | Deprecated | 65| ohos.multimedia.camera | CameraInput | hasFlash(callback: AsyncCallback<boolean>): void;<br>hasFlash(): Promise<boolean>; | Deprecated | 66| ohos.multimedia.camera | CameraInput | isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback<boolean>): void;<br>isFlashModeSupported(flashMode: FlashMode): Promise<boolean>; | Deprecated | 67| ohos.multimedia.camera | CameraInput | getFlashMode(callback: AsyncCallback<FlashMode>): void;<br>getFlashMode(): Promise<FlashMode>; | Deprecated | 68| ohos.multimedia.camera | CameraInput | setFlashMode(flashMode: FlashMode, callback: AsyncCallback<void>): void;<br>setFlashMode(flashMode: FlashMode): Promise<void>; | Deprecated | 69| ohos.multimedia.camera | CameraInput | isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback<boolean>): void;<br>isExposureModeSupported(aeMode: ExposureMode): Promise<boolean>; | Deprecated | 70| ohos.multimedia.camera | CameraInput | getExposureMode(callback: AsyncCallback<ExposureMode>): void;<br>getExposureMode(): Promise<ExposureMode>; | Deprecated | 71| ohos.multimedia.camera | CameraInput | setExposureMode(aeMode: ExposureMode, callback: AsyncCallback<void>): void;<br>setExposureMode(aeMode: ExposureMode): Promise<void>; | Deprecated | 72| ohos.multimedia.camera | CameraInput | getMeteringPoint(callback: AsyncCallback<Point>): void;<br>getMeteringPoint(): Promise<Point>; | Deprecated | 73| ohos.multimedia.camera | CameraInput | setMeteringPoint(point: Point, callback: AsyncCallback<void>): void;<br>setMeteringPoint(point: Point): Promise<void>; | Deprecated | 74| ohos.multimedia.camera | CameraInput | getExposureBiasRange(callback: AsyncCallback<Array<number>>): void;<br>getExposureBiasRange(): Promise<Array<number>>; | Deprecated | 75| ohos.multimedia.camera | CameraInput | setExposureBias(exposureBias: number, callback: AsyncCallback<void>): void;<br>setExposureBias(exposureBias: number): Promise<void>; | Deprecated | 76| ohos.multimedia.camera | CameraInput | getExposureValue(callback: AsyncCallback<number>): void;<br>getExposureValue(): Promise<number>; | Deprecated | 77| ohos.multimedia.camera | CameraInput | isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback<boolean>): void;<br>isFocusModeSupported(afMode: FocusMode): Promise<boolean>; | Deprecated | 78| ohos.multimedia.camera | CameraInput | getFocusMode(callback: AsyncCallback<FocusMode>): void;<br>getFocusMode(): Promise<FocusMode>; | Deprecated | 79| ohos.multimedia.camera | CameraInput | setFocusMode(afMode: FocusMode, callback: AsyncCallback<void>): void;<br>setFocusMode(afMode: FocusMode): Promise<void>; | Deprecated | 80| ohos.multimedia.camera | CameraInput | setFocusPoint(point: Point, callback: AsyncCallback<void>): void;<br>setFocusPoint(point: Point): Promise<void>; | Deprecated | 81| ohos.multimedia.camera | CameraInput | getFocusPoint(callback: AsyncCallback<Point>): void;<br>getFocusPoint(): Promise<Point>; | Deprecated | 82| ohos.multimedia.camera | CameraInput | getFocalLength(callback: AsyncCallback<number>): void;<br>getFocalLength(): Promise<number>; | Deprecated | 83| ohos.multimedia.camera | CameraInput | getZoomRatioRange(callback: AsyncCallback<Array<number>>): void;<br>getZoomRatioRange(): Promise<Array<number>>; | Deprecated | 84| ohos.multimedia.camera | CameraInput | getZoomRatio(callback: AsyncCallback<number>): void;<br>getZoomRatio(): Promise<number>; | Deprecated | 85| ohos.multimedia.camera | CameraInput | setZoomRatio(zoomRatio: number, callback: AsyncCallback<void>): void;<br>setZoomRatio(zoomRatio: number): Promise<void>; | Deprecated | 86| ohos.multimedia.camera | CameraInput | on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; | Deprecated | 87| ohos.multimedia.camera | CameraInput | on(type: 'exposureStateChange', callback: AsyncCallback<ExposureState>): void; | Deprecated | 88| ohos.multimedia.camera | CameraInput | on(type: 'error', callback: ErrorCallback<CameraInputError>): void; | Deprecated | 89| ohos.multimedia.camera | CameraInputErrorCode | ERROR_NO_PERMISSION = 0 | Added | 90| ohos.multimedia.camera | CameraInputErrorCode | ERROR_DEVICE_PREEMPTED = 1 | Added | 91| ohos.multimedia.camera | CameraInputErrorCode | ERROR_DEVICE_DISCONNECTED = 2 | Added | 92| ohos.multimedia.camera | CameraInputErrorCode | ERROR_DEVICE_IN_USE = 3 | Added | 93| ohos.multimedia.camera | CameraInputErrorCode | ERROR_DRIVER_ERROR = 4 | Added | 94| ohos.multimedia.camera | CameraFormat | CAMERA_FORMAT_RGBA_8888 = 3 | Added | 95| ohos.multimedia.camera | ExposureMode | EXPOSURE_MODE_AUTO = 1 | Added | 96| ohos.multimedia.camera | ExposureMode | EXPOSURE_MODE_CONTINUOUS_AUTO = 2 | Added | 97| ohos.multimedia.camera | ExposureMode | EXPOSURE_MODE_AUTO | Deprecated | 98| ohos.multimedia.camera | ExposureMode | EXPOSURE_MODE_CONTINUOUS_AUTO | Deprecated | 99| ohos.multimedia.camera | VideoStabilizationMode | LOW = 1 | Added | 100| ohos.multimedia.camera | VideoStabilizationMode | MIDDLE = 2 | Added | 101| ohos.multimedia.camera | VideoStabilizationMode | HIGH = 3 | Added | 102| ohos.multimedia.camera | VideoStabilizationMode | AUTO = 4 | Added | 103| ohos.multimedia.camera | VideoStabilizationMode | LOW | Deprecated | 104| ohos.multimedia.camera | VideoStabilizationMode | MIDDLE | Deprecated | 105| ohos.multimedia.camera | VideoStabilizationMode | HIGH | Deprecated | 106| ohos.multimedia.camera | VideoStabilizationMode | AUTO | Deprecated | 107| ohos.multimedia.camera | CaptureSession | addOutput(cameraOutput: CameraOutput, callback: AsyncCallback<void>): void;<br>addOutput(cameraOutput: CameraOutput): Promise<void>; | Added | 108| ohos.multimedia.camera | CaptureSession | removeOutput(cameraOutput: CameraOutput, callback: AsyncCallback<void>): void;<br>removeOutput(cameraOutput: CameraOutput): Promise<void>; | Added | 109| ohos.multimedia.camera | CaptureSession | isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode, callback: AsyncCallback<boolean>): void;<br>isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): Promise<boolean>; | Added | 110| ohos.multimedia.camera | CaptureSession | getActiveVideoStabilizationMode(callback: AsyncCallback<VideoStabilizationMode>): void;<br>getActiveVideoStabilizationMode(): Promise<VideoStabilizationMode>; | Added | 111| ohos.multimedia.camera | CaptureSession | setVideoStabilizationMode(mode: VideoStabilizationMode, callback: AsyncCallback<void>): void;<br>setVideoStabilizationMode(mode: VideoStabilizationMode): Promise<void>; | Added | 112| ohos.multimedia.camera | CaptureSession | on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void; | Added | 113| ohos.multimedia.camera | CaptureSession | hasFlash(callback: AsyncCallback<boolean>): void;<br>hasFlash(): Promise<boolean>; | Added | 114| ohos.multimedia.camera | CaptureSession | isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback<boolean>): void;<br>isFlashModeSupported(flashMode: FlashMode): Promise<boolean>; | Added | 115| ohos.multimedia.camera | CaptureSession | getFlashMode(callback: AsyncCallback<FlashMode>): void;<br>getFlashMode(): Promise<FlashMode>; | Added | 116| ohos.multimedia.camera | CaptureSession | setFlashMode(flashMode: FlashMode, callback: AsyncCallback<void>): void;<br>setFlashMode(flashMode: FlashMode): Promise<void>; | Added | 117| ohos.multimedia.camera | CaptureSession | isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback<boolean>): void;<br>isExposureModeSupported(aeMode: ExposureMode): Promise<boolean>; | Added | 118| ohos.multimedia.camera | CaptureSession | getExposureMode(callback: AsyncCallback<ExposureMode>): void;<br>getExposureMode(): Promise<ExposureMode>; | Added | 119| ohos.multimedia.camera | CaptureSession | setExposureMode(aeMode: ExposureMode, callback: AsyncCallback<void>): void;<br>setExposureMode(aeMode: ExposureMode): Promise<void>; | Added | 120| ohos.multimedia.camera | CaptureSession | getMeteringPoint(callback: AsyncCallback<Point>): void;<br>getMeteringPoint(): Promise<Point>; | Added | 121| ohos.multimedia.camera | CaptureSession | setMeteringPoint(point: Point, callback: AsyncCallback<void>): void;<br>setMeteringPoint(point: Point): Promise<void>; | Added | 122| ohos.multimedia.camera | CaptureSession | getExposureBiasRange(callback: AsyncCallback<Array<number>>): void;<br>getExposureBiasRange(): Promise<Array<number>>; | Added | 123| ohos.multimedia.camera | CaptureSession | setExposureBias(exposureBias: number, callback: AsyncCallback<void>): void;<br>setExposureBias(exposureBias: number): Promise<void>; | Added | 124| ohos.multimedia.camera | CaptureSession | getExposureValue(callback: AsyncCallback<number>): void;<br>getExposureValue(): Promise<number>; | Added | 125| ohos.multimedia.camera | CaptureSession | isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback<boolean>): void;<br>isFocusModeSupported(afMode: FocusMode): Promise<boolean>; | Added | 126| ohos.multimedia.camera | CaptureSession | getFocusMode(callback: AsyncCallback<FocusMode>): void;<br>getFocusMode(): Promise<FocusMode>; | Added | 127| ohos.multimedia.camera | CaptureSession | setFocusMode(afMode: FocusMode, callback: AsyncCallback<void>): void;<br>setFocusMode(afMode: FocusMode): Promise<void>; | Added | 128| ohos.multimedia.camera | CaptureSession | setFocusPoint(point: Point, callback: AsyncCallback<void>): void;<br>setFocusPoint(point: Point): Promise<void>; | Added | 129| ohos.multimedia.camera | CaptureSession | getFocusPoint(callback: AsyncCallback<Point>): void;<br>getFocusPoint(): Promise<Point>; | Added | 130| ohos.multimedia.camera | CaptureSession | getFocalLength(callback: AsyncCallback<number>): void;<br>getFocalLength(): Promise<number>; | Added | 131| ohos.multimedia.camera | CaptureSession | getZoomRatioRange(callback: AsyncCallback<Array<number>>): void;<br>getZoomRatioRange(): Promise<Array<number>>; | Added | 132| ohos.multimedia.camera | CaptureSession | getZoomRatio(callback: AsyncCallback<number>): void;<br>getZoomRatio(): Promise<number>; | Added | 133| ohos.multimedia.camera | CaptureSession | setZoomRatio(zoomRatio: number, callback: AsyncCallback<void>): void;<br>setZoomRatio(zoomRatio: number): Promise<void>; | Added | 134| ohos.multimedia.camera | CaptureSession | addOutput(previewOutput: PreviewOutput, callback: AsyncCallback<void>): void;<br>addOutput(previewOutput: PreviewOutput): Promise<void>;<br>addOutput(photoOutput: PhotoOutput, callback: AsyncCallback<void>): void;<br>addOutput(photoOutput: PhotoOutput): Promise<void>;<br>addOutput(videoOutput: VideoOutput, callback: AsyncCallback<void>): void;<br>addOutput(videoOutput: VideoOutput): Promise<void>; | Deprecated | 135| ohos.multimedia.camera | CaptureSession | removeOutput(previewOutput: PreviewOutput, callback: AsyncCallback<void>): void;<br>removeOutput(previewOutput: PreviewOutput): Promise<void>;<br>removeOutput(photoOutput: PhotoOutput, callback: AsyncCallback<void>): void;<br>removeOutput(photoOutput: PhotoOutput): Promise<void>;removeOutput(videoOutput: VideoOutput, callback: AsyncCallback<void>): void;<br>removeOutput(videoOutput: VideoOutput): Promise<void>;<br>removeOutput(metadataOutput: MetadataOutput, callback: AsyncCallback<void>): void;<br>removeOutput(metadataOutput: MetadataOutput): Promise<void>; | Deprecated | 136| ohos.multimedia.camera | CaptureSessionErrorCode | ERROR_INSUFFICIENT_RESOURCES = 0 | Added | 137| ohos.multimedia.camera | CaptureSessionErrorCode | ERROR_TIMEOUT = 1 | Added | 138| ohos.multimedia.camera | CameraOutput | release(callback: AsyncCallback<void>): void;<br>release(): Promise<void>; | Added | 139| ohos.multimedia.camera | PreviewOutput | start(callback: AsyncCallback<void>): void;<br>start(): Promise<void>; | Added | 140| ohos.multimedia.camera | PreviewOutput | stop(callback: AsyncCallback<void>): void;<br>stop(): Promise<void>; | Added | 141| ohos.multimedia.camera | PreviewOutput | release(callback: AsyncCallback<void>): void;<br>release(): Promise<void>; | Deprecated | 142| ohos.multimedia.camera | PhotoOutput | release(callback: AsyncCallback<void>): void;<br>release(): Promise<void>; | Deprecated | 143| ohos.multimedia.camera | VideoOutput | release(callback: AsyncCallback<void>): void;<br>release(): Promise<void>; | Deprecated | 144| ohos.multimedia.camera | PhotoCaptureSetting | mirror?: boolean; | Added | 145| ohos.multimedia.camera | PhotoOutputErrorCode | ERROR_DRIVER_ERROR = 0 | Added | 146| ohos.multimedia.camera | PhotoOutputErrorCode | ERROR_INSUFFICIENT_RESOURCES = 1 | Added | 147| ohos.multimedia.camera | PhotoOutputErrorCode | ERROR_TIMEOUT = 2 | Added | 148| ohos.multimedia.camera | VideoOutputErrorCode | ERROR_DRIVER_ERROR = 0 | Added | 149| ohos.multimedia.camera | MetadataObjectType | FACE_DETECTION = 0 | Added | 150| ohos.multimedia.camera | MetadataObjectType | FACE = 0 | Deprecated | 151| ohos.multimedia.camera | MetadataOutput | on(type: 'error', callback: ErrorCallback<MetadataOutputError>): void; | Added | 152| ohos.multimedia.camera | MetadataOutput | setCapturingMetadataObjectTypes(metadataObjectTypes: Array<MetadataObjectType>, callback: AsyncCallback<void>): void;<br>setCapturingMetadataObjectTypes(metadataObjectTypes: Array<MetadataObjectType>): Promise<void>; | Deprecated | 153| ohos.multimedia.camera | MetadataOutput | getSupportedMetadataObjectTypes(callback: AsyncCallback<Array<MetadataObjectType>>): void;<br>getSupportedMetadataObjectTypes(): Promise<Array<MetadataObjectType>>; | Deprecated | 154| ohos.multimedia.camera | MetadataOutputErrorCode | ERROR_UNKNOWN = -1 | Added | 155| ohos.multimedia.camera | MetadataOutputErrorCode | ERROR_INSUFFICIENT_RESOURCES = 0 | Added | 156| ohos.multimedia.camera | MetadataOutputError | code: MetadataOutputErrorCode; | Added | 157 158**Adaptation Guide** 159 160In addition to new APIs and deprecated APIs, you need to adapt your application to changed APIs. 161 162In Beta4 and later versions, the following APIs are changed. 163 164**New APIs** 165 1661. **Profile** API 167 168 Attribute 1: readonly format; type: CameraFormat 169 170 Attribute 2: readonly size; type: Size 171 1722. **FrameRateRange** API 173 174 Attribute 1: readonly min; type: number 175 176 Attribute 2: readonly max; type: number 177 1783. **VideoProfile** API (inherited from **Profile**) 179 180 Attribute: readonly frameRateRange; type: FrameRateRange 181 1824. **CameraOutputCapability** API 183 184 Attribute 1: readonly previewProfiles; type: Array<Profile> 185 186 Attribute 2: readonly photoProfiles; type: Array<Profile> 187 188 Attribute 3: readonly videoProfiles; type: Array<VideoProfile> 189 190 Attribute 4: readonly supportedMetadataObjectTypes; type: Array<MetadataObjectType> 191 1925. The following APIs are added to **CameraManager**: 193 194 getSupportedOutputCapability(camera: CameraDevice, callback: AsyncCallback<CameraOutputCapability>): void; 195 196 getSupportedOutputCapability(camera: CameraDevice): Promise<CameraOutputCapability>; 197 198 The sample code is as follows: 199 200 ``` 201 cameraManager.getSupportedCameras().then((cameras) => { 202 let cameraDevice = cameras[0]; 203 cameraManager.getSupportedOutputCapability(cameraDevice, (err, CameraOutputCapability) => { 204 if (err) { 205 console.error(`Failed to get the outputCapability. ${err.message}`); 206 return; 207 } 208 console.log('Callback returned with an array of supported outputCapability'); 209 }) 210 }) 211 ``` 212 213 ``` 214 cameraManager.getSupportedCameras().then((cameras) => { 215 let cameraDevice = cameras[0]; 216 cameraManager.getSupportedOutputCapability(cameraDevice).then((cameraoutputcapability) => { 217 console.log('Promise returned with an array of supported outputCapability'); 218 }) 219 }) 220 ``` 221 2226. The **isCameraMuted(): boolean;** API is added to **CameraManager**. 223 224 The sample code is as follows: 225 226 ``` 227 let ismuted = cameraManager.isCameraMuted(); 228 ``` 229 2307. The **isCameraMuteSupported(): boolean;** API is added to **CameraManager**. 231 232 The sample code is as follows: 233 234 ``` 235 let ismutesuppotred = cameraManager.isCameraMuteSupported(); 236 ``` 237 2388. The **muteCamera(mute: boolean): void;** API is added to **CameraManager**. 239 240 The sample code is as follows: 241 242 ``` 243 let mute = true; 244 cameraManager.muteCamera(mute); 245 ``` 246 2479. The **on(type: 'cameraMute', callback: AsyncCallback<boolean>): void;** API is added to **CameraManager**. 248 249 The sample code is as follows: 250 251 ``` 252 cameraManager.on('cameraMute', (err, curMuetd) => { 253 if (err) { 254 console.error(`Failed to get cameraMute callback. ${err.message}`); 255 return; 256 } 257 }) 258 ``` 259 26010. The **open(callback: AsyncCallback<void>): void;** and **open(): Promise<void>;** APIs are added to **CameraInput**. 261 262The sample code is as follows: 263 264``` 265cameraInput.open((err) => { 266 if (err) { 267 console.error(`Failed to open the camera. ${err.message}`); 268 return; 269 } 270 console.log('Callback returned with camera opened.'); 271}) 272``` 273 274``` 275cameraInput.open().then(() => { 276 console.log('Promise returned with camera opened.'); 277}) 278``` 279 28011. The **close(callback: AsyncCallback<void>): void;** and **close(): Promise<void>;** APIs are added to **CameraInput**. 281 282 The sample code is as follows: 283 284 ``` 285 cameraInput.close((err) => { 286 if (err) { 287 console.error(`Failed to close the cameras. ${err.message}`); 288 return; 289 } 290 console.log('Callback returned with camera closed.'); 291 }) 292 ``` 293 294 ``` 295 cameraInput.close().then(() => { 296 console.log('Promise returned with camera closed.'); 297 }) 298 ``` 299 30012. The following enumerations are added to **CameraInputErrorCode**: 301 302 Enumeration: ERROR_NO_PERMISSION; value: 0 303 304 Enumeration: ERROR_DEVICE_PREEMPTED; value: 1 305 306 Enumeration: ERROR_DEVICE_DISCONNECTED; value: 2 307 308 Enumeration: ERROR_DEVICE_IN_USE; value: 3 309 310 Enumeration: ERROR_DRIVER_ERROR; value: 4 311 31213. The following enumeration is added to **CameraFormat**: 313 314 Enumeration: CAMERA_FORMAT_RGBA_8888; value: 3 315 31614. The **getMeteringPoint(callback: AsyncCallback<Point>): void;** and **getMeteringPoint(): Promise<Point>;** APIs are added to **CaptureSession**. 317 318 The sample code is as follows: 319 320 ``` 321 captureSession.getMeteringPoint((err, exposurePoint) => { 322 if (err) { 323 console.log(`Failed to get the current exposure point ${err.message}`); 324 return ; 325 } 326 console.log(`Callback returned with current exposure point: ${exposurePoint}`); 327 }) 328 ``` 329 330 ``` 331 captureSession.getMeteringPoint().then((exposurePoint) => { 332 console.log(`Promise returned with current exposure point : ${exposurePoint}`); 333 }) 334 ``` 335 33615. The **setMeteringPoint(point: Point, callback: AsyncCallback<void>): void;** and **setMeteringPoint(point: Point): Promise<void>;** APIs are added to **CaptureSession**. 337 338 The sample code is as follows: 339 340 ``` 341 const Point1 = {x: 1, y: 1}; 342 343 captureSession.setMeteringPoint(Point1,(err) => { 344 if (err) { 345 console.log(`Failed to set the exposure point ${err.message}`); 346 return ; 347 } 348 console.log('Callback returned with the successful execution of setMeteringPoint'); 349 }) 350 ``` 351 352 ``` 353 const Point2 = {x: 2, y: 2}; 354 355 captureSession.setMeteringPoint(Point2).then(() => { 356 console.log('Promise returned with the successful execution of setMeteringPoint'); 357 }) 358 ``` 359 36016. The following enumerations are added to **CaptureSessionErrorCode**: 361 362 Enumeration: ERROR_INSUFFICIENT_RESOURCES; value: 0 363 364 Enumeration: ERROR_TIMEOUT; value: 1 365 36617. The **CameraOutput** API is added and contains the **release(callback: AsyncCallback<void>): void;** and **release(): Promise<void>;** methods. 367 368 The sample code (for **previewOutput**) is as follows: 369 370 ``` 371 previewOutput.release((err) => { 372 if (err) { 373 console.error(`Failed to release the PreviewOutput instance ${err.message}`); 374 return; 375 } 376 console.log('Callback invoked to indicate that the PreviewOutput instance is released successfully.'); 377 }); 378 ``` 379 380 ``` 381 previewOutput.release().then(() => { 382 console.log('Promise returned to indicate that the PreviewOutput instance is released successfully.'); 383 }) 384 ``` 385 38618. The **start(callback: AsyncCallback<void>): void;** and **start(): Promise<void>;** APIs are added to **PreviewOutput**. 387 388 The sample code is as follows: 389 390 ``` 391 previewOutput.start((err) => { 392 if (err) { 393 console.error(`Failed to start the previewOutput. ${err.message}`); 394 return; 395 } 396 console.log('Callback returned with previewOutput started.'); 397 }) 398 ``` 399 400 ``` 401 previewOutput.start().then(() => { 402 console.log('Promise returned with previewOutput started.'); 403 }) 404 ``` 405 40619. The **stop(callback: AsyncCallback<void>): void;** and **stop(): Promise<void>;** APIs are added to **PreviewOutput**. 407 408 The sample code is as follows: 409 410 ``` 411 previewOutput.stop((err) => { 412 if (err) { 413 console.error(`Failed to stop the previewOutput. ${err.message}`); 414 return; 415 } 416 console.log('Callback returned with previewOutput stopped.'); 417 }) 418 ``` 419 420 ``` 421 previewOutput.stop().then(() => { 422 console.log('Callback returned with previewOutput stopped.'); 423 }) 424 ``` 425 42620. **PhotoCaptureSetting** API 427 428 Attribute 1: mirror?; type: boolean 429 43021. The following enumerations are added to **PhotoOutputErrorCode**: 431 432 Enumeration: ERROR_DRIVER_ERROR; value: 0 433 434 Enumeration: ERROR_INSUFFICIENT_RESOURCES; value: 1 435 436 Enumeration: ERROR_TIMEOUT; value: 2 437 43822. The following enumeration is added to **VideoOutputErrorCode**: 439 440 Enumeration: ERROR_DRIVER_ERROR; value: 0 441 44223. The **on(type: 'error', callback: ErrorCallback<MetadataOutputError>): void;** API is added to **MetadataOutput**. 443 444 The sample code is as follows: 445 446 ``` 447 metadataOutput.on('error', (metadataOutputError) => { 448 console.log(`Metadata output error code: ${metadataOutputError.code}`); 449 }) 450 ``` 451 45224. The following enumerations are added to **MetadataOutputErrorCode**. 453 454 Enumeration: ERROR_UNKNOWN; value: -1 455 456 Enumeration: ERROR_INSUFFICIENT_RESOURCES; value: 0 457 45825. **MetadataOutputError** API 459 460 Attribute: code; value: MetadataOutputErrorCode 461 462**Deprecated APIs** 463 4641. The **on(type: 'exposureStateChange', callback: AsyncCallback<ExposureState>): void;** API in **CameraInput** is deprecated. 465 4662. The **release(callback: AsyncCallback<void>): void;** and **release(): Promise<void>;** APIs in **previewOutput** are deprecated. 467 4683. The following APIs in **metadataOutput** are deprecated: 469 470 setCapturingMetadataObjectTypes(metadataObjectTypes: Array<MetadataObjectType>, callback: AsyncCallback<void>): void;<br>setCapturingMetadataObjectTypes(metadataObjectTypes: Array<MetadataObjectType>): Promise<void>; 471 4724. The following APIs in **metadataOutput** are deprecated: 473 474 getSupportedMetadataObjectTypes(callback: AsyncCallback<Array<MetadataObjectType>>): void;<br>getSupportedMetadataObjectTypes(): Promise<Array<MetadataObjectType>>; 475 4765. The **release(callback: AsyncCallback<void>): void;** and **release(): Promise<void>;** APIs in **PreviewOutput** are deprecated. 477 4786. The **release(callback: AsyncCallback<void>): void;** and **release(): Promise<void>;** APIs in **PhotoOutput** are deprecated. 479 4807. The **release(callback: AsyncCallback<void>): void;** and **release(): Promise<void>;** APIs in **VideoOutput** are deprecated. 481 4828. The **getCameraId(callback: AsyncCallback<string>): void;** and **getCameraId(): Promise<string>;** APIs in **CameraInput** are deprecated. 483 4849. The **getExposurePoint(callback: AsyncCallback<Point>): void;** and **getExposurePoint(): Promise<Point>;** APIs in **CameraInput** are deprecated. 485 48610. The **setExposurePoint(exposurePoint: Point, callback: AsyncCallback<void>): void;** and **setExposurePoint(exposurePoint: Point): Promise<void>;** APIs in **CameraInput** are deprecated. 487 488**Changed APIs** 489 4901. In **CameraManager**, the return value of **getCameras** is changed from **Array<Camera>** to **Array<CameraDevice>**, and the API name is changed from **getCameras** to **getSupportedCameras**. Therefore, the **getCameras(callback: AsyncCallback<Array<Camera>>): void;** and **getCameras(): Promise<Array<Camera>>;** APIs are changed to **getSupportedCameras(callback: AsyncCallback<Array<CameraDevice>>): void** and **getSupportedCameras(): Promise<Array<CameraDevice>>;**. 491 492 The sample code is as follows: 493 494 ``` 495 cameraManager.getSupportedCameras((err, cameras) => { 496 if (err) { 497 console.error(`Failed to get the cameras. ${err.message}`); 498 return; 499 } 500 console.log(`Callback returned with an array of supported cameras: ${cameras.length}`); 501 }) 502 ``` 503 504 ``` 505 cameraManager.getSupportedCameras().then((cameras) => { 506 console.log(`Promise returned with an array of supported cameras: ${cameras.length}`); 507 }) 508 ``` 509 5102. In **CameraManager**, the input parameter of **createCameraInput** is changed from **cameraId: string** to **camera: CameraDevice**. Therefore, the **createCameraInput(cameraId: string, callback: AsyncCallback<CameraInput>): void;** and **createCameraInput(cameraId: string): Promise<CameraInput>;** APIs are changed to **createCameraInput(camera: CameraDevice, callback: AsyncCallback<CameraInput>): void;** and **createCameraInput(camera: CameraDevice): Promise<CameraInput>;**. 511 512 The sample code is as follows: 513 514 ``` 515 let cameraDevice = cameras[0]; 516 cameraManager.createCameraInput(cameraDevice, (err, cameraInput) => { 517 if (err) { 518 console.error(`Failed to create the CameraInput instance. ${err.message}`); 519 return; 520 } 521 console.log('Callback returned with the CameraInput instance.'); 522 }) 523 ``` 524 525 ``` 526 let cameraDevice = cameras[0]; 527 cameraManager.createCameraInput(cameraDevice).then((cameraInput) => { 528 console.log('Promise returned with the CameraInput instance'); 529 }) 530 ``` 531 5323. In **CameraManager**, the input parameter **profile: Profile** is added to **createPreviewOutput** and the **profile** parameter is obtained by the **getSupportedOutputCapability** API. Therefore, the **createPreviewOutput(surfaceId: string, callback: AsyncCallback<PreviewOutput>): void;** and **createPreviewOutput(surfaceId: string): Promise<PreviewOutput>;** APIs are changed to **createPreviewOutput(profile: Profile, surfaceId: string, callback: AsyncCallback<PreviewOutput>): void;** and **createPreviewOutput(profile: Profile, surfaceId: string): Promise<PreviewOutput>;**. 533 534 The sample code is as follows: 535 536 ``` 537 let profile = cameraoutputcapability.previewProfiles[0]; 538 cameraManager.createPreviewOutput(profile, surfaceId, (err, previewOutput) => { 539 if (err) { 540 console.error(`Failed to gcreate previewOutput. ${err.message}`); 541 return; 542 } 543 console.log('Callback returned with previewOutput created.'); 544 }) 545 ``` 546 547 ``` 548 let profile = cameraoutputcapability.previewProfiles[0]; 549 cameraManager.createPreviewOutput(profile, surfaceId).then((previewOutput) => { 550 console.log('Promise returned with previewOutput created.'); 551 }) 552 ``` 553 5544. In **CameraManager**, the input parameter **profile: Profile** is added to **createPhotoOutput** and the **profile** parameter is obtained by the **getSupportedOutputCapability** API. Therefore, the **CreatePhotoOutput(surfaceId: string, callback: AsyncCallback<PhotoOutput>): void;** and **CreatePhotoOutput(surfaceId: string): Promise<PhotoOutput>;** APIs are changed to **createPhotoOutput(profile: Profile, surfaceId: string, callback: AsyncCallback<PhotoOutput>): void;** and **createPhotoOutput(profile: Profile, surfaceId: string): Promise<PhotoOutput>;**. 555 556 The sample code is as follows: 557 558 ``` 559 let profile = cameraoutputcapability.photoProfiles[0]; 560 cameraManager.createPhotoOutput(profile, surfaceId, (err, photoOutput) => { 561 if (err) { 562 console.error(`Failed to create photoOutput. ${err.message}`); 563 return; 564 } 565 console.log('Callback returned with photoOutput created.'); 566 }) 567 ``` 568 569 ``` 570 let profile = cameraoutputcapability.photoProfiles[0]; 571 cameraManager.createPhotoOutput(profile, surfaceId).then((photoOutput) => { 572 console.log('Promise returned with photoOutput created.'); 573 }) 574 ``` 575 5765. In **CameraManager**, the input parameter **profile: Profile** is added to **createVideoOutput** and the **profile** parameter is obtained by the **getSupportedOutputCapability** API. Therefore, the **createVideoOutput(surfaceId: string, callback: AsyncCallback<VideoOutput>): void;** and **createVideoOutput(surfaceId: string): Promise<VideoOutput>;** APIs are changed to **createVideoOutput(profile: VideoProfile, surfaceId: string, callback: AsyncCallback<VideoOutput>): void;** and **createVideoOutput(profile: VideoProfile, surfaceId: string): Promise<VideoOutput>;**. 577 578 The sample code is as follows: 579 580 ``` 581 let profile = cameraoutputcapability.videoProfiles[0]; 582 cameraManager.createVideoOutput(profile, surfaceId, (err, videoOutput) => { 583 if (err) { 584 console.error(`Failed to create videoOutput. ${err.message}`); 585 return; 586 } 587 console.log('Callback returned with an array of supported outputCapability' ); 588 }) 589 ``` 590 591 ``` 592 let profile = cameraoutputcapability.videoProfiles[0]; 593 cameraManager.createVideoOutput(profile, surfaceId).then((videoOutput) => { 594 console.log('Promise returned with videoOutput created.'); 595 }) 596 ``` 597 5986. In **CameraManager**, the input parameter **metadataObjectTypes: Array<MetadataObjectType>** is added to **createMetadataOutput**, and the **metadataObjectTypes** parameter is obtained by the **getSupportedOutputCapability** API. Therefore, the **function createMetadataOutput(callback: AsyncCallback<MetadataOutput>): void;** and **function createMetadataOutput(): Promise<MetadataOutput>;** APIs are changed to **createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>, callback: AsyncCallback<MetadataOutput>): void;** and **createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>): Promise<MetadataOutput>;**. 599 600 The sample code is as follows: 601 602 ``` 603 let metadataObjectTypes = cameraoutputcapability.supportedMetadataObjectTypes; 604 cameraManager.createMetadataOutput(metadataObjectTypes, (err, metadataOutput) => { 605 if (err) { 606 console.error(`Failed to create metadataOutput. ${err.message}`); 607 return; 608 } 609 console.log('Callback returned with metadataOutput created.'); 610 }) 611 ``` 612 613 ``` 614 let metadataObjectTypes = cameraoutputcapability.supportedMetadataObjectTypes; 615 cameraManager.createMetadataOutput(metadataObjectTypes).then((metadataOutput) => { 616 console.log('Promise returned with metadataOutput created.'); 617 }) 618 ``` 619 6207. In **CameraManager**, **createCaptureSession** does not need to consider the context attribute. Therefore, the **createCaptureSession(context: Context, callback: AsyncCallback<CaptureSession>): void;** and **createCaptureSession(context: Context): Promise<CaptureSession>;** APIs are changed to **createCaptureSession(callback: AsyncCallback<CaptureSession>): void;** and **createCaptureSession(): Promise<CaptureSession>;**. 621 622 The sample code is as follows: 623 624 ```typescript 625 cameraManager.createCaptureSession((err, captureSession) => { 626 if (err) { 627 console.error(`Failed to create captureSession. ${err.message}`); 628 return; 629 } 630 console.log('Callback returned with captureSession created.'); 631 }) 632 ``` 633 634 ``` 635 cameraManager.createCaptureSession().then((captureSession) => { 636 console.log('Promise returned with captureSession created.'); 637 }) 638 ``` 639 6408. The type of the **camera** attribute of the **CameraStatusInfo** API is changed from **Camera** to **CameraDevice**. 641 6429. In **CameraInput**, the input parameter **camera: CameraDevice** is added to the **on(type: 'error')** API. Therefore, the **on(type: 'error', callback: ErrorCallback<CameraInputError>): void;** API is changed to **on(type: 'error', camera: CameraDevice, callback: ErrorCallback<CameraInputError>): void;**. 643 644 The sample code is as follows: 645 646 ``` 647 let cameraDevice = cameras[0]; 648 cameraInput.on('error', cameraDevice, (cameraInputError) => { 649 console.log(`Camera input error code: ${cameraInputError.code}`); 650 }) 651 ``` 652 65310. The following APIs are moved from **CameraInput** to **CaptureSession**: 654 655 hasFlash(callback: AsyncCallback<boolean>): void;<br>hasFlash(): Promise<boolean>;<br> 656 657 isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback<boolean>): void;<br>isFlashModeSupported(flashMode: FlashMode): Promise<boolean>;<br> 658 659 getFlashMode(callback: AsyncCallback<FlashMode>): void;<br>getFlashMode(): Promise<FlashMode>;<br> 660 661 setFlashMode(flashMode: FlashMode, callback: AsyncCallback<void>): void;<br>setFlashMode(flashMode: FlashMode): Promise<void>;<br> 662 663 isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback<boolean>): void;<br>isExposureModeSupported(aeMode: ExposureMode): Promise<boolean>;<br> 664 665 getExposureMode(callback: AsyncCallback<ExposureMode>): void;<br>getExposureMode(): Promise<ExposureMode>;<br> 666 667 setExposureMode(aeMode: ExposureMode, callback: AsyncCallback<void>): void;<br>setExposureMode(aeMode: ExposureMode): Promise<void>;<br> 668 669 getMeteringPoint(callback: AsyncCallback<Point>): void;<br>getMeteringPoint(): Promise<Point>;<br> 670 671 setMeteringPoint(point: Point, callback: AsyncCallback<void>): void;<br>setMeteringPoint(point: Point): Promise<void>;<br> 672 673 getExposureBiasRange(callback: AsyncCallback<Array<number>>): void;<br>getExposureBiasRange(): Promise<Array<number>>;<br> 674 675 setExposureBias(exposureBias: number, callback: AsyncCallback<void>): void;<br>setExposureBias(exposureBias: number): Promise<void>;<br> 676 677 getExposureValue(callback: AsyncCallback<number>): void;<br>getExposureValue(): Promise<number>;<br> 678 679 isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback<boolean>): void;<br>isFocusModeSupported(afMode: FocusMode): Promise<boolean>;<br> 680 681 getFocusMode(callback: AsyncCallback<FocusMode>): void;<br>getFocusMode(): Promise<FocusMode>;<br> 682 683 setFocusMode(afMode: FocusMode, callback: AsyncCallback<void>): void;<br>setFocusMode(afMode: FocusMode): Promise<void>;<br> 684 685 setFocusPoint(point: Point, callback: AsyncCallback<void>): void;<br>setFocusPoint(point: Point): Promise<void>;<br> 686 687 getFocusPoint(callback: AsyncCallback<Point>): void;<br>getFocusPoint(): Promise<Point>;<br> 688 689 getFocalLength(callback: AsyncCallback<number>): void;<br>getFocalLength(): Promise<number>;<br> 690 691 getZoomRatioRange(callback: AsyncCallback<Array<number>>): void;<br>getZoomRatioRange(): Promise<Array<number>>;<br> 692 693 getZoomRatio(callback: AsyncCallback<number>): void;<br>getZoomRatio(): Promise<number>;<br> 694 695 setZoomRatio(zoomRatio: number, callback: AsyncCallback<void>): void;<br>setZoomRatio(zoomRatio: number): Promise<void>; 696 69711. The **on(type: 'focusStateChange', callback: AsyncCallback<FocusState>): void;** API is moved from **CameraInput** to **CaptureSession**. 698 699 The sample code is as follows: 700 701 ``` 702 captureSession.on('focusStateChange', (focusState) => { 703 console.log(`Focus state : ${focusState}`); 704 }) 705 ``` 706 70712. The following enumerations are added to **ExposureMode**: 708 709 Enumeration: EXPOSURE_MODE_AUTO; initial value: changed from the default value to **1** 710 711 Enumeration: EXPOSURE_MODE_CONTINUOUS_AUTO; initial value: changed from the default value to **2** 712 71313. The following enumerations are added to **VideoStabilizationMode**: 714 715 Enumeration: LOW; initial value: changed from the default value to **1** 716 717 Enumeration: MIDDLE; initial value: changed from the default value to **2** 718 719 Enumeration: HIGH; initial value: changed from the default value to **3** 720 721 Enumeration: AUTO; initial value: changed from the default value to **4** 722 72314. In **CaptureSession**, the parameter of the **addOutput** API is changed from the original subclass type (**PreviewOutput**, **PhotoOutput**, **VideoOutput**, and **MetadataOutput**) to the base class type (**CameraOutput**). After the change, the number of APIs is reduced from 8 to 2. 724 725 APIs before change: 726 727 addOutput(previewOutput: PreviewOutput, callback: AsyncCallback<void>): void;<br>addOutput(previewOutput: PreviewOutput): Promise<void>;<br>addOutput(photoOutput: PhotoOutput, callback: AsyncCallback<void>): void;<br>addOutput(photoOutput: PhotoOutput): Promise<void>;<br>addOutput(videoOutput: VideoOutput, callback: AsyncCallback<void>): void;<br>addOutput(videoOutput: VideoOutput): Promise<void>;<br>addOutput(metadataOutput: MetadataOutput, callback: AsyncCallback<void>): void;<br>addOutput(metadataOutput: MetadataOutput): Promise<void>; 728 729 APIs after change: 730 731 addOutput(cameraOutput: CameraOutput, callback: AsyncCallback<void>): void;<br>addOutput(cameraOutput: CameraOutput): Promise<void>; 732 733 The sample code (for **PreviewOutput**) is as follows: 734 735 ``` 736 captureSession.addOutput(previewOutput, (err) => { 737 if (err) { 738 console.error(`Failed to add output. ${err.message}`); 739 return; 740 } 741 console.log('Callback returned with output added.'); 742 }) 743 ``` 744 745 ``` 746 captureSession.addOutput(previewOutput).then(() => { 747 console.log('Promise returned with cameraOutput added.'); 748 }) 749 ``` 750 75115. In **CaptureSession**, the parameter of the **removeOutput** API is changed from the original subclass type (**PreviewOutput**, **PhotoOutput**, **VideoOutput**, and **MetadataOutput**) to the base class type (**CameraOutput**). After the change, the number of APIs is reduced from 8 to 2. 752 753 APIs before change: 754 755 removeOutput(previewOutput: PreviewOutput, callback: AsyncCallback<void>): void;<br>removeOutput(previewOutput: PreviewOutput): Promise<void>;<br>removeOutput(photoOutput: PhotoOutput, callback: AsyncCallback<void>): void;<br>removeOutput(photoOutput: PhotoOutput): Promise<void>;<br>removeOutput(videoOutput: VideoOutput, callback: AsyncCallback<void>): void;<br>removeOutput(videoOutput: VideoOutput): Promise<void>;<br>removeOutput(metadataOutput: MetadataOutput, callback: AsyncCallback<void>): void;<br>removeOutput(metadataOutput: MetadataOutput): Promise<void>; 756 757 APIs after change: 758 759 removeOutput(cameraOutput: CameraOutput, callback: AsyncCallback<void>): void;<br>removeOutput(cameraOutput: CameraOutput): Promise<void>; 760 761 The sample code (for **PreviewOutput**) is as follows: 762 763 ``` 764 captureSession.removeOutput(previewOutput, (err) => { 765 if (err) { 766 console.error(`Failed to remove the CameraOutput instance. ${err.message}`); 767 return; 768 } 769 console.log('Callback invoked to indicate that the CameraOutput instance is removed.'); 770 }); 771 ``` 772 773 ``` 774 captureSession.removeOutput(previewOutput).then(() => { 775 console.log('Promise returned to indicate that the CameraOutput instance is removed.'); 776 }) 777 ``` 778 77916. The following enumeration in **MetadataObjectType** is changed: 780 781 The enumeration value name is changed from **FACE** to **FACE_DETECTION**. 782 78317. The name of the **Camera** API is changed to **CameraDevice**. 784