diff --git a/api/@ohos.multimedia.camera.d.ts b/api/@ohos.multimedia.camera.d.ts index 32a2d4b1df4530746bf92259f9f5922449e29054..f68b1e91d6a13e75e932ddc8469f0ef6a0397187 100644 --- a/api/@ohos.multimedia.camera.d.ts +++ b/api/@ohos.multimedia.camera.d.ts @@ -13936,12 +13936,11 @@ declare namespace camera { * Subscribes deferred video enhancement info callback. * * @param { 'deferredVideoEnhancementInfo' } type - Event type. - * @param { AsyncCallback } callback - Callback used to return the result. + * @param { AsyncCallback } callback - Callback used to return the result. * @throws { BusinessError } 202 - Not System Application. * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 13 dynamic - * @since 20 static */ on(type: 'deferredVideoEnhancementInfo', callback: AsyncCallback): void; @@ -13954,7 +13953,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 13 dynamic - * @since 20 static */ off(type: 'deferredVideoEnhancementInfo', callback?: AsyncCallback): void; @@ -13978,7 +13976,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 19 dynamic - * @since 20 static */ on(type: 'frameStart', callback: AsyncCallback): void; @@ -13998,7 +13995,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 19 dynamic - * @since 20 static */ off(type: 'frameStart', callback?: AsyncCallback): void; @@ -14018,7 +14014,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 19 dynamic - * @since 20 static */ on(type: 'frameEnd', callback: AsyncCallback): void; @@ -14038,7 +14033,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 19 dynamic - * @since 20 static */ off(type: 'frameEnd', callback?: AsyncCallback): void; @@ -14062,7 +14056,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 19 dynamic - * @since 20 static */ on(type: 'error', callback: ErrorCallback): void; @@ -14082,10 +14075,101 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 19 dynamic - * @since 20 static */ off(type: 'error', callback?: ErrorCallback): void; + /** + * Subscribes deferred video enhancement info callback. + * + * @param { 'deferredVideoEnhancementInfo' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 22 static + */ + onDeferredVideoEnhancementInfo(callback: AsyncCallback): void; + + /** + * Registers a listener for the start of the video recording to get the result by registering + * a callback function. This API uses an asynchronous callback to return the result. + * + * Description: Currently, it is not allowed to use off() to unregister the callback + * within the callback method of on(). + * + * @param { 'frameStart' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 22 static + */ + onFrameStart(callback: AsyncCallback): void; + + /** + * Subscribes frame end event callback. + * + * @param { 'frameEnd' } type - Event type. + * @param { AsyncCallback } callback - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 22 static + */ + onFrameEnd(callback: AsyncCallback): void; + + /** + * Registers a listener for errors in the metadata stream to get the result by registering + * a callback function. This API uses an asynchronous callback to return the result. + * + * Description: Currently, it is not allowed to use off() to unregister the callback + * within the callback method of on(). + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the video output errors. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 22 static + */ + onError(callback: ErrorCallback): void; + + /** + * Unsubscribes from deferred video enhancement info callback. + * + * @param { 'deferredVideoEnhancementInfo' } type - Event type. + * @param { AsyncCallback } [callback] - Callback used to return the result. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 22 static + */ + offDeferredVideoEnhancementInfo(callback?: AsyncCallback): void; + + /** + * Unsubscribes from frame start event callback. + * + * @param { 'frameStart' } type - Event type. + * @param { AsyncCallback } [callback] - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 22 static + */ + offFrameStart(callback?: AsyncCallback): void; + + /** + * Unsubscribes from frame end event callback. + * + * @param { 'frameEnd' } type - Event type. + * @param { AsyncCallback } [callback] - Callback used to return the result. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 22 static + */ + offFrameEnd(callback?: AsyncCallback): void; + + /** + * Unsubscribes from error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } [callback] - Callback used to get the video output errors. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 22 static + */ + offError(callback?: ErrorCallback): void; + /** * Gets the current preconfig type if you had already call preconfig interface. * @@ -14153,6 +14237,117 @@ declare namespace camera { VIDEO_META_MAKER_INFO = 0 } + /** + * Video capability object + * + * @typedef VideoCapability + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + interface VideoCapability { + /** + * Determine whether BFrame is supported. + * + * @returns { boolean } Is BFrame supported. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + isBFrameSupported(): boolean; + } + + /** + * Movie settings object + * + * @typedef MovieSettings + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + interface MovieSettings { + /** + * Movie codec type. + * + * @type { VideoCodecType } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + videoCodec: VideoCodecType; + + /** + * Video rotation. + * + * @type { ?ImageRotation } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + rotation?: ImageRotation; + + /** + * Movie location. + * + * @type { ?Location } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + location?: Location; + + /** + * Configure whether to enable B-frame, default false. + * + * @type { ?boolean } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + isBFrameEnabled?: boolean; + } + + /** + * Movie info object + * + * @typedef MovieInfo + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + interface MovieInfo { + /** + * Capture identity value. + * + * @type { int } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + captureId: int; + + /** + * ID of the photo taken. + * + * @type { ?photoAccessHelper.PhotoAsset } + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + asset?: photoAccessHelper.PhotoAsset; + } + /** * Metadata object type. * @@ -14547,8 +14742,8 @@ declare namespace camera { /** * Metadata object for face. * - * @typedef MetadataFaceObject * @extends MetadataObject + * @typedef MetadataFaceObject * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 13 dynamic @@ -14643,8 +14838,8 @@ declare namespace camera { /** * Metadata object for human body. * - * @typedef MetadataHumanBodyObject * @extends MetadataObject + * @typedef MetadataHumanBodyObject * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 13 dynamic @@ -14656,8 +14851,8 @@ declare namespace camera { /** * Metadata object for cat face. * - * @typedef MetadataCatFaceObject * @extends MetadataObject + * @typedef MetadataCatFaceObject * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 13 dynamic @@ -14692,8 +14887,8 @@ declare namespace camera { /** * Metadata object for cat body. * - * @typedef MetadataCatBodyObject * @extends MetadataObject + * @typedef MetadataCatBodyObject * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 13 dynamic @@ -14705,8 +14900,8 @@ declare namespace camera { /** * Metadata object for dog face. * - * @typedef MetadataDogFaceObject * @extends MetadataObject + * @typedef MetadataDogFaceObject * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 13 dynamic @@ -14741,8 +14936,8 @@ declare namespace camera { /** * Metadata object for dog body. * - * @typedef MetadataDogBodyObject * @extends MetadataObject + * @typedef MetadataDogBodyObject * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 13 dynamic @@ -14754,8 +14949,8 @@ declare namespace camera { /** * Metadata object for salient detection. * - * @typedef MetadataSalientDetectionObject * @extends MetadataObject + * @typedef MetadataSalientDetectionObject * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 13 dynamic @@ -14961,7 +15156,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 19 dynamic - * @since 20 static */ on(type: 'metadataObjectsAvailable', callback: AsyncCallback>): void; @@ -14981,7 +15175,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 19 dynamic - * @since 20 static */ off(type: 'metadataObjectsAvailable', callback?: AsyncCallback>): void; @@ -15005,7 +15198,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 19 dynamic - * @since 20 static */ on(type: 'error', callback: ErrorCallback): void; @@ -15025,9 +15217,56 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @atomicservice * @since 19 dynamic - * @since 20 static */ off(type: 'error', callback?: ErrorCallback): void; + + /** + * Registers a listener for the detected metadata object to get the result by registering + * a callback function. This API uses an asynchronous callback to return the result. + * + * Description: Currently, it is not allowed to use off() to unregister the callback + * within the callback method of on(). + * + * @param { 'metadataObjectsAvailable' } type - Event type. + * @param { AsyncCallback> } callback - Callback used to get the available metadata objects. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 22 static + */ + onMetadataObjectsAvailable(callback: AsyncCallback>): void; + + /** + * Registers a listener for errors in the video output to get the result by registering + * a callback function. This API uses an asynchronous callback to return the result. + * + * Description: Currently, it is not allowed to use off() to unregister the callback + * within the callback method of on(). + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the video output errors. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 22 static + */ + onError(callback: ErrorCallback): void; + + /** + * Unsubscribes from metadata objects available event callback. + * + * @param { 'metadataObjectsAvailable' } type - Event type. + * @param { AsyncCallback> } [callback] - Callback used to get the available metadata objects. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 22 static + */ + offmetadataObjectsAvailable(callback?: AsyncCallback>): void; + + /** + * Unsubscribes from error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } [callback] - Callback used to get the video output errors. + * @syscap SystemCapability.Multimedia.Camera.Core + * @since 22 static + */ + offError(callback?: ErrorCallback): void; } /** @@ -15319,7 +15558,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 dynamic - * @since 20 static */ on(type: 'error', callback: ErrorCallback): void; @@ -15332,7 +15570,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 dynamic - * @since 20 static */ off(type: 'error', callback?: ErrorCallback): void; @@ -15345,7 +15582,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 dynamic - * @since 20 static */ on(type: 'focusStateChange', callback: AsyncCallback): void; @@ -15358,7 +15594,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 dynamic - * @since 20 static */ off(type: 'focusStateChange', callback?: AsyncCallback): void; @@ -15371,7 +15606,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 dynamic - * @since 20 static */ on(type: 'isoInfoChange', callback: AsyncCallback): void; @@ -15384,7 +15618,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 dynamic - * @since 20 static */ off(type: 'isoInfoChange', callback?: AsyncCallback): void; @@ -15397,7 +15630,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 dynamic - * @since 20 static */ on(type: 'exposureInfoChange', callback: AsyncCallback): void; @@ -15410,7 +15642,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 dynamic - * @since 20 static */ off(type: 'exposureInfoChange', callback?: AsyncCallback): void; @@ -15423,7 +15654,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 dynamic - * @since 20 static */ on(type: 'luminationInfoChange', callback: AsyncCallback): void; @@ -15436,7 +15666,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 dynamic - * @since 20 static */ off(type: 'luminationInfoChange', callback?: AsyncCallback): void; @@ -15488,7 +15717,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 dynamic - * @since 20 static */ on(type: 'tryAEInfoChange', callback: AsyncCallback): void; @@ -15501,10 +15729,153 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 12 dynamic - * @since 20 static */ off(type: 'tryAEInfoChange', callback?: AsyncCallback): void; + /** + * Subscribes to error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the capture session errors. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 22 static + */ + onError(callback: ErrorCallback): void; + + /** + * Subscribes focus state change event callback. + * + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the focus state change. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 22 static + */ + onFocusStateChange(callback: AsyncCallback): void; + + /** + * Subscribes ISO info event callback. + * + * @param { 'isoInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the ISO info. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 22 static + */ + onIsoInfoChange(callback: AsyncCallback): void; + + /** + * Subscribes exposure info event callback. + * + * @param { 'exposureInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the exposure info. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 22 static + */ + onExposureInfoChange(callback: AsyncCallback): void; + + /** + * Subscribes lumination info event callback. + * + * @param { 'luminationInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the lumination info. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 22 static + */ + onLuminationInfoChange(callback: AsyncCallback): void; + + /** + * Subscribes try AE info event callback. + * + * @param { 'tryAEInfoChange' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the try AE info. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 22 static + */ + onTryAEInfoChange(callback: AsyncCallback): void; + + /** + * Unsubscribes from error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } [callback] - Callback used to get the capture session errors. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 22 static + */ + offError(callback?: ErrorCallback): void; + + /** + * Unsubscribes from focus state change event callback. + * + * @param { 'focusStateChange' } type - Event type. + * @param { AsyncCallback } [callback] - Callback used to get the focus state change. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 22 static + */ + offFocusStateChange(callback?: AsyncCallback): void; + + /** + * Unsubscribes from ISO info event callback. + * + * @param { 'isoInfoChange' } type - Event type. + * @param { AsyncCallback } [callback] - Callback used to get the ISO info. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 22 static + */ + offIsoInfoChange(callback?: AsyncCallback): void; + + /** + * Unsubscribes from exposure info event callback. + * + * @param { 'exposureInfoChange' } type - Event type. + * @param { AsyncCallback } [callback] - Callback used to get the exposure info. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 22 static + */ + offExposureInfoChange(callback?: AsyncCallback): void; + + /** + * Unsubscribes from lumination info event callback. + * + * @param { 'luminationInfoChange' } type - Event type. + * @param { AsyncCallback } [callback] - Callback used to get the lumination info. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 22 static + */ + offLuminationInfoChange(callback?: AsyncCallback): void; + + /** + * Unsubscribes from try AE info event callback. + * + * @param { 'tryAEInfoChange' } type - Event type. + * @param { AsyncCallback } [callback] - Callback used to get the try AE info. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 22 static + */ + offTryAEInfoChange(callback?: AsyncCallback): void; + /** * Gets supported timelapse interval range. * @@ -15836,7 +16207,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 13 dynamic - * @since 20 static */ on(type: 'depthDataAvailable', callback: AsyncCallback): void; @@ -15849,7 +16219,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 13 dynamic - * @since 20 static */ off(type: 'depthDataAvailable', callback?: AsyncCallback): void; @@ -15862,7 +16231,6 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 13 dynamic - * @since 20 static */ on(type: 'error', callback: ErrorCallback): void; @@ -15875,9 +16243,56 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi * @since 13 dynamic - * @since 20 static */ off(type: 'error', callback?: ErrorCallback): void; + + /** + * Subscribes to depth data objects available event callback. + * + * @param { 'depthDataAvailable' } type - Event type. + * @param { AsyncCallback } callback - Callback used to get the available DepthData objects. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 22 static + */ + onDepthDataAvailable(callback: AsyncCallback): void; + + /** + * Subscribes to error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } callback - Callback used to get the video output errors. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 22 static + */ + onError(callback: ErrorCallback): void; + + /** + * Unsubscribes from depth data objects available event callback. + * + * @param { 'depthDataAvailable' } type - Event type. + * @param { AsyncCallback } [callback] - Callback used to get the available DepthData objects. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 22 static + */ + offDepthDataAvailable(callback?: AsyncCallback): void; + + /** + * Unsubscribes from error events. + * + * @param { 'error' } type - Event type. + * @param { ErrorCallback } [callback] - Callback used to get the video output errors. + * @throws { BusinessError } 202 - Not System Application. + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + * @since 22 static + */ + offError(callback?: ErrorCallback): void; } /**