!14369 自动切换镜头

Merge pull request !14369 from 章超123/master1023
This commit is contained in:
openharmony_ci 2024-10-30 09:34:04 +00:00 committed by Gitee
commit 8a87214daa
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -3487,6 +3487,79 @@ declare namespace camera {
setColorSpace(colorSpace: colorSpaceManager.ColorSpace): void;
}
/**
* Auto Device Switch Query object.
*
* @interface AutoDeviceSwitchQuery
* @syscap SystemCapability.Multimedia.Camera.Core
* @since 13
*/
interface AutoDeviceSwitchQuery {
/**
* Check whether auto device switch is supported.
*
* @returns { boolean } Is auto device switch supported.
* @throws { BusinessError } 7400103 - Session not config, only throw in session usage.
* @syscap SystemCapability.Multimedia.Camera.Core
* @since 13
*/
isAutoDeviceSwitchSupported(): boolean;
}
/**
* Auto Device Switch object.
*
* @interface AutoDeviceSwitch
* @extends AutoDeviceSwitchQuery
* @syscap SystemCapability.Multimedia.Camera.Core
* @since 13
*/
interface AutoDeviceSwitch extends AutoDeviceSwitchQuery {
/**
* Enable auto device switch for session.
*
* @param { boolean } enabled - enable auto device switch if TRUE.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types;
* 3. Parameters verification failed.
* @throws { BusinessError } 7400102 - Operation not allowed.
* @throws { BusinessError } 7400103 - Session not config.
* @throws { BusinessError } 7400201 - Camera service fatal error.
* @syscap SystemCapability.Multimedia.Camera.Core
* @since 13
*/
enableAutoDeviceSwitch(enabled: boolean): void;
}
/**
* Auto Device Switch Status.
*
* @typedef AutoDeviceSwitchStatus
* @syscap SystemCapability.Multimedia.Camera.Core
* @since 13
*/
interface AutoDeviceSwitchStatus {
/**
* Notify whether device is switched.
*
* @type { boolean }
* @readonly
* @syscap SystemCapability.Multimedia.Camera.Core
* @since 13
*/
readonly isDeviceSwitched: boolean;
/**
* Notify whether device capability is changed.
*
* @type { boolean }
* @readonly
* @syscap SystemCapability.Multimedia.Camera.Core
* @since 13
*/
readonly isDeviceCapabilityChanged: boolean;
}
/**
* Macro Query object.
*
@ -4694,10 +4767,19 @@ declare namespace camera {
* Photo session object.
*
* @interface PhotoSession
* @extends Session, Flash, AutoExposure, Focus, Zoom, ColorManagement
* @syscap SystemCapability.Multimedia.Camera.Core
* @since 11
*/
interface PhotoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorManagement {
/**
* Photo session object.
*
* @interface PhotoSession
* @extends AutoDeviceSwitch
* @syscap SystemCapability.Multimedia.Camera.Core
* @since 13
*/
interface PhotoSession extends Session, Flash, AutoExposure, Focus, Zoom, ColorManagement, AutoDeviceSwitch {
/**
* Gets whether the choosed preconfig type can be used to configure photo session.
* Must choose preconfig type from {@link PreconfigType}.
@ -4857,6 +4939,26 @@ declare namespace camera {
*/
off(type: 'effectSuggestionChange', callback?: AsyncCallback<EffectSuggestionType>): void;
/**
* Subscribes to auto device switch status event callback.
*
* @param { 'autoDeviceSwitchStatusChange' } type - Event type.
* @param { AsyncCallback<AutoDeviceSwitchStatus> } callback - Callback used to return the result.
* @syscap SystemCapability.Multimedia.Camera.Core
* @since 13
*/
on(type: 'autoDeviceSwitchStatusChange', callback: AsyncCallback<AutoDeviceSwitchStatus>): void;
/**
* Unsubscribes to auto device switch status event callback.
*
* @param { 'autoDeviceSwitchStatusChange' } type - Event type.
* @param { AsyncCallback<AutoDeviceSwitchStatus> } callback - Callback used to return the result.
* @syscap SystemCapability.Multimedia.Camera.Core
* @since 13
*/
off(type: 'autoDeviceSwitchStatusChange', callback?: AsyncCallback<AutoDeviceSwitchStatus>): void;
/**
* Subscribes to lcd flash status.
*
@ -4921,10 +5023,19 @@ declare namespace camera {
* Video session object.
*
* @interface VideoSession
* @extends Session, Flash, AutoExposure, Focus, Zoom, Stabilization, ColorManagement
* @syscap SystemCapability.Multimedia.Camera.Core
* @since 11
*/
interface VideoSession extends Session, Flash, AutoExposure, Focus, Zoom, Stabilization, ColorManagement {
/**
* Video session object.
*
* @interface VideoSession
* @extends AutoDeviceSwitch
* @syscap SystemCapability.Multimedia.Camera.Core
* @since 13
*/
interface VideoSession extends Session, Flash, AutoExposure, Focus, Zoom, Stabilization, ColorManagement, AutoDeviceSwitch {
/**
* Gets whether the choosed preconfig type can be used to configure video session.
* Must choose preconfig type from {@link PreconfigType}.
@ -5060,6 +5171,26 @@ declare namespace camera {
*/
off(type: 'lcdFlashStatus', callback?: AsyncCallback<LcdFlashStatus>): void;
/**
* Subscribes to auto device switch status event callback.
*
* @param { 'autoDeviceSwitchStatusChange' } type - Event type.
* @param { AsyncCallback<AutoDeviceSwitchStatus> } callback - Callback used to return the result.
* @syscap SystemCapability.Multimedia.Camera.Core
* @since 13
*/
on(type: 'autoDeviceSwitchStatusChange', callback: AsyncCallback<AutoDeviceSwitchStatus>): void;
/**
* Unsubscribes to auto device switch status event callback.
*
* @param { 'autoDeviceSwitchStatusChange' } type - Event type.
* @param { AsyncCallback<AutoDeviceSwitchStatus> } callback - Callback used to return the result.
* @syscap SystemCapability.Multimedia.Camera.Core
* @since 13
*/
off(type: 'autoDeviceSwitchStatusChange', callback?: AsyncCallback<AutoDeviceSwitchStatus>): void;
/**
* Gets session functions.
*