diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index ea4231224401655ea6b19d80fb89017d684447f2..afab4d863c9fe6e228721185d2d2411a24e63798 100644 --- a/multimedia/camera_framework/camera.h +++ b/multimedia/camera_framework/camera.h @@ -1195,6 +1195,42 @@ typedef enum Camera_WhiteBalanceMode { CAMERA_WHITE_BALANCE_MODE_LOCKED = 6 } Camera_WhiteBalanceMode; +/** + * @brief Enumerates the control center effect types. + * + * @since 20 + * @version 1.0 + */ +typedef enum Camera_ControlCenterEffectType { + /** + * Control center beauty effect type. + */ + CONTROL_CENTER_EFFECT_TYPE_BEAUTY = 0, + + /** + * Control center portrait effect type. + */ + CONTROL_CENTER_EFFECT_TYPE_PORTRAIT = 1 +} Camera_ControlCenterEffectType; + +/** + * @brief Control center status info. + * + * @since 20 + * @version 1.0 + */ +typedef struct Camera_ControlCenterStatusInfo { + /** + * Control center effect type. + */ + Camera_ControlCenterEffectType effectType; + + /** + * If control center effect is active. + */ + bool isActive; +} Camera_ControlCenterStatusInfo; + #ifdef __cplusplus } #endif diff --git a/multimedia/camera_framework/camera.ndk.json b/multimedia/camera_framework/camera.ndk.json index 5bb71a86e196c8a5e8a3dae1e1ec126fbda71d0f..d17baabe69407742cdb2dafbc7d737900e8a5a33 100644 --- a/multimedia/camera_framework/camera.ndk.json +++ b/multimedia/camera_framework/camera.ndk.json @@ -694,5 +694,29 @@ { "first_introduced": "20", "name": "OH_CaptureSession_SetWhiteBalanceMode" + }, + { + "first_introduced": "20", + "name": "OH_CaptureSession_IsControlCenterSupported" + }, + { + "first_introduced": "20", + "name": "OH_CaptureSession_GetSupportedEffectTypes" + }, + { + "first_introduced": "20", + "name": "OH_CaptureSession_DeleteSupportedEffectTypes" + }, + { + "first_introduced": "20", + "name": "OH_CaptureSession_EnableControlCenter" + }, + { + "first_introduced": "20", + "name": "OH_CaptureSession_RegisterControlCenterEffectStatusChangeCallback" + }, + { + "first_introduced": "20", + "name": "OH_CaptureSession_UnregisterControlCenterEffectStatusChangeCallback" } ] diff --git a/multimedia/camera_framework/capture_session.h b/multimedia/camera_framework/capture_session.h index 6448626cf260d966a518729a655bb15560ffa117..914a30394424870203918d8629a48c0914f5b27c 100644 --- a/multimedia/camera_framework/capture_session.h +++ b/multimedia/camera_framework/capture_session.h @@ -1040,6 +1040,93 @@ Camera_ErrorCode OH_CaptureSession_SetWhiteBalance(Camera_CaptureSession *sessio Camera_ErrorCode OH_CaptureSession_SetWhiteBalanceMode( Camera_CaptureSession *session, Camera_WhiteBalanceMode whiteBalanceMode); +/** + * @brief Checks whether the control center is supported. + * + * @param session Pointer to a {@link Camera_CaptureSession} instance. + * @param isSupported Pointer to the check result. The value true means that the control center is supported, and false means the opposite. + * @return Result code. + * {@link #CAMERA_OK} is returned if the function is called successfully. + * {@link #CAMERA_INVALID_ARGUMENT} is returned if the input parameter is missing or the parameter type is incorrect. + * {@link #CAMERA_SESSION_NOT_CONFIG} is returned if the camera session is not configured. + * @since 20 + */ +Camera_ErrorCode OH_CaptureSession_IsControlCenterSupported(Camera_CaptureSession* session, bool* isSupported); + +/** + * @brief Get the supported effect types . + * + * @param session the {@link Camera_CaptureSession} instance. + * @param types the supported {@link Camera_ControlCenterEffectType} list to be filled if the method call succeeds. + * @param size the size of supported effect types queried. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. + * @since 20 + */ +Camera_ErrorCode OH_CaptureSession_GetSupportedEffectTypes( + Camera_CaptureSession* session, Camera_ControlCenterEffectType** types, uint32_t* size); + +/** + * @brief Delete the effect types. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param types the target {@link Camera_ControlCenterEffectType} list to be deleted if the method call succeeds. + * @param size the size of supported effect types to be deleted. + * @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_DeleteSupportedEffectTypes(Camera_CaptureSession* session, + Camera_ControlCenterEffectType* types, uint32_t size); + +/** + * @brief Enables or disables the control center. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param enabled Whether to enable the control center. The value true means to enable the control center, and false means to disable it. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SESSION_NOT_CONFIG} if the capture session not config. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 20 + */ +Camera_ErrorCode OH_CaptureSession_EnableControlCenter(Camera_CaptureSession* session, bool enable); + +/** + * @brief Capture session control center effect status info callback. + * + * @param session the {@link Camera_CaptureSession} which deliver the callback. + * @param controlCenterStatusInfo the {@link Camera_ControlCenterStatusInfo} which delivered by the callback. + * @since 20 + */ +typedef void (*OH_CaptureSession_OnControlCenterEffectStatusChange)(Camera_CaptureSession* session, + Camera_ControlCenterStatusInfo* controlCenterStatusInfo); + +/** + * @brief Register control center effect status information event callback. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param controlCenterEffectStatusChange the {@link OH_CaptureSession_OnControlCenterEffectStatusChange} 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_RegisterControlCenterEffectStatusChangeCallback(Camera_CaptureSession* session, + OH_CaptureSession_OnControlCenterEffectStatusChange controlCenterEffectStatusChange); + +/** + * @brief Unregister control center effect status information event callback. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param controlCenterEffectStatusChange the {@link OH_CaptureSession_OnControlCenterEffectStatusChange} 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_UnregisterControlCenterEffectStatusChangeCallback(Camera_CaptureSession* session, + OH_CaptureSession_OnControlCenterEffectStatusChange controlCenterEffectStatusChange); + #ifdef __cplusplus } #endif