1e41f4b71Sopenharmony_ci# Multimedia Subsystem Changelog 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci## cl.subsystemname.1 Camera API Changed 4e41f4b71Sopenharmony_ci1. All the APIs of the camera component are changed to system APIs in the API version 9. 5e41f4b71Sopenharmony_ci2. Some functional APIs are added and some others are deprecated to: 6e41f4b71Sopenharmony_ci 7e41f4b71Sopenharmony_ciImprove the usability of camera APIs. 8e41f4b71Sopenharmony_ciHelp you quickly understand camera APIs and use them for development. 9e41f4b71Sopenharmony_ciFacilitate 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 Impact** 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ciJS 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. 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ci**Key API/Component Changes** 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ci| Module | Class | Method/Attribute/Enum/Constant | Is System API| Change Type| 20e41f4b71Sopenharmony_ci| ---------------------- | ----------------------- | ------------------------------------------------------------ | --------------- | -------- | 21e41f4b71Sopenharmony_ci| ohos.multimedia.camera | camera | function getCameraManager(context: Context): CameraManager; | Yes | Added | 22e41f4b71Sopenharmony_ci| ohos.multimedia.camera | camera | function getCameraManager(context: Context, callback: AsyncCallback<CameraManager>): void;<br>function getCameraManager(context: Context): Promise<CameraManager>; | Yes | Deprecated | 23e41f4b71Sopenharmony_ci| ohos.multimedia.camera | CameraErrorCode | INVALID_ARGUMENT = 7400101,<br>OPERATION_NOT_ALLOWED = 7400102,<br>SESSION_NOT_CONFIG = 7400103,<br>SESSION_NOT_RUNNING = 7400104,<br>SESSION_CONFIG_LOCKED = 7400105,<br>DEVICE_SETTING_LOCKED = 7400106,<br>CONFILICT_CAMERA = 7400107,<br>DEVICE_DISABLED = 7400108,<br>SERVICE_FATAL_ERROR = 7400201 | Yes | Added | 24e41f4b71Sopenharmony_ci| ohos.multimedia.camera | CameraManager | getSupportedCameras(): Array<CameraDevice>;<br>getSupportedOutputCapability(camera: CameraDevice): CameraOutputCapability;<br>createCameraInput(camera: CameraDevice): CameraInput;<br>createCameraInput(position: CameraPosition, type: CameraType): CameraInput;<br>createPreviewOutput(profile: Profile, surfaceId: string): PreviewOutput;<br>createPhotoOutput(profile: Profile, surfaceId: string): PhotoOutput;<br>createVideoOutput(profile: VideoProfile, surfaceId: string): VideoOutput;<br>createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>): MetadataOutput;<br>createCaptureSession(): CaptureSession; | Yes | Added | 25e41f4b71Sopenharmony_ci| ohos.multimedia.camera | CameraManager | getSupportedCameras(callback: AsyncCallback<Array<CameraDevice>>): void;<br>getSupportedCameras(): Promise<Array<CameraDevice>>;<br>getSupportedOutputCapability(camera: CameraDevice, callback: AsyncCallback<CameraOutputCapability>): void;<br>getSupportedOutputCapability(camera: CameraDevice): Promise<CameraOutputCapability>;<br>createCameraInput(camera: CameraDevice, callback: AsyncCallback<CameraInput>): void;<br>createCameraInput(camera: CameraDevice): Promise<CameraInput>;<br>createCameraInput(position: CameraPosition, type: CameraType, callback: AsyncCallback<CameraInput>): void;<br>createCameraInput(position: CameraPosition, type: CameraType): Promise<CameraInput>;<br>createPreviewOutput(profile: Profile, surfaceId: string, callback: AsyncCallback<PreviewOutput>): void;<br>createPreviewOutput(profile: Profile, surfaceId: string): Promise<PreviewOutput>;<br>createPhotoOutput(profile: Profile, surfaceId: string, callback: AsyncCallback<PhotoOutput>): void;<br>createPhotoOutput(profile: Profile, surfaceId: string): Promise<PhotoOutput>;<br>createVideoOutput(profile: VideoProfile, surfaceId: string, callback: AsyncCallback<VideoOutput>): void;<br>createVideoOutput(profile: VideoProfile, surfaceId: string): Promise<VideoOutput>;<br>createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>, callback: AsyncCallback<MetadataOutput>): void;<br>createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>): Promise<MetadataOutput>;<br>createCaptureSession(callback: AsyncCallback<CaptureSession>): void;<br>createCaptureSession(): Promise<CaptureSession>; | Yes | Deprecated | 26e41f4b71Sopenharmony_ci| ohos.multimedia.camera | CameraType | CAMERA_TYPE_DEFAULT = 0 | Yes | Added | 27e41f4b71Sopenharmony_ci| ohos.multimedia.camera | CameraType | CAMERA_TYPE_UNSPECIFIED = 0 | Yes | Deprecated | 28e41f4b71Sopenharmony_ci| ohos.multimedia.camera | CameraInput | on(type: 'error', camera: CameraDevice, callback: ErrorCallback<BusinessError>): void; | Yes | Added | 29e41f4b71Sopenharmony_ci| ohos.multimedia.camera | CameraInput | release(callback: AsyncCallback<void>): void;<br>release(): Promise<void>;<br>on(type: 'error', camera: CameraDevice, callback: ErrorCallback<CameraInputError>): void; | Yes | Deprecated | 30e41f4b71Sopenharmony_ci| ohos.multimedia.camera | CameraInputErrorCode | ERROR_UNKNOWN = -1<br>ERROR_NO_PERMISSION = 0<br>ERROR_DEVICE_PREEMPTED = 1<br>ERROR_DEVICE_DISCONNECTED = 2<br>ERROR_DEVICE_IN_USE = 3<br>ERROR_DRIVER_ERROR = 4 | Yes | Deprecated | 31e41f4b71Sopenharmony_ci| ohos.multimedia.camera | CameraInputError | code: CameraInputErrorCode | Yes | Deprecated | 32e41f4b71Sopenharmony_ci| ohos.multimedia.camera | CaptureSession | beginConfig(): void;<br>addInput(cameraInput: CameraInput): void;<br>removeInput(cameraInput: CameraInput): void;<br>addOutput(cameraOutput: CameraOutput): void;<br>removeOutput(cameraOutput: CameraOutput): void;<br>hasFlash(): boolean;<br>isFlashModeSupported(flashMode: FlashMode): boolean;<br>getFlashMode(): FlashMode;<br>setFlashMode(flashMode: FlashMode): void;<br>isExposureModeSupported(aeMode: ExposureMode): boolean;<br>getExposureMode(): ExposureMode;<br>setExposureMode(aeMode: ExposureMode): void;<br>getMeteringPoint(): Point;<br>setMeteringPoint(point: Point): void;<br>getExposureBiasRange(): Array<number>;<br>setExposureBias(exposureBias: number): void;<br>getExposureValue(): number;<br>isFocusModeSupported(afMode: FocusMode): boolean;<br>getFocusMode(): FocusMode;<br>setFocusMode(afMode: FocusMode): void;<br>setFocusPoint(point: Point): void;<br>getFocusPoint(): Point;<br>getFocalLength(): number;<br>getZoomRatioRange(): Array<number>;<br>getZoomRatio(): number;<br>setZoomRatio(zoomRatio: number): void;<br>isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): boolean;<br>getActiveVideoStabilizationMode(): VideoStabilizationMode;<br>setVideoStabilizationMode(mode: VideoStabilizationMode): void;<br>on(type: 'error', callback: ErrorCallback<BusinessError>): void; | Yes | Added | 33e41f4b71Sopenharmony_ci| ohos.multimedia.camera | CaptureSession | beginConfig(callback: AsyncCallback<void>): void;<br>beginConfig(): Promise<void>;<br>addInput(cameraInput: CameraInput, callback: AsyncCallback<void>): void;<br>addInput(cameraInput: CameraInput): Promise<void>;<br>removeInput(cameraInput: CameraInput, callback: AsyncCallback<void>): void;<br>removeInput(cameraInput: CameraInput): Promise<void>;<br>addOutput(cameraOutput: CameraOutput, callback: AsyncCallback<void>): void;<br>addOutput(cameraOutput: CameraOutput): Promise<void>;<br>removeOutput(cameraOutput: CameraOutput, callback: AsyncCallback<void>): void;<br>removeOutput(cameraOutput: CameraOutput): Promise<void>;<br>hasFlash(callback: AsyncCallback<boolean>): void;<br>hasFlash(): Promise<boolean>;<br>isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback<boolean>): void;<br>isFlashModeSupported(flashMode: FlashMode): Promise<boolean>;<br>getFlashMode(callback: AsyncCallback<FlashMode>): void;<br>getFlashMode(): Promise<FlashMode>;<br>setFlashMode(flashMode: FlashMode, callback: AsyncCallback<void>): void;<br>setFlashMode(flashMode: FlashMode): Promise<void>;<br>isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback<boolean>): void;<br>isExposureModeSupported(aeMode: ExposureMode): Promise<boolean>;<br>getExposureMode(callback: AsyncCallback<ExposureMode>): void;<br>getExposureMode(): Promise<ExposureMode>;<br>setExposureMode(aeMode: ExposureMode, callback: AsyncCallback<void>): void;<br>setExposureMode(aeMode: ExposureMode): Promise<void>;<br>getMeteringPoint(callback: AsyncCallback<Point>): void;<br>getMeteringPoint(): Promise<Point>;<br>setMeteringPoint(point: Point, callback: AsyncCallback<void>): void;<br>setMeteringPoint(point: Point): Promise<void>;<br>getExposureBiasRange(callback: AsyncCallback<Array<number>>): void;<br>getExposureBiasRange(): Promise<Array<number>>;<br>setExposureBias(exposureBias: number, callback: AsyncCallback<void>): void;<br>setExposureBias(exposureBias: number): Promise<void>;<br>getExposureValue(callback: AsyncCallback<number>): void;<br>getExposureValue(): Promise<number>;<br>isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback<boolean>): void;<br>isFocusModeSupported(afMode: FocusMode): Promise<boolean>;<br>getFocusMode(callback: AsyncCallback<FocusMode>): void;<br>getFocusMode(): Promise<FocusMode>;<br>setFocusMode(afMode: FocusMode, callback: AsyncCallback<void>): void;<br>setFocusMode(afMode: FocusMode): Promise<void>;<br>setFocusPoint(point: Point, callback: AsyncCallback<void>): void;<br>setFocusPoint(point: Point): Promise<void>;<br>getFocusPoint(callback: AsyncCallback<Point>): void;<br>getFocusPoint(): Promise<Point>;<br>getFocalLength(callback: AsyncCallback<number>): void;<br>getFocalLength(): Promise<number>;<br>getZoomRatioRange(callback: AsyncCallback<Array<number>>): void;<br>getZoomRatioRange(): Promise<Array<number>>;<br>getZoomRatio(callback: AsyncCallback<number>): void;<br>getZoomRatio(): Promise<number>;<br>setZoomRatio(zoomRatio: number, callback: AsyncCallback<void>): void;<br>setZoomRatio(zoomRatio: number): Promise<void>;<br>isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode, callback: AsyncCallback<boolean>): void;<br>isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): Promise<boolean>;<br>getActiveVideoStabilizationMode(callback: AsyncCallback<VideoStabilizationMode>): void;<br>getActiveVideoStabilizationMode(): Promise<VideoStabilizationMode>;<br>setVideoStabilizationMode(mode: VideoStabilizationMode, callback: AsyncCallback<void>): void;<br>setVideoStabilizationMode(mode: VideoStabilizationMode): Promise<void>;<br>on(type: 'error', callback: ErrorCallback<CaptureSessionError>): void; | Yes | Deprecated | 34e41f4b71Sopenharmony_ci| ohos.multimedia.camera | CaptureSessionErrorCode | ERROR_UNKNOWN = -1<br>ERROR_INSUFFICIENT_RESOURCES = 0<br>ERROR_TIMEOUT = 1 | Yes | Deprecated | 35e41f4b71Sopenharmony_ci| ohos.multimedia.camera | CaptureSessionError | code: CaptureSessionErrorCode | Yes | Deprecated | 36e41f4b71Sopenharmony_ci| ohos.multimedia.camera | PreviewOutput | on(type: 'error', callback: ErrorCallback<BusinessError>): void; | Yes | Added | 37e41f4b71Sopenharmony_ci| ohos.multimedia.camera | PreviewOutput | on(type: 'error', callback: ErrorCallback<PreviewOutputError>): void; | Yes | Deprecated | 38e41f4b71Sopenharmony_ci| ohos.multimedia.camera | PreviewOutputErrorCode | ERROR_UNKNOWN = -1 | Yes | Deprecated | 39e41f4b71Sopenharmony_ci| ohos.multimedia.camera | PreviewOutputError | code: PreviewOutputErrorCode | Yes | Deprecated | 40e41f4b71Sopenharmony_ci| ohos.multimedia.camera | PhotoOutput | capture(): Promise<void>;<br>isMirrorSupported(): boolean;<br>on(type: 'error', callback: ErrorCallback<BusinessError>): void; | Yes | Added | 41e41f4b71Sopenharmony_ci| ohos.multimedia.camera | PhotoOutput | isMirrorSupported(callback: AsyncCallback<boolean>): void;<br>isMirrorSupported(): Promise<boolean>;<br>on(type: 'error', callback: ErrorCallback<PhotoOutputError>): void; | Yes | Deprecated | 42e41f4b71Sopenharmony_ci| ohos.multimedia.camera | PhotoOutputErrorCode | ERROR_UNKNOWN = -1<br>ERROR_DRIVER_ERROR = 0<br>ERROR_INSUFFICIENT_RESOURCES = 1<br>ERROR_TIMEOUT = 2 | Yes | Deprecated | 43e41f4b71Sopenharmony_ci| ohos.multimedia.camera | PhotoOutputError | code: PhotoOutputErrorCode | Yes | Deprecated | 44e41f4b71Sopenharmony_ci| ohos.multimedia.camera | VideoOutput | on(type: 'error', callback: ErrorCallback<BusinessError>): void; | Yes | Added | 45e41f4b71Sopenharmony_ci| ohos.multimedia.camera | VideoOutput | on(type: 'error', callback: ErrorCallback<VideoOutputError>): void; | Yes | Deprecated | 46e41f4b71Sopenharmony_ci| ohos.multimedia.camera | VideoOutputErrorCode | ERROR_UNKNOWN = -1<br>ERROR_DRIVER_ERROR = 0 | Yes | Deprecated | 47e41f4b71Sopenharmony_ci| ohos.multimedia.camera | VideoOutputError | code: VideoOutputErrorCode | Yes | Deprecated | 48e41f4b71Sopenharmony_ci| ohos.multimedia.camera | MetadataObject | readonly type: MetadataObjectType;<br>readonly timestamp: number; | Yes | Added | 49e41f4b71Sopenharmony_ci| ohos.multimedia.camera | MetadataObject | getType(callback: AsyncCallback<MetadataObjectType>): void;<br>getType(): Promise<MetadataObjectType>;<br>getTimestamp(callback: AsyncCallback<number>): void;<br>getTimestamp(): Promise<number>;<br>getBoundingBox(callback: AsyncCallback<Rect>): void;<br>getBoundingBox(): Promise<Rect>; | Yes | Deprecated | 50e41f4b71Sopenharmony_ci| ohos.multimedia.camera | MetadataFaceObject | readonly boundingBox: Rect | Yes | Added | 51e41f4b71Sopenharmony_ci| ohos.multimedia.camera | MetadataOutput | on(type: 'error', callback: ErrorCallback<BusinessError>): void; | Yes | Added | 52e41f4b71Sopenharmony_ci| ohos.multimedia.camera | MetadataOutput | on(type: 'error', callback: ErrorCallback<BusinessError>): void; | Yes | Deprecated | 53e41f4b71Sopenharmony_ci| ohos.multimedia.camera | MetadataOutputErrorCode | ERROR_UNKNOWN = -1<br>ERROR_INSUFFICIENT_RESOURCES = 0 | Yes | Deprecated | 54e41f4b71Sopenharmony_ci| ohos.multimedia.camera | MetadataOutputError | code: MetadataOutputErrorCode | Yes | Deprecated | 55e41f4b71Sopenharmony_ci 56e41f4b71Sopenharmony_ci**Adaptation Guide** 57e41f4b71Sopenharmony_ci 58e41f4b71Sopenharmony_ciIn addition to new APIs and deprecated APIs, you need to adapt your application to changed APIs. 59e41f4b71Sopenharmony_ci 60e41f4b71Sopenharmony_ciIn Beta4 and later versions, the following APIs are changed. 61e41f4b71Sopenharmony_ci 62e41f4b71Sopenharmony_ci**New APIs** 63e41f4b71Sopenharmony_ci 64e41f4b71Sopenharmony_ci1. **CameraErrorCode** enums 65e41f4b71Sopenharmony_ci 66e41f4b71Sopenharmony_ci Enum: INVALID_ARGUMENT; value: 7400101 67e41f4b71Sopenharmony_ci 68e41f4b71Sopenharmony_ci Enum: OPERATION_NOT_ALLOWED; value: 7400102 69e41f4b71Sopenharmony_ci 70e41f4b71Sopenharmony_ci Enum: SESSION_NOT_CONFIG; value: 7400103 71e41f4b71Sopenharmony_ci 72e41f4b71Sopenharmony_ci Enum: SESSION_NOT_RUNNING; value: 7400104 73e41f4b71Sopenharmony_ci 74e41f4b71Sopenharmony_ci Enum: SESSION_CONFIG_LOCKED; value: 7400105 75e41f4b71Sopenharmony_ci 76e41f4b71Sopenharmony_ci Enum: DEVICE_SETTING_LOCKED; value: 7400106 77e41f4b71Sopenharmony_ci 78e41f4b71Sopenharmony_ci Enum: CONFILICT_CAMERA; value: 7400107 79e41f4b71Sopenharmony_ci 80e41f4b71Sopenharmony_ci Enum: DEVICE_DISABLED; value: 7400108 81e41f4b71Sopenharmony_ci 82e41f4b71Sopenharmony_ci Enum: SERVICE_FATAL_ERROR; value: 7400201 83e41f4b71Sopenharmony_ci 84e41f4b71Sopenharmony_ci2. Added **capture(): Promise<void>** to the **PhotoOutput** API. 85e41f4b71Sopenharmony_ci 86e41f4b71Sopenharmony_ci3. Added the readonly type **MetadataObjectType** to the **MetadataObject** API. 87e41f4b71Sopenharmony_ci 88e41f4b71Sopenharmony_ci4. Added **readonly timestamp: number** to the **MetadataObject** API. 89e41f4b71Sopenharmony_ci 90e41f4b71Sopenharmony_ci5. Added **readonly boundingBox: Rect** to the **MetadataObject** API. 91e41f4b71Sopenharmony_ci 92e41f4b71Sopenharmony_ci**Deprecated APIs** 93e41f4b71Sopenharmony_ci 94e41f4b71Sopenharmony_ci1. Deprecated the **release(callback: AsyncCallback<void>): void** and **release(): Promise<void>** APIs in **CameraInput**. 95e41f4b71Sopenharmony_ci 96e41f4b71Sopenharmony_ci2. Deprecated the **CameraInputErrorCode** enums and all their values: **ERROR_UNKNOWN** = **-1**, **ERROR_NO_PERMISSION** = **0**, **ERROR_DEVICE_PREEMPTED** = **1**, **ERROR_DEVICE_DISCONNECTED** = **2**, **ERROR_DEVICE_IN_USE** = **3**, **ERROR_DRIVER_ERROR** = **4** 97e41f4b71Sopenharmony_ci 98e41f4b71Sopenharmony_ci3. Deprecated the **CameraInputError** API and its attribute **CameraInputErrorCode**. 99e41f4b71Sopenharmony_ci 100e41f4b71Sopenharmony_ci4. Deprecated the **CaptureSessionErrorCode** enums and all their values: **ERROR_UNKNOWN** = **-1**, **ERROR_INSUFFICIENT_RESOURCES** = **0**, **ERROR_TIMEOUT** = **1** 101e41f4b71Sopenharmony_ci 102e41f4b71Sopenharmony_ci5. Deprecated the **CaptureSessionError** API and its attribute **CaptureSessionErrorCode**. 103e41f4b71Sopenharmony_ci 104e41f4b71Sopenharmony_ci6. Deprecated the **PreviewOutputErrorCode** enum and its value: **ERROR_UNKNOWN** = **-1** 105e41f4b71Sopenharmony_ci 106e41f4b71Sopenharmony_ci7. Deprecated the **PreviewOutputError** API and its attribute **PreviewOutputErrorCode**. 107e41f4b71Sopenharmony_ci 108e41f4b71Sopenharmony_ci8. Deprecated the **PhotoOutputErrorCode** enums and all their values: **ERROR_UNKNOWN** = **-1**, **ERROR_DRIVER_ERROR** = **0**, **ERROR_INSUFFICIENT_RESOURCES** = **1**, **ERROR_TIMEOUT** = **2** 109e41f4b71Sopenharmony_ci 110e41f4b71Sopenharmony_ci9. Deprecated the **PhotoOutputError** API and its attribute **PhotoOutputErrorCode**. 111e41f4b71Sopenharmony_ci 112e41f4b71Sopenharmony_ci10. Deprecated the **VideoOutputErrorCode** enums and all their values: **ERROR_UNKNOWN** = **-1**, **ERROR_DRIVER_ERROR** = **0** 113e41f4b71Sopenharmony_ci 114e41f4b71Sopenharmony_ci11. Deprecated the **VideoOutputError** API and its attribute **VideoOutputErrorCode**. 115e41f4b71Sopenharmony_ci 116e41f4b71Sopenharmony_ci12. Deprecated **getType(callback: AsyncCallback<MetadataObjectType>): void** in the **MetadataObject** API. 117e41f4b71Sopenharmony_ci 118e41f4b71Sopenharmony_ci13. Deprecated **getType(): Promise<MetadataObjectType>** in the **MetadataObject** API. 119e41f4b71Sopenharmony_ci 120e41f4b71Sopenharmony_ci14. Deprecated **getTimestamp(callback: AsyncCallback<number>): void** in the **MetadataObject** API. 121e41f4b71Sopenharmony_ci 122e41f4b71Sopenharmony_ci15. Deprecated **getTimestamp(): Promise<number>** in the **MetadataObject** API. 123e41f4b71Sopenharmony_ci 124e41f4b71Sopenharmony_ci16. Deprecated **getBoundingBox(callback: AsyncCallback<Rect>): void** in the **MetadataObject** API. 125e41f4b71Sopenharmony_ci 126e41f4b71Sopenharmony_ci17. Deprecated **getBoundingBox(): Promise<Rect>** in the **MetadataObject** API. 127e41f4b71Sopenharmony_ci 128e41f4b71Sopenharmony_ci18. Deprecated the **MetadataOutputErrorCode** enums and all their values: **ERROR_UNKNOWN** = **-1**, **ERROR_INSUFFICIENT_RESOURCES** = **0** 129e41f4b71Sopenharmony_ci 130e41f4b71Sopenharmony_ci19. Deprecated the **MetadataOutputError** API and its attribute **MetadataOutputErrorCode**. 131e41f4b71Sopenharmony_ci 132e41f4b71Sopenharmony_ci**Changed APIs** 133e41f4b71Sopenharmony_ci 134e41f4b71Sopenharmony_ci1. Changed the return modes of the **getCameraManager** API in the camera module from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getCameraManager(context: Context, callback: AsyncCallback<CameraManager>): void** and **getCameraManager(context: Context): Promise<CameraManager>** are changed to **getCameraManager(context: Context): CameraManager**. 135e41f4b71Sopenharmony_ci 136e41f4b71Sopenharmony_ci The code snippet is as follows: 137e41f4b71Sopenharmony_ci 138e41f4b71Sopenharmony_ci ``` 139e41f4b71Sopenharmony_ci let cameraManager = camera.getCameraManager(context); 140e41f4b71Sopenharmony_ci ``` 141e41f4b71Sopenharmony_ci 142e41f4b71Sopenharmony_ci2. Changed the return modes of the **getSupportedCameras** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getSupportedCameras(callback: AsyncCallback<Array<CameraDevice>>): void** and **getSupportedCameras(): Promise<Array<CameraDevice>>** are changed to **getSupportedCameras(): Array<CameraDevice>**. 143e41f4b71Sopenharmony_ci 144e41f4b71Sopenharmony_ci The code snippet is as follows: 145e41f4b71Sopenharmony_ci 146e41f4b71Sopenharmony_ci ``` 147e41f4b71Sopenharmony_ci let cameras = cameraManager.getSupportedCameras(); 148e41f4b71Sopenharmony_ci ``` 149e41f4b71Sopenharmony_ci 150e41f4b71Sopenharmony_ci3. Changed the return modes of the **getSupportedOutputCapability** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getSupportedOutputCapability(camera: CameraDevice, callback: AsyncCallback<CameraOutputCapability>): void** and **getSupportedOutputCapability(camera: CameraDevice): Promise<CameraOutputCapability>** are changed to **getSupportedOutputCapability(camera: CameraDevice): CameraOutputCapability**. 151e41f4b71Sopenharmony_ci 152e41f4b71Sopenharmony_ci The code snippet is as follows: 153e41f4b71Sopenharmony_ci 154e41f4b71Sopenharmony_ci ``` 155e41f4b71Sopenharmony_ci let cameraDevice = cameras[0]; 156e41f4b71Sopenharmony_ci let CameraOutputCapability = cameraManager.getSupportedOutputCapability(cameraDevice); 157e41f4b71Sopenharmony_ci ``` 158e41f4b71Sopenharmony_ci 159e41f4b71Sopenharmony_ci4. Changed the return modes of the **createCameraInput(camera: CameraDevice)** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createCameraInput(camera: CameraDevice, callback: AsyncCallback<CameraInput>): void** and **createCameraInput(camera: CameraDevice): Promise<CameraInput>** are changed to **createCameraInput(camera: CameraDevice): CameraInput**. 160e41f4b71Sopenharmony_ci 161e41f4b71Sopenharmony_ci The code snippet is as follows: 162e41f4b71Sopenharmony_ci 163e41f4b71Sopenharmony_ci ``` 164e41f4b71Sopenharmony_ci let cameraDevice = cameras[0]; 165e41f4b71Sopenharmony_ci let cameraInput = cameraManager.createCameraInput(cameraDevice); 166e41f4b71Sopenharmony_ci ``` 167e41f4b71Sopenharmony_ci 168e41f4b71Sopenharmony_ci5. Changed the return modes of the **createCameraInput(position: CameraPosition, type: CameraType)** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createCameraInput(position: CameraPosition, type: CameraType, callback: AsyncCallback<CameraInput>): void** and **createCameraInput(position: CameraPosition, type: CameraType): Promise<CameraInput>** are changed to **createCameraInput(position: CameraPosition, type: CameraType): CameraInput**. 169e41f4b71Sopenharmony_ci 170e41f4b71Sopenharmony_ci The code snippet is as follows: 171e41f4b71Sopenharmony_ci 172e41f4b71Sopenharmony_ci ``` 173e41f4b71Sopenharmony_ci let cameraDevice = cameras[0]; 174e41f4b71Sopenharmony_ci let position = cameraDevice.cameraPosition; 175e41f4b71Sopenharmony_ci let type = cameraDevice.cameraType; 176e41f4b71Sopenharmony_ci let cameraInput = cameraManager.createCameraInput(position, type); 177e41f4b71Sopenharmony_ci ``` 178e41f4b71Sopenharmony_ci 179e41f4b71Sopenharmony_ci6. Changed the return modes of the **createPreviewOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createPreviewOutput(profile: Profile, surfaceId: string, callback: AsyncCallback<PreviewOutput>): void** and **createPreviewOutput(profile: Profile, surfaceId: string): Promise<PreviewOutput>** are changed to **createPreviewOutput(profile: Profile, surfaceId: string): PreviewOutput**. 180e41f4b71Sopenharmony_ci 181e41f4b71Sopenharmony_ci The code snippet is as follows: 182e41f4b71Sopenharmony_ci 183e41f4b71Sopenharmony_ci ``` 184e41f4b71Sopenharmony_ci let profile = cameraoutputcapability.previewProfiles[0]; 185e41f4b71Sopenharmony_ci let previewOutput = cameraManager.createPreviewOutput(profile, surfaceId); 186e41f4b71Sopenharmony_ci ``` 187e41f4b71Sopenharmony_ci 188e41f4b71Sopenharmony_ci7. Changed the return modes of the **createPhotoOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createPhotoOutput(profile: Profile, surfaceId: string, callback: AsyncCallback<PhotoOutput>): void** and **createPhotoOutput(profile: Profile, surfaceId: string): Promise<PhotoOutput>** are changed to **createPhotoOutput(profile: Profile, surfaceId: string): PhotoOutput**. 189e41f4b71Sopenharmony_ci 190e41f4b71Sopenharmony_ci The code snippet is as follows: 191e41f4b71Sopenharmony_ci 192e41f4b71Sopenharmony_ci ``` 193e41f4b71Sopenharmony_ci let profile = cameraoutputcapability.photoProfiles[0]; 194e41f4b71Sopenharmony_ci let photoOutput = cameraManager.createPhotoOutput(profile, surfaceId); 195e41f4b71Sopenharmony_ci ``` 196e41f4b71Sopenharmony_ci 197e41f4b71Sopenharmony_ci8. Changed the return modes of the **createVideoOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createVideoOutput(profile: VideoProfile, surfaceId: string, callback: AsyncCallback<VideoOutput>): void** and **createVideoOutput(profile: VideoProfile, surfaceId: string): Promise<VideoOutput>** are changed to **createVideoOutput(profile: VideoProfile, surfaceId: string): VideoOutput**. 198e41f4b71Sopenharmony_ci 199e41f4b71Sopenharmony_ci The code snippet is as follows: 200e41f4b71Sopenharmony_ci 201e41f4b71Sopenharmony_ci ``` 202e41f4b71Sopenharmony_ci let profile = cameraoutputcapability.videoProfiles[0]; 203e41f4b71Sopenharmony_ci let videoOutput = cameraManager.createVideoOutput(profile, surfaceId); 204e41f4b71Sopenharmony_ci ``` 205e41f4b71Sopenharmony_ci 206e41f4b71Sopenharmony_ci9. Changed the return modes of the **createMetadataOutput** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>, callback: AsyncCallback<MetadataOutput>): void** and **createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>): Promise<MetadataOutput>** are changed to **createMetadataOutput(metadataObjectTypes: Array<MetadataObjectType>): MetadataOutput**. 207e41f4b71Sopenharmony_ci 208e41f4b71Sopenharmony_ci The code snippet is as follows: 209e41f4b71Sopenharmony_ci 210e41f4b71Sopenharmony_ci ``` 211e41f4b71Sopenharmony_ci let metadataObjectTypes = cameraoutputcapability.supportedMetadataObjectTypes; 212e41f4b71Sopenharmony_ci let metadataOutput = cameraManager.createMetadataOutput(metadataObjectTypes); 213e41f4b71Sopenharmony_ci ``` 214e41f4b71Sopenharmony_ci 215e41f4b71Sopenharmony_ci10. Changed the return modes of the **createCaptureSession** API in CameraManager from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **createCaptureSession(callback: AsyncCallback<CaptureSession>): void** and **createCaptureSession(): Promise<CaptureSession>** are changed to **createCaptureSession(): CaptureSession**. 216e41f4b71Sopenharmony_ci 217e41f4b71Sopenharmony_ci The code snippet is as follows: 218e41f4b71Sopenharmony_ci 219e41f4b71Sopenharmony_ci ``` 220e41f4b71Sopenharmony_ci let captureSession = cameraManager.createCaptureSession(); 221e41f4b71Sopenharmony_ci ``` 222e41f4b71Sopenharmony_ci 223e41f4b71Sopenharmony_ci11. Changed the enum **CAMERA_TYPE_UNSPECIFIED** of **CameraType** to **CAMERA_TYPE_DEFAULT**. 224e41f4b71Sopenharmony_ci 225e41f4b71Sopenharmony_ci12. Changed the return value type of the **on** API in CameraInput from **CameraInputError** to **BusinessError**. Therefore, the original API **on(type: 'error', camera: CameraDevice, callback: ErrorCallback<CameraInputError>): void** is changed to **on(type: 'error', camera: CameraDevice, callback: ErrorCallback<BusinessError>): void**. 226e41f4b71Sopenharmony_ci 227e41f4b71Sopenharmony_ci The code snippet is as follows: 228e41f4b71Sopenharmony_ci 229e41f4b71Sopenharmony_ci ``` 230e41f4b71Sopenharmony_ci let cameraDevice = cameras[0]; 231e41f4b71Sopenharmony_ci cameraInput.on('error', cameraDevice, (BusinessError) => { 232e41f4b71Sopenharmony_ci 233e41f4b71Sopenharmony_ci }) 234e41f4b71Sopenharmony_ci ``` 235e41f4b71Sopenharmony_ci 236e41f4b71Sopenharmony_ci13. Changed the return modes of the **beginConfig** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **beginConfig(callback: AsyncCallback<void>): void** and **beginConfig(): Promise<void>** are changed to **beginConfig(): void**. 237e41f4b71Sopenharmony_ci 238e41f4b71Sopenharmony_ci The code snippet is as follows: 239e41f4b71Sopenharmony_ci 240e41f4b71Sopenharmony_ci ``` 241e41f4b71Sopenharmony_ci captureSession.beginConfig(); 242e41f4b71Sopenharmony_ci ``` 243e41f4b71Sopenharmony_ci 244e41f4b71Sopenharmony_ci14. Changed the return modes of the **addInput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **addInput(cameraInput: CameraInput, callback: AsyncCallback<void>): void** and **addInput(cameraInput: CameraInput): Promise<void>** are changed to **addInput(cameraInput: CameraInput): void**. 245e41f4b71Sopenharmony_ci 246e41f4b71Sopenharmony_ci The code snippet is as follows: 247e41f4b71Sopenharmony_ci 248e41f4b71Sopenharmony_ci ``` 249e41f4b71Sopenharmony_ci captureSession.addInput(cameraInput); 250e41f4b71Sopenharmony_ci ``` 251e41f4b71Sopenharmony_ci 252e41f4b71Sopenharmony_ci15. Changed the return modes of the **removeInput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **removeInput(cameraInput: CameraInput, callback: AsyncCallback<void>): void** and **removeInput(cameraInput: CameraInput): Promise<void>** are changed to **removeInput(cameraInput: CameraInput): void**. 253e41f4b71Sopenharmony_ci 254e41f4b71Sopenharmony_ci The code snippet is as follows: 255e41f4b71Sopenharmony_ci 256e41f4b71Sopenharmony_ci ``` 257e41f4b71Sopenharmony_ci captureSession.removeInput(cameraInput); 258e41f4b71Sopenharmony_ci ``` 259e41f4b71Sopenharmony_ci 260e41f4b71Sopenharmony_ci16. Changed the return modes of the **addOutput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **addOutput(cameraOutput: CameraOutput, callback: AsyncCallback<void>): void** and **addOutput(cameraOutput: CameraOutput): Promise<void>** are changed to **addOutput(cameraOutput: CameraOutput): void**. 261e41f4b71Sopenharmony_ci 262e41f4b71Sopenharmony_ci The code snippet is as follows: 263e41f4b71Sopenharmony_ci 264e41f4b71Sopenharmony_ci ``` 265e41f4b71Sopenharmony_ci captureSession.addOutput(previewOutput); 266e41f4b71Sopenharmony_ci ``` 267e41f4b71Sopenharmony_ci 268e41f4b71Sopenharmony_ci17. Changed the return modes of the **removeOutput** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **removeOutput(cameraOutput: CameraOutput, callback: AsyncCallback<void>): void** and **removeOutput(cameraOutput: CameraOutput): Promise<void>** are changed to **removeOutput(cameraOutput: CameraOutput): void**. 269e41f4b71Sopenharmony_ci 270e41f4b71Sopenharmony_ci The code snippet is as follows: 271e41f4b71Sopenharmony_ci 272e41f4b71Sopenharmony_ci ``` 273e41f4b71Sopenharmony_ci captureSession.removeOutput(previewOutput); 274e41f4b71Sopenharmony_ci ``` 275e41f4b71Sopenharmony_ci 276e41f4b71Sopenharmony_ci18. Changed the return modes of the **hasFlash** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **hasFlash(callback: AsyncCallback<boolean>): void** and **hasFlash(): Promise<boolean>** are changed to **hasFlash(): boolean**. 277e41f4b71Sopenharmony_ci 278e41f4b71Sopenharmony_ci The code snippet is as follows: 279e41f4b71Sopenharmony_ci 280e41f4b71Sopenharmony_ci ``` 281e41f4b71Sopenharmony_ci let status = captureSession.hasFlash(); 282e41f4b71Sopenharmony_ci ``` 283e41f4b71Sopenharmony_ci 284e41f4b71Sopenharmony_ci19. Changed the return modes of the **isFlashModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback<boolean>): void** and **isFlashModeSupported(flashMode: FlashMode): Promise<boolean>** are changed to **isFlashModeSupported(flashMode: FlashMode): boolean**. 285e41f4b71Sopenharmony_ci 286e41f4b71Sopenharmony_ci The code snippet is as follows: 287e41f4b71Sopenharmony_ci 288e41f4b71Sopenharmony_ci ``` 289e41f4b71Sopenharmony_ci let status = captureSession.isFlashModeSupported(camera.FlashMode.FLASH_MODE_AUTO); 290e41f4b71Sopenharmony_ci ``` 291e41f4b71Sopenharmony_ci 292e41f4b71Sopenharmony_ci20. Changed the return modes of the **getFlashMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFlashMode(callback: AsyncCallback<FlashMode>): void** and **getFlashMode(): Promise<FlashMode>** are changed to **getFlashMode(): FlashMode**. 293e41f4b71Sopenharmony_ci 294e41f4b71Sopenharmony_ci The code snippet is as follows: 295e41f4b71Sopenharmony_ci 296e41f4b71Sopenharmony_ci ``` 297e41f4b71Sopenharmony_ci let flashMode = captureSession.getFlashMode(); 298e41f4b71Sopenharmony_ci ``` 299e41f4b71Sopenharmony_ci 300e41f4b71Sopenharmony_ci21. Changed the return modes of the **isExposureModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback<boolean>): void** and **isExposureModeSupported(aeMode: ExposureMode): Promise<boolean>** are changed to **isExposureModeSupported(aeMode: ExposureMode): boolean**. 301e41f4b71Sopenharmony_ci 302e41f4b71Sopenharmony_ci The code snippet is as follows: 303e41f4b71Sopenharmony_ci 304e41f4b71Sopenharmony_ci ``` 305e41f4b71Sopenharmony_ci let isSupported = captureSession.isExposureModeSupported(camera.ExposureMode.EXPOSURE_MODE_LOCKED); 306e41f4b71Sopenharmony_ci ``` 307e41f4b71Sopenharmony_ci 308e41f4b71Sopenharmony_ci22. Changed the return modes of the **getExposureMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getExposureMode(callback: AsyncCallback<ExposureMode>): void** and **getExposureMode(): Promise<ExposureMode>** are changed to **getExposureMode(): ExposureMode**. 309e41f4b71Sopenharmony_ci 310e41f4b71Sopenharmony_ci The code snippet is as follows: 311e41f4b71Sopenharmony_ci 312e41f4b71Sopenharmony_ci ``` 313e41f4b71Sopenharmony_ci let exposureMode = captureSession.getExposureMode(); 314e41f4b71Sopenharmony_ci ``` 315e41f4b71Sopenharmony_ci 316e41f4b71Sopenharmony_ci23. Changed the return modes of the **setExposureMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setExposureMode(aeMode: ExposureMode, callback: AsyncCallback<void>): void** and **setExposureMode(aeMode: ExposureMode): Promise<void>** are changed to **setExposureMode(aeMode: ExposureMode): void**. 317e41f4b71Sopenharmony_ci 318e41f4b71Sopenharmony_ci The code snippet is as follows: 319e41f4b71Sopenharmony_ci 320e41f4b71Sopenharmony_ci ``` 321e41f4b71Sopenharmony_ci captureSession.setExposureMode(camera.ExposureMode.EXPOSURE_MODE_LOCKED); 322e41f4b71Sopenharmony_ci ``` 323e41f4b71Sopenharmony_ci 324e41f4b71Sopenharmony_ci24. Changed the return modes of the **getMeteringPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getMeteringPoint(callback: AsyncCallback<Point>): void** and **getMeteringPoint(): Promise<Point>** are changed to **getMeteringPoint(): Point**. 325e41f4b71Sopenharmony_ci 326e41f4b71Sopenharmony_ci The code snippet is as follows: 327e41f4b71Sopenharmony_ci 328e41f4b71Sopenharmony_ci ``` 329e41f4b71Sopenharmony_ci let exposurePoint = captureSession.getMeteringPoint(); 330e41f4b71Sopenharmony_ci ``` 331e41f4b71Sopenharmony_ci 332e41f4b71Sopenharmony_ci25. Changed the return modes of the **setMeteringPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setMeteringPoint(point: Point, callback: AsyncCallback<void>): void** and **setMeteringPoint(point: Point): Promise<void>** are changed to **setMeteringPoint(point: Point): void**. 333e41f4b71Sopenharmony_ci 334e41f4b71Sopenharmony_ci The code snippet is as follows: 335e41f4b71Sopenharmony_ci 336e41f4b71Sopenharmony_ci ``` 337e41f4b71Sopenharmony_ci let Point2 = {x: 2, y: 2}; 338e41f4b71Sopenharmony_ci captureSession.setMeteringPoint(Point2); 339e41f4b71Sopenharmony_ci ``` 340e41f4b71Sopenharmony_ci 341e41f4b71Sopenharmony_ci26. Changed the return modes of the **getExposureBiasRange** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getExposureBiasRange(callback: AsyncCallback<Array<number>>): void** and **getExposureBiasRange(): Promise<Array<number>>** are changed to **getExposureBiasRange(): Array<number>**. 342e41f4b71Sopenharmony_ci 343e41f4b71Sopenharmony_ci The code snippet is as follows: 344e41f4b71Sopenharmony_ci 345e41f4b71Sopenharmony_ci ``` 346e41f4b71Sopenharmony_ci let biasRangeArray = captureSession.getExposureBiasRange(); 347e41f4b71Sopenharmony_ci ``` 348e41f4b71Sopenharmony_ci 349e41f4b71Sopenharmony_ci27. Changed the return modes of the **setExposureBias** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setExposureBias(exposureBias: number, callback: AsyncCallback<void>): void** and **setExposureBias(exposureBias: number): Promise<void>** are changed to **setExposureBias(exposureBias: number): void**. 350e41f4b71Sopenharmony_ci 351e41f4b71Sopenharmony_ci The code snippet is as follows: 352e41f4b71Sopenharmony_ci 353e41f4b71Sopenharmony_ci ``` 354e41f4b71Sopenharmony_ci let exposureBias = biasRangeArray[0]; 355e41f4b71Sopenharmony_ci captureSession.setExposureBias(exposureBias); 356e41f4b71Sopenharmony_ci ``` 357e41f4b71Sopenharmony_ci 358e41f4b71Sopenharmony_ci28. Changed the return modes of the **getExposureValue** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getExposureValue(callback: AsyncCallback<number>): void** and **getExposureValue(): Promise<number>** are changed to **getExposureValue(): number**. 359e41f4b71Sopenharmony_ci 360e41f4b71Sopenharmony_ci The code snippet is as follows: 361e41f4b71Sopenharmony_ci 362e41f4b71Sopenharmony_ci ``` 363e41f4b71Sopenharmony_ci let exposureValue = captureSession.getExposureValue(); 364e41f4b71Sopenharmony_ci ``` 365e41f4b71Sopenharmony_ci 366e41f4b71Sopenharmony_ci29. Changed the return modes of the **isFocusModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback<boolean>): void** and **isFocusModeSupported(afMode: FocusMode): Promise<boolean>** are changed to **isFocusModeSupported(afMode: FocusMode): boolean**. 367e41f4b71Sopenharmony_ci 368e41f4b71Sopenharmony_ci The code snippet is as follows: 369e41f4b71Sopenharmony_ci 370e41f4b71Sopenharmony_ci ``` 371e41f4b71Sopenharmony_ci let status = captureSession.isFocusModeSupported(camera.FocusMode.FOCUS_MODE_AUTO); 372e41f4b71Sopenharmony_ci ``` 373e41f4b71Sopenharmony_ci 374e41f4b71Sopenharmony_ci30. Changed the return modes of the **getFocusMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFocusMode(callback: AsyncCallback<FocusMode>): void** and **getFocusMode(): Promise<FocusMode>** are changed to **getFocusMode(): FocusMode**. 375e41f4b71Sopenharmony_ci 376e41f4b71Sopenharmony_ci The code snippet is as follows: 377e41f4b71Sopenharmony_ci 378e41f4b71Sopenharmony_ci ``` 379e41f4b71Sopenharmony_ci let afMode = captureSession.getFocusMode(); 380e41f4b71Sopenharmony_ci ``` 381e41f4b71Sopenharmony_ci 382e41f4b71Sopenharmony_ci31. Changed the return modes of the **setFocusMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setFocusMode(afMode: FocusMode, callback: AsyncCallback<void>): void** and **setFocusMode(afMode: FocusMode): Promise<void>** are changed to **setFocusMode(afMode: FocusMode): void**. 383e41f4b71Sopenharmony_ci 384e41f4b71Sopenharmony_ci The code snippet is as follows: 385e41f4b71Sopenharmony_ci 386e41f4b71Sopenharmony_ci ``` 387e41f4b71Sopenharmony_ci captureSession.setFocusMode(camera.FocusMode.FOCUS_MODE_AUTO); 388e41f4b71Sopenharmony_ci ``` 389e41f4b71Sopenharmony_ci 390e41f4b71Sopenharmony_ci32. Changed the return modes of the **setFocusPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setFocusPoint(point: Point, callback: AsyncCallback<void>): void** and **setFocusPoint(point: Point): Promise<void>** are changed to **setFocusPoint(point: Point): void**. 391e41f4b71Sopenharmony_ci 392e41f4b71Sopenharmony_ci The code snippet is as follows: 393e41f4b71Sopenharmony_ci 394e41f4b71Sopenharmony_ci ``` 395e41f4b71Sopenharmony_ci let Point2 = {x: 2, y: 2}; 396e41f4b71Sopenharmony_ci captureSession.setFocusPoint(Point2); 397e41f4b71Sopenharmony_ci ``` 398e41f4b71Sopenharmony_ci 399e41f4b71Sopenharmony_ci33. Changed the return modes of the **getFocusPoint** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFocusPoint(callback: AsyncCallback<Point>): void** and **getFocusPoint(): Promise<Point>** are changed to **getFocusPoint(): Point**. 400e41f4b71Sopenharmony_ci 401e41f4b71Sopenharmony_ci The code snippet is as follows: 402e41f4b71Sopenharmony_ci 403e41f4b71Sopenharmony_ci ``` 404e41f4b71Sopenharmony_ci let point = captureSession.getFocusPoint(); 405e41f4b71Sopenharmony_ci ``` 406e41f4b71Sopenharmony_ci 407e41f4b71Sopenharmony_ci34. Changed the return modes of the **getFocalLength** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getFocalLength(callback: AsyncCallback<number>): void** and **getFocalLength(): Promise<number>** are changed to **getFocalLength(): number**. 408e41f4b71Sopenharmony_ci 409e41f4b71Sopenharmony_ci The code snippet is as follows: 410e41f4b71Sopenharmony_ci 411e41f4b71Sopenharmony_ci ``` 412e41f4b71Sopenharmony_ci let focalLength = captureSession.getFocalLength(); 413e41f4b71Sopenharmony_ci ``` 414e41f4b71Sopenharmony_ci 415e41f4b71Sopenharmony_ci35. Changed the return modes of the **getZoomRatioRange** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getZoomRatioRange(callback: AsyncCallback<Array<number>>): void** and **getZoomRatioRange(): Promise<Array<number>>** are changed to **getZoomRatioRange(): Array<number>**. 416e41f4b71Sopenharmony_ci 417e41f4b71Sopenharmony_ci The code snippet is as follows: 418e41f4b71Sopenharmony_ci 419e41f4b71Sopenharmony_ci ``` 420e41f4b71Sopenharmony_ci let zoomRatioRange = captureSession.getZoomRatioRange(); 421e41f4b71Sopenharmony_ci ``` 422e41f4b71Sopenharmony_ci 423e41f4b71Sopenharmony_ci36. Changed the return modes of the **getZoomRatio** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getZoomRatio(callback: AsyncCallback<number>): void** and **getZoomRatio(): Promise<number>** are changed to **getZoomRatio(): number**. 424e41f4b71Sopenharmony_ci 425e41f4b71Sopenharmony_ci The code snippet is as follows: 426e41f4b71Sopenharmony_ci 427e41f4b71Sopenharmony_ci ``` 428e41f4b71Sopenharmony_ci let zoomRatio = captureSession.getZoomRatio(); 429e41f4b71Sopenharmony_ci ``` 430e41f4b71Sopenharmony_ci 431e41f4b71Sopenharmony_ci37. Changed the return modes of the **setZoomRatio** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setZoomRatio(zoomRatio: number, callback: AsyncCallback<void>): void** and **setZoomRatio(zoomRatio: number): Promise<void>** are changed to **setZoomRatio(zoomRatio: number): void**. 432e41f4b71Sopenharmony_ci 433e41f4b71Sopenharmony_ci The code snippet is as follows: 434e41f4b71Sopenharmony_ci 435e41f4b71Sopenharmony_ci ``` 436e41f4b71Sopenharmony_ci let zoomRatio = zoomRatioRange[0]; 437e41f4b71Sopenharmony_ci captureSession.setZoomRatio(zoomRatio); 438e41f4b71Sopenharmony_ci ``` 439e41f4b71Sopenharmony_ci 440e41f4b71Sopenharmony_ci38. Changed the return modes of the **isVideoStabilizationModeSupported** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode, callback: AsyncCallback<boolean>): void** and **isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): Promise<boolean>** are changed to **isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): boolean**. 441e41f4b71Sopenharmony_ci 442e41f4b71Sopenharmony_ci The code snippet is as follows: 443e41f4b71Sopenharmony_ci 444e41f4b71Sopenharmony_ci ``` 445e41f4b71Sopenharmony_ci let isSupported = captureSession.isVideoStabilizationModeSupported(camera.VideoStabilizationMode.OFF); 446e41f4b71Sopenharmony_ci ``` 447e41f4b71Sopenharmony_ci 448e41f4b71Sopenharmony_ci39. Changed the return modes of the **getActiveVideoStabilizationMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **getActiveVideoStabilizationMode(callback: AsyncCallback<VideoStabilizationMode>): void** and **getActiveVideoStabilizationMode(): Promise<VideoStabilizationMode>** are changed to **getActiveVideoStabilizationMode(): VideoStabilizationMode**. 449e41f4b71Sopenharmony_ci 450e41f4b71Sopenharmony_ci The code snippet is as follows: 451e41f4b71Sopenharmony_ci 452e41f4b71Sopenharmony_ci ``` 453e41f4b71Sopenharmony_ci let vsMode = captureSession.getActiveVideoStabilizationMode(); 454e41f4b71Sopenharmony_ci ``` 455e41f4b71Sopenharmony_ci 456e41f4b71Sopenharmony_ci40. Changed the return modes of the **setVideoStabilizationMode** API in CaptureSession from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **setVideoStabilizationMode(mode: VideoStabilizationMode, callback: AsyncCallback<void>): void** and **setVideoStabilizationMode(mode: VideoStabilizationMode): Promise<void>** are changed to **setVideoStabilizationMode(mode: VideoStabilizationMode): void**. 457e41f4b71Sopenharmony_ci 458e41f4b71Sopenharmony_ci The code snippet is as follows: 459e41f4b71Sopenharmony_ci 460e41f4b71Sopenharmony_ci ``` 461e41f4b71Sopenharmony_ci captureSession.setVideoStabilizationMode(camera.VideoStabilizationMode.OFF); 462e41f4b71Sopenharmony_ci ``` 463e41f4b71Sopenharmony_ci 464e41f4b71Sopenharmony_ci41. Changed the **on(type:'error') callback** type in CaptureSession from **ErrorCallback<CaptureSessionError>** to **ErrorCallback<BusinessError>**. Therefore, the original API **on(type: 'error', callback: ErrorCallback<CaptureSessionError>): void** is changed to **on(type: 'error', callback: ErrorCallback<BusinessError>): void**. 465e41f4b71Sopenharmony_ci 466e41f4b71Sopenharmony_ci The code snippet is as follows: 467e41f4b71Sopenharmony_ci 468e41f4b71Sopenharmony_ci ``` 469e41f4b71Sopenharmony_ci captureSession.on('error', (BusinessError) => { 470e41f4b71Sopenharmony_ci 471e41f4b71Sopenharmony_ci }) 472e41f4b71Sopenharmony_ci ``` 473e41f4b71Sopenharmony_ci 474e41f4b71Sopenharmony_ci42. Changed the **on(type:'error') callback** type in PreviewOutput, from **ErrorCallback<PreviewOutputError>** to **ErrorCallback<BusinessError>**. Therefore, the original API **on(type: 'error', callback: ErrorCallback<PreviewOutputError>): void** is changed to **on(type: 'error', callback: ErrorCallback<BusinessError>): void**. 475e41f4b71Sopenharmony_ci 476e41f4b71Sopenharmony_ci The code snippet is as follows: 477e41f4b71Sopenharmony_ci 478e41f4b71Sopenharmony_ci ``` 479e41f4b71Sopenharmony_ci previewOutput.on('error', (BusinessError) => { 480e41f4b71Sopenharmony_ci 481e41f4b71Sopenharmony_ci }) 482e41f4b71Sopenharmony_ci ``` 483e41f4b71Sopenharmony_ci 484e41f4b71Sopenharmony_ci43. Changed the return modes of the **isMirrorSupported** API in PhotoOutput from asynchronous callback and asynchronous promise to the synchronous mode. Therefore, the original APIs **isMirrorSupported(callback: AsyncCallback<boolean>): void** and **isMirrorSupported(): Promise<boolean>** are changed to **isMirrorSupported(): boolean**. 485e41f4b71Sopenharmony_ci 486e41f4b71Sopenharmony_ci The code snippet is as follows: 487e41f4b71Sopenharmony_ci 488e41f4b71Sopenharmony_ci ``` 489e41f4b71Sopenharmony_ci let isSupported = photoOutput.isMirrorSupported(); 490e41f4b71Sopenharmony_ci ``` 491e41f4b71Sopenharmony_ci 492e41f4b71Sopenharmony_ci44. Changed the **on(type:'error') callback** type in PhotoOutput, from **ErrorCallback<PhotoOutputError>** to **ErrorCallback<BusinessError>**. Therefore, the original API **on(type: 'error', callback: ErrorCallback<PhotoOutputError>): void** is changed to **on(type: 'error', callback: ErrorCallback<BusinessError>): void**. 493e41f4b71Sopenharmony_ci 494e41f4b71Sopenharmony_ci The code snippet is as follows: 495e41f4b71Sopenharmony_ci 496e41f4b71Sopenharmony_ci ``` 497e41f4b71Sopenharmony_ci PhotoOutput.on('error', (BusinessError) => { 498e41f4b71Sopenharmony_ci 499e41f4b71Sopenharmony_ci }) 500e41f4b71Sopenharmony_ci ``` 501e41f4b71Sopenharmony_ci 502e41f4b71Sopenharmony_ci45. Changed the **on(type:'error') callback** type in VideoOutput, from **ErrorCallback<VideoOutputError>** to **ErrorCallback<BusinessError>**. Therefore, the original API **on(type: 'error', callback: ErrorCallback<VideoOutputError>): void** is changed to **on(type: 'error', callback: ErrorCallback<BusinessError>): void**. 503e41f4b71Sopenharmony_ci 504e41f4b71Sopenharmony_ci The code snippet is as follows: 505e41f4b71Sopenharmony_ci 506e41f4b71Sopenharmony_ci ``` 507e41f4b71Sopenharmony_ci VideoOutput.on('error', (BusinessError) => { 508e41f4b71Sopenharmony_ci 509e41f4b71Sopenharmony_ci }) 510e41f4b71Sopenharmony_ci ``` 511e41f4b71Sopenharmony_ci 512e41f4b71Sopenharmony_ci46. Changed the **on(type:'error') callback** type in MetadataOutput, from **ErrorCallback<MetadataOutputError>** to **ErrorCallback<BusinessError>**. Therefore, the original API **on(type: 'error', callback: ErrorCallback<MetadataOutputError>): void** is changed to **on(type: 'error', callback: ErrorCallback<BusinessError>): void**. 513e41f4b71Sopenharmony_ci 514e41f4b71Sopenharmony_ci The code snippet is as follows: 515e41f4b71Sopenharmony_ci 516e41f4b71Sopenharmony_ci ``` 517e41f4b71Sopenharmony_ci MetadataOutput.on('error', (BusinessError) => { 518e41f4b71Sopenharmony_ci 519e41f4b71Sopenharmony_ci }) 520e41f4b71Sopenharmony_ci ```