diff --git a/multimedia/camera_framework/camera.ndk.json b/multimedia/camera_framework/camera.ndk.json index 8ebef26bc7a7a8ab67830a29f57548a6ce2a73a0..ff95d61ee10ccdf7ce6e97dad268cb9889d902b4 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 80c46e731e9f3baaa82608d2d67c8d4abf564831..5bf9fd4c379f8dd1ccf19f9a1ed2b7457e62deb6 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