From 86682e355215fa37d25589d78a3e5ba1fbd26b5c Mon Sep 17 00:00:00 2001 From: wangdongyusky Date: Thu, 31 Jul 2025 10:33:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=85=E7=BA=A7=E5=BE=AE=E8=B7=9D=E7=9B=91?= =?UTF-8?q?=E5=90=AC=E6=8E=A5=E5=8F=A3=E5=BC=80=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangdongyusky --- multimedia/camera_framework/camera.ndk.json | 8 +++++ multimedia/camera_framework/capture_session.h | 33 +++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/multimedia/camera_framework/camera.ndk.json b/multimedia/camera_framework/camera.ndk.json index 8ebef26bc..ff95d61ee 100644 --- a/multimedia/camera_framework/camera.ndk.json +++ b/multimedia/camera_framework/camera.ndk.json @@ -726,5 +726,13 @@ { "first_introduced": "20", "name": "OH_CaptureSession_UnregisterControlCenterEffectStatusChangeCallback" + }, + { + "first_introduced": "20", + "name": "OH_CaptureSession_RegisterMacroStatusChangeCallback" + }, + { + "first_introduced": "20", + "name": "OH_CaptureSession_UnregisterMacroStatusChangeCallback" } ] diff --git a/multimedia/camera_framework/capture_session.h b/multimedia/camera_framework/capture_session.h index 80c46e731..5bf9fd4c3 100644 --- a/multimedia/camera_framework/capture_session.h +++ b/multimedia/camera_framework/capture_session.h @@ -1163,6 +1163,39 @@ Camera_ErrorCode OH_CaptureSession_RegisterControlCenterEffectStatusChangeCallba Camera_ErrorCode OH_CaptureSession_UnregisterControlCenterEffectStatusChangeCallback(Camera_CaptureSession* session, OH_CaptureSession_OnControlCenterEffectStatusChange controlCenterEffectStatusChange); +/** + * @brief Register macro status change event callback. + * + * @param session Pointer to the {@link Camera_CaptureSession} instance. + * @param macroStatusChange The {@link OH_CaptureSession_OnMacroStatusChange} to be registered. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 20 + */ +Camera_ErrorCode OH_CaptureSession_RegisterMacroStatusChangeCallback( + Camera_CaptureSession* session, OH_CaptureSession_OnMacroStatusChange macroStatusChange); + +/** + * @brief Unregister macro status change callback. + * + * @param session Pointer to the {@link Camera_CaptureSession} instance. + * @param macroStatusChange The {@link OH_CaptureSession_OnMacroStatusChange} to be unregistered. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 20 + */ +Camera_ErrorCode OH_CaptureSession_UnregisterMacroStatusChangeCallback( + Camera_CaptureSession* session, OH_CaptureSession_OnMacroStatusChange macroStatusChange); + +/** + * @brief Capture session macro status change callback. + * + * @param session Pointer to the {@link Camera_CaptureSession} which deliver the callback. + * @param isMacroDetected The macro detection result which delivered by the callback. + * @since 20 + */ +typedef void (*OH_CaptureSession_OnMacroStatusChange)(Camera_CaptureSession* session, bool isMacroDetected); + #ifdef __cplusplus } #endif -- Gitee