From 8b0f898c80c11adb29314b592216e16d3bc2e2fe Mon Sep 17 00:00:00 2001 From: Gloria Date: Tue, 4 Jul 2023 08:53:32 +0800 Subject: [PATCH] Update docs against 19790+19805 Signed-off-by: wusongqing --- .../media/camera-device-input.md | 2 +- en/application-dev/media/camera-metadata.md | 2 +- .../media/camera-recording-case.md | 2 +- .../media/camera-shooting-case.md | 2 +- en/application-dev/media/camera-shooting.md | 4 +-- .../reference/apis/js-apis-avsession.md | 36 +++++++++++++++---- .../reference/apis/js-apis-camera.md | 16 ++++----- 7 files changed, 44 insertions(+), 20 deletions(-) diff --git a/en/application-dev/media/camera-device-input.md b/en/application-dev/media/camera-device-input.md index 3702e16760..2d9acf3df4 100644 --- a/en/application-dev/media/camera-device-input.md +++ b/en/application-dev/media/camera-device-input.md @@ -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). ```ts -cameraManager.on('cameraStatus', (cameraStatusInfo) => { +cameraManager.on('cameraStatus', (err, cameraStatusInfo) => { console.info(`camera: ${cameraStatusInfo.camera.cameraId}`); console.info(`status: ${cameraStatusInfo.status}`); }) diff --git a/en/application-dev/media/camera-metadata.md b/en/application-dev/media/camera-metadata.md index 8fdeff1df0..67fb374517 100644 --- a/en/application-dev/media/camera-metadata.md +++ b/en/application-dev/media/camera-metadata.md @@ -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. ```ts - metadataOutput.on('metadataObjectsAvailable', (metadataObjectArr) => { + metadataOutput.on('metadataObjectsAvailable', (err, metadataObjectArr) => { console.info(`metadata output metadataObjectsAvailable`); }) ``` diff --git a/en/application-dev/media/camera-recording-case.md b/en/application-dev/media/camera-recording-case.md index 7aedbf5688..e92b8d80d5 100644 --- a/en/application-dev/media/camera-recording-case.md +++ b/en/application-dev/media/camera-recording-case.md @@ -22,7 +22,7 @@ if (!cameraManager) { } // Listen for camera status changes. -cameraManager.on('cameraStatus', (cameraStatusInfo) => { +cameraManager.on('cameraStatus', (err, cameraStatusInfo) => { console.log(`camera : ${cameraStatusInfo.camera.cameraId}`); console.log(`status: ${cameraStatusInfo.status}`); }) diff --git a/en/application-dev/media/camera-shooting-case.md b/en/application-dev/media/camera-shooting-case.md index da2588b10b..bf1da09913 100644 --- a/en/application-dev/media/camera-shooting-case.md +++ b/en/application-dev/media/camera-shooting-case.md @@ -21,7 +21,7 @@ if (!cameraManager) { return; } // Listen for camera status changes. -cameraManager.on('cameraStatus', (cameraStatusInfo) => { +cameraManager.on('cameraStatus', (err, cameraStatusInfo) => { console.info(`camera : ${cameraStatusInfo.camera.cameraId}`); console.info(`status: ${cameraStatusInfo.status}`); }) diff --git a/en/application-dev/media/camera-shooting.md b/en/application-dev/media/camera-shooting.md index 9026267ebc..9748b389d9 100644 --- a/en/application-dev/media/camera-shooting.md +++ b/en/application-dev/media/camera-shooting.md @@ -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. ```ts - photoOutput.on('captureStart', (captureId) => { + photoOutput.on('captureStart', (err, 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 - 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 - photoOutput.on('captureEnd', (captureEndInfo) => { + photoOutput.on('captureEnd', (err, captureEndInfo) => { console.info(`photo capture end, captureId : ${captureEndInfo.captureId}`); console.info(`frameCount : ${captureEndInfo.frameCount}`); }) diff --git a/en/application-dev/reference/apis/js-apis-avsession.md b/en/application-dev/reference/apis/js-apis-avsession.md index d70b0712fa..b2ad9fb707 100644 --- a/en/application-dev/reference/apis/js-apis-avsession.md +++ b/en/application-dev/reference/apis/js-apis-avsession.md @@ -307,9 +307,9 @@ Creates a session controller based on the session ID. Multiple session controlle **Return value** -| Type | Description | -| ----------------------------------------------------- | ------------------------------------------------------------ | -| 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.| +| Type | Description | +| ------------------------------------------------------- | ------------------------------------------------------------ | +| 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** @@ -1119,6 +1119,10 @@ For details about the error codes, see [AVSession Management Error Codes](../err **Example** ```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 imagePixel : image.PixelMap = await imageSource.createPixelMap({desiredSize:{width: 150, height: 150}}); let queueItemDescription_1 = { @@ -1139,7 +1143,7 @@ let queueItemDescription_2 = { title: 'music_name', subtitle: 'music_sub_name', description: 'music_description', - icon: PIXELMAP_OBJECT, + icon: imagePixel, iconUri: 'http://www.xxx.com', extras: {'extras':'any'} }; @@ -1182,6 +1186,10 @@ For details about the error codes, see [AVSession Management Error Codes](../err **Example** ```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 imagePixel : image.PixelMap = await imageSource.createPixelMap({desiredSize:{width: 150, height: 150}}); let queueItemDescription_1 = { @@ -1202,7 +1210,7 @@ let queueItemDescription_2 = { title: 'music_name', subtitle: 'music_sub_name', description: 'music_description', - icon: PIXELMAP_OBJECT, + icon: imagePixel, iconUri: 'http://www.icon.uri.com', extras: {'extras':'any'} }; @@ -2252,7 +2260,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err | ID| Error Message| | -------- | ------------------------------ | | 6600101 | Session service exception. | -| 6600103 | The session controller does not exist. | +| 6600102 | The session does not exist. | **Example** @@ -2531,6 +2539,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err | ID| Error Message| | -------- | ---------------- | | 6600101 | Session service exception. | +| 6600102 | The session does not exist. | **Example** @@ -2795,6 +2804,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err | -------- | ---------------------------------------- | | 6600101 | Session service exception. | | 6600102 | The session does not exist. | +| 6600103 | The session controller does not exist. | **Example** @@ -2830,6 +2840,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err | -------- | ---------------------------------------- | | 6600101 | Session service exception. | | 6600102 | The session does not exist. | +| 6600103 | The session controller does not exist. | **Example** @@ -3002,6 +3013,8 @@ For details about the error codes, see [AVSession Management Error Codes](../err | 6600101 | Session service exception. | | 6600102 | The session does not exist. | | 6600103 | The session controller does not exist. | +| 6600105 | Invalid session command. | +| 6600107 | Too many commands or events. | **Example** ```js @@ -3033,6 +3046,8 @@ For details about the error codes, see [AVSession Management Error Codes](../err | 6600101 | Session service exception. | | 6600102 | The session does not exist. | | 6600103 | The session controller does not exist. | +| 6600105 | Invalid session command. | +| 6600107 | Too many commands or events. | **Example** ```js @@ -4025,6 +4040,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err | ID| Error Message| | -------- | ---------------- | | 6600101 | Session service exception. | +| 6600103 | The session controller does not exist. | **Example** @@ -4054,6 +4070,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err | ID| Error Message| | -------- | ---------------- | | 6600101 | Session service exception. | +| 6600103 | The session controller does not exist. | **Example** @@ -4083,6 +4100,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err | ID| Error Message| | -------- | ---------------- | | 6600101 | Session service exception. | +| 6600103 | The session controller does not exist. | **Example** @@ -4112,6 +4130,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err | ID| Error Message| | -------- | ---------------- | | 6600101 | Session service exception. | +| 6600103 | The session controller does not exist. | **Example** @@ -4141,6 +4160,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err | ID| Error Message| | -------- | ---------------- | | 6600101 | Session service exception. | +| 6600103 | The session controller does not exist. | **Example** @@ -4201,6 +4221,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err | ID| Error Message| | -------- | ---------------- | | 6600101 | Session service exception. | +| 6600103 | The session controller does not exist. | **Example** @@ -4230,6 +4251,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err | ID| Error Message| | -------- | ---------------- | | 6600101 | Session service exception. | +| 6600103 | The session controller does not exist. | **Example** @@ -4259,6 +4281,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err | ID| Error Message | | -------- | ---------------- | | 6600101 | Session service exception. | +| 6600103 | The session controller does not exist. | **Example** @@ -4288,6 +4311,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err | ID | Error Message | | -------- | ---------------- | | 6600101 | Session service exception. | +| 6600103 | The session controller does not exist. | **Example** diff --git a/en/application-dev/reference/apis/js-apis-camera.md b/en/application-dev/reference/apis/js-apis-camera.md index c86b21c5f8..56a63d8d56 100644 --- a/en/application-dev/reference/apis/js-apis-camera.md +++ b/en/application-dev/reference/apis/js-apis-camera.md @@ -576,7 +576,7 @@ Listens for camera mute status changes. This API uses an asynchronous callback t **Example** ```js -cameraManager.on('cameraMute', (curMuetd) => { +cameraManager.on('cameraMute', (err, curMuetd) => { let isMuted = curMuetd; }) ``` @@ -1770,7 +1770,7 @@ Before the setting, you are advised to use **[getExposureBiasRange](#getexposure | 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** @@ -1804,7 +1804,7 @@ Obtains the exposure value in use. | 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** @@ -2281,7 +2281,7 @@ Listens for focus state changes. This API uses an asynchronous callback to retur **Example** ```js -captureSession.on('focusStateChange', (focusState) => { +captureSession.on('focusStateChange', (err, focusState) => { console.log(`Focus state : ${focusState}`); }) ``` @@ -2883,7 +2883,7 @@ Listens for shooting start events. This API uses an asynchronous callback to ret **Example** ```js -photoOutput.on('captureStart', (captureId) => { +photoOutput.on('captureStart', (err, 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 **Example** ```js -photoOutput.on('frameShutter', (frameShutterInfo) => { +photoOutput.on('frameShutter', (err, frameShutterInfo) => { console.log(`photo capture end, captureId : ${frameShutterInfo.captureId}`); console.log(`Timestamp for frame : ${frameShutterInfo.timestamp}`); }) @@ -2930,7 +2930,7 @@ Listens for shooting end events. This API uses an asynchronous callback to retur **Example** ```js -photoOutput.on('captureEnd', (captureEndInfo) => { +photoOutput.on('captureEnd', (err, captureEndInfo) => { console.log(`photo capture end, captureId : ${captureEndInfo.captureId}`); console.log(`frameCount : ${captureEndInfo.frameCount}`); }) @@ -3378,7 +3378,7 @@ Listens for metadata objects. This API uses an asynchronous callback to return t **Example** ```js -metadataOutput.on('metadataObjectsAvailable', (metadataObjectArr) => { +metadataOutput.on('metadataObjectsAvailable', (err, metadataObjectArr) => { console.log(`metadata output metadataObjectsAvailable`); }) ``` -- GitLab