From 86ff30930efec8c0ff60e79c4a0ceff1fb5d2435 Mon Sep 17 00:00:00 2001 From: xiongyangyang Date: Wed, 9 Apr 2025 14:51:51 +0800 Subject: [PATCH] system pressure level Signed-off-by: xiongyangyang --- multimedia/camera_framework/camera.h | 33 ++++++++++++++++++ multimedia/camera_framework/capture_session.h | 34 +++++++++++++++++++ 2 files changed, 67 insertions(+) diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index 274390abd..70b742de6 100644 --- a/multimedia/camera_framework/camera.h +++ b/multimedia/camera_framework/camera.h @@ -1152,6 +1152,39 @@ typedef struct Camera_ConcurrentInfo { uint32_t modeAndCapabilitySize; } Camera_ConcurrentInfo; +/** + * @brief Enum for system pressure level. + * + * @since 20 + * @version 1.0 + */ +typedef enum Camera_SystemPressureLevel { + /** + * System pressure normal. + */ + SYSTEM_PRESSURE_NORMAL = 0, + + /** + * System pressure mild. + */ + SYSTEM_PRESSURE_MILD = 1, + + /** + * System pressure severe. + */ + SYSTEM_PRESSURE_SEVERE = 2, + + /** + * System pressure critical. + */ + SYSTEM_PRESSURE_CRITICAL = 3, + + /** + * System pressure shutdown. + */ + SYSTEM_PRESSURE_SHUTDOWN = 4 +} Camera_SystemPressureLevel; + #ifdef __cplusplus } #endif diff --git a/multimedia/camera_framework/capture_session.h b/multimedia/camera_framework/capture_session.h index bbccf4e81..ed21a3846 100644 --- a/multimedia/camera_framework/capture_session.h +++ b/multimedia/camera_framework/capture_session.h @@ -104,6 +104,16 @@ typedef void (*OH_CaptureSession_OnSmoothZoomInfo)(Camera_CaptureSession* sessio typedef void (*OH_CaptureSession_OnAutoDeviceSwitchStatusChange)(Camera_CaptureSession* session, Camera_AutoDeviceSwitchStatusInfo* autoDeviceSwitchStatusInfo); +/** + * @brief Capture session system pressure level callback. + * + * @param session the {@link Camera_CaptureSession} which deliver the callback. + * @param systemPressureLevel the {@link Camera_SystemPressureLevel} which delivered by the callback. + * @since 20 + */ +typedef void (*OH_CaptureSession_OnSystemPressureLevel)(Camera_CaptureSession* session, + Camera_SystemPressureLevel* systemPressureLevel); + /** * @brief A listener for capture session. * @@ -929,6 +939,30 @@ Camera_ErrorCode OH_CaptureSession_EnableAutoDeviceSwitch(Camera_CaptureSession* Camera_ErrorCode OH_CaptureSession_SetQualityPrioritization( Camera_CaptureSession* session, Camera_QualityPrioritization qualityPrioritization); +/** + * @brief Register system pressure level callback. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param systemPressureLevel the {@link OH_CaptureSession_OnSystemPressureLevel} 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_RegisterSystemPressureLevelCallback(Camera_CaptureSession* session, + OH_CaptureSession_OnSystemPressureLevel systemPressureLevel); + +/** + * @brief Unregister system pressure level callback. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param systemPressureLevel the {@link OH_CaptureSession_OnSystemPressureLevel} 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_UnregisterSystemPressureLevelCallback(Camera_CaptureSession* session, + OH_CaptureSession_OnSystemPressureLevel systemPressureLevel); + #ifdef __cplusplus } #endif -- Gitee