已开启
notification转为sysApi #153832
chinese-deer创建于 7月4日
notification转为sysApi #153832
已开启
共 10 个文件变更+133-353
| @@ -37,7 +37,6 @@ | |||
| 37 | - [Interface (ManualIso)](arkts-apis-camera-ManualIso.md) | 37 | - [Interface (ManualIso)](arkts-apis-camera-ManualIso.md) |
| 38 | - [Interface (ManualIsoQuery)](arkts-apis-camera-ManualIsoQuery.md) | 38 | - [Interface (ManualIsoQuery)](arkts-apis-camera-ManualIsoQuery.md) |
| 39 | - [Interface (MetadataOutput)](arkts-apis-camera-MetadataOutput.md) | 39 | - [Interface (MetadataOutput)](arkts-apis-camera-MetadataOutput.md) |
| 40 | - - [Interface (Notification)](arkts-apis-camera-Notification.md) | ||
| 41 | - [Interface (OIS)](arkts-apis-camera-OIS.md) | 40 | - [Interface (OIS)](arkts-apis-camera-OIS.md) |
| 42 | - [Interface (OISQuery)](arkts-apis-camera-OISQuery.md) | 41 | - [Interface (OISQuery)](arkts-apis-camera-OISQuery.md) |
| 43 | - [Interface (Photo)](arkts-apis-camera-Photo.md) | 42 | - [Interface (Photo)](arkts-apis-camera-Photo.md) |
| @@ -70,7 +69,6 @@ | |||
| 70 | - [camera_device.h](capi-camera-device-h.md) | 69 | - [camera_device.h](capi-camera-device-h.md) |
| 71 | - [camera_input.h](capi-camera-input-h.md) | 70 | - [camera_input.h](capi-camera-input-h.md) |
| 72 | - [camera_manager.h](capi-camera-manager-h.md) | 71 | - [camera_manager.h](capi-camera-manager-h.md) |
| 73 | - - [camera_notification_info.h](capi-camera-notification-info.md) | ||
| 74 | - [capture_session.h](capi-capture-session-h.md) | 72 | - [capture_session.h](capi-capture-session-h.md) |
| 75 | - [metadata_output.h](capi-metadata-output-h.md) | 73 | - [metadata_output.h](capi-metadata-output-h.md) |
| 76 | - [metadata_object_ext.h](capi-metadata-object-ext-h.md) | 74 | - [metadata_object_ext.h](capi-metadata-object-ext-h.md) |
| @@ -105,7 +103,6 @@ | |||
| 105 | - [Camera_ConcurrentInfo](capi-oh-camera-camera-concurrentinfo.md) | 103 | - [Camera_ConcurrentInfo](capi-oh-camera-camera-concurrentinfo.md) |
| 106 | - [Camera_ControlCenterStatusInfo](capi-oh-camera-camera-controlcenterstatusinfo.md) | 104 | - [Camera_ControlCenterStatusInfo](capi-oh-camera-camera-controlcenterstatusinfo.md) |
| 107 | - [Camera_Manager](capi-oh-camera-camera-manager.md) | 105 | - [Camera_Manager](capi-oh-camera-camera-manager.md) |
| 108 | - - [Camera_NotificationInfo](capi-oh-camera-oh-camera-notificationinfo.md) | ||
| 109 | - [CameraInput_Callbacks](capi-oh-camera-camerainput-callbacks.md) | 106 | - [CameraInput_Callbacks](capi-oh-camera-camerainput-callbacks.md) |
| 110 | - [Camera_Input](capi-oh-camera-camera-input.md) | 107 | - [Camera_Input](capi-oh-camera-camera-input.md) |
| 111 | - [CameraManager_Callbacks](capi-oh-camera-cameramanager-callbacks.md) | 108 | - [CameraManager_Callbacks](capi-oh-camera-cameramanager-callbacks.md) |
| @@ -1,74 +0,0 @@ | |||
| 1 | -# Interface (Notification) | ||
| 2 | -<!--Kit: Camera Kit--> | ||
| 3 | -<!--Subsystem: Multimedia--> | ||
| 4 | -<!--Owner: @qano--> | ||
| 5 | -<!--Designer: @leo_ysl--> | ||
| 6 | -<!--Tester: @xchaosioda--> | ||
| 7 | -<!--Adviser: @w_Machine_cc--> | ||
| 8 | - | ||
| 9 | - | ||
| 10 | -用于接收相机通知信息的接口类。 | ||
| 11 | - | ||
| 12 | -## 导入模块 | ||
| 13 | - | ||
| 14 | -```ts | ||
| 15 | -import { camera } from '@kit.CameraKit'; | ||
| 16 | -``` | ||
| 17 | -## onNotificationReceive | ||
| 18 | - | ||
| 19 | -onNotificationReceive(callback: Callback\<NotificationInfo\>): void; | ||
| 20 | - | ||
| 21 | -注册接收通知信息的回调,通过注册回调函数获取结果。使用callback异步回调。 | ||
| 22 | - | ||
| 23 | -**起始版本:** 26.0.0 | ||
| 24 | - | ||
| 25 | -**模型约束:** 此接口仅可在Stage模型下使用。 | ||
| 26 | - | ||
| 27 | -**原子化服务API:** 从API版本26.0.0开始,该接口支持在原子化服务中使用。 | ||
| 28 | - | ||
| 29 | -**系统能力:** SystemCapability.Multimedia.Camera.Core | ||
| 30 | - | ||
| 31 | -**参数:** | ||
| 32 | - | ||
| 33 | -| 参数名 | 类型 | 必填 | 说明 | | ||
| 34 | -| -------- | -------------------- | ---- | -------------------- | | ||
| 35 | -| callback | [NotificationInfo](arkts-apis-camera-t.md#notificationinfo) | 是 | 回调函数,返回当前通知信息。 | | ||
| 36 | - | ||
| 37 | -**示例:** | ||
| 38 | - | ||
| 39 | -```ts | ||
| 40 | -function RegisterNotificationReceive(session: camera.PhotoSession): void { | ||
| 41 | - session.onNotificationReceive((info: camera.NotificationInfo) => { | ||
| 42 | - // 监听信息回调,name为信息事件类型,value为信息事件状态。 | ||
| 43 | - console.info(`notification name: ${info.name}, value: ${info.value}.`); | ||
| 44 | - }) | ||
| 45 | -} | ||
| 46 | -``` | ||
| 47 | - | ||
| 48 | -## offNotificationReceive | ||
| 49 | - | ||
| 50 | -offNotificationReceive(callback?: Callback\<NotificationInfo\>): void; | ||
| 51 | - | ||
| 52 | -注销接收通知信息的回调。 | ||
| 53 | - | ||
| 54 | -**起始版本:** 26.0.0 | ||
| 55 | - | ||
| 56 | -**模型约束:** 此接口仅可在Stage模型下使用。 | ||
| 57 | - | ||
| 58 | -**原子化服务API:** 从API版本26.0.0开始,该接口支持在原子化服务中使用。 | ||
| 59 | - | ||
| 60 | -**系统能力:** SystemCapability.Multimedia.Camera.Core | ||
| 61 | - | ||
| 62 | -**参数:** | ||
| 63 | - | ||
| 64 | -| 参数名 | 类型 | 必填 | 说明 | | ||
| 65 | -| -------- | -------------------- | ---- | -------------------- | | ||
| 66 | -| callback | [NotificationInfo](arkts-apis-camera-t.md#notificationinfo) | 否 | 回调函数,返回当前通知信息。如果指定参数则取消对应callback,callback对象如果为空或为匿名函数,则取消所有callback。 | | ||
| 67 | - | ||
| 68 | -**示例:** | ||
| 69 | - | ||
| 70 | -```ts | ||
| 71 | -function UnregisterNotificationReceive(session: camera.PhotoSession): void { | ||
| 72 | - session.offNotificationReceive(); | ||
| 73 | -} | ||
| 74 | -``` | ||
| @@ -537,39 +537,6 @@ | |||
| 537 | | EXPOSURE_STATE_SCAN | 0 | 曝光处于扫描状态。 | | 537 | | EXPOSURE_STATE_SCAN | 0 | 曝光处于扫描状态。 | |
| 538 | | EXPOSURE_STATE_CONVERGED | 1 | 曝光已经收敛。 | | 538 | | EXPOSURE_STATE_CONVERGED | 1 | 曝光已经收敛。 | |
| 539 | 539 | ||
| 540 | -## NotificationName | ||
| 541 | - | ||
| 542 | -枚举,通知的事件名。 | ||
| 543 | - | ||
| 544 | -**起始版本:** 26.0.0 | ||
| 545 | - | ||
| 546 | -**模型约束:** 此接口仅可在Stage模型下使用。 | ||
| 547 | - | ||
| 548 | -**原子化服务API:** 从API版本26.0.0开始,该接口支持在原子化服务中使用。 | ||
| 549 | - | ||
| 550 | -**系统能力:** SystemCapability.Multimedia.Camera.Core | ||
| 551 | - | ||
| 552 | -| 名称 | 值 | 说明 | | ||
| 553 | -| ------------------------- | ---- | ------------ | | ||
| 554 | -| DEFOCUS_FROM_PROXIMITY | 0 | 对焦物体和镜头距离过近的事件。 | | ||
| 555 | - | ||
| 556 | -## ProximityStateForFocus | ||
| 557 | - | ||
| 558 | -对焦物体与镜头之间距离状态的枚举。 | ||
| 559 | - | ||
| 560 | -**起始版本:** 26.0.0 | ||
| 561 | - | ||
| 562 | -**模型约束:** 此接口仅可在Stage模型下使用。 | ||
| 563 | - | ||
| 564 | -**原子化服务API:** 从API版本26.0.0开始,该接口支持在原子化服务中使用。 | ||
| 565 | - | ||
| 566 | -**系统能力:** SystemCapability.Multimedia.Camera.Core | ||
| 567 | - | ||
| 568 | -| 名称 | 值 | 说明 | | ||
| 569 | -| ------------------------- | ---- | ------------ | | ||
| 570 | -| IN_RANGE_RAISE_NONE | 0 | 对焦物体和镜头距离合理。 | | ||
| 571 | -| OUT_OF_RANGE_RAISE_REQUIRED | 1 | 对焦物体和镜头距离过近。 | | ||
| 572 | - | ||
| 573 | ## AutomotiveCameraPosition | 540 | ## AutomotiveCameraPosition |
| 574 | 541 | ||
| 575 | 表示Car设备摄像头位置的枚举。 | 542 | 表示Car设备摄像头位置的枚举。 |
| @@ -297,7 +297,7 @@ | |||
| 297 | | type | [MetadataObjectType](arkts-apis-camera-e.md#metadataobjecttype) | 是 | 否 | metadata 类型。 | | 297 | | type | [MetadataObjectType](arkts-apis-camera-e.md#metadataobjecttype) | 是 | 否 | metadata 类型。 | |
| 298 | | timestamp | number | 是 | 否 | 当前时间戳。单位为纳秒(ns)。| | 298 | | timestamp | number | 是 | 否 | 当前时间戳。单位为纳秒(ns)。| |
| 299 | | boundingBox | [Rect](#rect) | 是 | 否 | metadata 区域框。 | | 299 | | boundingBox | [Rect](#rect) | 是 | 否 | metadata 区域框。 | |
| 300 | -| isLockFocusTracked | boolean | 是 | 是 | 是否已锁定焦点跟踪。true表示已锁定,false表示未锁定。 | | 300 | +| isLockFocusTracked | boolean | 是 | 是 | 是否已锁定焦点跟踪。true表示已锁定,false表示未锁定。**起始版本:** 26.0.0<br> **模型约束:** 此接口仅可在Stage模型下使用。<br>**原子化服务API:** 从API版本26.0.0开始,该接口支持在原子化服务中使用。 | |
| 301 | 301 | ||
| 302 | ## MetadataBasicFaceObject | 302 | ## MetadataBasicFaceObject |
| 303 | 303 | ||
| @@ -519,20 +519,3 @@ | |||
| 519 | | -------- | ---------- | -------- |-----| ---------- | | 519 | | -------- | ---------- | -------- |-----| ---------- | |
| 520 | | zoomRatio | number | 是 | 否 | 可变焦距比。 | | 520 | | zoomRatio | number | 是 | 否 | 可变焦距比。 | |
| 521 | | equivalentFocalLength | number | 是 | 否 | 当前焦距比对应的等效焦距值。 | | 521 | | equivalentFocalLength | number | 是 | 否 | 当前焦距比对应的等效焦距值。 | |
| 522 | - | ||
| 523 | -## DefocusFromProximityNotificationInfo | ||
| 524 | - | ||
| 525 | -对焦物体和镜头距离过近导致失焦事件的通知对象。 | ||
| 526 | - | ||
| 527 | -**起始版本:** 26.0.0 | ||
| 528 | - | ||
| 529 | -**模型约束:** 此接口仅可在Stage模型下使用。 | ||
| 530 | - | ||
| 531 | -**原子化服务API:** 从API版本26.0.0开始,该接口支持在原子化服务中使用。 | ||
| 532 | - | ||
| 533 | -**系统能力:** SystemCapability.Multimedia.Camera.Core | ||
| 534 | - | ||
| 535 | -| 名称 | 类型 | 只读 | 可选 | 说明 | | ||
| 536 | -| -------- | -------------------------------------------------------------- |----- |---| --------------| | ||
| 537 | -| name | [NotificationName](arkts-apis-camera-e.md#notificationname) | 是 | 否 | 通知事件名称。 | | ||
| 538 | -| value | [ProximityStateForFocus](arkts-apis-camera-e.md#proximitystateforfocus) | 是 | 否 | 通知事件状态。 | | ||
| @@ -25,25 +25,3 @@ type ImageType = image.Image | image.Picture | |||
| 25 | | [image.Image](../apis-image-kit/arkts-apis-image-Image.md) | 图片容器类型,用于获取全质量图。 | | 25 | | [image.Image](../apis-image-kit/arkts-apis-image-Image.md) | 图片容器类型,用于获取全质量图。 | |
| 26 | | [image.Picture](../apis-image-kit/arkts-apis-image-Picture.md) | 图片容器类型,用于获取未压缩图(YUV)。| | 26 | | [image.Picture](../apis-image-kit/arkts-apis-image-Picture.md) | 图片容器类型,用于获取未压缩图(YUV)。| |
| 27 | 27 | ||
| 28 | -## NotificationInfo | ||
| 29 | - | ||
| 30 | -type NotificationInfo = DefocusFromProximityNotificationInfo | ||
| 31 | - | ||
| 32 | -通知信息类型,用于获取微距缩放场景下对焦物体距离镜头过近导致对焦模糊的事件。 | ||
| 33 | - | ||
| 34 | -> **说明:** | ||
| 35 | -> | ||
| 36 | -> 该通知仅在微距模式下且缩放倍率大于等于 4 倍时触发。 | ||
| 37 | -> 可以通过[enableMacro](../apis-camera-kit/arkts-apis-camera-Macro.md#enablemacro19)设置微距能力,并使用[setZoomRatio](../apis-camera-kit/arkts-apis-camera-Zoom.md#setzoomratio11)设置缩放倍率。 | ||
| 38 | - | ||
| 39 | -**起始版本:** 26.0.0 | ||
| 40 | - | ||
| 41 | -**模型约束:** 此接口仅可在Stage模型下使用。 | ||
| 42 | - | ||
| 43 | -**原子化服务API:** 从API版本26.0.0开始,该接口支持在原子化服务中使用。 | ||
| 44 | - | ||
| 45 | -**系统能力:** SystemCapability.Multimedia.Camera.Core | ||
| 46 | - | ||
| 47 | -| 类型 | 说明 | | ||
| 48 | -|---------|---------------------------------------------------------------| | ||
| 49 | -| [DefocusFromProximityNotificationInfo](arkts-apis-camera-i.md#defocusfromproximitynotificationinfo) | 通知事件类型,对焦物体和镜头距离过近导致对焦模糊事件的通知对象。 | | ||
| @@ -94,8 +94,6 @@ | |||
| 94 | | [OH_Camera_OISAxes](#oh_camera_oisaxes) | OH_Camera_OISAxes | 光学防抖(OIS)轴枚举。 | | 94 | | [OH_Camera_OISAxes](#oh_camera_oisaxes) | OH_Camera_OISAxes | 光学防抖(OIS)轴枚举。 | |
| 95 | | [OH_Camera_ExposureState](#oh_camera_exposurestate) | OH_Camera_ExposureState | 枚举相机曝光状态。 | | 95 | | [OH_Camera_ExposureState](#oh_camera_exposurestate) | OH_Camera_ExposureState | 枚举相机曝光状态。 | |
| 96 | | [OH_Camera_MetadataObjectEmotion](#oh_camera_metadataobjectemotion) | OH_Camera_MetadataObjectEmotion | 元数据对象情绪类型枚举。 | | 96 | | [OH_Camera_MetadataObjectEmotion](#oh_camera_metadataobjectemotion) | OH_Camera_MetadataObjectEmotion | 元数据对象情绪类型枚举。 | |
| 97 | -| [OH_Camera_NotificationName](#oh_camera_notificationname) | OH_Camera_NotificationName | 相机通知名称枚举类型。 | | ||
| 98 | -| [OH_Camera_ProximityStateForFocus](#oh_camera_proximitystateforfocus) | OH_Camera_ProximityStateForFocus | 对焦物体和相机距离状态枚举类型。 | | ||
| 99 | 97 | ||
| 100 | ### 函数 | 98 | ### 函数 |
| 101 | 99 | ||
| @@ -1,105 +0,0 @@ | |||
| 1 | -# camera_notification_info.h | ||
| 2 | -<!--Kit: Camera Kit--> | ||
| 3 | -<!--Subsystem: Multimedia--> | ||
| 4 | -<!--Owner: @qano--> | ||
| 5 | -<!--Designer: @leo_ysl--> | ||
| 6 | -<!--Tester: @xchaosioda--> | ||
| 7 | -<!--Adviser: @w_Machine_cc--> | ||
| 8 | - | ||
| 9 | -## 概述 | ||
| 10 | - | ||
| 11 | -声明相机通知信息。 | ||
| 12 | - | ||
| 13 | -**引用文件:** <ohcamera/camera_notification_info.h> | ||
| 14 | - | ||
| 15 | -**库:** libohcamera.so | ||
| 16 | - | ||
| 17 | -**系统能力:** SystemCapability.Multimedia.Camera.Core | ||
| 18 | - | ||
| 19 | -**起始版本:** 26.0.0 | ||
| 20 | - | ||
| 21 | -**相关模块:** [OH_Camera](capi-oh-camera.md) | ||
| 22 | - | ||
| 23 | -## 汇总 | ||
| 24 | - | ||
| 25 | -### 结构体 | ||
| 26 | - | ||
| 27 | -| 名称 | typedef关键字 | 描述 | | ||
| 28 | -| -- | -- | -- | | ||
| 29 | -| [OH_Camera_NotificationInfo](capi-oh-camera-oh-camera-notificationinfo.md) | OH_Camera_NotificationInfo | 通知信息扩展结构体。 | | ||
| 30 | - | ||
| 31 | -### 函数 | ||
| 32 | - | ||
| 33 | -| 名称 | typedef关键字 | 描述 | | ||
| 34 | -| -- | -- | -- | | ||
| 35 | -| [Camera_ErrorCode OH_CameraNotificationInfo_GetNotificationName(const OH_Camera_NotificationInfo* notificationInfo, OH_Camera_NotificationName* name)](#oh_cameranotificationinfo_getnotificationname) | - | 从摄像头通知信息实例中获取通知名称。 | | ||
| 36 | -| [Camera_ErrorCode OH_CameraNotificationInfo_GetProximityStateForFocus(const OH_Camera_NotificationInfo* notificationInfo, OH_Camera_ProximityStateForFocus* state)](#oh_cameranotificationinfo_getproximitystateforfocus) | - | 从相机通知信息实例中获取对焦物体与镜头是否过近的状态。 | | ||
| 37 | -| [void OH_CameraNotificationInfo_Destroy(OH_Camera_NotificationInfo* notificationInfo)](#oh_cameranotificationinfo_destroy) | - | 销毁相机通知信息实例。 | | ||
| 38 | - | ||
| 39 | -### OH_CameraNotificationInfo_GetNotificationName() | ||
| 40 | - | ||
| 41 | -```c | ||
| 42 | -Camera_ErrorCode OH_CameraNotificationInfo_GetNotificationName(const OH_Camera_NotificationInfo* notificationInfo, OH_Camera_NotificationName* name) | ||
| 43 | -``` | ||
| 44 | - | ||
| 45 | -**描述** | ||
| 46 | - | ||
| 47 | -从摄像头通知信息实例中获取通知名称。 | ||
| 48 | - | ||
| 49 | -**起始版本:** 26.0.0 | ||
| 50 | - | ||
| 51 | -**参数:** | ||
| 52 | - | ||
| 53 | -| 参数项 | 描述 | | ||
| 54 | -| -- | -- | | ||
| 55 | -| const OH_Camera_NotificationInfo* notificationInfo | 指向OH_Camera_NotificationInfo实例的指针。 | | ||
| 56 | -| [OH_Camera_NotificationName](capi-camera-h.md#oh_camera_notificationname)* name| 指向通知名称的指针,该名称是一个OH_Camera_NotificationName实例。 | | ||
| 57 | - | ||
| 58 | -**返回:** | ||
| 59 | - | ||
| 60 | -| 类型 | 说明 | | ||
| 61 | -| -- | -- | | ||
| 62 | -| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | CAMERA_OK:方法调用成功。<br> CAMERA_INVALID_ARGUMENT:参数丢失或参数类型错误。 | | ||
| 63 | - | ||
| 64 | -### OH_CameraNotificationInfo_GetProximityStateForFocus() | ||
| 65 | - | ||
| 66 | -```c | ||
| 67 | -Camera_ErrorCode OH_CameraNotificationInfo_GetProximityStateForFocus(const OH_Camera_NotificationInfo* notificationInfo, OH_Camera_ProximityStateForFocus* state) | ||
| 68 | -``` | ||
| 69 | - | ||
| 70 | -**描述** | ||
| 71 | - | ||
| 72 | -从相机通知信息实例中获取对焦物体与镜头是否过近的状态。 | ||
| 73 | - | ||
| 74 | -**起始版本:** 26.0.0 | ||
| 75 | - | ||
| 76 | -**参数:** | ||
| 77 | - | ||
| 78 | -| 参数项 | 描述 | | ||
| 79 | -| -- | -- | | ||
| 80 | -| const OH_Camera_NotificationInfo* notificationInfo | 指向OH_Camera_NotificationInfo实例的指针。 | | ||
| 81 | -| [OH_Camera_ProximityStateForFocus](capi-camera-h.md#oh_camera_proximitystateforfocus)* state| 指向对焦距离状态的指针,该状态是一个OH_Camera_ProximityStateForFocus实例。 | | ||
| 82 | - | ||
| 83 | -**返回:** | ||
| 84 | - | ||
| 85 | -| 类型 | 说明 | | ||
| 86 | -| -- | -- | | ||
| 87 | -| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | CAMERA_OK:方法调用成功。<br> CAMERA_INVALID_ARGUMENT:参数丢失或参数类型错误。 | | ||
| 88 | - | ||
| 89 | -### OH_CameraNotificationInfo_Destroy() | ||
| 90 | - | ||
| 91 | -```c | ||
| 92 | -void OH_CameraNotificationInfo_Destroy(OH_Camera_NotificationInfo* notificationInfo) | ||
| 93 | -``` | ||
| 94 | - | ||
| 95 | -**描述** | ||
| 96 | - | ||
| 97 | -销毁相机通知信息实例。 | ||
| 98 | - | ||
| 99 | -**起始版本:** 26.0.0 | ||
| 100 | - | ||
| 101 | -**参数:** | ||
| 102 | - | ||
| 103 | -| 参数项 | 描述 | | ||
| 104 | -| -- | -- | | ||
| 105 | -| OH_Camera_NotificationInfo* notificationInfo |指向待销毁的OH_Camera_NotificationInfo实例的指针。 | | ||
| @@ -164,10 +164,7 @@ | |||
| 164 | | [Camera_ErrorCode OH_CaptureSession_DeleteZoomPointInfos(const Camera_CaptureSession* session, OH_Camera_ZoomPointInfo* zoomPointInfo)](#oh_capturesession_deletezoompointinfos) | - | 删除变焦点信息。 | | 164 | | [Camera_ErrorCode OH_CaptureSession_DeleteZoomPointInfos(const Camera_CaptureSession* session, OH_Camera_ZoomPointInfo* zoomPointInfo)](#oh_capturesession_deletezoompointinfos) | - | 删除变焦点信息。 | |
| 165 | | [bool OH_CaptureSession_IsLockFocusTrackingSupported(const Camera_CaptureSession* session)](#oh_capturesession_islockfocustrackingsupported) | - |查询是否支持锁定焦点跟踪。 | | 165 | | [bool OH_CaptureSession_IsLockFocusTrackingSupported(const Camera_CaptureSession* session)](#oh_capturesession_islockfocustrackingsupported) | - |查询是否支持锁定焦点跟踪。 | |
| 166 | | [Camera_ErrorCode OH_CaptureSession_LockFocusTracking(Camera_CaptureSession* session, Camera_Point focusPoint)](#oh_capturesession_lockfocustracking) | - | 锁定焦点跟踪,可通过[OH_CaptureSession_UnlockFocusTracking](#oh_capturesession_unlockfocustracking)解锁。 | | 166 | | [Camera_ErrorCode OH_CaptureSession_LockFocusTracking(Camera_CaptureSession* session, Camera_Point focusPoint)](#oh_capturesession_lockfocustracking) | - | 锁定焦点跟踪,可通过[OH_CaptureSession_UnlockFocusTracking](#oh_capturesession_unlockfocustracking)解锁。 | |
| 167 | -| [Camera_ErrorCode OH_CaptureSession_UnlockFocusTracking(Camera_CaptureSession* session)](#oh_capturesession_unlockfocustracking) | - | 解锁焦点追踪。 | | 167 | +| [Camera_ErrorCode OH_CaptureSession_UnlockFocusTracking(Camera_CaptureSession* session)](#oh_capturesession_unlockfocustracking) | - | 解锁焦点跟踪。 | |
| 168 | -| [typedef void (*OH_CaptureSession_OnNotificationReceive)(void* context, OH_Camera_NotificationInfo* notificationInfo)](#oh_capturesession_onnotificationreceive) | OH_CaptureSession_OnNotificationReceive | 定义相机通知信息事件的回调函数。 | | ||
| 169 | -| [Camera_ErrorCode OH_CaptureSession_RegisterNotificationReceivedCallback(const Camera_CaptureSession* session, void* context, OH_CaptureSession_OnNotificationReceive callback)](#oh_capturesession_registernotificationreceivedcallback) | - | 注册回调函数以监听接收到的相机通知信息事件。可以通过[OH_CaptureSession_UnregisterNotificationReceivedCallback](#oh_capturesession_unregisternotificationreceivedcallback)进行注销。 | | ||
| 170 | -| [Camera_ErrorCode OH_CaptureSession_UnregisterNotificationReceivedCallback(const Camera_CaptureSession* session,void* context, OH_CaptureSession_OnNotificationReceive callback)](#oh_capturesession_unregisternotificationreceivedcallback) | - | 注销监听相机通知信息接收事件的回调。 | | ||
| 171 | 168 | ||
| 172 | ## 函数说明 | 169 | ## 函数说明 |
| 173 | 170 | ||
| @@ -3440,74 +3437,3 @@ Camera_ErrorCode OH_CaptureSession_UnlockFocusTracking(Camera_CaptureSession* se | |||
| 3440 | | 类型 | 说明 | | 3437 | | 类型 | 说明 | |
| 3441 | | -- | -- | | 3438 | | -- | -- | |
| 3442 | | [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | CAMERA_OK:方法调用成功。<br> CAMERA_INVALID_ARGUMENT:参数丢失或者参数不正确。<br> CAMERA_SERVICE_FATAL_ERROR:相机服务异常。 | | 3439 | | [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | CAMERA_OK:方法调用成功。<br> CAMERA_INVALID_ARGUMENT:参数丢失或者参数不正确。<br> CAMERA_SERVICE_FATAL_ERROR:相机服务异常。 | |
| 3443 | - | ||
| 3444 | -### OH_CaptureSession_OnNotificationReceive() | ||
| 3445 | - | ||
| 3446 | -```c | ||
| 3447 | -typedef void (*OH_CaptureSession_OnNotificationReceive)(void* context, OH_Camera_NotificationInfo* notificationInfo) | ||
| 3448 | -``` | ||
| 3449 | - | ||
| 3450 | -**描述** | ||
| 3451 | - | ||
| 3452 | -定义相机通知信息事件的回调函数。 | ||
| 3453 | - | ||
| 3454 | -**起始版本:** 26.0.0 | ||
| 3455 | - | ||
| 3456 | -**参数:** | ||
| 3457 | - | ||
| 3458 | -| 参数项 | 描述 | | ||
| 3459 | -| -- | -- | | ||
| 3460 | -| void* context | 指向注册回调时传入的用户自定义上下文的指针。 | | ||
| 3461 | -| [OH_Camera_NotificationInfo](capi-oh-camera-oh-camera-notificationinfo.md)* notificationInfo | 指向OH_Camera_NotificationInfo实例的指针。 | | ||
| 3462 | - | ||
| 3463 | -### OH_CaptureSession_RegisterNotificationReceivedCallback() | ||
| 3464 | - | ||
| 3465 | -```c | ||
| 3466 | -Camera_ErrorCode OH_CaptureSession_RegisterNotificationReceivedCallback(const Camera_CaptureSession* session, void* context, OH_CaptureSession_OnNotificationReceive callback) | ||
| 3467 | -``` | ||
| 3468 | - | ||
| 3469 | -**描述** | ||
| 3470 | - | ||
| 3471 | -注册回调函数以监听接收到的相机通知信息事件。可以通过[OH_CaptureSession_UnregisterNotificationReceivedCallback](#oh_capturesession_unregisternotificationreceivedcallback)进行注销。 | ||
| 3472 | - | ||
| 3473 | -**起始版本:** 26.0.0 | ||
| 3474 | - | ||
| 3475 | -**参数:** | ||
| 3476 | - | ||
| 3477 | -| 参数项 | 描述 | | ||
| 3478 | -| -- | -- | | ||
| 3479 | -| [const Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | 指向Camera_CaptureSession实例的指针。 | | ||
| 3480 | -| void* context | 指向注册回调时传入的用户自定义上下文的指针。 | | ||
| 3481 | -| [OH_CaptureSession_OnNotificationReceive](#oh_capturesession_onnotificationreceive) callback | 回调函数,用于接收相机通知信息,类型为OH_CaptureSession_OnNotificationReceive实例。 | | ||
| 3482 | - | ||
| 3483 | -**返回:** | ||
| 3484 | - | ||
| 3485 | -| 类型 | 说明 | | ||
| 3486 | -| -- | -- | | ||
| 3487 | -| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | CAMERA_OK:方法调用成功。<br> CAMERA_INVALID_ARGUMENT:参数丢失或者参数不正确。 | | ||
| 3488 | - | ||
| 3489 | -### OH_CaptureSession_UnregisterNotificationReceivedCallback() | ||
| 3490 | - | ||
| 3491 | -```c | ||
| 3492 | -Camera_ErrorCode OH_CaptureSession_UnregisterNotificationReceivedCallback(const Camera_CaptureSession* session, void* context, OH_CaptureSession_OnNotificationReceive callback) | ||
| 3493 | -``` | ||
| 3494 | - | ||
| 3495 | -**描述** | ||
| 3496 | - | ||
| 3497 | -注销监听相机通知信息接收事件的回调。 | ||
| 3498 | - | ||
| 3499 | -**起始版本:** 26.0.0 | ||
| 3500 | - | ||
| 3501 | -**参数:** | ||
| 3502 | - | ||
| 3503 | -| 参数项 | 描述 | | ||
| 3504 | -| -- | -- | | ||
| 3505 | -| [const Camera_CaptureSession](capi-oh-camera-camera-capturesession.md)* session | 指向Camera_CaptureSession实例的指针。 | | ||
| 3506 | -| void* context | 指向注册回调时传入的用户自定义上下文的指针。 | | ||
| 3507 | -| [OH_CaptureSession_OnNotificationReceive](#oh_capturesession_onnotificationreceive) callback | 表示相机通知信息事件的回调函数,该回调是一个OH_CaptureSession_OnNotificationReceive实例。 | | ||
| 3508 | - | ||
| 3509 | -**返回:** | ||
| 3510 | - | ||
| 3511 | -| 类型 | 说明 | | ||
| 3512 | -| -- | -- | | ||
| 3513 | -| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | CAMERA_OK:方法调用成功。<br> CAMERA_INVALID_ARGUMENT:参数丢失或者参数不正确。 | | ||
| @@ -1,21 +0,0 @@ | |||
| 1 | -# OH_Camera_NotificationInfo | ||
| 2 | -<!--Kit: Camera Kit--> | ||
| 3 | -<!--Subsystem: Multimedia--> | ||
| 4 | -<!--Owner: @qano--> | ||
| 5 | -<!--Designer: @leo_ysl--> | ||
| 6 | -<!--Tester: @xchaosioda--> | ||
| 7 | -<!--Adviser: @w_Machine_cc--> | ||
| 8 | - | ||
| 9 | -```c | ||
| 10 | -typedef struct OH_Camera_NotificationInfo OH_Camera_NotificationInfo | ||
| 11 | -``` | ||
| 12 | - | ||
| 13 | -## 概述 | ||
| 14 | - | ||
| 15 | -通知信息扩展结构体。 | ||
| 16 | - | ||
| 17 | -**起始版本:** 26.0.0 | ||
| 18 | - | ||
| 19 | -**相关模块:** [OH_Camera](capi-oh-camera.md) | ||
| 20 | - | ||
| 21 | -**所在头文件:** [camera_notification_info.h](capi-camera-notification-info.md) | ||
| @@ -8451,3 +8451,134 @@ function getColorReservation(session: camera.VideoSessionForSys): camera.ColorRe | |||
| 8451 | return colorReservation; | 8451 | return colorReservation; |
| 8452 | } | 8452 | } |
| 8453 | ``` | 8453 | ``` |
| 8454 | + | ||
| 8455 | +### NotificationName | ||
| 8456 | + | ||
| 8457 | +枚举,通知的事件名。 | ||
| 8458 | + | ||
| 8459 | +**起始版本:** 26.0.0 | ||
| 8460 | + | ||
| 8461 | +**模型约束:** 此接口仅可在Stage模型下使用。 | ||
| 8462 | + | ||
| 8463 | +**原子化服务API:** 从API版本26.0.0开始,该接口支持在原子化服务中使用。 | ||
| 8464 | + | ||
| 8465 | +**系统能力:** SystemCapability.Multimedia.Camera.Core | ||
| 8466 | + | ||
| 8467 | +| 名称 | 值 | 说明 | | ||
| 8468 | +| ------------------------- | ---- | ------------ | | ||
| 8469 | +| DEFOCUS_FROM_PROXIMITY | 0 | 对焦物体和镜头距离过近的事件。 | | ||
| 8470 | + | ||
| 8471 | +### ProximityStateForFocus | ||
| 8472 | + | ||
| 8473 | +对焦物体与镜头之间距离状态的枚举。 | ||
| 8474 | + | ||
| 8475 | +**起始版本:** 26.0.0 | ||
| 8476 | + | ||
| 8477 | +**模型约束:** 此接口仅可在Stage模型下使用。 | ||
| 8478 | + | ||
| 8479 | +**原子化服务API:** 从API版本26.0.0开始,该接口支持在原子化服务中使用。 | ||
| 8480 | + | ||
| 8481 | +**系统能力:** SystemCapability.Multimedia.Camera.Core | ||
| 8482 | + | ||
| 8483 | +| 名称 | 值 | 说明 | | ||
| 8484 | +| ------------------------- | ---- | ------------ | | ||
| 8485 | +| IN_RANGE_RAISE_NONE | 0 | 对焦物体和镜头距离合理。 | | ||
| 8486 | +| OUT_OF_RANGE_RAISE_REQUIRED | 1 | 对焦物体和镜头距离过近。 | | ||
| 8487 | + | ||
| 8488 | +### onNotificationReceive | ||
| 8489 | + | ||
| 8490 | +onNotificationReceive(callback: Callback\<NotificationInfo\>): void; | ||
| 8491 | + | ||
| 8492 | +注册接收通知信息的回调,通过注册回调函数获取结果。使用callback异步回调。 | ||
| 8493 | + | ||
| 8494 | +**起始版本:** 26.0.0 | ||
| 8495 | + | ||
| 8496 | +**模型约束:** 此接口仅可在Stage模型下使用。 | ||
| 8497 | + | ||
| 8498 | +**原子化服务API:** 从API版本26.0.0开始,该接口支持在原子化服务中使用。 | ||
| 8499 | + | ||
| 8500 | +**系统能力:** SystemCapability.Multimedia.Camera.Core | ||
| 8501 | + | ||
| 8502 | +**参数:** | ||
| 8503 | + | ||
| 8504 | +| 参数名 | 类型 | 必填 | 说明 | | ||
| 8505 | +| -------- | -------------------- | ---- | -------------------- | | ||
| 8506 | +| callback | Callback\<[NotificationInfo](#notificationinfo)\> | 是 | 回调函数,返回当前通知信息。 | | ||
| 8507 | + | ||
| 8508 | +**示例:** | ||
| 8509 | + | ||
| 8510 | +```ts | ||
| 8511 | +function RegisterNotificationReceive(session: camera.PhotoSession): void { | ||
| 8512 | + session.onNotificationReceive((info: camera.NotificationInfo) => { | ||
| 8513 | + // 监听信息回调,name为信息事件类型,value为信息事件状态。 | ||
| 8514 | + console.info(`notification name: ${info.name}, value: ${info.value}.`); | ||
| 8515 | + }) | ||
| 8516 | +} | ||
| 8517 | +``` | ||
| 8518 | + | ||
| 8519 | +### offNotificationReceive | ||
| 8520 | + | ||
| 8521 | +offNotificationReceive(callback?: Callback\<NotificationInfo\>): void; | ||
| 8522 | + | ||
| 8523 | +注销接收通知信息的回调。 | ||
| 8524 | + | ||
| 8525 | +**起始版本:** 26.0.0 | ||
| 8526 | + | ||
| 8527 | +**模型约束:** 此接口仅可在Stage模型下使用。 | ||
| 8528 | + | ||
| 8529 | +**原子化服务API:** 从API版本26.0.0开始,该接口支持在原子化服务中使用。 | ||
| 8530 | + | ||
| 8531 | +**系统能力:** SystemCapability.Multimedia.Camera.Core | ||
| 8532 | + | ||
| 8533 | +**参数:** | ||
| 8534 | + | ||
| 8535 | +| 参数名 | 类型 | 必填 | 说明 | | ||
| 8536 | +| -------- | -------------------- | ---- | -------------------- | | ||
| 8537 | +| callback | Callback\<[NotificationInfo](#notificationinfo)\> | 否 | 回调函数,返回当前通知信息。如果指定参数则取消对应callback,callback对象如果为空或为匿名函数,则取消所有callback。 | | ||
| 8538 | + | ||
| 8539 | +**示例:** | ||
| 8540 | + | ||
| 8541 | +```ts | ||
| 8542 | +function UnregisterNotificationReceive(session: camera.PhotoSession): void { | ||
| 8543 | + session.offNotificationReceive(); | ||
| 8544 | +} | ||
| 8545 | +``` | ||
| 8546 | +### DefocusFromProximityNotificationInfo | ||
| 8547 | + | ||
| 8548 | +对焦物体和镜头距离过近导致失焦事件的通知对象。 | ||
| 8549 | + | ||
| 8550 | +**起始版本:** 26.0.0 | ||
| 8551 | + | ||
| 8552 | +**模型约束:** 此接口仅可在Stage模型下使用。 | ||
| 8553 | + | ||
| 8554 | +**原子化服务API:** 从API版本26.0.0开始,该接口支持在原子化服务中使用。 | ||
| 8555 | + | ||
| 8556 | +**系统能力:** SystemCapability.Multimedia.Camera.Core | ||
| 8557 | + | ||
| 8558 | +| 名称 | 类型 | 只读 | 可选 | 说明 | | ||
| 8559 | +| -------- | -------------------------------------------------------------- |----- |---| --------------| | ||
| 8560 | +| name | [NotificationName](#notificationname) | 是 | 否 | 通知事件名称。 | | ||
| 8561 | +| value | [ProximityStateForFocus](#proximitystateforfocus) | 是 | 否 | 通知事件状态。 | | ||
| 8562 | + | ||
| 8563 | +### NotificationInfo | ||
| 8564 | + | ||
| 8565 | +type NotificationInfo = DefocusFromProximityNotificationInfo | ||
| 8566 | + | ||
| 8567 | +通知信息类型,用于获取微距缩放场景下对焦物体距离镜头过近导致对焦模糊的事件。 | ||
| 8568 | + | ||
| 8569 | +> **说明:** | ||
| 8570 | +> | ||
| 8571 | +> 该通知仅在微距模式下且缩放倍率大于等于 4 倍时触发。 | ||
| 8572 | +> 可以通过[enableMacro](../apis-camera-kit/arkts-apis-camera-Macro.md#enablemacro19)设置微距能力,并使用[setZoomRatio](../apis-camera-kit/arkts-apis-camera-Zoom.md#setzoomratio11)设置缩放倍率。 | ||
| 8573 | + | ||
| 8574 | +**起始版本:** 26.0.0 | ||
| 8575 | + | ||
| 8576 | +**模型约束:** 此接口仅可在Stage模型下使用。 | ||
| 8577 | + | ||
| 8578 | +**原子化服务API:** 从API版本26.0.0开始,该接口支持在原子化服务中使用。 | ||
| 8579 | + | ||
| 8580 | +**系统能力:** SystemCapability.Multimedia.Camera.Core | ||
| 8581 | + | ||
| 8582 | +| 类型 | 说明 | | ||
| 8583 | +|---------|---------------------------------------------------------------| | ||
| 8584 | +| [DefocusFromProximityNotificationInfo](#defocusfromproximitynotificationinfo) | 通知事件类型,对焦物体和镜头距离过近导致对焦模糊事件的通知对象。 | | ||