diff --git a/en/application-dev/reference/apis/js-apis-camera.md b/en/application-dev/reference/apis/js-apis-camera.md index c076a882942d2145b641555efd8ac2bd5a504fd4..3d41d138f00cfee03c52555c27fe3e18e8dd2dcf 100644 --- a/en/application-dev/reference/apis/js-apis-camera.md +++ b/en/application-dev/reference/apis/js-apis-camera.md @@ -1,7 +1,7 @@ # Camera > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** -> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. +> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. ## Modules to Import @@ -31,11 +31,6 @@ Gets a **CameraManager** instance. This method uses an asynchronous callback to | context | Context | Yes | Application context | | callback | AsyncCallback | Yes | Callback used to return the CameraManager instance | - -**Return values** - -none - **Example** ``` @@ -82,59 +77,62 @@ camera.getCameraManager(context).then((cameraManger) => { Enumerates camera status types. +**System Capabilities:** + +SystemCapability.Multimedia.Camera.Core + | Name | Default Value | Description | |---------------------------|---------------|--------------------| -| CAMERA_STATUS_APPEAR | 0 | Camera appear
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_STATUS_DISAPPEAR | 1 | Camera disappear
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_STATUS_AVAILABLE | 2 | Camera available
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_STATUS_UNAVAILABLE | 3 | Camera unavailable
System Capabilities: SystemCapability.Multimedia.Camera.Core| +| CAMERA_STATUS_APPEAR | 0 | Camera appear | +| CAMERA_STATUS_DISAPPEAR | 1 | Camera disappear | +| CAMERA_STATUS_AVAILABLE | 2 | Camera available | +| CAMERA_STATUS_UNAVAILABLE | 3 | Camera unavailable | ## CameraPosition Enumerates the camera positions. +**System Capabilities:** + +SystemCapability.Multimedia.Camera.Core + | Name | Default value | Description | |-----------------------------|---------------|-----------------------| -| CAMERA_POSITION_UNSPECIFIED | 0 | Unspecified position
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_POSITION_BACK | 1 | Rear camera
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_POSITION_FRONT | 2 | Front camera
System Capabilities: SystemCapability.Multimedia.Camera.Core | +| CAMERA_POSITION_UNSPECIFIED | 0 | Unspecified position | +| CAMERA_POSITION_BACK | 1 | Rear camera | +| CAMERA_POSITION_FRONT | 2 | Front camera | ## CameraType Enumerates the camera types. +**System Capabilities:** + +SystemCapability.Multimedia.Camera.Core + | Name | Default value | Description | |-------------------------|---------------|-------------------------| -| CAMERA_TYPE_UNSPECIFIED | 0 | Unspecified camera type
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_TYPE_WIDE_ANGLE | 1 | Wide camera
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_TYPE_ULTRA_WIDE | 2 | Ultra wide camera
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_TYPE_TELEPHOTO | 3 | Telephoto camera
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_TYPE_TRUE_DEPTH | 4 | True depth camera
System Capabilities: SystemCapability.Multimedia.Camera.Core | +| CAMERA_TYPE_UNSPECIFIED | 0 | Unspecified camera type | +| CAMERA_TYPE_WIDE_ANGLE | 1 | Wide camera | +| CAMERA_TYPE_ULTRA_WIDE | 2 | Ultra wide camera | +| CAMERA_TYPE_TELEPHOTO | 3 | Telephoto camera | +| CAMERA_TYPE_TRUE_DEPTH | 4 | True depth camera | ## ConnectionType Enumerates camera connection types. -| Name | Default value | Description | -|------------------------------|---------------|----------------------------| -| CAMERA_CONNECTION_BUILT_IN | 0 | Built-in camera
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_CONNECTION_USB_PLUGIN | 1 | Camera connected using USB
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_CONNECTION_REMOTE | 2 | Remote camera
System Capabilities: SystemCapability.Multimedia.Camera.Core | - - -## CameraFormat - -Enumerates the camera formats. +**System Capabilities:** -| Name | Default value | Description | -|----------------------------|---------------|---------------------| -| CAMERA_FORMAT_YCRCb_420_SP | 1003 | Camera YCRCb
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_FORMAT_JPEG | 2000 | Camera format jpeg
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_FORMAT_AVC | 3000 | Camera format avc
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_FORMAT_HEVC | 3001 | Camera format hevc
System Capabilities: SystemCapability.Multimedia.Camera.Core | +SystemCapability.Multimedia.Camera.Core +| Name | Default value | Description | +|------------------------------|---------------|----------------------------| +| CAMERA_CONNECTION_BUILT_IN | 0 | Built-in camera | +| CAMERA_CONNECTION_USB_PLUGIN | 1 | Camera connected using USB | +| CAMERA_CONNECTION_REMOTE | 2 | Remote camera | ## CameraManager @@ -156,10 +154,6 @@ Gets all cameras supported by the device. This method uses an asynchronous callb |----------|--------------------------------|-----------|---------------------------------------------------------| | callback | AsyncCallback\> | Yes | Callback used to return the array of supported cameras. | -**Return values** - -none - **Example** ``` @@ -182,10 +176,6 @@ SystemCapability.Multimedia.Camera.Core Gets all cameras supported by the device. This method uses a promise to return the array of supported cameras. -**Parameters** - -none - **Return values** | Type | Description | @@ -218,10 +208,6 @@ Creates a **CameraInput** instance with the specified camera ID. This method use | cameraId | string | Yes | Camera ID used to create the instance | | callback | AsyncCallback | Yes | Callback used to return the CameraInput instance | -**Return values** - -none - **Example** ``` @@ -282,10 +268,6 @@ Creates a **CameraInput** instance with the specified camera position and camera | cameraType | CameraType | Yes | Camera type | | callback | AsyncCallback | Yes | Callback used to return the CameraInput instance | -**Return values** - -none - **Example** ``` @@ -346,10 +328,6 @@ Listens for camera status changes. This method uses a callback to get camera sta | type | string | Yes | Name of the event to listen for. | | callback | Callback | Yes | Callback used to get the camera status change. | -**Return value** - -None - **Example** ``` @@ -361,38 +339,48 @@ cameraManager.on('cameraStatus', (cameraStatusInfo) => { ## Camera -Camera class. +when we call *cameraManager.getCameras()* API, then it will return the **Camera** class which will have all camera-related metadata such as *cameraId, cameraPosition, cameraType & connectionType*. + +**System Capabilities:** + +SystemCapability.Multimedia.Camera.Core **Fields** | Name | Type | Access | Description | |----------------|----------------|----------|------------------------| -| cameraId | string | readonly | Camera ID
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| cameraPosition | cameraPosition | readonly | Camera position
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| cameraType | cameraType | readonly | Camera type
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| connectionType | connectionType | readonly | Camera connection type
System Capabilities: SystemCapability.Multimedia.Camera.Core| +| cameraId | string | readonly | Camera ID | +| cameraPosition | cameraPosition | readonly | Camera position | +| cameraType | cameraType | readonly | Camera type | +| connectionType | connectionType | readonly | Camera connection type | ``` -var cameraManager = await camera.getCameraManager(); -var cameras = await cameraManager.getCameras(); -var cameraObj = cameras[0]; -var cameraId = cameraObj.cameraId; -var cameraPosition = cameraObj.cameraPosition; -var cameraType = cameraObj.cameraType; -var cameraId = cameraObj.connectionType; +async function getCameraInfo() { + var cameraManager = await camera.getCameraManager(); + var cameras = await cameraManager.getCameras(); + var cameraObj = cameras[0]; + var cameraId = cameraObj.cameraId; + var cameraPosition = cameraObj.cameraPosition; + var cameraType = cameraObj.cameraType; + var cameraId = cameraObj.connectionType; +} ``` ## CameraStatusInfo -CameraStatusInfo class. +This interface is a CameraManager callback API return. **CameraStatusInfo** will have *Camera* class & *CameraStatus* predefine constants.From *Camera* class, we can have all camera-related metadata & from *CameraStatus* constants, we will have information such as *APPEAR, DISAPPEAR, AVAILABLE & UNAVAILABLE*. + +**System Capabilities:** + +SystemCapability.Multimedia.Camera.Core **Fields** | Name | Type | Description | |----------------|----------------|------------------| -| camera | Camera | Camera object
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| status | CameraStatus | Camera status
System Capabilities: SystemCapability.Multimedia.Camera.Core | +| camera | Camera | Camera object | +| status | CameraStatus | Camera status | ## CameraInput @@ -415,10 +403,6 @@ Gets the camera ID based on which this **CameraInput** instance is created. This |----------|------------------------|-----------|---------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the camera ID | -**Return values** - -none - ``` cameraInput.getCameraId((err, cameraId) => { if (err) { @@ -439,10 +423,6 @@ SystemCapability.Multimedia.Camera.Core Gets the camera ID based on which this **CameraInput** instance is created. This method uses a promise to return the camera ID. -**Parameters** - -none - **Return values** | Type | Description | @@ -457,251 +437,6 @@ cameraInput.getCameraId().then((cameraId) => { }) ``` -### getSupportedSizes\(format: CameraFormat, callback: AsyncCallback\>\): void; - -**System Capabilities:** - -SystemCapability.Multimedia.Camera.Core - -**Description** - -Gets supported sizes for a given format. This method uses an asynchronous callback to return the supported sizes. - -**Parameters** - -| Name | Type | Mandatory | Description | -|----------|------------------------------|-----------|---------------------------------------------| -| format | CameraFormat | Yes | Camera format used to get supported sizes | -| callback | AsyncCallback\> | Yes | Callback used to return the supported sizes | - - -**Return values** - -none - -**Example** - -``` -cameraInput.getSupportedSizes(format, (err, sizes) => { - if (err) { - console.error('Failed to get the supported sizes. ${err.message}'); - return; - } - console.log('Callback returned with the supported sizes:' + sizes); -}) -``` - -### getSupportedSizes\(format: CameraFormat\): Promise\>; - -**System Capabilities:** - -SystemCapability.Multimedia.Camera.Core - -**Description** - -Gets supported sizes for a given format. This method uses a promise to return the supported sizes. - -**Parameters** - -| Name | Type | Mandatory | Description | -|----------|----------------------------|-----------|-----------------------------------------------| -| format | CameraFormat | Yes | Camera format used to get the supported sizes | - -**Return values** - -| Type | Description | -|------------------------|---------------------------------------------| -| Promise\> | Promise used to return the supported sizes. | - -**Example** - -``` -cameraInput.getSupportedSizes(format).then((sizes) => { - console.log('Promise returned with supported sizes: ' + sizes); -}) -``` - -### getSupportedPreviewFormats\(callback: AsyncCallback\>\): void; - -**System Capabilities:** - -SystemCapability.Multimedia.Camera.Core - -**Description** - -Gets supported formats for preview. This method uses an asynchronous callback to return the supported formats. - -**Parameters** - -| Name | Type | Mandatory | Description | -|----------|--------------------------------------|-----------|---------------------------------------------------| -| callback | AsyncCallback\> | Yes | Callback used to return the supported preview formats. | - - -**Return values** - -none - -**Example** - -``` -cameraInput.getSupportedPreviewFormats((err, previewFormats) => { - if (err) { - console.error('Failed to get the supported preview formats. ${err.message}'); - return; - } - console.log('Callback returned with supported preview formats: ' + previewFormats.length); -}) -``` - -### getSupportedPreviewFormats\(\): Promise\>; - -**System Capabilities:** - -SystemCapability.Multimedia.Camera.Core - -**Description** - -Gets supported formats for preview. This method uses a promise to return the supported formats. - -**Parameters** - -none - -**Return values** - -| Type | Description | -|--------------------------------|-------------------------------------------------------| -| Promise\> | Promise used to return the supported preview formats | - -**Example** - -``` -cameraInput.getSupportedPreviewFormats().then((previewFormats) => { - console.log('Promise returned with supported preview formats.' + previewFormats.length); -}) -``` - -### getSupportedPhotoFormats\(callback: AsyncCallback\>\): void; - -**System Capabilities:** - -SystemCapability.Multimedia.Camera.Core - -**Description** - -Gets supported formats for photographing. This method uses an asynchronous callback to return the supported formats. - -**Parameters** - -| Name | Type | Mandatory | Description | -|----------|--------------------------------------|-----------|-------------------------------------------------| -| callback | AsyncCallback\> | Yes | Callback used to return the supported photo formats. | - -**Return values** - -none - -**Example** - -``` -cameraInput.getSupportedPhotoFormats((err, photoFormats) => { - if (err) { - console.error('Failed to get the supported photo formats. ${err.message}'); - return; - } - console.log('Callback returned with supported photo formats'); -}) -``` - -### getSupportedPhotoFormats\(\): Promise\>; - -**System Capabilities:** - -SystemCapability.Multimedia.Camera.Core - -**Description** - -Gets supported formats for photographing. This method uses a promise to return the supported formats. - -**Parameters** - -none - -**Return values** - -| Type | Description | -|--------------------------------|---------------------------------------------------| -| Promise\> | Promise used to return supported photo formats. | - -**Example** - -``` -cameraInput.getSupportedPhotoFormats().then((photoFormats) => { - console.log('Promise returned with supported photo formats.' + photoFormats.length); -}) -``` - -### getSupportedVideoFormats\(callback: AsyncCallback\>\): void; - -**System Capabilities:** - -SystemCapability.Multimedia.Camera.Core - -**Description** - -Gets supported formats for video recording. This method uses an asynchronous callback to return the supported video formats. - -**Parameters** - -| Name | Type | Mandatory | Description | -|----------|--------------------------------------|-----------|-------------------------------------------------| -| callback | AsyncCallback\> | Yes | Callback used to return the supported video formats. | - -**Return values** - -none - -**Example** - -``` -cameraInput.getSupportedVideoFormats((err, videoFormats) => { - if (err) { - console.error('Failed to get the supported video formats. ${err.message}'); - return; - } - console.log('Callback returned with supported video formats : ' + videoFormats.length); -}) -``` - -### getSupportedVideoFormats\(\): Promise\>; - -**System Capabilities:** - -SystemCapability.Multimedia.Camera.Core - -**Description** - -Gets supported formats for video recording. This method uses a promise to return the supported video format. - -**Parameters** - -none - -**Return values** - -| Type | Description | -|--------------------------------|---------------------------------------------------| -| Promise\> | Promise used to return supported video formats. | - -**Example** - -``` -cameraInput.getSupportedVideoFormats().then((videoFormats) => { - console.log('Promise returned with supported video formats.' + videoFormats.length); -}) -``` - ### hasFlash(callback: AsyncCallback): void; **System Capabilities:** @@ -718,10 +453,6 @@ Checks whether the device has flash light. This method uses an asynchronous call |----------|-------------------------|-----------|----------------------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the flash light support status | -**Return values** - -none - **Example** ``` @@ -744,10 +475,6 @@ SystemCapability.Multimedia.Camera.Core Checks whether the device has flash light. This method uses a promise to return the result. -**Parameters** - -none - **Return values** | Type | Description | @@ -779,10 +506,6 @@ Checks whether a specified flash mode is supported. This method uses an asynchro | flashMode | FlashMode | Yes | Flash mode | | callback | AsyncCallback | Yes | Callback used to return the device flash support status | -**Return values** - -none - **Example** ``` @@ -844,10 +567,6 @@ Note: Before setting the flash mode, check the support for the flash light (FlashMode | Yes | Flash mode | | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -887,7 +606,7 @@ Note: Before setting the flash mode, check the support for the flash light ( { +cameraInput.setFlashMode(flashMode).then(() => { console.log('Promise returned with the successful execution of setFlashMode.'); }) ``` @@ -908,10 +627,6 @@ Gets current flash mode. This method uses an asynchronous callback to return the |-----------|---------------------------|-----------|------------------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the current flash mode | -**Return values** - -none - **Example** ``` @@ -934,10 +649,6 @@ SystemCapability.Multimedia.Camera.Core Gets current flash mode. This method uses a promise to return the result. -**Parameters** - -none - **Return values** | Type | Description | @@ -947,7 +658,7 @@ none **Example** ``` -cameraInput.getFlashMode().then(flashMode) => { +cameraInput.getFlashMode().then((flashMode) => { console.log('Promise returned with current flash mode : ' + flashMode); }) ``` @@ -969,10 +680,6 @@ Checks whether a specified focus mode is supported. This method uses an asynchro | afMode | FocusMode | Yes | Focus mode | | callback | AsyncCallback | Yes | Callback used to return the device focus support status | -**Return values** - -none - **Example** ``` @@ -1034,10 +741,6 @@ Note: Before setting the focus mode, check focus mode support (FocusMode | Yes | Focus mode | | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -1077,7 +780,7 @@ Note: Before setting the focus mode, check focus mode support ( Enumerates the focus modes. +**System Capabilities:** + +SystemCapability.Multimedia.Camera.Core + | Name | Default value | Description | |----------------------------|---------------|----------------------------| -| FOCUS_MODE_MANUAL | 0 | Focus mode manual
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| FOCUS_MODE_CONTINUOUS_AUTO | 1 | Focus mode continuous auto
System Capabilities: SystemCapability.Multimedia.Camera.Core| -| FOCUS_MODE_AUTO | 2 | Focus mode auto
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| FOCUS_MODE_LOCKED | 3 | Focus mode locked
System Capabilities: SystemCapability.Multimedia.Camera.Core | - +| FOCUS_MODE_MANUAL | 0 | Focus mode manual | +| FOCUS_MODE_CONTINUOUS_AUTO | 1 | Focus mode continuous auto | +| FOCUS_MODE_AUTO | 2 | Focus mode auto | +| FOCUS_MODE_LOCKED | 3 | Focus mode locked | ## createCaptureSession\(context: Context, callback: AsyncCallback\): void; @@ -1484,14 +1149,10 @@ Creates a **CaptureSession** instance. This method uses an asynchronous callback | context | Context | Yes | Application context | | callback | AsyncCallback | Yes | Callback used to return the CaptureSession instance | -**Return values** - -none - **Example** ``` -captureSession.createCaptureSession(context), (err, captureSession) => { +captureSession.createCaptureSession((context), (err, captureSession) => { if (err) { console.error('Failed to create the CaptureSession instance. ${err.message}'); return; @@ -1550,10 +1211,6 @@ Starts configuration for this CaptureSession instance. This method uses an async |----------|----------------------|-----------|----------------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -1576,10 +1233,6 @@ SystemCapability.Multimedia.Camera.Core Starts configuration for this CaptureSession instance. This method uses a promise to return the result. -**Parameters** - -none - **Return values** | Type | Description | @@ -1611,10 +1264,6 @@ Commits the configuration for this CaptureSession instance. This method uses an |----------|---------------------|-----------|----------------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -1637,10 +1286,6 @@ SystemCapability.Multimedia.Camera.Core Commits the configuration for this CaptureSession instance. This method uses a promise to return the result. -**Parameters** - -none - **Return values** | Type | Description | @@ -1672,10 +1317,6 @@ Add a CameraInput instance to this CaptureSession instance. This method uses an | cameraInput | CameraInput | Yes | CameraInput instance to add | | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -1735,10 +1376,6 @@ Add a PreviewOutput instance to this CaptureSession instance. This method uses a | previewOutput | PreviewOutput | Yes | PreviewOutput instance to add | | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -1798,10 +1435,6 @@ Add a PhotoOutput instance to this CaptureSession instance. This method uses an | photoOutput | PhotoOutput | Yes | PhotoOutput instance to add | | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -1861,10 +1494,6 @@ Add a VideoOutput instance to this CaptureSession instance. This method uses an | videoOutput | VideoOutput | Yes | VideoOutput instance to add | | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -1924,11 +1553,6 @@ Removes a **CameraInput** instance from this **CaptureSession** instance. This m | cameraInput | CameraInput | Yes | CameraInput instance to remove | | callback | AsyncCallback | Yes | Callback used to return the result | - -**Return values** - -none - **Example** ``` @@ -1988,10 +1612,6 @@ Removes a **PreviewOutput** instance from this **CaptureSession** instance. This | previewOutput | PreviewOutput | Yes | PreviewOutput instance to remove | | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -2053,10 +1673,6 @@ Removes a **PhotoOutput** instance from this **CaptureSession** instance. This m | photoOutput | PhotoOutput | Yes | PhotoOutput instance to remove | | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -2118,10 +1734,6 @@ Removes a **VideoOutput** instance from this **CaptureSession** instance. This m | videoOutput | VideoOutput | Yes | VideoOutput instance to remove | | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -2182,10 +1794,6 @@ Starts this **CaptureSession** instance. This method uses an asynchronous callba |----------|----------------------|-----------|----------------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -2208,10 +1816,6 @@ SystemCapability.Multimedia.Camera.Core Starts this **CaptureSession** instance. This method uses a promise to return the result. -**Parameters** - -none - **Return values** | Type | Description | @@ -2243,10 +1847,6 @@ Stops this **CaptureSession** instance. This method uses an asynchronous callbac |----------|----------------------|-----------|------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -2269,10 +1869,6 @@ SystemCapability.Multimedia.Camera.Core Stops this **CaptureSession** instance. This method uses a promise to return the result. -**Parameters** - -none - **Return values** | Type | Description | @@ -2303,10 +1899,6 @@ Releases this **CaptureSession** instance. This method uses an asynchronous call |----------|----------------------|-----------|------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -2329,10 +1921,6 @@ SystemCapability.Multimedia.Camera.Core Releases this **CaptureSession** instance. This method uses a promise to return the result. -**Parameters** - -none - **Return values** | Type | Description | @@ -2364,10 +1952,6 @@ Listens for **CaptureSession** errors. This method uses a callback to get errors | type | string | Yes | Name of the event to listen for. | | callback | Callback | Yes | Callback used to get the capture session errors. | -**Return value** - -None - **Example** ``` @@ -2393,14 +1977,10 @@ Creates a **PreviewOutput** instance. This method uses an asynchronous callback | surfaceId | string | Yes | Surface ID received from XComponent view | | callback | AsyncCallback | Yes | Callback used to return the PreviewOutput instance | -**Return values** - -none - **Example** ``` -camera.createPreviewOutput(surfaceId), (err, previewOutput) => { +camera.createPreviewOutput((surfaceId), (err, previewOutput) => { if (err) { console.error('Failed to create the PreviewOutput instance. ${err.message}'); return; @@ -2459,10 +2039,6 @@ Releases this **PreviewOutput** instance. This method uses an asynchronous callb |----------|----------------------|-----------|----------------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -2485,9 +2061,6 @@ SystemCapability.Multimedia.Camera.Core Releases this **PreviewOutput** instance. This method uses a promise to return the result. -**Parameters** -none - **Return values** | Type | Description | @@ -2520,10 +2093,6 @@ Listens for preview frame start events. This method uses a callback to get the e | type | string | Yes | Name of the event to listen for. | | callback | Callback | Yes | Callback used to return the result | -**Return value** - -None - **Example** ``` @@ -2549,10 +2118,6 @@ Listens for preview frame end event. This method uses a callback to get the even | type | string | Yes | Name of the event to listen for. | | callback | Callback | Yes | Callback used to return the result | -**Return value** - -None - **Example** ``` @@ -2578,10 +2143,6 @@ Listens for **PreviewOutput** errors. This method uses a callback to get errors. | type | string | Yes | Name of the event to listen for. | | callback | Callback | Yes | Callback used to get the preview output errors. | -**Return value** - -None - **Example** ``` @@ -2607,14 +2168,10 @@ Creates a **PhotoOutput** instance. This method uses an asynchronous callback to | surfaceId | string | Yes | Surface ID received from ImageReceiver | | callback | AsyncCallback | Yes | Callback used to return the PhotoOutput instance | -**Return values** - -none - **Example** ``` -camera.createPhotoOutput(surfaceId), (err, photoOutput) => { +camera.createPhotoOutput((surfaceId), (err, photoOutput) => { if (err) { console.error('Failed to create the PhotoOutput instance. ${err.message}'); return; @@ -2656,42 +2213,58 @@ camera.createPhotoOutput(surfaceId).then((photoOutput) => { Enumerates the image rotation angles. +**System Capabilities:** + +SystemCapability.Multimedia.Camera.Core + | Name | Default Value | Description | |--------------|---------------|----------------------------------------| -| ROTATION_0 | 0 | The capture image rotates 0 degrees
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| ROTATION_90 | 90 | The capture image rotates 90 degrees
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| ROTATION_180 | 180 | The capture image rotates 180 degrees
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| ROTATION_270 | 270 | The capture image rotates 270 degrees
System Capabilities: SystemCapability.Multimedia.Camera.Core| +| ROTATION_0 | 0 | The capture image rotates 0 degrees | +| ROTATION_90 | 90 | The capture image rotates 90 degrees | +| ROTATION_180 | 180 | The capture image rotates 180 degrees | +| ROTATION_270 | 270 | The capture image rotates 270 degrees | ## Location Defines the location of a captured image. +**System Capabilities:** + +SystemCapability.Multimedia.Camera.Core + | Name | Type | Access | Description | |-----------|--------|--------------|-------------| -| latitude | number | read / write | Latitude
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| longitude | number | read / write | Longitude
System Capabilities: SystemCapability.Multimedia.Camera.Core | +| latitude | number | read / write | Latitude | +| longitude | number | read / write | Longitude | ## QualityLevel Enumerates the image quality levels. +**System Capabilities:** + +SystemCapability.Multimedia.Camera.Core + | Name | Default value | Description | |----------------------|---------------|----------------------| -| QUALITY_LEVEL_HIGH | 0 | High image quality
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| QUALITY_LEVEL_MEDIUM | 1 | Medium image quality
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| QUALITY_LEVEL_LOW | 2 | Low image quality
System Capabilities: SystemCapability.Multimedia.Camera.Core | +| QUALITY_LEVEL_HIGH | 0 | High image quality | +| QUALITY_LEVEL_MEDIUM | 1 | Medium image quality | +| QUALITY_LEVEL_LOW | 2 | Low image quality | ## PhotoCaptureSetting Defines the settings for image capture. +**System Capabilities:** + +SystemCapability.Multimedia.Camera.Core + | Name | Type | Mandatory | Description | |----------|---------------|-----------|---------------------| -| quality | QualityLevel | Optional | Photo image quality
System Capabilities: SystemCapability.Multimedia.Camera.Core| -| rotation | ImageRotation | Optional | Photo rotation
System Capabilities: SystemCapability.Multimedia.Camera.Core | +| quality | QualityLevel | Optional | Photo image quality | +| rotation | ImageRotation | Optional | Photo rotation | ## PhotoOutput @@ -2714,10 +2287,6 @@ Captures a photo. This method uses an asynchronous callback to return the result |----------|---------------------|-----------|----------------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -2747,10 +2316,6 @@ Captures a photo with the specified capture settings. This method uses an asynch | setting | PhotoCaptureSetting | Yes | Photo capture settings | | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -2810,10 +2375,6 @@ Releases this **PhotoOutput** instance. This method uses an asynchronous callbac |----------|----------------------|-----------|----------------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -2836,9 +2397,6 @@ SystemCapability.Multimedia.Camera.Core Releases this **PhotoOutput** instance. This method uses a promise to return the result. -**Parameters** -none - **Return values** | Type | Description | @@ -2871,10 +2429,6 @@ Listens for photo capture start events. This method uses a callback to get the e | type | string | Yes | Name of the event to listen for. | | callback | Callback | Yes | Callback used to get the capture ID. | -**Return value** - -None - **Example** ``` @@ -2900,10 +2454,6 @@ Listens for frame shutter events. This method uses a callback to get the event i | type | string | Yes | Name of the event to listen for. | | callback | Callback | Yes | Callback used to get the frame shutter information.| -**Return value** - -None - **Example** ``` @@ -2930,10 +2480,6 @@ Listens for photo capture end events. This method uses a callback to get the eve | type | string | Yes | Name of the event to listen for. | | callback | Callback | Yes | Callback used to get the capture end information | -**Return value** - -None - **Example** ``` @@ -2960,10 +2506,6 @@ Listens for **PhotoOutput** errors. This method uses a callback to get errors. | type | string | Yes | Name of the event to listen for. | | callback | Callback | Yes | Callback used to get the photo output errors. | -**Return value** - -None - **Example** ``` @@ -2989,14 +2531,10 @@ Creates a **VideoOutput** instance. This method uses an asynchronous callback to | surfaceId | string | Yes | Surface ID received from VideoRecorder | | callback | AsyncCallback | Yes | Callback used to return the VideoOutput instance | -**Return values** - -none - **Example** ``` -camera.createVideoOutput(surfaceId), (err, videoOutput) => { +camera.createVideoOutput((surfaceId), (err, videoOutput) => { if (err) { console.error('Failed to create the VideoOutput instance. ${err.message}'); return; @@ -3054,10 +2592,6 @@ Starts the video output. This method uses an asynchronous callback to return the |----------|----------------------|-----------|----------------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -3080,9 +2614,6 @@ SystemCapability.Multimedia.Camera.Core Starts the video output. This method uses a promise to return the result. -**Parameters** -none - **Return values** | Type | Description | @@ -3114,10 +2645,6 @@ Stops the video output. This method uses an asynchronous callback to return the |----------|----------------------|-----------|----------------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -3140,9 +2667,6 @@ SystemCapability.Multimedia.Camera.Core Stops the video output. This method uses a promise to return the result. -**Parameters** -none - **Return values** | Type | Description | @@ -3173,10 +2697,6 @@ Releases this VideoOutput instance. This method uses an asynchronous callback to |----------|----------------------|-----------|----------------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -3199,10 +2719,6 @@ SystemCapability.Multimedia.Camera.Core Releases this VideoOutput instance. This method uses a promise to return the result. -**Parameters** - -none - **Return values** | Type | Description | @@ -3235,10 +2751,6 @@ Listens for video frame start events. This method uses a callback to get the eve | type | string | Yes | Name of the event to listen for. | | callback | Callback | Yes | Callback used to return the result | -**Return value** - -None - **Example** ``` @@ -3258,10 +2770,6 @@ Listens for video frame end events. This method uses a callback to get the event | type | string | Yes | Name of the event to listen for. | | callback | Callback | Yes | Callback used to return the result | -**Return value** - -None - **Example** ``` @@ -3281,10 +2789,6 @@ Listens for **VideoOutput** errors. This method uses a callback to get errors. | type | string | Yes | Name of the event to listen for. | | callback | Callback | Yes | Callback used to get the video output errors. | -**Return value** - -None - **Example** ```