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