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