diff --git a/CODEOWNERS b/CODEOWNERS
index 9b36e3beb739abd5f7bd294dfb149297e93c0651..9ffdaf23ba7351b7dd5e18b54559e424f4a2b80a 100644
--- a/CODEOWNERS
+++ b/CODEOWNERS
@@ -317,6 +317,7 @@ zh-cn/application-dev/reference/apis/js-apis-system-parameter.md @qinxiaowang
zh-cn/application-dev/reference/apis/js-apis-thermal.md @qinxiaowang
zh-cn/application-dev/reference/apis/js-apis-update.md @HelloCrease
zh-cn/application-dev/reference/apis/js-apis-usb.md @ge-yafang
+zh-cn/application-dev/reference/apis/js-apis-colorSpaceManager.mdd @ge-yafang
zh-cn/application-dev/reference/apis/js-apis-vibrator.md @HelloCrease
zh-cn/application-dev/reference/apis/js-apis-appAccount.md @zengyawen
zh-cn/application-dev/reference/apis/js-apis-distributed-account.md @zengyawen
diff --git a/en/application-dev/Readme-EN.md b/en/application-dev/Readme-EN.md
index bd194e23cf6c4715dfbc6fa9af0b2b273d2e8478..f3fa0e7ac0e9b829f2418e4b1bf96001e66553d2 100644
--- a/en/application-dev/Readme-EN.md
+++ b/en/application-dev/Readme-EN.md
@@ -37,7 +37,7 @@
- Tools
- [DevEco Studio (OpenHarmony) User Guide](quick-start/deveco-studio-user-guide-for-openharmony.md)
- Hands-On Tutorials
- - [Samples](https://gitee.com/openharmony/app_samples/blob/master/README.md)
+ - [Samples](https://gitee.com/openharmony/applications_app_samples/blob/master/README.md)
- [Codelabs](https://gitee.com/openharmony/codelabs)
- API References
- [Component Reference (JavaScript-based Web-like Development Paradigm)](reference/arkui-js/Readme-EN.md)
diff --git a/en/application-dev/ability/stage-ability-continuation.md b/en/application-dev/ability/stage-ability-continuation.md
index 6945f49db8ef05109452fc1b3dcad3dc1e5ddeca..701b730a833a7b97f00398746cddae4d2856a248 100644
--- a/en/application-dev/ability/stage-ability-continuation.md
+++ b/en/application-dev/ability/stage-ability-continuation.md
@@ -41,7 +41,7 @@ The code snippets provided below are all from [Sample](https://gitee.com/openhar
"module": {
"abilities": [
{
- "continuable": true,
+ "continuable": true
}
]
}
@@ -62,7 +62,7 @@ The code snippets provided below are all from [Sample](https://gitee.com/openhar
"module": {
"abilities": [
{
- "launchType": "standard",
+ "launchType": "standard"
}
]
}
@@ -76,7 +76,7 @@ The code snippets provided below are all from [Sample](https://gitee.com/openhar
"module": {
"abilities": [
{
- "launchType": "singleton",
+ "launchType": "singleton"
}
]
}
diff --git a/en/application-dev/ability/wantagent.md b/en/application-dev/ability/wantagent.md
index eacc92936960cca3bd022e6438a63c15a8f2688a..5a85bab15b8422aaabb0a173ad888126e08fc038 100644
--- a/en/application-dev/ability/wantagent.md
+++ b/en/application-dev/ability/wantagent.md
@@ -1,6 +1,8 @@
# WantAgent Development
## When to Use
-The **WantAgent** class encapsulates want information that specifies a particular action, which can be starting an ability or publishing a common event. You can either call **wantAgent.trigger** to trigger a **WantAgent** directly or add a **WantAgent** to a notification so that it will be triggered when users tap the notification.
+The **WantAgent** class encapsulates want information that specifies a particular action, which can be starting an ability or publishing a common event. You can either call **wantAgent.trigger** to trigger a **WantAgent** directly or add a **WantAgent** to a notification so that it will be triggered when users tap the notification.
+
+
## Available APIs
| API | Description|
@@ -21,7 +23,7 @@ The **WantAgent** class encapsulates want information that specifies a particula
```
private wantAgentObj = null // Save the WantAgent object created. It will be used to complete the trigger operations.
- //wantAgentInfo
+ // wantAgentInfo
var wantAgentInfo = {
wants: [
{
@@ -45,7 +47,7 @@ The **WantAgent** class encapsulates want information that specifies a particula
```
private wantAgentObj = null // Save the WantAgent object created. It will be used to complete the trigger operations.
- //wantAgentInfo
+ // wantAgentInfo
var wantAgentInfo = {
wants: [
{
diff --git a/en/application-dev/application-dev-guide-for-gitee.md b/en/application-dev/application-dev-guide-for-gitee.md
index e60f2c01333c1bef7324b3ef6cfe2c83821a95cd..f074e1906535d708b193adea3b1ee3308fb0de4e 100644
--- a/en/application-dev/application-dev-guide-for-gitee.md
+++ b/en/application-dev/application-dev-guide-for-gitee.md
@@ -47,7 +47,7 @@ DevEco Studio is a high-performance integrated development environment (IDE) rec
### Hands-On Tutorials
-To make you better understand how functions work together and jumpstart your application development projects, we provide stripped-down, real-world [samples](https://gitee.com/openharmony/app_samples/blob/master/README.md) and [codelabs](https://gitee.com/openharmony/codelabs).
+To make you better understand how functions work together and jumpstart your application development projects, we provide stripped-down, real-world [samples](https://gitee.com/openharmony/applications_app_samples/blob/master/README.md) and [codelabs](https://gitee.com/openharmony/codelabs).
### API References
diff --git a/en/application-dev/application-dev-guide.md b/en/application-dev/application-dev-guide.md
index 7065480d1c4a12bd0984f4916d678c1bed7a4997..2b22839820539e2919f1a705595a47cc491df8d0 100644
--- a/en/application-dev/application-dev-guide.md
+++ b/en/application-dev/application-dev-guide.md
@@ -47,7 +47,7 @@ DevEco Studio is a high-performance integrated development environment (IDE) rec
### Hands-On Tutorials
-To make you better understand how functions work together and jumpstart your application development projects, we provide stripped-down, real-world [samples](https://gitee.com/openharmony/app_samples/blob/master/README.md) and [codelabs](https://gitee.com/openharmony/codelabs).
+To make you better understand how functions work together and jumpstart your application development projects, we provide stripped-down, real-world [samples](https://gitee.com/openharmony/applications_app_samples/blob/master/README.md) and [codelabs](https://gitee.com/openharmony/codelabs).
### API References
diff --git a/en/application-dev/database/database-distributedobject-guidelines.md b/en/application-dev/database/database-distributedobject-guidelines.md
index 8cc0a8aca0a6b8f6fad3f1a03f452e8ea9d3eb97..ec77d5330b57751e36b3ba2d96b57028c340dd36 100644
--- a/en/application-dev/database/database-distributedobject-guidelines.md
+++ b/en/application-dev/database/database-distributedobject-guidelines.md
@@ -4,7 +4,7 @@
The **distributedDataObject** module provides APIs to implement data collaboration of the same application across multiple devices. In addition, the devices that form a Super Device can listen for object status and data changes with each other.
-For example, when the data of the a distributed data object is added, deleted, or modified for application A on device 1, application A on device 2 can obtain the updated data. In addition, device 2 can listen for data changes and online/offline of the data objects on device 1.
+For example, when the data of a distributed data object is added, deleted, or modified for application A on device 1, application A on device 2 can obtain the updated data. In addition, device 2 can listen for data changes and online/offline of the data objects on device 1.
## Available APIs
@@ -18,7 +18,7 @@ Call **createDistributedObject()** to create a distributed data object instance.
**Table 1** API for creating a distributed data object instance
| Package| API| Description|
| -------- | -------- | -------- |
-| ohos.data.distributedDataObject| createDistributedObject(source: object): DistributedObject | Creates a distributed data object instance for data operations.
- **source**: attributes of the **distributedObject** set.
- **DistributedObject**: returns the distributed object created.|
+| ohos.data.distributedDataObject| createDistributedObject(source: object): DistributedObject | Creates a distributed data object instance for data operations.
- **source**: attributes of the distributed data object to set.
- **DistributedObject**: returns the distributed data object created. |
### Generating a Session ID
@@ -29,14 +29,14 @@ Call **genSessionId()** to generate a session ID randomly. The generated session
| -------- | -------- | -------- |
| ohos.data.distributedDataObject| genSessionId(): string | Generates a session ID, which can be used as the session ID of a distributed data object.|
-### Setting a SessionID for a Distributed Data Object
+### Setting a Session ID for a Distributed Data Object
Call **setSessionId()** to set a session ID for a distributed data object. The session ID is a unique identifier for one collaboration across devices. The distributed data objects to be synchronized must be associated with the same session ID.
**Table 3** API for setting a session ID
| Class| API| Description|
| -------- | -------- | -------- |
-| DistributedDataObject | setSessionId(sessionId?: string): boolean | Sets a session ID for a distributed data object.
**sessionId**: session ID of a distributed object in a trusted network. To remove a distributed data object from the network, set this parameter to "" or leave it empty.|
+| DistributedDataObject | setSessionId(sessionId?: string): boolean | Sets a session ID for a distributed data object.
**sessionId**: session ID of a distributed data object in a trusted network. To remove a distributed data object from the network, set this parameter to "" or leave it empty. |
### Observing Data Changes
@@ -47,7 +47,7 @@ Call **on()** to subscribe to data changes of a distributed data object. When th
| Class| API| Description|
| -------- | -------- | -------- |
| DistributedDataObject| on(type: 'change', callback: Callback<{ sessionId: string, fields: Array<string> }>): void | Subscribes to data changes.|
-| DistributedDataObject| off(type: 'change', callback?: Callback<{ sessionId: string, fields: Array<string> }>): void | Unsubscribes from data changes. **Callback**: specifies the data changes to unsubscribe from. If this parameter is not specified, all data changes of this distributed data object will be unsubscribed from.|
+| DistributedDataObject| off(type: 'change', callback?: Callback<{ sessionId: string, fields: Array<string> }>): void | Unsubscribes from data changes.
**Callback**: callback to unregister. If this parameter is not specified, all data changes of this distributed data object will be unsubscribed from. |
### Observing Online or Offline Status
@@ -59,7 +59,7 @@ Call **on()** to subscribe to status changes of a distributed data object. The s
| DistributedDataObject| on(type: 'status', callback: Callback<{ sessionId: string, networkId: string, status: 'online' \| 'offline' }>): void | Subscribes to the status changes of a distributed data object.|
| DistributedDataObject| off(type: 'status', callback?: Callback<{ sessionId: string, deviceId: string, status: 'online' \| 'offline' }>): void | Unsubscribes from status changes of a distributed data object.|
-### Saving a Distributed Data Object and Revoking the Data Saving Operation
+### Saving or Deleting a Distributed Data Object
Call **save()** to save a distributed data object. When the application is active, the saved data will not be released. When the application exits and restarts, the data saved on the device will be restored.
@@ -71,11 +71,12 @@ The saved data will be released in the following cases:
- The application has been uninstalled.
- Data is successfully restored.
-**Table 6** APIs for saving a distributed data object and revoking the saving operation
+**Table 6** APIs for saving and deleting a distributed data object
+
| Class| API| Description|
| -------- | -------- | -------- |
| DistributedDataObject | save(deviceId: string): Promise<SaveSuccessResponse> | Saves a distributed data object.|
-| DistributedDataObject| revokeSave(): Promise<RevokeSaveSuccessResponse> | Revokes the data saving operation.|
+| DistributedDataObject| revokeSave(): Promise<RevokeSaveSuccessResponse> | Deletes a distributed data object. |
## How to Develop
@@ -89,12 +90,10 @@ The following example shows how to implement distributed data object synchroniza
2. Apply for the permission.
- Add the required permission (FA model) in the **config.json** file.
+ Add the permissions required (FA model) to the **config.json** file. The sample code is as follows:
- The sample code is as follows:
-
- ```json
- {
+ ```json
+ {
"module": {
"reqPermissions": [
{
@@ -103,30 +102,27 @@ The following example shows how to implement distributed data object synchroniza
]
}
}
- ```
-
+ ```
For the apps based on the stage model, see [Declaring Permissions](../security/accesstoken-guidelines.md#stage-model).
-
+
This permission must also be granted by the user when the application is started for the first time. The sample code is as follows:
-
- ```json
+
+ ```js
import featureAbility from '@ohos.ability.featureAbility';
-
- function grantPermission() {
- console.info('grantPermission');
- let context = featureAbility.getContext();
- context.requestPermissionsFromUser(['ohos.permission.DISTRIBUTED_DATASYNC'], 666, function (result) {
- console.info(`result.requestCode=${result.requestCode}`)
-
- })
- console.info('end grantPermission');
- }
-
- grantPermission();
- ```
-
+
+ function grantPermission() {
+ console.info('grantPermission');
+ let context = featureAbility.getContext();
+ context.requestPermissionsFromUser(['ohos.permission.DISTRIBUTED_DATASYNC'], 666, function (result) {
+ console.info(`result.requestCode=${result.requestCode}`)
+
+ })
+ console.info('end grantPermission');
+ }
+
+ grantPermission();
+ ```
-
3. Obtain a distributed data object instance.
The sample code is as follows:
@@ -142,12 +138,10 @@ The following example shows how to implement distributed data object synchroniza
var sessionId = distributedObject.genSessionId();
```
-4. Add the distributed data object instance to the synchronization network.
+4. Add the distributed data object instance to a network for data synchronization. The data objects in the synchronization network include the local and remote objects.
- The data objects in the synchronization network include the local and remote objects.
-
The sample code is as follows:
-
+
```js
// Local object
var local_object = distributedObject.createDistributedObject({
@@ -167,16 +161,16 @@ The following example shows how to implement distributed data object synchroniza
parent: undefined,
list: undefined
});
- // After learning that the device goes online, the remote object synchronizes data. That is, name changes to jack and age to 18.
+ // After learning that the local device goes online, the remote object synchronizes data. That is, name changes to jack and age to 18.
remote_object.setSessionId(sessionId);
```
5. Observe the data changes of the distributed data object.
You can subscribe to data changes of the remote object. When the data in the remote object changes, a callback will be called to return the data changes.
-
+
The sample code is as follows:
-
+
```js
function changeCallback(sessionId, changeData) {
console.info("change" + sessionId);
@@ -185,13 +179,13 @@ The following example shows how to implement distributed data object synchroniza
changeData.forEach(element => {
console.info("changed !" + element + " " + local_object[element]);
});
- }
+ }
}
// To refresh the page in changeCallback, correctly bind (this) to the changeCallback.
local_object.on("change", this.changeCallback.bind(this));
```
-
+
6. Modify attributes of the distributed data object.
The object attributes support basic data types (such as number, Boolean, and string) and complex data types (array and nested basic types).
@@ -250,7 +244,7 @@ The following example shows how to implement distributed data object synchroniza
local_object.on("status", this.statusCallback);
```
-10. Save a distributed data object and revoke the data saving operation.
+10. Save a distributed data object and delete it.
```js
// Save a distributed data object.
@@ -261,7 +255,7 @@ The following example shows how to implement distributed data object synchroniza
}, (result) => {
console.info("save local failed.");
});
- // Revoke the data saving operation.
+ // Delete a distributed data object..
g_object.revokeSave().then((result) => {
console.info("revokeSave success.");
}, (result) => {
@@ -271,7 +265,7 @@ The following example shows how to implement distributed data object synchroniza
11. Unsubscribe from the status changes of the distributed data object.
- You can specify the callback to unregister. If you do not specify the callback, this API unregisters all status change callbacks of this distributed data object.
+ You can specify the callback to unregister. If you do not specify the callback, all status change callbacks of this distributed data object will be unregistered.
The sample code is as follows:
@@ -282,9 +276,7 @@ The following example shows how to implement distributed data object synchroniza
local_object.off("status");
```
-12. Remove a distributed data object from the synchronization network.
-
- Data changes on the local object will not be synchronized to the removed distributed data object.
+12. Remove a distributed data object from the synchronization network. Data changes on the local object will not be synchronized to the removed distributed data object.
The sample code is as follows:
diff --git a/en/application-dev/device-usage-statistics/device-usage-statistics-overview.md b/en/application-dev/device-usage-statistics/device-usage-statistics-overview.md
index fc2a79e0990457a483c7dc75d3ab1fd88c55f126..69fca5fb8177eddc65ddfc0ffade70350446a8a1 100644
--- a/en/application-dev/device-usage-statistics/device-usage-statistics-overview.md
+++ b/en/application-dev/device-usage-statistics/device-usage-statistics-overview.md
@@ -7,21 +7,21 @@ With device usage statistics APIs, you can have a better understanding of the ap
Currently you can have access to statistics on the application usage, and the notification and system usage statistics feature will be available for use in later versions.
- **The application usage statistics is updated**:
-1. Every 30 minutes
-2. Upon system time change
-3. Upon start of a new day
+ 1. Every 30 minutes
+ 2. Upon system time change
+ 3. Upon start of a new day
- **The application usage statistics can include the following**:
-1. Events of all applications based on the specified start time and end time
-2. Application usage duration statistics based on the specified start time and end time
-3. Events of the current application based on the specified start time and end time
-4. Application usage duration statistics in the specified time frame at the specified interval (daily, weekly, monthly, or annually)
-5. Priority group of the current invoker application
-6. Whether a specific application is in the idle state
-7. Number of FA usage records specified by **maxNum**, sorted by time (most recent first). If **maxNum** is not specified, the default value **1000** will be used.
-8. Number of notifications from applications based on the specified start time and end time
-9. Statistics about system events (hibernation, wakeup, unlocking, and screen locking) that occur between the specified start time and end time
-10. Priority group of the invoker application or a specified application
+ 1. Events of all applications based on the specified start time and end time
+ 2. Application usage duration statistics based on the specified start time and end time
+ 3. Events of the current application based on the specified start time and end time
+ 4. Application usage duration statistics in the specified time frame at the specified interval (daily, weekly, monthly, or annually)
+ 5. Priority group of the current invoker application
+ 6. Whether a specific application is in the idle state
+ 7. Number of FA usage records specified by **maxNum**, sorted by time (most recent first). If **maxNum** is not specified, the default value **1000** will be used.
+ 8. Number of notifications from applications based on the specified start time and end time
+ 9. Statistics about system events (hibernation, wakeup, unlocking, and screen locking) that occur between the specified start time and end time
+ 10. Priority group of the invoker application or a specified application
- **The setters can be used to:**
@@ -35,6 +35,6 @@ Currently you can have access to statistics on the application usage, and the no
Deregister the callback for application group changes.
-### Required Permissions
+## Required Permissions
- Before calling the following system APIs, you need to apply for the **ohos.permission.BUNDLE_ACTIVE_INFO** permission: **queryBundleActiveStates**, **queryBundleStateInfos**, **queryBundleStateInfoByInterval**, **queryBundleActiveEventStates**, **queryAppNotificationNumber**, **queryAppUsagePriorityGroup(bundleName?)**, **setBundleGroup**, **registerGroupCallBack**, and **unRegisterGroupCallBack**.
- This permission is not required for calling third-party APIs: **queryCurrentBundleActiveStates**, **queryAppUsagePriorityGroup()**, and **isIdleState**.
diff --git a/en/application-dev/device/vibrator-guidelines.md b/en/application-dev/device/vibrator-guidelines.md
index 4f49e7996188a7bc668e23fc2a21a1a29ec6e562..97f9f5933b55c9a1b57b5555db5812b6576a262a 100644
--- a/en/application-dev/device/vibrator-guidelines.md
+++ b/en/application-dev/device/vibrator-guidelines.md
@@ -16,7 +16,7 @@ For details about the APIs, see [Vibrator](../reference/apis/js-apis-vibrator.md
| ohos.vibrator | vibrate(duration: number, callback?: AsyncCallback<void>): void | Triggers vibration with the specified duration. This API uses a callback to return the result. |
| ohos.vibrator | vibrate(effectId: EffectId): Promise<void> | Triggers vibration with the specified effect. This API uses a promise to return the result. |
| ohos.vibrator | vibrate(effectId: EffectId, callback?: AsyncCallback<void>): void | Triggers vibration with the specified effect. This API uses a callback to return the result.|
-| ohos.vibrator | stop(stopMode: VibratorStopMode): Promise<void> | Stops vibration. This API uses a promise to return the result. |
+| ohos.vibrator | stop(stopMode: VibratorStopMode): Promise<void>| Stops vibration. This API uses a promise to return the result. |
| ohos.vibrator | stop(stopMode: VibratorStopMode, callback?: AsyncCallback<void>): void | Stops vibration. This API uses a callback to return the result. |
@@ -55,7 +55,7 @@ For details about the APIs, see [Vibrator](../reference/apis/js-apis-vibrator.md
],
"when": "inuse"
}
- },
+ }
]
```
diff --git a/en/application-dev/media/Readme-EN.md b/en/application-dev/media/Readme-EN.md
index 131114d67cb3e1c8519d6d5f3a85b438e5846f6f..5f6e88fc07c88d3e5913058a26887e818a3cc3bc 100755
--- a/en/application-dev/media/Readme-EN.md
+++ b/en/application-dev/media/Readme-EN.md
@@ -20,4 +20,4 @@
- Camera
- [Camera Development](camera.md)
-
+ - [Distributed Camera Development](remote-camera.md)
diff --git a/en/application-dev/media/audio-capturer.md b/en/application-dev/media/audio-capturer.md
index 64566aba64e213ca8e088ad3a71e036625153187..0815ef31a288440271a27a8f03fb417923a46190 100644
--- a/en/application-dev/media/audio-capturer.md
+++ b/en/application-dev/media/audio-capturer.md
@@ -8,7 +8,7 @@ You can use the APIs provided by **AudioCapturer** to record raw audio files.
During application development, you are advised to use **on('stateChange')** to subscribe to state changes of the **AudioCapturer** instance. This is because some operations can be performed only when the audio capturer is in a given state. If the application performs an operation when the audio capturer is not in the given state, the system may throw an exception or generate other undefined behavior.
-For details about the APIs, see [AudioCapturer in Audio Management](../reference/apis/js-apis-audio.md).
+For details about the APIs, see [AudioCapturer in Audio Management](../reference/apis/js-apis-audio.md#audiocapturer8).
**Figure 1** Audio capturer state
diff --git a/en/application-dev/media/audio-playback.md b/en/application-dev/media/audio-playback.md
index 131cacdb3f39ecf6eafb5088525d97d209c9cf18..5227f6cdd1b9ec89818b0d1762c99267ec7eba97 100644
--- a/en/application-dev/media/audio-playback.md
+++ b/en/application-dev/media/audio-playback.md
@@ -18,7 +18,7 @@ You can use audio playback APIs to convert audio data into audible analog signal
## How to Develop
-For details about the APIs, see [AudioPlayer in the Media API](../reference/apis/js-apis-media.md).
+For details about the APIs, see [AudioPlayer in the Media API](../reference/apis/js-apis-media.md#audioplayer).
### Full-Process Scenario
diff --git a/en/application-dev/media/audio-recorder.md b/en/application-dev/media/audio-recorder.md
index 6fb1c28efa8bd8bd69e16b09cd577ec4bdeff6e6..f465db2b88118b77c9a4e64307170da07c3e8918 100644
--- a/en/application-dev/media/audio-recorder.md
+++ b/en/application-dev/media/audio-recorder.md
@@ -16,7 +16,7 @@ During audio recording, audio signals are captured, encoded, and saved to files.
## How to Develop
-For details about the APIs, see [AudioRecorder in the Media API](../reference/apis/js-apis-media.md).
+For details about the APIs, see [AudioRecorder in the Media API](../reference/apis/js-apis-media.md#audiorecorder).
### Full-Process Scenario
@@ -185,4 +185,3 @@ export class AudioRecorderDemo {
}
}
```
-
diff --git a/en/application-dev/media/audio-stream-manager.md b/en/application-dev/media/audio-stream-manager.md
index 4f0f88c8fa2c3357e7a8d582642cf4efbb7bf1db..9a8176b4bdab20b681ad9b3e96343a2ccfc10829 100644
--- a/en/application-dev/media/audio-stream-manager.md
+++ b/en/application-dev/media/audio-stream-manager.md
@@ -12,7 +12,7 @@ For details about the APIs, see [AudioStreamManager](../reference/apis/js-apis-a
**Figure 1** Audio stream management invoking relationship
-
+
## How to Develop
diff --git a/en/application-dev/media/camera.md b/en/application-dev/media/camera.md
index bdbccf975c64a6df4cef6845c850cc8de1b2de26..06439dd049be835cdf5a96a35e2a2a42012ee6f8 100644
--- a/en/application-dev/media/camera.md
+++ b/en/application-dev/media/camera.md
@@ -292,7 +292,7 @@ await captureSession.start().then(() => {
##### Switching a Session
```js
-// Stop the current session.
+// Stop the session.
await captureSession.stop((err) => {
if (err) {
console.error('Failed to stop the session ${err.message}');
@@ -347,8 +347,8 @@ await captureSession.start().then(() => {
```js
let settings = {
- quality: camera.QualityLevel.QUALITY_LEVEL_HIGH // Set the image quality to high.
- rotation: camera.ImageRotation.ROTATION_0, // Set the image rotation angle to 0.
+ quality: camera.QualityLevel.QUALITY_LEVEL_HIGH, // Set the image quality to high.
+ rotation: camera.ImageRotation.ROTATION_0 // Set the image rotation angle to 0.
}
// Use the current photographing settings to take photos.
photoOutput.capture(settings, (err) => {
@@ -395,7 +395,7 @@ await videoOutput.stop((err) => {
#### Releasing Resources
```js
-// Stop the current session.
+// Stop the session.
await captureSession.stop((err) => {
if (err) {
console.error('Failed to stop the session ${err.message}');
diff --git a/en/application-dev/media/figures/zh-ch_image_audio_stream_manager.png b/en/application-dev/media/figures/en-us_image_audio_stream_manager.png
similarity index 100%
rename from en/application-dev/media/figures/zh-ch_image_audio_stream_manager.png
rename to en/application-dev/media/figures/en-us_image_audio_stream_manager.png
diff --git a/en/application-dev/media/remote-camera.md b/en/application-dev/media/remote-camera.md
index b63946d6a03a9fbb4d4e6b8e20c3e4920364523b..8d9bd0eb7b7568e9cb46dd6c2a37b4380933b0bf 100644
--- a/en/application-dev/media/remote-camera.md
+++ b/en/application-dev/media/remote-camera.md
@@ -52,7 +52,7 @@ await cameraManager.getCameras((err, cameras) => {
cameraArray = cameras
})
-for(let cameraIndex = 0; cameraIndex < cameraArray.length; cameraIndex) {
+for(let cameraIndex = 0; cameraIndex < cameraArray.length; cameraIndex++) {
console.log('cameraId : ' + cameraArray[cameraIndex].cameraId) // Obtain the camera ID.
console.log('cameraPosition : ' + cameraArray[cameraIndex].cameraPosition) // Obtain the camera position.
console.log('cameraType : ' + cameraArray[cameraIndex].cameraType) // Obtain the camera type.
diff --git a/en/application-dev/media/video-playback.md b/en/application-dev/media/video-playback.md
index cfc09db79fc853066e03205010f43c2f63c27ce5..6ee5cf660069294f717c5cac614ed707db9f1a8c 100644
--- a/en/application-dev/media/video-playback.md
+++ b/en/application-dev/media/video-playback.md
@@ -33,7 +33,7 @@ The table below lists the mainstream playback formats and resolutions.
## How to Develop
-For details about the APIs, see [VideoPlayer in the Media API](../reference/apis/js-apis-media.md).
+For details about the APIs, see [VideoPlayer in the Media API](../reference/apis/js-apis-media.md#videoplayer8).
### Full-Process Scenario
diff --git a/en/application-dev/media/video-recorder.md b/en/application-dev/media/video-recorder.md
index 2982675bd37ff683c83f253d23d3a6c71014d66b..62e81cf05c384a7cd1a780c562697be046153d05 100644
--- a/en/application-dev/media/video-recorder.md
+++ b/en/application-dev/media/video-recorder.md
@@ -14,7 +14,7 @@ During video recording, audio and video signals are captured, encoded, and saved
## How to Develop
-For details about the APIs, see [VideoRecorder in the Media API](../reference/apis/js-apis-media.md).
+For details about the APIs, see [VideoRecorder in the Media API](../reference/apis/js-apis-media.md#videorecorder9).
### Full-Process Scenario
diff --git a/en/application-dev/reference/apis/development-intro.md b/en/application-dev/reference/apis/development-intro.md
index 8528a10ab6f4ba3dd14186079357ce28e650ee6a..f1cc73aa8437b7cb20bf5fe16b284da2a788d570 100644
--- a/en/application-dev/reference/apis/development-intro.md
+++ b/en/application-dev/reference/apis/development-intro.md
@@ -26,6 +26,12 @@ A description regarding system APIs will be provided in the document.
- If all the APIs of a module are system APIs, the following description is provided at the beginning of the reference document: "All the APIs of this module are system APIs."
- If a specific API of a module is a system API, the following description is provided individually for the API: "This is a system API."
+Non-system applications are applications whose Ability Privilege Level (APL) is **normal**. The default application level is **normal**.
+
+For details about the APL and how to declare the APL of an application higher than **normal**, see [Access Control Overview - App APLs](../../security/accesstoken-overview.md#app-apls).
+
+The public SDK, which does not include system APIs, is provided as standard in DevEco Studio. To use system APIs, switch to the full SDK. For details on the operation, see [Guide to Switching to Full SDK](../../quick-start/full-sdk-switch-guide.md).
+
## Permission Description
By default, applications can access limited system resources. However, in some cases, an application needs to access excess data (including personal data) and functions of the system or another application to implement extended functions. For details, see [Access Control Overview](../../security/accesstoken-overview.md).
diff --git a/en/application-dev/reference/apis/js-apis-bundle-LauncherAbilityInfo.md b/en/application-dev/reference/apis/js-apis-bundle-LauncherAbilityInfo.md
index 7b932cacbc2195e8c52976aa80e71bd3b638921d..3a00ac698a3529d153ef3741979238569555f12c 100644
--- a/en/application-dev/reference/apis/js-apis-bundle-LauncherAbilityInfo.md
+++ b/en/application-dev/reference/apis/js-apis-bundle-LauncherAbilityInfo.md
@@ -10,6 +10,8 @@ The **LauncherAbilityInfo** module provides information about a launcher ability
**System capability**: SystemCapability.BundleManager.BundleFramework
+**System API**: This is a system API and cannot be called by third-party applications.
+
| Name | Type | Readable| Writable| Description |
| --------------- | ---------------------------------------------------- | ---- | ---- | ------------------------------------ |
| applicationInfo | [ApplicationInfo](js-apis-bundle-ApplicationInfo.md) | Yes | No | Application information of the launcher ability.|
diff --git a/en/application-dev/reference/apis/js-apis-camera.md b/en/application-dev/reference/apis/js-apis-camera.md
index 5a88150801a77616a6954139376edead865f55a8..78db0562f97cf687e26c210d870519c829b691ee 100644
--- a/en/application-dev/reference/apis/js-apis-camera.md
+++ b/en/application-dev/reference/apis/js-apis-camera.md
@@ -20,9 +20,9 @@ Obtains a **CameraManager** instance. This API uses an asynchronous callback to
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ----------------------------------------------- | ---- | ---------------------------- |
-| context | Context | Yes | Application context. |
+| Name | Type | Mandatory| Description |
+| -------- | ----------------------------------------------- | ---- | ---------------------------------- |
+| context | Context | Yes | Application context. |
| callback | AsyncCallback<[CameraManager](#cameramanager)\> | Yes | Callback used to return the **CameraManager** instance.|
**Example**
@@ -30,7 +30,7 @@ Obtains a **CameraManager** instance. This API uses an asynchronous callback to
```js
camera.getCameraManager(context, (err, cameraManager) => {
if (err) {
- console.error(`Failed to get the CameraManager instance ${err.message}`);
+ console.error('Failed to get the CameraManager instance ${err.message}');
return;
}
console.log('Callback returned with the CameraManager instance');
@@ -53,8 +53,8 @@ Obtains a **CameraManager** instance. This API uses a promise to return the resu
**Return value**
-| Type | Description |
-| ----------------------------------------- | ----------------------------------- |
+| Type | Description |
+| ----------------------------------------- | ----------------------------------------- |
| Promise<[CameraManager](#cameramanager)\> | Promise used to return the **CameraManager** instance.|
**Example**
@@ -78,1149 +78,947 @@ Enumerates the camera statuses.
| CAMERA_STATUS_AVAILABLE | 2 | The camera is available. |
| CAMERA_STATUS_UNAVAILABLE | 3 | The camera is unavailable.|
-## Profile
-Defines the camera profile.
+## CameraPosition
+
+Enumerates the camera positions.
**System capability**: SystemCapability.Multimedia.Camera.Core
-| Name | Type | Read only| Description |
-| -------- | ----------------------------- |---- | ------------- |
-| format | [CameraFormat](#cameraformat) | Yes | Output format. |
-| size | [Size](#size) | Yes | Resolution. |
+| Name | Value | Description |
+| --------------------------- | ---- | ---------------- |
+| CAMERA_POSITION_UNSPECIFIED | 0 | Unspecified position.|
+| CAMERA_POSITION_BACK | 1 | Rear camera. |
+| CAMERA_POSITION_FRONT | 2 | Front camera. |
-## FrameRateRange
+## CameraType
- Defines the frame rate range.
+Enumerates the camera types.
**System capability**: SystemCapability.Multimedia.Camera.Core
-| Name | Type | Read only| Description |
-| ------------------------- | ------ | ---- | ------------------- |
-| min | number | Yes | Minimum rate, in fps. |
-| max | number | Yes | Maximum rate, in fps. |
+| Name | Value | Description |
+| ----------------------- | ---- | ---------------- |
+| 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 | Camera with depth of field information. |
+
-## VideoProfile
+## ConnectionType
-Defines the video profile.
+Enumerates the camera connection types.
**System capability**: SystemCapability.Multimedia.Camera.Core
-| Name | Type | Read only| Description |
-| ------------------------- | ----------------------------------------- | --- |------------ |
-| frameRateRanges | [FrameRateRange](#frameraterange) | Yes | Frame rate range. |
+| Name | 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. |
-## CameraOutputCapability
+## Size
-Defines the camera output capability.
+Defines the image size that can be used in previewing, photographing, and video recording.
**System capability**: SystemCapability.Multimedia.Camera.Core
-| Name | Type | Read only| Description |
-| ----------------------------- | -------------------------------------------------- | --- |------------------- |
-| previewProfiles | Array<[Profile](#profile)\> | Yes | Supported preview profiles. |
-| photoProfiles | Array<[Profile](#profile)\> | Yes | Supported shooting profiles. |
-| videoProfiles | Array<[VideoProfile](#videoprofile)\> | Yes | Supported video recording profiles. |
-| supportedMetadataObjectTypes | Array<[MetadataObjectType](#metadataobjecttype)\> | Yes | Supported metadata object types.|
+| Name | Type | Readable| Writable| Description |
+| ------ | ------ | ---- | ---- | ------------ |
+| height | string | Yes | Yes | Image height.|
+| width | number | Yes | Yes | Image width.|
## CameraManager
Implements camera management. Before calling any API in **CameraManager**, you must use **getCameraManager** to obtain a **CameraManager** instance.
-### getSupportedCameras
+### getCameras
-getSupportedCameras(callback: AsyncCallback\>): void
+getCameras(callback: AsyncCallback\>): void
-Obtains supported cameras. This API uses an asynchronous callback to return the result.
+Obtains all cameras supported by the device. This API uses an asynchronous callback to return the array of supported cameras.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ----------------------------------------------------- | ---- | ------------------------------- |
-| callback | AsyncCallback\> | Yes | Callback used to return the array of supported cameras.|
+| Name | Type | Mandatory| Description |
+| -------- | ----------------------------------------- | ---- | ------------------------------------ |
+| callback | AsyncCallback\> | Yes | Callback used to return the array of supported cameras.|
**Example**
```js
-cameraManager.getSupportedCameras((err, cameras) => {
+cameraManager.getCameras((err, cameras) => {
if (err) {
- console.error(`Failed to get the cameras. ${err.message}`);
+ console.error('Failed to get the cameras. ${err.message}');
return;
}
- console.log(`Callback returned with an array of supported cameras: ${cameras.length}`);
+ console.log('Callback returned with an array of supported cameras: ' + cameras.length);
})
```
-### getSupportedCameras
+### getCameras
-getSupportedCameras(): Promise\>
+getCameras(): Promise\>
-Obtains supported cameras. This API uses a promise to return the result.
+Obtains all cameras supported by the device. This API uses a promise to return the array of supported cameras.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Return value**
-| Type | Description |
-| ----------------------------------------------- | ------------------------- |
-| Promise\> | Promise used to return the array of supported cameras.|
+| Type | Description |
+| ----------------------------------- | ----------------------------- |
+| Promise\> | Promise used to return the array of supported cameras.|
**Example**
```js
-cameraManager.getSupportedCameras().then((cameraArray) => {
- console.log(`Promise returned with an array of supported cameras: ${cameraArray.length}`);
+cameraManager.getCameras().then((cameraArray) => {
+ console.log('Promise returned with an array of supported cameras: ' + cameraArray.length);
})
```
-### getSupportedOutputCapability
+### createCameraInput
+
+createCameraInput(cameraId: string, callback: AsyncCallback): void
-getSupportedOutputCapability(camera:CameraDevice, callback: AsyncCallback): void
+Creates a **CameraInput** instance with the specified camera ID. This API uses an asynchronous callback to return the result.
-Obtains the output capability supported by a camera. This API uses an asynchronous callback to return the result.
+**Required permissions**: ohos.permission.CAMERA
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ---------------------------------------------------------------- | -- | -------------------------- |
-| camera | [CameraDevice](#cameradevice) | Yes| **CameraDevice** object. |
-| callback | AsyncCallback<[CameraOutputCapability](#cameraoutputcapability)\> | Yes| Callback used to return the output capability.|
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------- | ---- | ----------------------------------- |
+| cameraId | string | Yes | ID of the target camera. |
+| callback | AsyncCallback<[CameraInput](#camerainput)\> | Yes | Callback used to return the **CameraInput** instance.|
**Example**
```js
-cameraManager.getSupportedOutputCapability(cameraDevice, (err, cameras) => {
+cameraManager.createCameraInput(cameraId, (err, cameraInput) => {
if (err) {
- console.error(`Failed to get the cameras. ${err.message}`);
+ console.error('Failed to create the CameraInput instance. ${err.message}');
return;
}
- console.log('Callback returned with an array of supported outputCapability');
+ console.log('Callback returned with the CameraInput instance.');
})
```
-### getSupportedOutputCapability
+### createCameraInput
+
+createCameraInput(cameraId: string): Promise
-getSupportedOutputCapability(camera:CameraDevice): Promise
+Creates a **CameraInput** instance with the specified camera ID. This API uses a promise to return the result.
-Obtains the output capability supported by a camera. This API uses a promise to return the result.
+**Required permissions**: ohos.permission.CAMERA
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | --------------------------------- | ---- | ---------- |
-| camera | [CameraDevice](#cameradevice) | Yes | **CameraDevice** object.|
+| Name | Type | Mandatory| Description |
+| -------- | ------ | ---- | ------------ |
+| cameraId | string | Yes | ID of the target camera.|
**Return value**
-| Type | Description |
-| -------------------------------------------------------------- | ----------------------------- |
-| Promise<[CameraOutputCapability](#cameraoutputcapability)\> | Promise used to return the output capability.|
-
+| Type | Description |
+| ------------------------------------- | ---------------------------------------- |
+| Promise<[CameraInput](#camerainput)\> | Promise used to return the **CameraInput** instance.|
**Example**
```js
-cameraManager.getSupportedOutputCapability(cameraDevice).then((cameraoutputcapability) => {
- console.log('Promise returned with an array of supported outputCapability');
+cameraManager.createCameraInput(cameraId).then((cameraInput) => {
+ console.log('Promise returned with the CameraInput instance');
})
```
-### getSupportedMetadataObjectType
+### createCameraInput
+
+createCameraInput(position: CameraPosition, type: CameraType, callback: AsyncCallback): void
-getSupportedMetadataObjectType(callback: AsyncCallback\>): void
+Creates a **CameraInput** instance with the specified camera position and type. This API uses an asynchronous callback to return the result.
-Obtains the metadata object types supported by this camera. This API uses an asynchronous callback to return the result.
+**Required permissions**: ohos.permission.CAMERA
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ---------------------------------------------------------------- | -- | -------------------------- |
-| callback | AsyncCallback\> | Yes| Callback used to return the metadata object types.|
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------- | ---- | ----------------------------------- |
+| position | [CameraPosition](#cameraposition) | Yes | Camera position. |
+| type | [CameraType](#cameratype) | Yes | Camera type. |
+| callback | AsyncCallback<[CameraInput](#camerainput)\> | Yes | Callback used to return the **CameraInput** instance.|
**Example**
```js
-cameraManager.getSupportedMetadataObjectType((err, metadataobject) => {
+cameraManager.createCameraInput(camera.CameraPosition.CAMERA_POSITION_BACK, camera.CameraType.CAMERA_TYPE_UNSPECIFIED, (err, cameraInput) => {
if (err) {
- console.error(`Failed to get the supported metadataObjectType. ${err.message}`);
+ console.error('Failed to create the CameraInput instance. ${err.message}');
return;
}
- console.log('Callback returned with an array of supported metadataObjectType.' );
+ console.log('Callback returned with the CameraInput instance');
})
```
-### getSupportedMetadataObjectType
+### createCameraInput
+
+createCameraInput(position: CameraPosition, type: CameraType): Promise
-getSupportedMetadataObjectType(camera:CameraDevice): Promise
+Creates a **CameraInput** instance with the specified camera position and type. This API uses a promise to return the result.
-Obtains the metadata object types supported by this camera. This API uses a promise to return the result.
+**Required permissions**: ohos.permission.CAMERA
**System capability**: SystemCapability.Multimedia.Camera.Core
-**Return value**
+**Parameters**
-| Type | Description |
-| -------------------------------------------------------------- | ----------------------------- |
-| Promise\> | Promise used to return the metadata object types.|
+| Name | Type | Mandatory| Description |
+| -------- | --------------------------------- | ---- | ---------- |
+| position | [CameraPosition](#cameraposition) | Yes | Camera position.|
+| type | [CameraType](#cameratype) | Yes | Camera type.|
+
+**Return value**
+| Type | Description |
+| ------------------------------------- | ---------------------------------------- |
+| Promise<[CameraInput](#camerainput)\> | Promise used to return the **CameraInput** instance.|
**Example**
```js
-cameraManager.getSupportedMetadataObjectType().then((metadataobject) => {
- console.log('Promise returned with an array of supported metadataObjectType.' );
+cameraManager.createCameraInput(camera.CameraPosition.CAMERA_POSITION_BACK, camera.CameraType.CAMERA_TYPE_UNSPECIFIED).then((cameraInput) => {
+ console.log('Promise returned with the CameraInput instance.');
})
```
-### isCameraMuted
+### on('cameraStatus')
-isCameraMuted(callback: AsyncCallback): void
+on(type: 'cameraStatus', callback: AsyncCallback): void
-Checks whether this camera is muted. This API uses an asynchronous callback to return the result.
+Listens for camera status changes. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ---------------------------------------- | ---- | ------------------------------------ |
-| callback | AsyncCallback | Yes | Callback used to return the result. The value **true** means that the camera is muted, and **false** means the opposite.|
+| Name | Type | Mandatory| Description |
+| :------- | :---------------------------------------------------- | :--- | :--------------------------------------------------- |
+| type | string | Yes | Event type. The value is fixed at **`cameraStatus`**, indicating the camera status change event.|
+| callback | AsyncCallback<[CameraStatusInfo](#camerastatusinfo)\> | Yes | Callback used to return the camera status change. |
**Example**
```js
-cameraManager.isCameraMuted((err, status) => {
+cameraManager.on('cameraStatus', (err, cameraStatusInfo) => {
if (err) {
- console.error(`Failed to get the cameraMuted status. ${err.message}`);
+ console.error('Failed to get cameraStatus callback. ${err.message}');
return;
}
- console.log('Callback returned with cameraMuted status');
+ console.log('camera : ' + cameraStatusInfo.camera.cameraId);
+ console.log('status: ' + cameraStatusInfo.status);
})
```
-### isCameraMuted
-
-isCameraMuted(): Promise
+## Camera
-Checks whether this camera is muted. This API uses a promise to return the result.
+After **[camera.getCameraManager](#cameragetcameramanager)** is called, a camera instance is returned, with camera-related metadata such as **cameraId**, **cameraPosition**, **cameraType**, and **connectionType**.
**System capability**: SystemCapability.Multimedia.Camera.Core
-**Return value**
-
-| Type | Description |
-| ------------------------------------ | --------------------------------------------- |
-| Promise | Promise used to return the result. The value **true** means that the camera is muted, and **false** means the opposite. |
-
+| Name | Type | Read only| Description |
+| -------------- | --------------------------------- | ---- | -------------- |
+| cameraId | string | Yes | Camera ID. |
+| cameraPosition | [CameraPosition](#cameraposition) | Yes | Camera position. |
+| cameraType | [CameraType](#cameratype) | Yes | Camera type. |
+| connectionType | [ConnectionType](#connectiontype) | Yes | Camera connection type.|
**Example**
```js
-cameraManager.isCameraMuted().then((status) => {
- console.log('Promise returned with the status whether camera is muted.');
-})
+async function getCameraInfo("cameraId") {
+ var cameraManager = await camera.getCameraManager(context);
+ var cameras = await cameraManager.getCameras();
+ var cameraObj = cameras[0];
+ var cameraId = cameraObj.cameraId;
+ var cameraPosition = cameraObj.cameraPosition;
+ var cameraType = cameraObj.cameraType;
+ var connectionType = cameraObj.connectionType;
+}
```
-### isCameraMuteSupported
+## CameraStatusInfo
+
+Describes the camera status information.
+
+**System capability**: SystemCapability.Multimedia.Camera.Core
-isCameraMuteSupported(callback: AsyncCallback): void
+| Name | Type | Description |
+| ------ | ----------------------------- | ---------- |
+| camera | [Camera](#camera) | Camera object.|
+| status | [CameraStatus](#camerastatus) | Camera status.|
-Checks whether this camera can be muted. This API uses an asynchronous callback to return the result.
-This is a system API.
+## CameraInput
-**Required permissions**: ohos.permission.CAMERA
+Implements a **CameraInput** instance. Before calling any API in **CameraInput**, you must create a **CameraInput** instance.
+
+### getCameraId
+
+getCameraId(callback: AsyncCallback\): void
+
+Obtains the camera ID based on which this **CameraInput** instance is created. This API uses an asynchronous callback to return the camera ID.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | --------------------------------------- | ---- | ------------------------------------ |
-| callback | AsyncCallback | Yes | Callback used to return the result. The value **true** means that the camera can be muted, and **false** means the opposite. |
+| Name | Type | Mandatory| Description |
+| -------- | ---------------------- | ---- | -------------------------- |
+| callback | AsyncCallback | Yes | Callback used to return the camera ID.|
**Example**
```js
-cameraManager.isCameraMuteSupported((err, status) => {
+cameraInput.getCameraId((err, cameraId) => {
if (err) {
- console.error(`Failed to get the cameraMuteSupported. ${err.message}`);
+ console.error('Failed to get the camera ID. ${err.message}');
return;
}
- console.log('Callback returned with the status whether cameraMuteSupported.');
+ console.log('Callback returned with the camera ID: ' + cameraId);
})
```
-### isCameraMuteSupported
+### getCameraId
-isCameraMuteSupported(): Promise
+getCameraId(): Promise
-Checks whether this camera can be muted. This API uses a promise to return the result.
-
-This is a system API.
-
-**Required permissions**: ohos.permission.CAMERA
+Obtains the camera ID based on which this **CameraInput** instance is created. This API uses a promise to return the camera ID.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Return value**
-| Type | Description |
-| --------------------- | ----------------------------- |
-| Promise | Promise used to return the result. The value **true** means that the camera can be muted, and **false** means the opposite.|
-
+| Type | Description |
+| ---------------- | ----------------------------- |
+| Promise | Promise used to return the camera ID.|
**Example**
```js
-cameraManager.isCameraMuteSupported().then((status) => {
- console.log('Promise returned with the status whether cameraMuteSupported.');
+cameraInput.getCameraId().then((cameraId) => {
+ console.log('Promise returned with the camera ID:' + cameraId);
})
```
-### muteCamera
-muteCamera(mute:boolean, callback: AsyncCallback): void
-
-Mutes this camera. This API uses an asynchronous callback to return the result.
+### hasFlash
-This is a system API.
+hasFlash(callback: AsyncCallback): void
-**Required permissions**: ohos.permission.CAMERA
+Checks whether the device has flash. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ----------------------------------------- | ---- | ------------------------------------ |
-| mute | boolean | Yes | Whether to mute the camera. The value **true** means to mute the camera, and **false** means the opposite. |
-| callback | AsyncCallback | Yes | Callback used to return the result.|
+| Name | Type | Mandatory| Description |
+| -------- | ----------------------- | ---- | -------------------------------------- |
+| callback | AsyncCallback | Yes | Callback used to return the flash support status. The value **true** means that the device has flash.|
**Example**
```js
-cameraManager.muteCamera(isMuted, (err) => {
+cameraInput.hasFlash((err, status) => {
if (err) {
- console.error(`Failed to mute the camera. ${err.message}`);
+ console.error('Failed to check whether the device has flash light. ${err.message}');
return;
}
- console.log('Callback returned with the muteCamera.');
+ console.log('Callback returned with flash light support status: ' + status);
})
```
-### muteCamera
-
-muteCamera(mute:boolean): Promise
-
-Mutes this camera. This API uses a promise to return the result.
+### hasFlash
-This is a system API.
+hasFlash(): Promise
-**Required permissions**: ohos.permission.CAMERA
+Checks whether the device has flash. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
-**Parameters**
-
-| Name | Type | Mandatory| Description |
-| -------- | ----------------------------------------- | ---- | ------------ |
-| mute | boolean | Yes | Whether to mute the camera. The value **true** means to mute the camera, and **false** means the opposite. |
-
**Return value**
-| Type | Description |
-| ----------------------------------- | ----------------------------- |
-| Promise | Promise used to return the result.|
-
+| Type | Description |
+| ----------------- | ------------------------------------------------------- |
+| Promise | Promise used to return the flash support status. The value **true** means that the device has flash.|
**Example**
-```js
-cameraManager.muteCamera(isMuted).then(() => {
- console.log('Promise returned muteCamera.');
+```js
+cameraInput.hasFlash().then((status) => {
+ console.log('Promise returned with the flash light support status:' + status);
})
```
-### createCameraInput
-
-createCameraInput(camera: CameraDevice, callback: AsyncCallback): void
-
-Creates a **CameraInput** instance with the specified **CameraDevice** object. This API uses an asynchronous callback to return the result.
+### isFlashModeSupported
-This is a system API.
+isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback): void
-**Required permissions**: ohos.permission.CAMERA
+Checks whether a specified flash mode is supported. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ------------------------------------------- | ---- | --------------------------------- |
-| camera | [CameraDevice](#cameradevice) | Yes | **CameraDevice** object. |
-| callback | AsyncCallback<[CameraInput](#camerainput)\> | Yes | Callback used to return the **CameraInput** instance. |
+| Name | Type | Mandatory| Description |
+| --------- | ----------------------- | ---- | ---------------------------------------- |
+| flashMode | [FlashMode](#flashmode) | Yes | Flash mode. |
+| callback | AsyncCallback | Yes | Callback used to return the flash mode support status. The value **true** means that the flash mode is supported, and **false** means the opposite.|
**Example**
```js
-cameraManager.createCameraInput(camera, (err, cameraInput) => {
+cameraInput.isFlashModeSupported(camera.FlashMode.FLASH_MODE_AUTO, (err, status) => {
if (err) {
- console.error(`Failed to create the CameraInput instance. ${err.message}`);
+ console.error('Failed to check whether the flash mode is supported. ${err.message}');
return;
}
- console.log('Callback returned with the CameraInput instance.');
+ console.log('Callback returned with the flash mode support status: ' + status);
})
```
-### createCameraInput
-
-createCameraInput(camera: CameraDevice): Promise
-
-Creates a **CameraInput** instance with the specified **CameraDevice** object. This API uses a promise to return the result.
+### isFlashModeSupported
-This is a system API.
+isFlashModeSupported(flashMode: FlashMode): Promise
-**Required permissions**: ohos.permission.CAMERA
+Checks whether a specified flash mode is supported. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ----------------------------- | ---- | ---------- |
-| camera | [CameraDevice](#cameradevice) | Yes | **CameraDevice** object.|
+| Name | Type | Mandatory| Description |
+| --------- | ----------------------- | ---- | ---------------- |
+| flashMode | [FlashMode](#flashmode) | Yes | Flash mode.|
**Return value**
-| Type | Description |
-| ------------------------------------- | ------------------------------------ |
-| Promise<[CameraInput](#camerainput)\> | Promise used to return the **CameraInput** instance.|
+| Type | Description |
+| ----------------- | ------------------------------------------------------------ |
+| Promise | Promise used to return the flash mode support status. The value **true** means that the flash mode is supported, and **false** means the opposite.|
**Example**
```js
-cameraManager.createCameraInput(camera).then((cameraInput) => {
- console.log('Promise returned with the CameraInput instance');
+cameraInput.isFlashModeSupported(camera.FlashMode.FLASH_MODE_AUTO).then((status) => {
+ console.log('Promise returned with flash mode support status.' + status);
})
```
-### createCameraInput
+### setFlashMode
-createCameraInput(position: CameraPosition, type: CameraType, callback: AsyncCallback): void
+setFlashMode(flashMode: FlashMode, callback: AsyncCallback): void
-Creates a **CameraInput** instance with the specified camera position and type. This API uses an asynchronous callback to return the result.
+Sets the flash mode. This API uses an asynchronous callback to return the result.
-This is a system API.
+Before the setting, do the following checks:
-**Required permissions**: ohos.permission.CAMERA
+1. Use **[hasFlash](#hasflash)** to check whether the device has flash.
+2. Use **[isFlashModeSupported](#isflashmodesupported)** to check whether the device supports the flash mode.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ------------------------------------------- | ---- | --------------------------------- |
-| position | [CameraPosition](#cameraposition) | Yes | Camera position. |
-| type | [CameraType](#cameratype) | Yes | Camera type. |
-| callback | AsyncCallback<[CameraInput](#camerainput)\> | Yes | Callback used to return the **CameraInput** instance. |
+| Name | Type | Mandatory| Description |
+| --------- | ----------------------- | ---- | ------------------------ |
+| flashMode | [FlashMode](#flashmode) | Yes | Flash mode. |
+| callback | AsyncCallback | Yes | Callback used to return the result.|
**Example**
```js
-cameraManager.createCameraInput(camera.CameraPosition.CAMERA_POSITION_BACK, camera.CameraType.CAMERA_TYPE_UNSPECIFIED, (err, cameraInput) => {
+cameraInput.setFlashMode(camera.FlashMode.FLASH_MODE_AUTO, (err) => {
if (err) {
- console.error(`Failed to create the CameraInput instance. ${err.message}`);
+ console.error('Failed to set the flash mode ${err.message}');
return;
}
- console.log('Callback returned with the CameraInput instance');
+ console.log('Callback returned with the successful execution of setFlashMode.');
})
```
-### createCameraInput
+### setFlashMode
-createCameraInput(position: CameraPosition, type:CameraType ): Promise
+setFlashMode(flashMode: FlashMode): Promise
-Creates a **CameraInput** instance with the specified camera position and type. This API uses a promise to return the result.
+Sets a flash mode. This API uses a promise to return the result.
-This is a system API.
+Before the setting, do the following checks:
-**Required permissions**: ohos.permission.CAMERA
+1. Use **[hasFlash](#hasflash)** to check whether the device has flash.
+2. Use **[isFlashModeSupported](#isflashmodesupported)** to check whether the device supports the flash mode.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | --------------------------------- | ---- | ------------ |
-| position | [CameraPosition](#cameraposition) | Yes | Camera position. |
-| type | [CameraType](#cameratype) | Yes | Camera type. |
+| Name | Type | Mandatory| Description |
+| --------- | ----------------------- | ---- | ---------------- |
+| flashMode | [FlashMode](#flashmode) | Yes | Flash mode.|
**Return value**
-| Type | Description |
-| ------------------------------------- | ------------------------------------ |
-| Promise<[CameraInput](#camerainput)\> | Promise used to return the **CameraInput** instance.|
+| Type | Description |
+| -------------- | --------------------------- |
+| Promise| Promise used to return the result.|
**Example**
```js
-cameraManager.createCameraInput(camera.CameraPosition.CAMERA_POSITION_BACK, camera.CameraType.CAMERA_TYPE_UNSPECIFIED).then((cameraInput) => {
- console.log('Promise returned with the CameraInput instance');
+cameraInput.setFlashMode(camera.FlashMode.FLASH_MODE_AUTO).then(() => {
+ console.log('Promise returned with the successful execution of setFlashMode.');
})
```
-### createPreviewOutput
+### getFlashMode
-createPreviewOutput(profile: Profile, surfaceId: string, callback: AsyncCallback): void
+getFlashMode(callback: AsyncCallback): void
-Creates a **PreviewOutput** instance. This API uses an asynchronous callback to return the result.
+Obtains the flash mode in use. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ----------------------------------------------- | ---- | ------------------------------- |
-| profile | [Profile](#profile) | Yes | Supported preview profile. |
-| surfaceId| string | Yes | Surface ID, which is obtained from **[XComponent](../arkui-ts/ts-basic-components-xcomponent.md)** or **[ImageReceiver](js-apis-image.md#imagereceiver9)**.|
-| callback | AsyncCallback<[PreviewOutput](#previewoutput)\> | Yes | Callback used to return the **PreviewOutput** instance.|
+| Name | Type | Mandatory| Description |
+| -------- | --------------------------------------- | ---- | ---------------------------------------- |
+| callback | AsyncCallback<[FlashMode](#flashmode)\> | Yes | Callback used to return the flash mode.|
**Example**
```js
-cameraManager.createPreviewOutput(profile, surfaceId, (err, previewoutput) => {
+cameraInput.getFlashMode((err, flashMode) => {
if (err) {
- console.error(`Failed to gcreate previewOutput. ${err.message}`);
+ console.error('Failed to get the flash mode ${err.message}');
return;
}
- console.log('Callback returned with previewOutput created.');
+ console.log('Callback returned with current flash mode: ' + flashMode);
})
```
-### createPreviewOutput
+### getFlashMode
-createPreviewOutput(profile: Profile, surfaceId: string): Promise
+getFlashMode(): Promise
-Creates a **PreviewOutput** instance. This API uses a promise to return the result.
+Obtains the flash mode in use. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
-**Parameters**
-
-| Name | Type | Mandatory| Description |
-| -------- | ---------------------------------| ---- | ----------------- |
-| profile | [Profile](#profile) | Yes | Supported preview profile. |
-| surfaceId| string | Yes | Surface ID, which is obtained from **[XComponent](../arkui-ts/ts-basic-components-xcomponent.md)** or **[ImageReceiver](js-apis-image.md#imagereceiver9)**.|
-
**Return value**
-| Type | Description |
-| ---------------------------------------- | ---------------------------------------- |
-| Promise<[PreviewOutput](#previewoutput)\> | Promise used to return the **PreviewOutput** instance. |
+| Type | Description |
+| --------------------------------- | --------------------------------------- |
+| Promise<[FlashMode](#flashmode)\> | Promise used to return the flash mode.|
**Example**
```js
-cameraManager.createPreviewOutput(profile, surfaceId).then((previewoutput) => {
- console.log('Promise returned with previewOutput created.');
+cameraInput.getFlashMode().then((flashMode) => {
+ console.log('Promise returned with current flash mode : ' + flashMode);
})
```
-### createDeferredPreviewOutput
+### isFocusModeSupported
-createDeferredPreviewOutput(profile: Profile, callback: AsyncCallback): void
+isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback): void
-Creates a **PreviewOutput** instance without a surface ID. This API uses an asynchronous callback to return the result.
+Checks whether a specified focus mode is supported. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ----------------------------------------------- | ---- | --------------------------------- |
-| profile | [Profile](#profile) | Yes | Supported preview profile. |
-| callback | AsyncCallback<[PreviewOutput](#previewoutput)\> | Yes | Callback used to return the **PreviewOutput** instance. |
+| Name | Type | Mandatory| Description |
+| -------- | ----------------------- | ---- | -------------------------------------- |
+| afMode | [FocusMode](#focusmode) | Yes | Focus mode. |
+| callback | AsyncCallback | Yes | Callback used to return the focus mode support status. The value **true** means that the focus mode is supported, and **false** means the opposite.|
**Example**
```js
-cameraManager.createDeferredPreviewOutput(profile, (err, previewoutput) => {
+cameraInput.isFocusModeSupported(camera.FocusMode.FOCUS_MODE_AUTO, (err, status) => {
if (err) {
- console.error(`Failed to create deferredPreviewOutput. ${err.message}`);
+ console.error('Failed to check whether the focus mode is supported. ${err.message}');
return;
}
- console.log('Callback returned with deferredPreviewOutput created.');
+ console.log('Callback returned with the focus mode support status: ' + status);
})
```
-### createDeferredPreviewOutput
+### isFocusModeSupported
-createDeferredPreviewOutput(profile: Profile): Promise
+isFocusModeSupported(afMode: FocusMode): Promise
-Creates a **PreviewOutput** instance without a surface ID. This API uses a promise to return the result.
+Checks whether a specified focus mode is supported. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | ---------------------------------| ---- | ---------- |
-| profile | [Profile](#profile) | Yes | Supported preview profile. |
+| Name | Type | Mandatory| Description |
+| ------ | ----------------------- | ---- | ---------------- |
+| afMode | [FocusMode](#focusmode) | Yes | Focus mode.|
**Return value**
-| Type | Description |
-| ----------------------------------------- | --------------------------------------- |
-| Promise<[PreviewOutput](#previewoutput)\> | Promise used to return the **PreviewOutput** instance.|
+| Type | Description |
+| ----------------- | ----------------------------------------------------------- |
+| Promise | Promise used to return the focus mode support status. The value **true** means that the focus mode is supported, and **false** means the opposite.|
**Example**
```js
-cameraManager.createDeferredPreviewOutput(profile).then((previewoutput) => {
- console.log('Promise returned with DefeerredPreviewOutput created.');
+cameraInput.isFocusModeSupported(camera.FocusMode.FOCUS_MODE_AUTO).then((status) => {
+ console.log('Promise returned with focus mode support status.' + status);
})
```
-### createPhotoOutput
+### setFocusMode
-createPhotoOutput(profile: Profile, surfaceId: string, callback: AsyncCallback): void
+setFocusMode(afMode: FocusMode, callback: AsyncCallback): void
-Creates a **PhotoOutput** instance. This API uses an asynchronous callback to return the result.
+Sets a focus mode. This API uses an asynchronous callback to return the result.
+
+Before the setting, use **[isFocusModeSupported](#isfocusmodesupported)** to check whether the focus mode is supported.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ------------------------------------------- | ---- | ----------------------------------- |
-| profile | [Profile](#profile) | Yes | Supported shooting profile. |
-| surfaceId| string | Yes | Surface ID, which is obtained from **[ImageReceiver](js-apis-image.md#imagereceiver9)**.|
-| callback | AsyncCallback<[PhotoOutput](#photooutput)\> | Yes | Callback used to return the **PhotoOutput** instance. |
+| Name | Type | Mandatory| Description |
+| -------- | ----------------------- | ---- | ------------------------ |
+| afMode | [FocusMode](#focusmode) | Yes | Focus mode. |
+| callback | AsyncCallback | Yes | Callback used to return the result.|
**Example**
```js
-cameraManager.createPhotoOutput(profile, surfaceId, (err, photooutput) => {
+cameraInput.setFocusMode(camera.FocusMode.FOCUS_MODE_AUTO, (err) => {
if (err) {
- console.error(`Failed to create photoOutput. ${err.message}`);
+ console.error('Failed to set the focus mode ${err.message}');
return;
}
- console.log('Callback returned with photoOutput created.');
+ console.log('Callback returned with the successful execution of setFocusMode.');
})
```
-### createPhotoOutput
+### setFocusMode
+
+setFocusMode(afMode: FocusMode): Promise
-createPhotoOutput(profile: Profile, surfaceId: string): Promise
+Sets a focus mode. This API uses a promise to return the result.
-Creates a **PhotoOutput** instance. This API uses a promise to return the result.
+Before the setting, use **[isFocusModeSupported](#isfocusmodesupported)** to check whether the focus mode is supported.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ---------------------------------| ---- | ----------- |
-| profile | [Profile](#profile) | Yes | Supported shooting profile. |
-| surfaceId| string | Yes | Surface ID, which is obtained from **[ImageReceiver](js-apis-image.md#imagereceiver9)**.|
+| Name | Type | Mandatory| Description |
+| ------ | ----------------------- | ---- | ---------------- |
+| afMode | [FocusMode](#focusmode) | Yes | Focus mode.|
**Return value**
-| Type | Description |
-| ------------------------------------- | -------------------------------------- |
-| Promise<[PhotoOutput](#photooutput)\> | Promise used to return the **PhotoOutput** instance. |
+| Type | Description |
+| -------------- | --------------------------- |
+| Promise| Promise used to return the result.|
**Example**
```js
-cameraManager.createPhotoOutput(profile, surfaceId).then((photooutput) => {
- console.log('Promise returned with photoOutput created.');
+cameraInput.setFocusMode(camera.FocusMode.FOCUS_MODE_AUTO).then(() => {
+ console.log('Promise returned with the successful execution of setFocusMode.');
})
```
-### createVideoOutput
+### getFocusMode
-createVideoOutput(profile: VideoProfile, surfaceId: string, callback: AsyncCallback): void
+getFocusMode(callback: AsyncCallback): void
-Creates a **VideoOutput** instance. This API uses an asynchronous callback to return the result.
+Obtains the focus mode in use. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ------------------------------------------- | ---- | ------------------------------ |
-| profile | [VideoProfile](#videoprofile) | Yes | Supported video recording profile. |
-| surfaceId| string | Yes | Surface ID, which is obtained from **[VideoRecorder](js-apis-media.md#videorecorder9)**.|
-| callback | AsyncCallback<[VideoOutput](#videooutput)\> | Yes | Callback used to return the **VideoOutput** instance.|
+| Name | Type | Mandatory| Description |
+| -------- | --------------------------------------- | ---- | -------------------------------------- |
+| callback | AsyncCallback<[FocusMode](#focusmode)\> | Yes | Callback used to return the focus mode.|
**Example**
```js
-cameraManager.createVideoOutput(profile, surfaceId, (err, videooutput) => {
+cameraInput.getFocusMode((err, afMode) => {
if (err) {
- console.error(`Failed to create videoOutput. ${err.message}`);
+ console.error('Failed to get the focus mode ${err.message}');
return;
}
- console.log('Callback returned with an array of supported outputCapability' );
+ console.log('Callback returned with current focus mode: ' + afMode);
})
```
-### createVideoOutput
+### getFocusMode
-createVideoOutput(profile: VideoProfile, surfaceId: string): Promise
+getFocusMode(): Promise
-Creates a **VideoOutput** instance. This API uses a promise to return the result.
+Obtains the focus mode in use. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
-**Parameters**
-
-| Name | Type | Mandatory| Description |
-| -------- | ---------------------------------| ---- | ---------- |
-| profile | [VideoProfile](#videoprofile) | Yes | Supported video recording profile. |
-| surfaceId| string | Yes | Surface ID, which is obtained from **[VideoRecorder](js-apis-media.md#videorecorder9)**.|
-
**Return value**
-| Type | Description |
-| ------------------------------------- | -------------------------------------- |
-| Promise<[VideoOutput](#videooutput)\> | Promise used to return the **VideoOutput** instance. |
+| Type | Description |
+| ------------------- | ------------------------------------- |
+| Promise | Promise used to return the focus mode.|
**Example**
```js
-cameraManager.createVideoOutput(profile, surfaceId).then((videooutput) => {
- console.log('Promise returned with videoOutput created.');
+cameraInput.getFocusMode().then((afMode) => {
+ console.log('Promise returned with current focus mode : ' + afMode);
})
```
-### createMetadataOutput
+### getZoomRatioRange
-createMetadataOutput(metadataObjectTypes: Array, callback: AsyncCallback): void
+getZoomRatioRange\(callback: AsyncCallback\>\): void
-Creates a **MetadataOutput** instance. This API uses an asynchronous callback to return the result.
+Obtains the zoom ratio range. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------------------- | -------------------------------------------------- | --- | ---------------------------- |
-| metadataObjectTypes | Array<[MetadataObjectType](#metadataobjecttype)\> | Yes | Supported metadata object types. |
-| callback | AsyncCallback<[MetadataOutput](#metadataoutput)\> | Yes | Callback used to return the **MetadataOutput** instance. |
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------ | ---- | ------------------------ |
+| callback | AsyncCallback\> | Yes | Callback used to return the result.|
**Example**
```js
-cameraManager.createMetadataOutput(metadataObjectTypes, (err, metadataoutput) => {
+cameraInput.getZoomRatioRange((err, zoomRatioRange) => {
if (err) {
- console.error(`Failed to create metadataOutput. ${err.message}`);
+ console.error('Failed to get the zoom ratio range. ${err.message}');
return;
}
- console.log('Callback returned with metadataOutput created.');
+ console.log('Callback returned with zoom ratio range: ' + zoomRatioRange.length);
})
```
-### createMetadataOutput
+### getZoomRatioRange
-createMetadataOutput(metadataObjectTypes: Array): Promise
+getZoomRatioRange\(\): Promise\>
-Creates a **MetadataOutput** instance. This API uses a promise to return the result.
+Obtains the zoom ratio range. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
-**Parameters**
-
-| Name | Type | Mandatory| Description |
-| -------------------- | -------------------------------------------------- | --- | -------------- |
-| metadataObjectTypes | Array<[MetadataObjectType](#metadataobjecttype)\> | Yes | Supported metadata object types.|
-
**Return value**
-| Type | Description |
-| ------------------------------------------ | ----------------------------------------- |
-| Promise<[MetadataOutput](#metadataoutput)\> | Promise used to return the **MetadataOutput** instance.|
+| Type | Description |
+| ------------------------ | ------------------------------------------- |
+| Promise\> | Promise used to return the zoom ratio range.|
**Example**
```js
-cameraManager.createMetadataOutput(metadataObjectTypes).then((metadataoutput) => {
- console.log('Promise returned with metadataOutput created.');
+cameraInput.getZoomRatioRange().then((zoomRatioRange) => {
+ console.log('Promise returned with zoom ratio range: ' + zoomRatioRange.length);
})
```
-### createCaptureSession
+### setZoomRatio
-createCaptureSession(callback: AsyncCallback): void
+setZoomRatio(zoomRatio: number, callback: AsyncCallback): void
-Creates a **CaptureSession** instance. This API uses an asynchronous callback to return the result.
+Sets a zoom ratio. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------------------- | ----------------------------------------- | ----------- | ---------------------------- |
-| callback | AsyncCallback<[CaptureSession](#capturesession)\> | Yes | Callback used to return the **CaptureSession** instance.|
+| Name | Type | Mandatory| Description |
+| --------- | -------------------- | ---- | ------------------------ |
+| zoomRatio | number | Yes | Zoom ratio. |
+| callback | AsyncCallback | Yes | Callback used to return the result.|
**Example**
```js
-cameraManager.createCaptureSession((err, capturesession) => {
+cameraInput.setZoomRatio(1, (err) => {
if (err) {
- console.error(`Failed to create captureSession. ${err.message}`);
+ console.error('Failed to set the zoom ratio value ${err.message}');
return;
}
- console.log('Callback returned with captureSession created.');
-})
-```
-
-### createCaptureSession
-
-createCaptureSession(): Promise
-
-Creates a **CaptureSession** instance. This API uses a promise to return the result.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-**Return value**
-
-| Type | Description |
-| ------------------------------------------- | ---------------------------------------- |
-| Promise<[CaptureSession](#capturesession)\> | Promise used to return the **CaptureSession** instance.|
-
-**Example**
-
-```js
-cameraManager.createCaptureSession().then((capturesession) => {
- console.log('Promise returned with captureSession created.');
+ console.log('Callback returned with the successful execution of setZoomRatio.');
})
```
-### on('cameraStatus')
+### setZoomRatio
-on(type: 'cameraStatus', callback: AsyncCallback): void
+setZoomRatio(zoomRatio: number): Promise
-Listens for camera status changes. This API uses an asynchronous callback to return the result.
+Sets a zoom ratio. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ----------------------------------------------------- | ---- | --------- |
-| type | string | Yes | Event type. The value is fixed at **'cameraStatus'**, indicating the camera status change event.|
-| callback | AsyncCallback<[CameraStatusInfo](#camerastatusinfo)\> | Yes | Callback used to return the camera status change. |
-
-**Example**
-
-```js
-cameraManager.on('cameraStatus', (err, cameraStatusInfo) => {
- if (err) {
- console.error(`Failed to get cameraStatus callback. ${err.message}`);
- return;
- }
- console.log(`camera : ${cameraStatusInfo.camera.cameraId}`);
- console.log(`status: ${cameraStatusInfo.status}`);
-})
-```
-
-### on('cameraMute')
-
-on(type: 'cameraMute', callback: AsyncCallback): void
-
-Listens for camera mute status changes. This API uses an asynchronous callback to return the result.
-
-This is a system API.
-
-**Required permissions**: ohos.permission.CAMERA
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
+| Name | Type | Mandatory| Description |
+| --------- | ------ | ---- | ------------ |
+| zoomRatio | number | Yes | Zoom ratio.|
-**Parameters**
+**Return value**
-| Name | Type | Mandatory| Description |
-| -------- | --------------------------------------- | ---- | ------------------------------- |
-| type | string | Yes | Event type. The value is fixed at **'cameraMute'**, indicating the camera mute status change event.|
-| callback | AsyncCallback | Yes | Callback used to return the camera mute status. |
+| Type | Description |
+| -------------- | --------------------------- |
+| Promise| Promise used to return the result.|
**Example**
```js
-cameraManager.on('cameraMute', (err, status) => {
- if (err) {
- console.error(`Failed to get cameraMute callback. ${err.message}`);
- return;
- }
- console.log(`status: ${status}`);
+cameraInput.setZoomRatio(1).then(() => {
+ console.log('Promise returned with the successful execution of setZoomRatio.');
})
```
-## CameraStatusInfo
-
-Describes the camera status information.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-| Name | Type | Description |
-| ------ | ----------------------------- | ---------- |
-| camera | [CameraDevice](#cameradevice) | Camera object.|
-| status | [CameraStatus](#camerastatus) | Camera status.|
-
-## CameraPosition
-
-Enumerates the camera positions.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-| Name | Value | Description |
-| --------------------------- | ---- | -------------- |
-| CAMERA_POSITION_UNSPECIFIED | 0 | Unspecified position. |
-| CAMERA_POSITION_BACK | 1 | Rear camera. |
-| CAMERA_POSITION_FRONT | 2 | Front camera. |
-
-## CameraType
-
-Enumerates the camera types.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-| Name | Value | Description |
-| ----------------------- | ---- | -------------- |
-| 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 | Camera with depth of field information.|
-
-## ConnectionType
-
-Enumerates the camera connection types.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-| Name | 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.|
-
-## CameraDevice
-
-Defines the camera device information.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-| Name | Type | Read only| Description |
-| -------------- | --------------------------------- | ---- | ---------- |
-| cameraId | string | Yes | **CameraDevice** object.|
-| cameraPosition | [CameraPosition](#cameraposition) | Yes | Camera position. |
-| cameraType | [CameraType](#cameratype) | Yes | Camera type. |
-| connectionType | [ConnectionType](#connectiontype) | Yes | Camera connection type.|
-
-**Example**
-
-```js
-async function getCameraInfo("cameraId") {
- let cameraManager = await camera.getCameraManager(context);
- let cameras = await cameraManager.getSupportedCameras();
- let cameraObj = cameras[0];
- let cameraId = cameraObj.cameraId;
- let cameraPosition = cameraObj.cameraPosition;
- let cameraType = cameraObj.cameraType;
- let connectionType = cameraObj.connectionType;
-}
-```
-
-## Size
-
-Enumerates the camera output capability.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-| Name | Type | Readable| Writable| Description |
-| ------ | ------ | ---- | ---- | ------------ |
-| height | number | Yes | Yes | Image height, in pixels.|
-| width | number | Yes | Yes | Image width, in pixels.|
-
-## Point
-
-Enumerates the point coordinates, which are used for focus and exposure configuration.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-| Name | Type | Mandatory | Description |
-| ------ | ------ | ---- | ------------ |
-| x | number | Yes | X coordinate of a point. |
-| y | number | Yes | Y coordinate of a point. |
-
-## CameraFormat
-
-Enumerates the camera output formats.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-| Name | Default Value | Description |
-| ----------------------- | --------- | ------------ |
-| CAMERA_FORMAT_YUV_420_SP| 1003 | YUV 420 SP image. |
-| CAMERA_FORMAT_JPEG | 2000 | JPEG image. |
-
-## CameraInput
-
-Provides camera information used in **[CaptureSession](#capturesession)**.
-
-### open
+### getZoomRatio
-open\(callback: AsyncCallback\): void
+getZoomRatio(callback: AsyncCallback): void
-Opens this camera. This API uses an asynchronous callback to return the result.
+Obtains the zoom ratio in use. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | -------------------- | ---- | ------------------- |
-| callback | AsyncCallback | Yes | Callback used to return the result.|
+| Name | Type | Mandatory| Description |
+| -------- | ---------------------- | ---- | ------------------------ |
+| callback | AsyncCallback | Yes | Callback used to return the result.|
**Example**
```js
-cameraInput.open((err) => {
+cameraInput.getZoomRatio((err, zoomRatio) => {
if (err) {
- console.error(`Failed to open the camera. ${err.message}`);
+ console.error('Failed to get the zoom ratio ${err.message}');
return;
}
- console.log('Callback returned with camera opened.');
+ console.log('Callback returned with current zoom ratio: ' + zoomRatio);
})
```
-### open
+### getZoomRatio
-open(): Promise
+getZoomRatio(): Promise
-Opens this camera. This API uses a promise to return the result.
+Obtains the zoom ratio in use. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Return value**
-| Type | Description |
-| -------------- | ----------------------- |
-| Promise| Promise used to return the result.|
+| Type | Description |
+| ---------------- | --------------------------- |
+| Promise | Promise used to return the zoom ratio.|
**Example**
```js
-cameraInput.open().then(() => {
- console.log('Promise returned with camera opened.');
+cameraInput.getZoomRatio().then((zoomRatio) => {
+ console.log('Promise returned with current zoom ratio : ' + zoomRatio);
})
```
-### close
+### release
-close\(callback: AsyncCallback\): void
+release\(callback: AsyncCallback\): void
-Closes this camera. This API uses an asynchronous callback to return the result.
+Releases this **CameraInput** instance. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | -------------------- | ---- | -------------------- |
+| Name | Type | Mandatory| Description |
+| -------- | -------------------- | ---- | ------------------------ |
| callback | AsyncCallback | Yes | Callback used to return the result.|
**Example**
```js
-cameraInput.close((err) => {
+cameraInput.release((err) => {
if (err) {
- console.error(`Failed to close the cameras. ${err.message}`);
+ console.error('Failed to release the CameraInput instance ${err.message}');
return;
}
- console.log('Callback returned with camera closed.');
-})
+ console.log('Callback invoked to indicate that the CameraInput instance is released successfully.');
+});
```
-### close
+### release
-close(): Promise
+release(): Promise
-Closes this camera. This API uses a promise to return the result.
+Releases this **CameraInput** instance. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Return value**
-| Type | Description |
-| -------------- | ----------------------- |
+| Type | Description |
+| -------------- | --------------------------- |
| Promise| Promise used to return the result.|
**Example**
```js
-cameraInput.close().then(() => {
- console.log('Promise returned with camera closed.');
+cameraInput.release().then(() => {
+ console.log('Promise returned to indicate that the CameraInput instance is released successfully.');
})
```
-### release
+### on('focusStateChange')
-release\(callback: AsyncCallback\): void
+on(type: 'focusStateChange', callback: AsyncCallback): void
-Releases this camera. This API uses an asynchronous callback to return the result.
+Listens for focus state changes. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | -------------------- | ---- | ------------------- |
-| callback | AsyncCallback | Yes | Callback used to return the result.|
-
-**Example**
-
-```js
-cameraInput.release((err) => {
- if (err) {
- console.error(`Failed to release the CameraInput instance ${err.message}`);
- return;
- }
- console.log('Callback invoked to indicate that the CameraInput instance is released successfully.');
-});
-```
-
-### release
-
-release(): Promise
-
-Releases this camera. This API uses a promise to return the result.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-**Return value**
-
-| Type | Description |
-| -------------- | ----------------------- |
-| Promise| Promise used to return the result.|
+| Name | Type | Mandatory| Description |
+| :------- | :---------------------------------------- | :--- | :------------------------------------------------------- |
+| type | string | Yes | Event type. The value is fixed at **'focusStateChange'**, indicating the focus state change event.|
+| callback | AsyncCallback<[FocusState](#focusstate)\> | Yes | Callback used to return the focus state change. |
**Example**
```js
-cameraInput.release().then(() => {
- console.log('Promise returned to indicate that the CameraInput instance is released successfully.');
+cameraInput.on('focusStateChange', (focusState) => {
+ console.log('Focus state : ' + focusState);
})
```
@@ -1234,42 +1032,37 @@ Listens for **CameraInput** errors. This API uses a callback to return the resul
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | -------------------------------- | ---- | ------------------------------------------- |
+| Name | Type | Mandatory| Description |
+| :------- | :------------------------------- | :--- | :----------------------------------------------- |
| type | string | Yes | Event type. The value is fixed at **'error'**, indicating the camera input error event.|
-| callback | ErrorCallback<[CameraInputError](#camerainputerror)\> | Yes | Callback used to return the result. |
+| callback | ErrorCallback<[CameraInputError](#camerainputerror)\> | Yes | Callback used to return the result. |
**Example**
```js
cameraInput.on('error', (cameraInputError) => {
- console.log(`Camera input error code: ${cameraInputError.code}`);
+ console.log('Camera input error code: ' + cameraInputError.code);
})
```
-## CameraInputErrorCode
+## CameraInputErrorCode
-Enumerates the error codes used for camera input.
+Enumerates the error codes used in a **CameraInput** instance.
**System capability**: SystemCapability.Multimedia.Camera.Core
-| Name | Value | Description |
-| ------------------------- | ---- | ---------- |
-| ERROR_UNKNOWN | -1 | Unknown error.|
-| ERROR_NO_PERMISSION | 0 | You do not have the required permission.|
-| ERROR_DEVICE_PREEMPTED | 1 | The camera is preempted.|
-| ERROR_DEVICE_DISCONNECTED | 2 | The camera is disconnected.|
-| ERROR_DEVICE_IN_USE | 3 | The camera is in use.|
-| ERROR_DRIVER_ERROR | 4 | Driver error. |
+| Name | Value | Description |
+| ------------- | ---- | ---------- |
+| ERROR_UNKNOWN | -1 | Unknown error.|
-## CameraInputError
+## CameraInputError
-Defines an error object used for **[CameraInput](#camerainput)**.
+Defines a **CameraInput** error.
**System capability**: SystemCapability.Multimedia.Camera.Core
-| Name| Type | Description |
-| ---- | --------------------------------------------- | --------------------- |
+| Name| Type | Description |
+| ---- | ------------------------------------------- | -------------------------- |
| code | [CameraInputErrorCode](#camerainputerrorcode) | **CameraInput** error code.|
@@ -1279,37 +1072,25 @@ Enumerates the flash modes.
**System capability**: SystemCapability.Multimedia.Camera.Core
-| Name | Value | Description |
-| ---------------------- | ---- | ---------- |
+| Name | Value | Description |
+| ---------------------- | ---- | ------------ |
| FLASH_MODE_CLOSE | 0 | The flash is off.|
| FLASH_MODE_OPEN | 1 | The flash is on.|
| FLASH_MODE_AUTO | 2 | The flash mode is auto, indicating that the flash fires automatically depending on the shooting conditions.|
| FLASH_MODE_ALWAYS_OPEN | 3 | The flash is steady on.|
-## ExposureMode
-
-Enumerates the exposure modes.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-| Name | Value | Description |
-| ----------------------------- | ---- | ----------- |
-| EXPOSURE_MODE_LOCKED | 0 | Exposure locked.|
-| EXPOSURE_MODE_AUTO | 1 | Auto exposure.|
-| EXPOSURE_MODE_CONTINUOUS_AUTO | 2 | Continuous auto exposure.|
-
## FocusMode
Enumerates the focus modes.
**System capability**: SystemCapability.Multimedia.Camera.Core
-| Name | Value | Description |
-| -------------------------- | ---- | ------------ |
+| Name | Value | Description |
+| -------------------------- | ---- | ------------------ |
| FOCUS_MODE_MANUAL | 0 | Manual focus. |
| FOCUS_MODE_CONTINUOUS_AUTO | 1 | Continuous auto focus.|
| FOCUS_MODE_AUTO | 2 | Auto focus. |
-| FOCUS_MODE_LOCKED | 3 | Focus locked. |
+| FOCUS_MODE_LOCKED | 3 | Focus locked. |
## FocusState
@@ -1317,40 +1098,70 @@ Enumerates the focus states.
**System capability**: SystemCapability.Multimedia.Camera.Core
-| Name | Value | Description |
-| --------------------- | ---- | --------- |
-| FOCUS_STATE_SCAN | 0 | Focusing. |
-| FOCUS_STATE_FOCUSED | 1 | Focused. |
+| Name | Value | Description |
+| --------------------- | ---- | ------------ |
+| FOCUS_STATE_SCAN | 0 | Focusing. |
+| FOCUS_STATE_FOCUSED | 1 | Focused.|
| FOCUS_STATE_UNFOCUSED | 2 | Unfocused.|
-## ExposureState
+## camera.createCaptureSession
+
+createCaptureSession\(context: Context, callback: AsyncCallback\): void
-Enumerates the exposure states.
+Creates a **CaptureSession** instance. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
-| Name | Value | Description |
-| ------------------------- | ---- | -------- |
-| EXPOSURE_STATE_SCAN | 0 | Exposing. |
-| EXPOSURE_STATE_CONVERGED | 1 | Exposure converged.|
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------------------------------- | ---- | -------------------------------------- |
+| context | Context | Yes | Application context. |
+| callback | AsyncCallback<[CaptureSession](#capturesession)\> | Yes | Callback used to return the **CaptureSession** instance.|
+
+**Example**
+
+```js
+camera.createCaptureSession((context), (err, captureSession) => {
+ if (err) {
+ console.error('Failed to create the CaptureSession instance. ${err.message}');
+ return;
+ }
+ console.log('Callback returned with the CaptureSession instance.' + captureSession);
+});
+```
+
+## camera.createCaptureSession
-## VideoStabilizationMode
+createCaptureSession(context: Context\): Promise;
-Enumerates the video stabilization modes.
+Creates a **CaptureSession** instance. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
-| Name | Value | Description |
-| --------- | ---- | ------------ |
-| OFF | 0 | Video stabilization is disabled. |
-| LOW | 1 | The basic video stabilization algorithm is used. |
-| MIDDLE | 2 | A video stabilization algorithm with a stabilization effect better than that of the **LOW** type is used. |
-| HIGH | 3 | A video stabilization algorithm with a stabilization effect better than that of the **MIDDLE** type is used. |
-| AUTO | 4 | Automatic video stabilization is used. |
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| ------- | ------- | ---- | ------------ |
+| context | Context | Yes | Application context.|
+
+**Return value**
+
+| Type | Description |
+| ------------------------------------------- | ----------------------------------------- |
+| Promise<[CaptureSession](#capturesession)\> | Promise used to return the **CaptureSession** instance.|
+
+**Example**
+
+```js
+camera.createCaptureSession(context).then((captureSession) => {
+ console.log('Promise returned with the CaptureSession instance');
+})
+```
## CaptureSession
-Implements a shooting session, which saves all **[CameraInput](#camerainput)** and **[CameraOutput](#cameraoutput)** instances required to run the camera and requests the camera to complete shooting or video recording.
+Implements a shooting session.
### beginConfig
@@ -1362,8 +1173,8 @@ Starts configuration for this **CaptureSession** instance. This API uses an asyn
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | -------------------- | ---- | ------------------- |
+| Name | Type | Mandatory| Description |
+| -------- | -------------------- | ---- | ------------------------ |
| callback | AsyncCallback | Yes | Callback used to return the result.|
**Example**
@@ -1371,7 +1182,7 @@ Starts configuration for this **CaptureSession** instance. This API uses an asyn
```js
captureSession.beginConfig((err) => {
if (err) {
- console.error(`Failed to start the configuration. ${err.message}`);
+ console.error('Failed to start the configuration. ${err.message}');
return;
}
console.log('Callback invoked to indicate the begin config success.');
@@ -1388,8 +1199,8 @@ Starts configuration for this **CaptureSession** instance. This API uses a promi
**Return value**
-| Type | Description |
-| -------------- | ------------------------ |
+| Type | Description |
+| -------------- | --------------------------- |
| Promise| Promise used to return the result.|
@@ -1411,8 +1222,8 @@ Commits the configuration for this **CaptureSession** instance. This API uses an
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | -------------------- | ---- | -------------------- |
+| Name | Type | Mandatory| Description |
+| -------- | -------------------- | ---- | ------------------------ |
| callback | AsyncCallback | Yes | Callback used to return the result.|
**Example**
@@ -1420,7 +1231,7 @@ Commits the configuration for this **CaptureSession** instance. This API uses an
```js
captureSession.commitConfig((err) => {
if (err) {
- console.error(`Failed to commit the configuration. ${err.message}`);
+ console.error('Failed to commit the configuration. ${err.message}');
return;
}
console.log('Callback invoked to indicate the commit config success.');
@@ -1437,8 +1248,8 @@ Commits the configuration for this **CaptureSession** instance. This API uses a
**Return value**
-| Type | Description |
-| -------------- | ------------------------ |
+| Type | Description |
+| -------------- | --------------------------- |
| Promise| Promise used to return the result.|
**Example**
@@ -1449,529 +1260,546 @@ captureSession.commitConfig().then(() => {
})
```
-### canAddInput
+### addInput
-canAddInput(cameraInput: CameraInput, callback: AsyncCallback): void
+addInput\(cameraInput: CameraInput, callback: AsyncCallback\): void
-Checks whether a **[CameraInput](#camerainput)** instance can be added to this **CaptureSession**. This API uses an asynchronous callback to return the result.
+Adds a **CameraInput** instance to this **CaptureSession** instance. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| ----------- | --------------------------- | ---- | ------------------------ |
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------- | ---- | --------------------------- |
| cameraInput | [CameraInput](#camerainput) | Yes | **CameraInput** instance to add.|
-| callback | AsyncCallback | Yes | Callback used to return the result. |
+| callback | AsyncCallback | Yes | Callback used to return the result. |
**Example**
```js
-captureSession.canAddInput(cameraInput, (err, status) => {
+captureSession.addInput(cameraInput, (err) => {
if (err) {
- console.error(`Can not add cameraInput. ${err.message}`);
+ console.error('Failed to add the CameraInput instance. ${err.message}');
return;
}
- console.log('Callback returned with cameraInput can added.');
-})
+ console.log('Callback invoked to indicate that the CameraInput instance is added.');
+});
```
-### canAddInput
+### addInput
-canAddInput(cameraInput: CameraInput): Promise
+addInput\(cameraInput: CameraInput\): Promise
-Checks whether a **[CameraInput](#camerainput)** instance can be added to this **CaptureSession**. This API uses a promise to return the result.
+Adds a **CameraInput** instance to this **CaptureSession** instance. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| ----------- | --------------------------- | ---- | ------------------------ |
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------- | ---- | --------------------------- |
| cameraInput | [CameraInput](#camerainput) | Yes | **CameraInput** instance to add.|
**Return value**
-| Type | Description |
-| -------------- | -------------------------- |
-| Promise | Promise used to return the result.|
+| Type | Description |
+| -------------- | --------------------------- |
+| Promise| Promise used to return the result.|
**Example**
```js
-captureSession.canAddInput(cameraInput).then(() => {
- console.log('Promise returned with cameraInput can added.');
+captureSession.addInput(cameraInput).then(() => {
+ console.log('Promise used to indicate that the CameraInput instance is added.');
})
```
-### addInput
+### addOutput
-addInput\(cameraInput: CameraInput, callback: AsyncCallback\): void
+addOutput\(previewOutput: PreviewOutput, callback: AsyncCallback\): void
-Adds a **[CameraInput](#camerainput)** instance to this **CaptureSession**. This API uses an asynchronous callback to return the result.
+Adds a **PreviewOutput** instance to this **CaptureSession** instance. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| ----------- | --------------------------- | ---- | ------------------------ |
-| cameraInput | [CameraInput](#camerainput) | Yes | **CameraInput** instance to add.|
-| callback | AsyncCallback | Yes | Callback used to return the result. |
+| Name | Type | Mandatory| Description |
+| ------------- | ------------------------------- | ---- | ----------------------------- |
+| previewOutput | [PreviewOutput](#previewoutput) | Yes | **PreviewOutput** instance to add.|
+| callback | AsyncCallback | Yes | Callback used to return the result. |
**Example**
```js
-captureSession.addInput(cameraInput, (err) => {
+captureSession.addOutput(previewOutput, (err) => {
if (err) {
- console.error(`Failed to add the CameraInput instance. ${err.message}`);
+ console.error('Failed to add the PreviewOutput instance ${err.message}');
return;
}
- console.log('Callback invoked to indicate that the CameraInput instance is added.');
+ console.log('Callback invoked to indicate that the PreviewOutput instance is added.');
});
```
-### addInput
+### addOutput
-addInput\(cameraInput: CameraInput\): Promise
+addOutput\(previewOutput: PreviewOutput\): Promise
-Adds a **[CameraInput](#camerainput)** instance to this **CaptureSession**. This API uses a promise to return the result.
+Adds a **PreviewOutput** instance to this **CaptureSession** instance. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| ----------- | --------------------------- | ---- | ------------------------ |
-| cameraInput | [CameraInput](#camerainput) | Yes | **CameraInput** instance to add.|
+| Name | Type | Mandatory| Description |
+| ------------- | ------------------------------- | ---- | ----------------------------- |
+| previewOutput | [PreviewOutput](#previewoutput) | Yes | **PreviewOutput** instance to add.|
**Return value**
-| Type | Description |
-| -------------- | ------------------------ |
+| Type | Description |
+| -------------- | --------------------------- |
| Promise| Promise used to return the result.|
**Example**
```js
-captureSession.addInput(cameraInput).then(() => {
- console.log('Promise used to indicate that the CameraInput instance is added.');
+captureSession.addOutput(previewOutput).then(() => {
+ console.log('Promise used to indicate that the PreviewOutput instance is added.');
})
```
-### removeInput
+### addOutput
-removeInput\(cameraInput: CameraInput, callback: AsyncCallback\): void
+addOutput\(photoOutput: PhotoOutput, callback: AsyncCallback\): void
-Removes a **[CameraInput](#camerainput)** instance from this **CaptureSession**. This API uses an asynchronous callback to return the result.
+Adds a **PhotoOutput** instance to this **CaptureSession** instance. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| ----------- | --------------------------- | ---- | ------------------------ |
-| cameraInput | [CameraInput](#camerainput) | Yes | **CameraInput** instance to remove.|
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------- | ---- | --------------------------- |
+| photoOutput | [PhotoOutput](#photooutput) | Yes | **PhotoOutput** instance to add.|
| callback | AsyncCallback | Yes | Callback used to return the result. |
**Example**
```js
-captureSession.removeInput(cameraInput, (err) => {
+captureSession.addOutput(photoOutput, (err) => {
if (err) {
- console.error(`Failed to remove the CameraInput instance. ${err.message}`);
+ console.error('Failed to add the PhotoOutput instance ${err.message}');
return;
}
- console.log('Callback invoked to indicate that the cameraInput instance is removed.');
+ console.log('Callback invoked to indicate that the PhotoOutput instance is added.');
});
```
-### removeInput
+### addOutput
-removeInput\(cameraInput: CameraInput\): Promise
+addOutput\(photoOutput: PhotoOutput\): Promise
-Removes a **[CameraInput](#camerainput)** instance from this **CaptureSession**. This API uses a promise to return the result.
+Adds a **PhotoOutput** instance to this **CaptureSession** instance. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| ----------- | --------------------------- | ---- | ------------------------ |
-| cameraInput | [CameraInput](#camerainput) | Yes | **CameraInput** instance to remove.|
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------- | ---- | --------------------------- |
+| photoOutput | [PhotoOutput](#photooutput) | Yes | **PhotoOutput** instance to add.|
**Return value**
-| Type | Description |
-| -------------- | ------------------------- |
-| Promise\ | Promise used to return the result.|
+| Type | Description |
+| -------------- | --------------------------- |
+| Promise\ | Promise used to return the result.|
**Example**
```js
-captureSession.removeInput(cameraInput).then(() => {
- console.log('Promise returned to indicate that the cameraInput instance is removed.');
+captureSession.addOutput(photoOutput).then(() => {
+ console.log('Promise used to indicate that the PhotoOutput instance is added.');
})
```
-### canAddOutput
+### addOutput
-canAddOutput(cameraOutput: CameraOutput, callback: AsyncCallback\): void
+addOutput\(videoOutput: VideoOutput, callback: AsyncCallback\): void
-Checks whether a **[CameraOutput](#cameraoutput)** instance can be added to this **CaptureSession**. This API uses an asynchronous callback to return the result.
+Adds a **VideoOutput** instance to this **CaptureSession** instance. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| ------------- | ------------------------------- | ---- | ------------------------- |
-| cameraOutput | [CameraOutput](#cameraoutput) | Yes | **CameraOutput** instance to add.|
-| callback | AsyncCallback | Yes | Callback used to return the result. |
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------- | ---- | --------------------------- |
+| videoOutput | [VideoOutput](#videooutput) | Yes | **VideoOutput** instance to add.|
+| callback | AsyncCallback | Yes | Callback used to return the result. |
**Example**
```js
-captureSession.canAddOutput(cameraOutput, (err, status) => {
+captureSession.addOutput(videoOutput, (err) => {
if (err) {
- console.error(`Can not add cameraOutput. ${err.message}`);
+ console.error('Failed to add the VideoOutput instance ${err.message}');
return;
}
- console.log('Callback returned with cameraOutput can added.');
-})
+ console.log('Callback invoked to indicate that the VideoOutput instance is added.');
+});
```
-### canAddOutput
+### addOutput
-canAddOutput(cameraOutput: CameraOutput): Promise
+addOutput\(videoOutput: VideoOutput\): Promise
-Checks whether a **[CameraOutput](#cameraoutput)** instance can be added to this **CaptureSession**. This API uses a promise to return the result.
+Adds a **VideoOutput** instance to this **CaptureSession** instance. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| ------------- | ------------------------------- | ---- | ------------------------- |
-| cameraOutput | [CameraOutput](#cameraoutput) | Yes | **CameraOutput** instance to add.|
-
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------- | ---- | --------------------------- |
+| videoOutput | [VideoOutput](#videooutput) | Yes | **VideoOutput** instance to add.|
**Return value**
-| Type | Description |
+| Type | Description |
| -------------- | --------------------------- |
-| Promise | Promise used to return the result.|
-
+| Promise\ | Promise used to return the result.|
**Example**
```js
-captureSession.canAddOutput(cameraOutput).then(() => {
- console.log('Promise returned with cameraOutput can added.');
+captureSession.addOutput(videoOutput).then(() => {
+ console.log('Promise used to indicate that the VideoOutput instance is added.');
})
```
-### addOutput
+### removeInput
-addOutput\(cameraOutput: CameraOutput, callback: AsyncCallback\): void
+removeInput\(cameraInput: CameraInput, callback: AsyncCallback\): void
-Adds a **[CameraOutput](#cameraoutput)** instance to this **CaptureSession**. This API uses an asynchronous callback to return the result.
+Removes a **CameraInput** instance from this **CaptureSession** instance. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| ------------- | ------------------------------- | ---- | ------------------------ |
-| cameraOutput | [CameraOutput](#cameraoutput) | Yes | **CameraOutput** instance to add.|
-| callback | AsyncCallback | Yes | Callback used to return the result. |
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------- | ---- | --------------------------- |
+| cameraInput | [CameraInput](#camerainput) | Yes | **CameraInput** instance to remove.|
+| callback | AsyncCallback | Yes | Callback used to return the result. |
**Example**
```js
-captureSession.addOutput(cameraOutput, (err) => {
+captureSession.removeInput(cameraInput, (err) => {
if (err) {
- console.error(`Failed to add output. ${err.message}`);
+ console.error('Failed to remove the CameraInput instance. ${err.message}');
return;
}
- console.log('Callback returned with output added.');
-})
+ console.log('Callback invoked to indicate that the cameraInput instance is removed.');
+});
```
-### addOutput
+### removeInput
-addOutput\(cameraOutput: CameraOutput\): Promise
+removeInput\(cameraInput: CameraInput\): Promise
-Adds a **[CameraOutput](#cameraoutput)** instance to this **CaptureSession**. This API uses a promise to return the result.
+Removes a **CameraInput** instance from this **CaptureSession** instance. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| ------------- | ------------------------------- | ---- | ------------------------- |
-| cameraOutput | [CameraOutput](#cameraoutput) | Yes | **CameraOutput** instance to add.|
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------- | ---- | --------------------------- |
+| cameraInput | [CameraInput](#camerainput) | Yes | **CameraInput** instance to remove.|
**Return value**
-| Type | Description |
-| -------------- | ----------------------- |
-| Promise| Promise used to return the result.|
+| Type | Description |
+| -------------- | --------------------------- |
+| Promise\ | Promise used to return the result.|
**Example**
```js
-captureSession.addOutput(cameraOutput).then(() => {
- console.log('Promise returned with cameraOutput added.');
+captureSession.removeInput(cameraInput).then(() => {
+ console.log('Promise returned to indicate that the cameraInput instance is removed.');
})
```
### removeOutput
-removeOutput\(cameraOutput: CameraOutput, callback: AsyncCallback\): void
+removeOutput\(previewOutput: PreviewOutput, callback: AsyncCallback\): void
-Removes a **[CameraOutput](#cameraoutput)** instance from this **CaptureSession**. This API uses an asynchronous callback to return the result.
+Removes a **PreviewOutput** instance from this **CaptureSession** instance. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| ------------- | ------------------------------- | ---- | ------------------------ |
-| cameraOutput | [CameraOutput](#cameraoutput) | Yes | **CameraOutput** instance to remove.|
+| Name | Type | Mandatory| Description |
+| ------------- | ------------------------------- | ---- | ----------------------------- |
+| previewOutput | [PreviewOutput](#previewoutput) | Yes | **PreviewOutput** instance to remove.|
| callback | AsyncCallback | Yes | Callback used to return the result. |
**Example**
```js
-captureSession.removeOutput(cameraOutput, (err) => {
+captureSession.removeOutput(previewOutput, (err) => {
if (err) {
- console.error(`Failed to remove the CameraOutput instance. ${err.message}`);
+ console.error('Failed to remove the PreviewOutput instance. ${err.message}');
return;
}
- console.log('Callback invoked to indicate that the CameraOutput instance is removed.');
+ console.log('Callback invoked to indicate that the PreviewOutput instance is removed.');
});
```
### removeOutput
-removeOutput(cameraOutput: CameraOutput): Promise
+removeOutput(previewOutput: PreviewOutput): Promise
-Removes a **[CameraOutput](#cameraoutput)** instance from this **CaptureSession**. This API uses a promise to return the result.
+Removes a **PreviewOutput** instance from this **CaptureSession** instance. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| ------------- | ------------------------------- | ---- | ------------------------- |
-| cameraOutput | [CameraOutput](#cameraoutput) | Yes | **CameraOutput** instance to remove.|
+| Name | Type | Mandatory| Description |
+| ------------- | ------------------------------- | ---- | ----------------------------- |
+| previewOutput | [PreviewOutput](#previewoutput) | Yes | **PreviewOutput** instance to remove.|
**Return value**
-| Type | Description |
-| -------------- | ------------------------ |
+| Type | Description |
+| -------------- | --------------------------- |
| Promise| Promise used to return the result.|
**Example**
```js
-captureSession.removeOutput(cameraOutput).then(() => {
- console.log('Promise returned to indicate that the CameraOutput instance is removed.');
+captureSession.removeOutput(previewOutput).then(() => {
+ console.log('Promise returned to indicate that the PreviewOutput instance is removed.');
})
```
-### start
+### removeOutput
-start\(callback: AsyncCallback\): void
+removeOutput(photoOutput: PhotoOutput, callback: AsyncCallback): void
-Starts this **CaptureSession**. This API uses an asynchronous callback to return the result.
+Removes a **PhotoOutput** instance from this **CaptureSession** instance. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | -------------------- | ---- | -------------------- |
-| callback | AsyncCallback | Yes | Callback used to return the result.|
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------- | ---- | --------------------------- |
+| photoOutput | [PhotoOutput](#photooutput) | Yes | **PhotoOutput** instance to remove.|
+| callback | AsyncCallback | Yes | Callback used to return the result. |
**Example**
```js
-captureSession.start((err) => {
+captureSession.removeOutput(photoOutput, (err) => {
if (err) {
- console.error(`Failed to start the session ${err.message}`);
+ console.error('Failed to remove the PhotoOutput instance. ${err.message}');
return;
}
- console.log('Callback invoked to indicate the session start success.');
+ console.log('Callback invoked to indicate that the PhotoOutput instance is removed.');
});
```
-### start
+### removeOutput
-start\(\): Promise
+removeOutput(photoOutput: PhotoOutput): Promise
-Starts this **CaptureSession**. This API uses a promise to return the result.
+Removes a **PhotoOutput** instance from this **CaptureSession** instance. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------- | ---- | --------------------------- |
+| photoOutput | [PhotoOutput](#photooutput) | Yes | **PhotoOutput** instance to remove.|
+
+
**Return value**
-| Type | Description |
-| -------------- | ------------------------ |
+| Type | Description |
+| -------------- | --------------------------- |
| Promise| Promise used to return the result.|
+
**Example**
```js
-captureSession.start().then(() => {
- console.log('Promise returned to indicate the session start success.');
+captureSession.removeOutput(photoOutput).then(() => {
+ console.log('Promise returned to indicate that the PhotoOutput instance is removed.');
})
```
-### stop
+### removeOutput
-stop\(callback: AsyncCallback\): void
+removeOutput(videoOutput: VideoOutput, callback: AsyncCallback): void
-Stops this **CaptureSession**. This API uses an asynchronous callback to return the result.
+Removes a **VideoOutput** instance from this **CaptureSession** instance. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | -------------------- | ---- | ------------------- |
-| callback | AsyncCallback | Yes | Callback used to return the result.|
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------- | ---- | --------------------------- |
+| videoOutput | [VideoOutput](#videooutput) | Yes | **VideoOutput** instance to remove.|
+| callback | AsyncCallback | Yes | Callback used to return the result. |
**Example**
```js
-captureSession.stop((err) => {
+captureSession.removeOutput(videoOutput, (err) => {
if (err) {
- console.error(`Failed to stop the session ${err.message}`);
+ console.error('Failed to remove the VideoOutput instance. ${err.message}');
return;
}
- console.log('Callback invoked to indicate the session stop success.');
+ console.log('Callback invoked to indicate that the VideoOutput instance is removed.');
});
```
-### stop
+### removeOutput
-stop(): Promise
+removeOutput(videoOutput: VideoOutput): Promise
-Stops this **CaptureSession**. This API uses a promise to return the result.
+Removes a **VideoOutput** instance from this **CaptureSession** instance. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| ----------- | --------------------------- | ---- | --------------------------- |
+| videoOutput | [VideoOutput](#videooutput) | Yes | **VideoOutput** instance to remove.|
+
+
**Return value**
-| Type | Description |
-| -------------- | ----------------------- |
+| Type | Description |
+| -------------- | --------------------------- |
| Promise| Promise used to return the result.|
+
**Example**
```js
-captureSession.stop().then(() => {
- console.log('Promise returned to indicate the session stop success.');
+captureSession.removeOutput(videoOutput).then(() => {
+ console.log('Promise returned to indicate that the VideoOutput instance is removed.');
})
```
-### lockForControl
+### start
-lockForControl(callback: AsyncCallback): void
+start\(callback: AsyncCallback\): void
-Requests to exclusively control the hardware attributes **[CameraInput](#camerainput)** of the camera device. This API uses an asynchronous callback to return the result. After the exclusive control is complete, you must call **[unlockForControl](#unlockforcontrol)** to release the exclusive control.
+Starts this **CaptureSession** instance. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | -------------------- | ---- | ------------------- |
+| Name | Type | Mandatory| Description |
+| -------- | -------------------- | ---- | ------------------------ |
| callback | AsyncCallback | Yes | Callback used to return the result.|
**Example**
```js
-captureSession.lockForControl((err) => {
+captureSession.start((err) => {
if (err) {
- console.error(`Failed to lock. ${err.message}`);
+ console.error('Failed to start the session ${err.message}');
return;
}
- console.log('Locked.');
-})
+ console.log('Callback invoked to indicate the session start success.');
+});
```
-### lockForControl
+### start
-lockForControl(): Promise
+start\(\): Promise
-Requests to exclusively control the hardware attributes **[CameraInput](#camerainput)** of the camera device. This API uses a promise to return the result. After the exclusive control is complete, you must call **[unlockForControl](#unlockforcontrol)** to release the exclusive control.
+Starts this **CaptureSession** instance. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Return value**
-| Type | Description |
-| -------------- | ------------------------ |
+| Type | Description |
+| -------------- | --------------------------- |
| Promise| Promise used to return the result.|
**Example**
```js
-captureSession.lockForControl().then(() => {
- console.log('Locked.');
+captureSession.start().then(() => {
+ console.log('Promise returned to indicate the session start success.');
})
```
-### unlockForControl
+### stop
-unlockForControl(callback: AsyncCallback): void
+stop\(callback: AsyncCallback\): void
-Releases the exclusive control on the device configuration. This API uses an asynchronous callback to return the result.
+Stops this **CaptureSession** instance. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | -------------------- | ---- | -------------------- |
+
+| Name | Type | Mandatory| Description |
+| -------- | -------------------- | ---- | ------------------------ |
| callback | AsyncCallback | Yes | Callback used to return the result.|
**Example**
```js
-captureSession.unlockForControl((err) => {
+captureSession.stop((err) => {
if (err) {
- console.error(`Failed to unlock. ${err.message}`);
+ console.error('Failed to stop the session ${err.message}');
return;
}
- console.log('Unlocked.');
-})
+ console.log('Callback invoked to indicate the session stop success.');
+});
```
-### unlockForControl
+### stop
-unlockForControl(): Promise
+stop(): Promise
-Releases the exclusive control on the device configuration. This API uses a promise to return the result.
+Stops this **CaptureSession** instance. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Return value**
-| Type | Description |
-| -------------- | ------------------------ |
+| Type | Description |
+| -------------- | --------------------------- |
| Promise| Promise used to return the result.|
**Example**
```js
-captureSession.unlockForControl().then(() => {
- console.log('Unlocked.');
+captureSession.stop().then(() => {
+ console.log('Promise returned to indicate the session stop success.');
})
```
@@ -1979,14 +1807,14 @@ captureSession.unlockForControl().then(() => {
release\(callback: AsyncCallback\): void
-Releases this **CaptureSession**. This API uses an asynchronous callback to return the result.
+Releases this **CaptureSession** instance. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | -------------------- | ---- | -------------------- |
+| Name | Type | Mandatory| Description |
+| -------- | -------------------- | ---- | ------------------------ |
| callback | AsyncCallback | Yes | Callback used to return the result.|
**Example**
@@ -1994,7 +1822,7 @@ Releases this **CaptureSession**. This API uses an asynchronous callback to retu
```js
captureSession.release((err) => {
if (err) {
- console.error(`Failed to release the CaptureSession instance ${err.message}`);
+ console.error('Failed to release the CaptureSession instance ${err.message}');
return;
}
console.log('Callback invoked to indicate that the CaptureSession instance is released successfully.');
@@ -2005,14 +1833,14 @@ captureSession.release((err) => {
release(): Promise
-Releases this **CaptureSession**. This API uses a promise to return the result.
+Releases this **CaptureSession** instance. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Return value**
-| Type | Description |
-| -------------- | ------------------------ |
+| Type | Description |
+| -------------- | --------------------------- |
| Promise| Promise used to return the result.|
**Example**
@@ -2023,2077 +1851,433 @@ captureSession.release().then(() => {
})
```
-### hasFlash
+### on('error')
-hasFlash(callback: AsyncCallback): void
+on(type: 'error', callback: ErrorCallback): void
-Checks whether the device has flash. This API uses an asynchronous callback to return the result.
+Listens for **CaptureSession** errors. This API uses a callback to return the errors.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | ----------------------- | ---- | -------------------------------- |
-| callback | AsyncCallback | Yes | Callback used to return the flash support status. The value **true** means that the device has flash.|
+| Name | Type | Mandatory| Description |
+| :------- | :---------------------------------------------------------- | :--- | :-------------------------------------------- |
+| type | string | Yes | Event type. The value is fixed at **'error'**, indicating the capture session error event.|
+| callback | ErrorCallback<[CaptureSessionError](#capturesessionerror)\> | Yes | Callback used to return the error information. |
**Example**
```js
-cameraInput.hasFlash((err, status) => {
- if (err) {
- console.error(`Failed to check whether the device has flash light. ${err.message}`);
- return;
- }
- console.log(`Callback returned with flash light support status: ${status}`);
+captureSession.on('error', (captureSessionError) => {
+ console.log('Capture session error code: ' + captureSessionError.code);
})
```
-### hasFlash
-
-hasFlash(): Promise
+## CaptureSessionErrorCode
-Checks whether the device has flash. This API uses a promise to return the result.
+Enumerates the error codes used in a **CaptureSession** instance.
**System capability**: SystemCapability.Multimedia.Camera.Core
-**Return value**
+| Name | Value | Description |
+| ------------- | ---- | ---------- |
+| ERROR_UNKNOWN | -1 | Unknown error.|
-| Type | Description |
-| ----------------- | ----------------------------------------------- |
-| Promise | Promise used to return the flash support status. The value **true** means that the device has flash.|
+## CaptureSessionError
-**Example**
+Defines a **CaptureSession** error.
-```js
-cameraInput.hasFlash().then((status) => {
- console.log(`Promise returned with the flash light support status: ${status}`);
-})
-```
+**System capability**: SystemCapability.Multimedia.Camera.Core
-### isFlashModeSupported
+| Name| Type | Description |
+| ---- | ------------------------------------------- | -------------------------- |
+| code | [CaptureSessionError](#capturesessionerror) | **CaptureSession** error code.|
-isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback): void
+## camera.createPreviewOutput
-Checks whether a specified flash mode is supported. This API uses an asynchronous callback to return the result.
+createPreviewOutput(surfaceId: string, callback: AsyncCallback): void
+
+Creates a **PreviewOutput** instance. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| --------- | ----------------------- | ---- | --------------------------------- |
-| flashMode | [FlashMode](#flashmode) | Yes | Flash mode. |
-| callback | AsyncCallback | Yes | Callback used to return the flash mode support status. The value **true** means that the flash mode is supported, and **false** means the opposite.|
+| Name | Type | Mandatory| Description |
+| --------- | ----------------------------------------------- | ---- | ------------------------------------- |
+| surfaceId | string | Yes | Surface ID, which is obtained from **XComponent**. |
+| callback | AsyncCallback<[PreviewOutput](#previewoutput)\> | Yes | Callback used to return the **PreviewOutput** instance.|
**Example**
```js
-cameraInput.isFlashModeSupported(camera.FlashMode.FLASH_MODE_AUTO, (err, status) => {
+camera.createPreviewOutput(("surfaceId"), (err, previewOutput) => {
if (err) {
- console.error(`Failed to check whether the flash mode is supported. ${err.message}`);
+ console.error('Failed to create the PreviewOutput instance. ${err.message}');
return;
}
- console.log(`Callback returned with the flash mode support status: ${status}`);
-})
+ console.log('Callback returned with previewOutput instance');
+});
```
-### isFlashModeSupported
+## camera.createPreviewOutput
-isFlashModeSupported(flashMode: FlashMode): Promise
+createPreviewOutput(surfaceId: string): Promise\
-Checks whether a specified flash mode is supported. This API uses a promise to return the result.
+Creates a **PreviewOutput** instance. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| --------- | ----------------------- | ---- | ------------- |
-| flashMode | [FlashMode](#flashmode) | Yes | Flash mode.|
+| Name | Type | Mandatory| Description |
+| --------- | ------ | ---- | ---------------------------------- |
+| surfaceId | string | Yes | Surface ID, which is obtained from **XComponent**.|
**Return value**
-| Type | Description |
-| ----------------- | ---------------------------------------------------- |
-| Promise | Promise used to return the flash mode support status. The value **true** means that the flash mode is supported, and **false** means the opposite.|
+| Type | Description |
+| ----------------------------------------- | --------------------------- |
+| Promise<[PreviewOutput](#previewoutput)\> | Promise used to return the result.|
**Example**
```js
-cameraInput.isFlashModeSupported(camera.FlashMode.FLASH_MODE_AUTO).then((status) => {
- console.log(`Promise returned with flash mode support status.${status}`);
+camera.createPreviewOutput("surfaceId").then((previewOutput) => {
+ console.log('Promise returned with the PreviewOutput instance');
})
```
-### setFlashMode
+## PreviewOutput
-setFlashMode(flashMode: FlashMode, callback: AsyncCallback): void
+Implements preview output.
-Sets the flash mode. This API uses an asynchronous callback to return the result.
+### release
-Before the setting, do the following checks:
+release(callback: AsyncCallback): void
-1. Use **[hasFlash](#hasflash)** to check whether the device has flash.
-2. Use **[isFlashModeSupported](#isflashmodesupported)** to check whether the device supports the flash mode.
+Releases this **PreviewOutput** instance. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| --------- | ----------------------- | ---- | --------------------- |
-| flashMode | [FlashMode](#flashmode) | Yes | Flash mode. |
-| callback | AsyncCallback | Yes | Callback used to return the result.|
+| Name | Type | Mandatory| Description |
+| -------- | -------------------- | ---- | ------------------------ |
+| callback | AsyncCallback | Yes | Callback used to return the result.|
**Example**
```js
-cameraInput.setFlashMode(camera.FlashMode.FLASH_MODE_AUTO, (err) => {
+previewOutput.release((err) => {
if (err) {
- console.error(`Failed to set the flash mode ${err.message}`);
+ console.error('Failed to release the PreviewOutput instance ${err.message}');
return;
}
- console.log('Callback returned with the successful execution of setFlashMode.');
-})
+ console.log('Callback invoked to indicate that the PreviewOutput instance is released successfully.');
+});
```
-### setFlashMode
-
-setFlashMode(flashMode: FlashMode): Promise
-
-Sets a flash mode. This API uses a promise to return the result.
+### release
-Before the setting, do the following checks:
+release(): Promise
-1. Use **[hasFlash](#hasflash)** to check whether the device has flash.
-2. Use **[isFlashModeSupported](#isflashmodesupported)** to check whether the device supports the flash mode.
+Releases this **PreviewOutput** instance. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
-**Parameters**
-
-| Name | Type | Mandatory| Description |
-| --------- | ----------------------- | ---- | ------------- |
-| flashMode | [FlashMode](#flashmode) | Yes | Flash mode.|
-
**Return value**
-| Type | Description |
-| -------------- | ------------------------ |
+| Type | Description |
+| -------------- | --------------------------- |
| Promise| Promise used to return the result.|
+
**Example**
```js
-cameraInput.setFlashMode(camera.FlashMode.FLASH_MODE_AUTO).then(() => {
- console.log('Promise returned with the successful execution of setFlashMode.');
+previewOutput.release().then(() => {
+ console.log('Promise returned to indicate that the PreviewOutput instance is released successfully.');
})
```
-### getFlashMode
+### on('frameStart')
-getFlashMode(callback: AsyncCallback): void
+on(type: 'frameStart', callback: AsyncCallback): void
-Obtains the flash mode in use. This API uses an asynchronous callback to return the result.
+Listens for preview frame start events. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | --------------------------------------- | ---- | --------------------------------- |
-| callback | AsyncCallback<[FlashMode](#flashmode)\> | Yes | Callback used to return the flash mode.|
+| Name | Type | Mandatory| Description |
+| :------- | :------------------- | :--- | :------------------------------------------- |
+| type | string | Yes | Event type. The value is fixed at **'frameStart'**, indicating the preview frame start event.|
+| callback | AsyncCallback | Yes | Callback used to return the result. |
**Example**
```js
-cameraInput.getFlashMode((err, flashMode) => {
- if (err) {
- console.error(`Failed to get the flash mode ${err.message}`);
- return;
- }
- console.log(`Callback returned with current flash mode: ${flashMode}`);
+previewOutput.on('frameStart', () => {
+ console.log('Preview frame started');
})
```
-### getFlashMode
+### on('frameEnd')
-getFlashMode(): Promise
+on(type: 'frameEnd', callback: AsyncCallback): void
-Obtains the flash mode in use. This API uses a promise to return the result.
+Listens for preview frame end events. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
-**Return value**
+**Parameters**
-| Type | Description |
-| --------------------------------- | --------------------------------- |
-| Promise<[FlashMode](#flashmode)\> | Promise used to return the flash mode.|
+| Name | Type | Mandatory| Description |
+| :------- | :------------------- | :--- | :----------------------------------------- |
+| type | string | Yes | Event type. The value is fixed at **'frameEnd'**, indicating the preview frame end event.|
+| callback | AsyncCallback | Yes | Callback used to return the result. |
**Example**
```js
-cameraInput.getFlashMode().then((flashMode) => {
- console.log(`Promise returned with current flash mode : ${flashMode}`);
+previewOutput.on('frameEnd', () => {
+ console.log('Preview frame ended');
})
```
-### isExposureModeSupported
+### on('error')
-isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback): void;
+on(type: 'error', callback: ErrorCallback): void
-Checks whether a specified exposure mode is supported. This API uses an asynchronous callback to return the result.
+Listens for **PreviewOutput** errors. This API uses a callback to return the errors.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory | Description |
-| -------- | -------------------------------| ---- | ----------------------------- |
-| aeMode | [ExposureMode](#exposuremode) | Yes | Exposure mode. |
-| callback | AsyncCallback | Yes | Callback used to return the exposure mode support status. The value **true** means that the exposure mode is supported, and **false** means the opposite.|
+| Name | Type | Mandatory| Description |
+| :------- | :----------------------------------------------------------- | :--- | :-------------------------------------------- |
+| type | string | Yes | Event type. The value is fixed at **'error'**, indicating the preview output error event.|
+| callback | ErrorCallback<[PreviewOutputErrorCode](#previewoutputerrorcode)\> | Yes | Callback used to return the error information. |
**Example**
```js
-cameraInput.isExposureModeSupported(camera.ExposureMode.EXPOSURE_MODE_LOCKEN,(err) => {
- if (err) {
- console.log(`Failed to check exposure mode supported ${err.message}`);
- return ;
- }
- console.log('Callback returned with the successful execution of isExposureModeSupported');
+previewOutput.on('error', (previewOutputError) => {
+ console.log('Preview output error code: ' + previewOutputError.code);
})
```
-### isExposureModeSupported
-
-isExposureModeSupported(aeMode: ExposureMode): Promise
+## PreviewOutputErrorCode
-Checks whether a specified exposure mode is supported. This API uses a promise to return the result.
+Enumerates the error codes used in a **PreviewOutput** instance.
**System capability**: SystemCapability.Multimedia.Camera.Core
-**Parameters**
-
-| Name | Type | Mandatory | Description |
-| -------- | -------------------------------| ---- | ----------------------------- |
-| aeMode | [ExposureMode](#exposuremode) | Yes | Exposure mode. |
+| Name | Value | Description |
+| ------------- | ---- | ---------- |
+| ERROR_UNKNOWN | -1 | Unknown error.|
-**Return value**
+## PreviewOutputError
-| Name | Description |
-| ----------------- |--------------------------------- |
-| Promise | Promise used to return the exposure mode support status. The value **true** means that the exposure mode is supported, and **false** means the opposite.|
+Defines a **PreviewOutput** error.
-**Example**
+**System capability**: SystemCapability.Multimedia.Camera.Core
-```js
-cameraInput.isExposureModeSupported(camera.ExposureMode.EXPOSURE_MODE_LOCKED).then((isSupported) => {
- console.log(`Promise returned with exposure mode supported : ${isSupported}`);
-})
-```
+| Name| Type | Description |
+| ---- | ------------------------------------------------- | ---------------------- |
+| code | [PreviewOutputErrorCode](#previewoutputerrorcode) | **PreviewOutput** error code.|
-### getExposureMode
+## camera.createPhotoOutput
-getExposureMode(callback: AsyncCallback): void
+createPhotoOutput(surfaceId: string, callback: AsyncCallback): void
-Obtains the exposure mode in use. This API uses an asynchronous callback to return the result.
+Creates a **PhotoOutput** instance. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
**Parameters**
-| Name | Type | Mandatory| Description |
-| -------- | -------------------------------| ---- | ---------------------------------------- |
-| callback | AsyncCallback<[ExposureMode](#exposuremode)\> | Yes | Callback used to return the exposure mode.|
+| Name | Type | Mandatory| Description |
+| --------- | ------------------------------------------- | ---- | ----------------------------------- |
+| surfaceId | string | Yes | Surface ID, which is obtained from **[ImageReceiver](js-apis-image.md#imagereceiver9)**. |
+| callback | AsyncCallback<[PhotoOutput](#photooutput)\> | Yes | Callback used to return the **PhotoOutput** instance.|
**Example**
```js
-cameraInput.getExposureMode((err, exposureMode) => {
+camera.createPhotoOutput(("surfaceId"), (err, photoOutput) => {
if (err) {
- console.log(`Failed to get the exposure mode ${err.message}`);
- return ;
+ console.error('Failed to create the PhotoOutput instance. ${err.message}');
+ return;
}
- console.log(`Callback returned with current exposure mode: ${exposureMode}`);
-})
+ console.log('Callback returned with the PhotoOutput instance.');
+});
```
-### getExposureMode
+## camera.createPhotoOutput
-getExposureMode(): Promise
+createPhotoOutput(surfaceId: string): Promise
-Obtains the exposure mode in use. This API uses a promise to return the result.
+Creates a **PhotoOutput** instance. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Camera.Core
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| --------- | ------ | ---- | --------------------------------- |
+| surfaceId | string | Yes | Surface ID, which is obtained from **[ImageReceiver](js-apis-image.md#imagereceiver9)**.|
+
**Return value**
-| Name | Description |
-| --------------------------------------- |------------------------------- |
-| Promise<[ExposureMode](#exposuremode)\> | Promise used to return the exposure mode.|
+| Type | Description |
+| ------------------------------------- | -------------------------------------- |
+| Promise<[PhotoOutput](#photooutput)\> | Promise used to return the **PhotoOutput** instance.|
**Example**
```js
-cameraInput.getExposureMode().then((exposureMode) => {
- console.log(`Promise returned with current exposure mode : ${exposureMode}`);
+camera.createPhotoOutput("surfaceId").then((photoOutput) => {
+ console.log('Promise returned with PhotoOutput instance');
})
```
+## ImageRotation
-### setExposureMode
-
-setExposureMode(aeMode: ExposureMode, callback: AsyncCallback): void
-
-Sets an exposure mode. This API uses an asynchronous callback to return the result.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
+Enumerates the image rotation angles.
-**Parameters**
-
-| Name | Type | Mandatory| Description |
-| -------- | -------------------------------| ---- | ----------------------- |
-| aeMode | [ExposureMode](#exposuremode) | Yes | Exposure mode. |
-| callback | AsyncCallback | Yes | Callback used to return the result.|
-
-**Example**
-
-```js
-cameraInput.setExposureMode(camera.ExposureMode.EXPOSURE_MODE_LOCKEN,(err) => {
- if (err) {
- console.log(`Failed to set the exposure mode ${err.message}`);
- return ;
- }
- console.log('Callback returned with the successful execution of setExposureMode');
-})
-```
-
-### setExposureMode
-
-setExposureMode(aeMode: ExposureMode): Promise
-
-Sets an exposure mode. This API uses a promise to return the result.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-**Return value**
-
-| Name | Description |
-| ----------------- |---------------------------- |
-| Promise | Promise used to return the result.|
-
-**Example**
-
-```js
-cameraInput.setExposureMode(camera.ExposureMode.EXPOSURE_MODE_LOCKED).then(() => {
- console.log('Promise returned with the successful execution of setExposureMode.');
-})
-```
-
-### getMeteringPoint
-
-getMeteringPoint(callback: AsyncCallback): void
-
-Obtains the center of the metering area. This API uses an asynchronous callback to return the result.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-**Parameters**
-
-| Name | Type | Mandatory| Description |
-| -------- | -------------------------------| ---- | ------------------------ |
-| callback | AsyncCallback<[Point](#point)\>| Yes | Callback used to return the center of the metering area.|
-
-**Example**
-
-```js
-cameraInput.getMeteringPoint((err, exposurePoint) => {
- if (err) {
- console.log(`Failed to get the current exposure point ${err.message}`);
- return ;
- }
- console.log(`Callback returned with current exposure point: ${exposurePoint}`);
-})
-```
-
-### getMeteringPoint
-
-getMeteringPoint(): Promise
-
-Obtains the center of the metering area. This API uses a promise to return the result.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-**Return value**
-
-| Name | Description |
-| ------------------------- |----------------------------- |
-| Promise<[Point](#point)\> | Promise used to return the center of the metering area.|
-
-**Example**
-
-```js
-cameraInput.getMeteringPoint().then((exposurePoint) => {
- console.log(`Promise returned with current exposure point : ${exposurePoint}`);
-})
-```
-
-### setMeteringPoint
-
-setMeteringPoint(point: Point, callback: AsyncCallback): void
-
-Sets the center of the metering area. This API uses an asynchronous callback to return the result.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-**Parameters**
-
-| Name | Type | Mandatory| Description |
-| ------------- | -------------------------------| ---- | ------------------- |
-| exposurePoint | [Point](#point) | Yes | Exposure point. |
-| callback | AsyncCallback | Yes | Callback used to return the result.|
-
-**Example**
-
-```js
-const Point1 = {x: 1, y: 1};
-
-cameraInput.setMeteringPoint(Point1,(err) => {
- if (err) {
- console.log(`Failed to set the exposure point ${err.message}`);
- return ;
- }
- console.log('Callback returned with the successful execution of setMeteringPoint');
-})
-```
-
-### setMeteringPoint
-
-setMeteringPoint(point: Point): Promise
-
-Sets the center of the metering area. This API uses a promise to return the result.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-**Parameters**
-
-| Name | Type | Mandatory| Description |
-| ------------- | -------------------------------| ---- | ------------------- |
-| exposurePoint | [Point](#point) | Yes | Exposure point. |
-
-**Return value**
-
-| Name | Description |
-| ----------------- |------------------------ |
-| Promise | Promise used to return the center of the metering area.|
-
-**Example**
-
-```js
-const Point2 = {x: 2, y: 2};
-
-cameraInput.setMeteringPoint(Point2).then(() => {
- console.log('Promise returned with the successful execution of setMeteringPoint');
-})
-```
-
-### getExposureBiasRange
-
-getExposureBiasRange(callback: AsyncCallback\>): void
-
-Obtains the exposure compensation values. This API uses an asynchronous callback to return the result.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-**Parameters**
-
-| Name | Type | Mandatory| Description |
-| -------- | -------------------------------| ---- | ----------------------------- |
-| callback | AsyncCallback\> | Yes | Callback used to return the array of compensation values.|
-
-**Example**
-
-```js
-cameraInput.getExposureBiasRange((err, biasRangeArray) => {
- if (err) {
- console.log(`Failed to get the array of compenstation range ${err.message}`);
- return ;
- }
- console.log('Callback returned with the array of compenstation range: ' + JSON.stringify(biasRangeArray));
-})
-```
-
-### getExposureBiasRange
-
-getExposureBiasRange(): Promise\>
-
-Obtains the exposure compensation values. This API uses a promise to return the result.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-**Return value**
-
-| Name | Description |
-| ----------------- |-------------------------------------- |
-| Promise\> | Promise used to return the array of compensation values.|
-
-**Example**
-
-```js
-cameraInput.isExposureModeSupported(camera.ExposureMode.EXPOSURE_MODE_LOCKED).then((isSupported) => {
- console.log(`Promise returned with exposure mode supported : ${isSupported}`);
-})
-```
-
-### setExposureBias
-
-setExposureBias(exposureBias: number, callback: AsyncCallback): void
-
-Sets an exposure compensation value. This API uses an asynchronous callback to return the result.
-
-Before the setting, you are advised to use **[getExposureBiasRange](#getexposurebiasrange)** to obtain the supported values.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-**Parameters**
-
-| Name | Type | Mandatory| Description |
-| -------- | -------------------------------| ---- | ------------------- |
-| exposureBias | number | Yes | Compensation value. |
-| callback | AsyncCallback | Yes | Callback used to return the result.|
-
-**Example**
-
-```js
-cameraInput.setExposureBias(-4,(err) => {
- if (err) {
- console.log(`Failed to set the exposure bias ${err.message}`);
- return ;
- }
- console.log('Callback returned with the successful execution of setExposureBias');
-})
-```
-
-### setExposureBias
-
-setExposureBias(exposureBias: number): Promise
-
-Sets an exposure compensation value. This API uses a promise to return the result.
-
-Before the setting, you are advised to use **[getExposureBiasRange](#getexposurebiasrange)** to obtain the supported values.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-**Parameters**
-
-| Name | Type | Mandatory| Description |
-| -------------- | --------- | ---- | --------- |
-| exposureBias | number | Yes | Compensation value. |
-
-**Return value**
-
-| Name | Description |
-| ----------------- |------------------------- |
-| Promise | Promise used to return the result.|
-
-**Example**
-
-```js
-cameraInput.setExposureBias(-4).then(() => {
- console.log('Promise returned with the successful execution of setExposureBias.');
-})
-```
-
-### getExposureValue
-
-getExposureValue(callback: AsyncCallback): void
-
-Obtains the exposure value in use. This API uses an asynchronous callback to return the result.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-**Parameters**
-
-| Name | Type | Mandatory| Description |
-| -------- | ------------------------| ---- | --------------------- |
-| callback | AsyncCallback | Yes | Callback used to the exposure value.|
-
-**Example**
-
-```js
-cameraInput.getExposureValue((err, exposureValue) => {
- if (err) {
- console.log(`Failed to get the exposure value ${err.message}`);
- return ;
- }
- console.log(`Callback returned with the exposure value: ${exposureValue}`);
-})
-```
-
-### getExposureValue
-
-getExposureValue(): Promise
-
-Obtains the exposure value in use. This API uses a promise to return the result.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-**Return value**
-
-| Name | Description |
-| ----------------- |-------------------------- |
-| Promise | Promise used to the exposure value.|
-
-**Example**
-
-```js
-cameraInput.getExposureValue().then((exposureValue) => {
- console.log(`Promise returned with exposure value: ${exposureValude}`);
-})
-```
-
-### isFocusModeSupported
-
-isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback): void
-
-Checks whether a specified focus mode is supported. This API uses an asynchronous callback to return the result.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-**Parameters**
-
-| Name | Type | Mandatory| Description |
-| -------- | ----------------------- | ---- | -------------------------------- |
-| afMode | [FocusMode](#focusmode) | Yes | Focus mode. |
-| callback | AsyncCallback | Yes | Callback used to return the focus mode support status. The value **true** means that the focus mode is supported, and **false** means the opposite.|
-
-**Example**
-
-```js
-cameraInput.isFocusModeSupported(camera.FocusMode.FOCUS_MODE_AUTO, (err, status) => {
- if (err) {
- console.error(`Failed to check whether the focus mode is supported. ${err.message}`);
- return;
- }
- console.log(`Callback returned with the focus mode support status: ${status}`);
-})
-```
-
-### isFocusModeSupported
-
-isFocusModeSupported(afMode: FocusMode): Promise
-
-Checks whether a specified focus mode is supported. This API uses a promise to return the result.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-**Parameters**
-
-| Name | Type | Mandatory| Description |
-| ------ | ----------------------- | ---- | ------------- |
-| afMode | [FocusMode](#focusmode) | Yes | Focus mode.|
-
-**Return value**
-
-| Type | Description |
-| ----------------- | --------------------------------------------------- |
-| Promise | Promise used to return the focus mode support status. The value **true** means that the focus mode is supported, and **false** means the opposite.|
-
-**Example**
-
-```js
-cameraInput.isFocusModeSupported(camera.FocusMode.FOCUS_MODE_AUTO).then((status) => {
- console.log(`Promise returned with focus mode support status ${status}.`);
-})
-```
-
-### setFocusMode
-
-setFocusMode(afMode: FocusMode, callback: AsyncCallback): void
-
-Sets a focus mode. This API uses an asynchronous callback to return the result.
-
-Before the setting, use **[isFocusModeSupported](#isfocusmodesupported)** to check whether the focus mode is supported.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-**Parameters**
-
-| Name | Type | Mandatory| Description |
-| -------- | ----------------------- | ---- | ------------------- |
-| afMode | [FocusMode](#focusmode) | Yes | Focus mode. |
-| callback | AsyncCallback | Yes | Callback used to return the result.|
-
-**Example**
-
-```js
-cameraInput.setFocusMode(camera.FocusMode.FOCUS_MODE_AUTO, (err) => {
- if (err) {
- console.error(`Failed to set the focus mode ${err.message}`);
- return;
- }
- console.log('Callback returned with the successful execution of setFocusMode.');
-})
-```
-
-### setFocusMode
-
-setFocusMode(afMode: FocusMode): Promise
-
-Sets a focus mode. This API uses a promise to return the result.
-
-Before the setting, use **[isFocusModeSupported](#isfocusmodesupported)** to check whether the focus mode is supported.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-**Parameters**
-
-| Name | Type | Mandatory| Description |
-| ------ | ----------------------- | ---- | ------------- |
-| afMode | [FocusMode](#focusmode) | Yes | Focus mode.|
-
-**Return value**
-
-| Type | Description |
-| -------------- | ------------------------ |
-| Promise| Promise used to return the result.|
-
-**Example**
-
-```js
-cameraInput.setFocusMode(camera.FocusMode.FOCUS_MODE_AUTO).then(() => {
- console.log('Promise returned with the successful execution of setFocusMode.');
-})
-```
-
-### getFocusMode
-
-getFocusMode(callback: AsyncCallback): void
-
-Obtains the focus mode in use. This API uses an asynchronous callback to return the result.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-**Parameters**
-
-| Name | Type | Mandatory| Description |
-| -------- | --------------------------------------- | ---- | ------------------------------- |
-| callback | AsyncCallback<[FocusMode](#focusmode)\> | Yes | Callback used to return the focus mode.|
-
-**Example**
-
-```js
-cameraInput.getFocusMode((err, afMode) => {
- if (err) {
- console.error(`Failed to get the focus mode ${err.message}`);
- return;
- }
- console.log(`Callback returned with current focus mode: ${afMode}`);
-})
-```
-
-### getFocusMode
-
-getFocusMode(): Promise
-
-Obtains the focus mode in use. This API uses a promise to return the result.
-
-**System capability**: SystemCapability.Multimedia.Camera.Core
-
-**Return value**
-
-| Type | Description |
-| ------------------- | -------------------------------- |
-| Promise | Promise used to return the focus mode.|
-
-**Example**
-
-```js
-cameraInput.getFocusMode().then((afMode) => {
- console.log(`Promise returned with current focus mode : ${afMode}`);
-})
-```
-
-### setFocusPoint
-
-setFocusPoint(point: Point, callback: AsyncCallback