提交 8b0f898c 编写于 作者: G Gloria

Update docs against 19790+19805

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 98022549
...@@ -75,7 +75,7 @@ During camera application development, you can listen for the camera status, inc ...@@ -75,7 +75,7 @@ During camera application development, you can listen for the camera status, inc
Register the 'cameraStatus' event and return the listening result through a callback, which carries the **CameraStatusInfo** parameter. For details about the parameter, see [CameraStatusInfo](../reference/apis/js-apis-camera.md#camerastatusinfo). Register the 'cameraStatus' event and return the listening result through a callback, which carries the **CameraStatusInfo** parameter. For details about the parameter, see [CameraStatusInfo](../reference/apis/js-apis-camera.md#camerastatusinfo).
```ts ```ts
cameraManager.on('cameraStatus', (cameraStatusInfo) => { cameraManager.on('cameraStatus', (err, cameraStatusInfo) => {
console.info(`camera: ${cameraStatusInfo.camera.cameraId}`); console.info(`camera: ${cameraStatusInfo.camera.cameraId}`);
console.info(`status: ${cameraStatusInfo.status}`); console.info(`status: ${cameraStatusInfo.status}`);
}) })
......
...@@ -48,7 +48,7 @@ During camera application development, you can listen for the status of metadata ...@@ -48,7 +48,7 @@ During camera application development, you can listen for the status of metadata
- Register the 'metadataObjectsAvailable' event to listen for metadata objects that are available. When a valid metadata object is detected, the callback function returns the metadata. This event can be registered when a **MetadataOutput** object is created. - Register the 'metadataObjectsAvailable' event to listen for metadata objects that are available. When a valid metadata object is detected, the callback function returns the metadata. This event can be registered when a **MetadataOutput** object is created.
```ts ```ts
metadataOutput.on('metadataObjectsAvailable', (metadataObjectArr) => { metadataOutput.on('metadataObjectsAvailable', (err, metadataObjectArr) => {
console.info(`metadata output metadataObjectsAvailable`); console.info(`metadata output metadataObjectsAvailable`);
}) })
``` ```
......
...@@ -22,7 +22,7 @@ if (!cameraManager) { ...@@ -22,7 +22,7 @@ if (!cameraManager) {
} }
// Listen for camera status changes. // Listen for camera status changes.
cameraManager.on('cameraStatus', (cameraStatusInfo) => { cameraManager.on('cameraStatus', (err, cameraStatusInfo) => {
console.log(`camera : ${cameraStatusInfo.camera.cameraId}`); console.log(`camera : ${cameraStatusInfo.camera.cameraId}`);
console.log(`status: ${cameraStatusInfo.status}`); console.log(`status: ${cameraStatusInfo.status}`);
}) })
......
...@@ -21,7 +21,7 @@ if (!cameraManager) { ...@@ -21,7 +21,7 @@ if (!cameraManager) {
return; return;
} }
// Listen for camera status changes. // Listen for camera status changes.
cameraManager.on('cameraStatus', (cameraStatusInfo) => { cameraManager.on('cameraStatus', (err, cameraStatusInfo) => {
console.info(`camera : ${cameraStatusInfo.camera.cameraId}`); console.info(`camera : ${cameraStatusInfo.camera.cameraId}`);
console.info(`status: ${cameraStatusInfo.status}`); console.info(`status: ${cameraStatusInfo.status}`);
}) })
......
...@@ -136,7 +136,7 @@ During camera application development, you can listen for the status of the phot ...@@ -136,7 +136,7 @@ During camera application development, you can listen for the status of the phot
- Register the 'captureStart' event to listen for photographing start events. This event can be registered when a **PhotoOutput** object is created and is triggered when the bottom layer starts exposure for photographing for the first time. The capture ID is returned. - Register the 'captureStart' event to listen for photographing start events. This event can be registered when a **PhotoOutput** object is created and is triggered when the bottom layer starts exposure for photographing for the first time. The capture ID is returned.
```ts ```ts
photoOutput.on('captureStart', (captureId) => { photoOutput.on('captureStart', (err, captureId) => {
console.info(`photo capture stated, captureId : ${captureId}`); console.info(`photo capture stated, captureId : ${captureId}`);
}) })
``` ```
...@@ -144,7 +144,7 @@ During camera application development, you can listen for the status of the phot ...@@ -144,7 +144,7 @@ During camera application development, you can listen for the status of the phot
- Register the 'captureEnd' event to listen for photographing end events. This event can be registered when a **PhotoOutput** object is created and is triggered when the photographing is complete. [CaptureEndInfo](../reference/apis/js-apis-camera.md#captureendinfo) is returned. - Register the 'captureEnd' event to listen for photographing end events. This event can be registered when a **PhotoOutput** object is created and is triggered when the photographing is complete. [CaptureEndInfo](../reference/apis/js-apis-camera.md#captureendinfo) is returned.
```ts ```ts
photoOutput.on('captureEnd', (captureEndInfo) => { photoOutput.on('captureEnd', (err, captureEndInfo) => {
console.info(`photo capture end, captureId : ${captureEndInfo.captureId}`); console.info(`photo capture end, captureId : ${captureEndInfo.captureId}`);
console.info(`frameCount : ${captureEndInfo.frameCount}`); console.info(`frameCount : ${captureEndInfo.frameCount}`);
}) })
......
...@@ -308,8 +308,8 @@ Creates a session controller based on the session ID. Multiple session controlle ...@@ -308,8 +308,8 @@ Creates a session controller based on the session ID. Multiple session controlle
**Return value** **Return value**
| Type | Description | | Type | Description |
| ----------------------------------------------------- | ------------------------------------------------------------ | | ------------------------------------------------------- | ------------------------------------------------------------ |
| Promise<[AVSessionController](#avsessioncontroller10)\> | Promise used to return the session controller created, which can be used to obtain the session ID,<br>send commands and events to sessions, and obtain metadata and playback state information.| | Promise<[AVSessionController](#avsessioncontroller10)\> | Promise used to return the session controller created, which can be used to obtain the session ID, send commands and events to sessions, and obtain metadata and playback state information. |
**Error codes** **Error codes**
...@@ -1119,6 +1119,10 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -1119,6 +1119,10 @@ For details about the error codes, see [AVSession Management Error Codes](../err
**Example** **Example**
```js ```js
import image from '@ohos.multimedia.image';
import resourceManager from '@ohos.resourceManager';
let value : Uint8Array = await resourceManager.getRawFile('IMAGE_URI');
let imageSource : imageImageSource = image.createImageSource(value.buffer); let imageSource : imageImageSource = image.createImageSource(value.buffer);
let imagePixel : image.PixelMap = await imageSource.createPixelMap({desiredSize:{width: 150, height: 150}}); let imagePixel : image.PixelMap = await imageSource.createPixelMap({desiredSize:{width: 150, height: 150}});
let queueItemDescription_1 = { let queueItemDescription_1 = {
...@@ -1139,7 +1143,7 @@ let queueItemDescription_2 = { ...@@ -1139,7 +1143,7 @@ let queueItemDescription_2 = {
title: 'music_name', title: 'music_name',
subtitle: 'music_sub_name', subtitle: 'music_sub_name',
description: 'music_description', description: 'music_description',
icon: PIXELMAP_OBJECT, icon: imagePixel,
iconUri: 'http://www.xxx.com', iconUri: 'http://www.xxx.com',
extras: {'extras':'any'} extras: {'extras':'any'}
}; };
...@@ -1182,6 +1186,10 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -1182,6 +1186,10 @@ For details about the error codes, see [AVSession Management Error Codes](../err
**Example** **Example**
```js ```js
import image from '@ohos.multimedia.image';
import resourceManager from '@ohos.resourceManager';
let value : Uint8Array = await resourceManager.getRawFile('IMAGE_URI');
let imageSource : imageImageSource = image.createImageSource(value.buffer); let imageSource : imageImageSource = image.createImageSource(value.buffer);
let imagePixel : image.PixelMap = await imageSource.createPixelMap({desiredSize:{width: 150, height: 150}}); let imagePixel : image.PixelMap = await imageSource.createPixelMap({desiredSize:{width: 150, height: 150}});
let queueItemDescription_1 = { let queueItemDescription_1 = {
...@@ -1202,7 +1210,7 @@ let queueItemDescription_2 = { ...@@ -1202,7 +1210,7 @@ let queueItemDescription_2 = {
title: 'music_name', title: 'music_name',
subtitle: 'music_sub_name', subtitle: 'music_sub_name',
description: 'music_description', description: 'music_description',
icon: PIXELMAP_OBJECT, icon: imagePixel,
iconUri: 'http://www.icon.uri.com', iconUri: 'http://www.icon.uri.com',
extras: {'extras':'any'} extras: {'extras':'any'}
}; };
...@@ -2252,7 +2260,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -2252,7 +2260,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
| ID| Error Message| | ID| Error Message|
| -------- | ------------------------------ | | -------- | ------------------------------ |
| 6600101 | Session service exception. | | 6600101 | Session service exception. |
| 6600103 | The session controller does not exist. | | 6600102 | The session does not exist. |
**Example** **Example**
...@@ -2531,6 +2539,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -2531,6 +2539,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
| ID| Error Message| | ID| Error Message|
| -------- | ---------------- | | -------- | ---------------- |
| 6600101 | Session service exception. | | 6600101 | Session service exception. |
| 6600102 | The session does not exist. |
**Example** **Example**
...@@ -2795,6 +2804,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -2795,6 +2804,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 6600101 | Session service exception. | | 6600101 | Session service exception. |
| 6600102 | The session does not exist. | | 6600102 | The session does not exist. |
| 6600103 | The session controller does not exist. |
**Example** **Example**
...@@ -2830,6 +2840,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -2830,6 +2840,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
| -------- | ---------------------------------------- | | -------- | ---------------------------------------- |
| 6600101 | Session service exception. | | 6600101 | Session service exception. |
| 6600102 | The session does not exist. | | 6600102 | The session does not exist. |
| 6600103 | The session controller does not exist. |
**Example** **Example**
...@@ -3002,6 +3013,8 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -3002,6 +3013,8 @@ For details about the error codes, see [AVSession Management Error Codes](../err
| 6600101 | Session service exception. | | 6600101 | Session service exception. |
| 6600102 | The session does not exist. | | 6600102 | The session does not exist. |
| 6600103 | The session controller does not exist. | | 6600103 | The session controller does not exist. |
| 6600105 | Invalid session command. |
| 6600107 | Too many commands or events. |
**Example** **Example**
```js ```js
...@@ -3033,6 +3046,8 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -3033,6 +3046,8 @@ For details about the error codes, see [AVSession Management Error Codes](../err
| 6600101 | Session service exception. | | 6600101 | Session service exception. |
| 6600102 | The session does not exist. | | 6600102 | The session does not exist. |
| 6600103 | The session controller does not exist. | | 6600103 | The session controller does not exist. |
| 6600105 | Invalid session command. |
| 6600107 | Too many commands or events. |
**Example** **Example**
```js ```js
...@@ -4025,6 +4040,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -4025,6 +4040,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
| ID| Error Message| | ID| Error Message|
| -------- | ---------------- | | -------- | ---------------- |
| 6600101 | Session service exception. | | 6600101 | Session service exception. |
| 6600103 | The session controller does not exist. |
**Example** **Example**
...@@ -4054,6 +4070,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -4054,6 +4070,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
| ID| Error Message| | ID| Error Message|
| -------- | ---------------- | | -------- | ---------------- |
| 6600101 | Session service exception. | | 6600101 | Session service exception. |
| 6600103 | The session controller does not exist. |
**Example** **Example**
...@@ -4083,6 +4100,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -4083,6 +4100,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
| ID| Error Message| | ID| Error Message|
| -------- | ---------------- | | -------- | ---------------- |
| 6600101 | Session service exception. | | 6600101 | Session service exception. |
| 6600103 | The session controller does not exist. |
**Example** **Example**
...@@ -4112,6 +4130,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -4112,6 +4130,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
| ID| Error Message| | ID| Error Message|
| -------- | ---------------- | | -------- | ---------------- |
| 6600101 | Session service exception. | | 6600101 | Session service exception. |
| 6600103 | The session controller does not exist. |
**Example** **Example**
...@@ -4141,6 +4160,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -4141,6 +4160,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
| ID| Error Message| | ID| Error Message|
| -------- | ---------------- | | -------- | ---------------- |
| 6600101 | Session service exception. | | 6600101 | Session service exception. |
| 6600103 | The session controller does not exist. |
**Example** **Example**
...@@ -4201,6 +4221,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -4201,6 +4221,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
| ID| Error Message| | ID| Error Message|
| -------- | ---------------- | | -------- | ---------------- |
| 6600101 | Session service exception. | | 6600101 | Session service exception. |
| 6600103 | The session controller does not exist. |
**Example** **Example**
...@@ -4230,6 +4251,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -4230,6 +4251,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
| ID| Error Message| | ID| Error Message|
| -------- | ---------------- | | -------- | ---------------- |
| 6600101 | Session service exception. | | 6600101 | Session service exception. |
| 6600103 | The session controller does not exist. |
**Example** **Example**
...@@ -4259,6 +4281,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -4259,6 +4281,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
| ID| Error Message | | ID| Error Message |
| -------- | ---------------- | | -------- | ---------------- |
| 6600101 | Session service exception. | | 6600101 | Session service exception. |
| 6600103 | The session controller does not exist. |
**Example** **Example**
...@@ -4288,6 +4311,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err ...@@ -4288,6 +4311,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
| ID | Error Message | | ID | Error Message |
| -------- | ---------------- | | -------- | ---------------- |
| 6600101 | Session service exception. | | 6600101 | Session service exception. |
| 6600103 | The session controller does not exist. |
**Example** **Example**
......
...@@ -576,7 +576,7 @@ Listens for camera mute status changes. This API uses an asynchronous callback t ...@@ -576,7 +576,7 @@ Listens for camera mute status changes. This API uses an asynchronous callback t
**Example** **Example**
```js ```js
cameraManager.on('cameraMute', (curMuetd) => { cameraManager.on('cameraMute', (err, curMuetd) => {
let isMuted = curMuetd; let isMuted = curMuetd;
}) })
``` ```
...@@ -1770,7 +1770,7 @@ Before the setting, you are advised to use **[getExposureBiasRange](#getexposure ...@@ -1770,7 +1770,7 @@ Before the setting, you are advised to use **[getExposureBiasRange](#getexposure
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | -------------------------------| ---- | ------------------- | | -------- | -------------------------------| ---- | ------------------- |
| exposureBias | number | Yes | EV. The supported EV range can be obtained by calling **getExposureBiasRange**. If the value passed is not within the supported range, the nearest critical point is used. There is a step for EV. For example, if the step is 0.5 and this parameter is set to 1.2, the EV that takes effect is 1.0. If the operation fails, an error code defined in [CameraErrorCode](#cameraerrorcode) is returned. | | exposureBias | number | Yes | EV. The supported EV range can be obtained by calling **getExposureBiasRange**. If the value passed is not within the supported range, the nearest critical point is used. There is a step for EV. For example, if the step is 0.5 and this parameter is set to 1.2, the EV that takes effect is 1.0. If the operation fails, an error code defined in [CameraErrorCode](#cameraerrorcode) is returned.|
**Error codes** **Error codes**
...@@ -1804,7 +1804,7 @@ Obtains the exposure value in use. ...@@ -1804,7 +1804,7 @@ Obtains the exposure value in use.
| Type | Description | | Type | Description |
| ---------- | ----------------------------- | | ---------- | ----------------------------- |
| number | Exposure value obtained. There is a step for EV. For example, if the step is 0.5 and this parameter is set to 1.2, the EV that takes effect is 1.0. If the operation fails, an error code defined in [CameraErrorCode](#cameraerrorcode) is returned. | | number | Exposure value obtained. There is a step for EV. For example, if the step is 0.5 and this parameter is set to 1.2, the EV that takes effect is 1.0. If the operation fails, an error code defined in [CameraErrorCode](#cameraerrorcode) is returned.|
**Error codes** **Error codes**
...@@ -2281,7 +2281,7 @@ Listens for focus state changes. This API uses an asynchronous callback to retur ...@@ -2281,7 +2281,7 @@ Listens for focus state changes. This API uses an asynchronous callback to retur
**Example** **Example**
```js ```js
captureSession.on('focusStateChange', (focusState) => { captureSession.on('focusStateChange', (err, focusState) => {
console.log(`Focus state : ${focusState}`); console.log(`Focus state : ${focusState}`);
}) })
``` ```
...@@ -2883,7 +2883,7 @@ Listens for shooting start events. This API uses an asynchronous callback to ret ...@@ -2883,7 +2883,7 @@ Listens for shooting start events. This API uses an asynchronous callback to ret
**Example** **Example**
```js ```js
photoOutput.on('captureStart', (captureId) => { photoOutput.on('captureStart', (err, captureId) => {
console.log(`photo capture stated, captureId : ${captureId}`); console.log(`photo capture stated, captureId : ${captureId}`);
}) })
``` ```
...@@ -2906,7 +2906,7 @@ Listens for frame shutter events. This API uses an asynchronous callback to retu ...@@ -2906,7 +2906,7 @@ Listens for frame shutter events. This API uses an asynchronous callback to retu
**Example** **Example**
```js ```js
photoOutput.on('frameShutter', (frameShutterInfo) => { photoOutput.on('frameShutter', (err, frameShutterInfo) => {
console.log(`photo capture end, captureId : ${frameShutterInfo.captureId}`); console.log(`photo capture end, captureId : ${frameShutterInfo.captureId}`);
console.log(`Timestamp for frame : ${frameShutterInfo.timestamp}`); console.log(`Timestamp for frame : ${frameShutterInfo.timestamp}`);
}) })
...@@ -2930,7 +2930,7 @@ Listens for shooting end events. This API uses an asynchronous callback to retur ...@@ -2930,7 +2930,7 @@ Listens for shooting end events. This API uses an asynchronous callback to retur
**Example** **Example**
```js ```js
photoOutput.on('captureEnd', (captureEndInfo) => { photoOutput.on('captureEnd', (err, captureEndInfo) => {
console.log(`photo capture end, captureId : ${captureEndInfo.captureId}`); console.log(`photo capture end, captureId : ${captureEndInfo.captureId}`);
console.log(`frameCount : ${captureEndInfo.frameCount}`); console.log(`frameCount : ${captureEndInfo.frameCount}`);
}) })
...@@ -3378,7 +3378,7 @@ Listens for metadata objects. This API uses an asynchronous callback to return t ...@@ -3378,7 +3378,7 @@ Listens for metadata objects. This API uses an asynchronous callback to return t
**Example** **Example**
```js ```js
metadataOutput.on('metadataObjectsAvailable', (metadataObjectArr) => { metadataOutput.on('metadataObjectsAvailable', (err, metadataObjectArr) => {
console.log(`metadata output metadataObjectsAvailable`); console.log(`metadata output metadataObjectsAvailable`);
}) })
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册