From 97a41bf4402e151bd7726f27a6253287d92e7b44 Mon Sep 17 00:00:00 2001 From: zhanglei Date: Thu, 21 Aug 2025 23:11:12 -0700 Subject: [PATCH] add ndk api Signed-off-by: zhanglei Change-Id: I46636c9c79395734a7b5f5abdfc290e278b8fea4 --- multimedia/camera_framework/camera.h | 18 +++++++++++++ multimedia/camera_framework/camera.ndk.json | 8 ++++++ multimedia/camera_framework/photo_output.h | 28 +++++++++++++++++++++ 3 files changed, 54 insertions(+) diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index c158c5ebe6b..5d2967e91f4 100644 --- a/multimedia/camera_framework/camera.h +++ b/multimedia/camera_framework/camera.h @@ -1265,6 +1265,24 @@ typedef struct Camera_ControlCenterStatusInfo { bool isActive; } Camera_ControlCenterStatusInfo; +/** + * @brief Enum for photo quality prioritization. + * + * @since 21 + * @version 1.0 + */ +typedef enum Camera_PhotoQualityPrioritization { + /** + * High quality photos are the top preference, even at the expense of shot-to-shot time. + */ + CAMERA_PHOTO_QUALITY_PRIORITIZATION_HIGH_QUALITY = 0, + + /** + * Prefering speed over quality, even at the expense of quality. + */ + CAMERA_PHOTO_QUALITY_PRIORITIZATION_SPEED = 1, +} Camera_PhotoQualityPrioritization; + #ifdef __cplusplus } #endif diff --git a/multimedia/camera_framework/camera.ndk.json b/multimedia/camera_framework/camera.ndk.json index ff95d61ee10..b81d6791601 100644 --- a/multimedia/camera_framework/camera.ndk.json +++ b/multimedia/camera_framework/camera.ndk.json @@ -734,5 +734,13 @@ { "first_introduced": "20", "name": "OH_CaptureSession_UnregisterMacroStatusChangeCallback" + }, + { + "first_introduced": "21", + "name": "OH_PhotoOutput_IsPhotoQualityPrioritizationSupported" + }, + { + "first_introduced": "21", + "name": "OH_PhotoOutput_SetPhotoQualityPrioritization" } ] diff --git a/multimedia/camera_framework/photo_output.h b/multimedia/camera_framework/photo_output.h index 27e502b695a..fd7b3b415ff 100644 --- a/multimedia/camera_framework/photo_output.h +++ b/multimedia/camera_framework/photo_output.h @@ -499,6 +499,34 @@ Camera_ErrorCode OH_PhotoOutput_IsMovingPhotoSupported(Camera_PhotoOutput* photo */ Camera_ErrorCode OH_PhotoOutput_EnableMovingPhoto(Camera_PhotoOutput* photoOutput, bool enabled); +/** + * @brief Check whether to support photo quality prioritization. + * + * @param photoOutput the {@link Camera_PhotoOutput} instance which used to check whether photo quality prioritization supported. + * @param qualityPrioritization the {@link Camera_PhotoQualityPrioritization} instance indicating quality preference. + * @param isSupported the result of whether quality prioritization is supported. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 21 + */ + +Camera_ErrorCode OH_PhotoOutput_IsPhotoQualityPrioritizationSupported(Camera_PhotoOutput* photoOutput, + Camera_PhotoQualityPrioritization qualityPrioritization, bool* isSupported); + +/** + * @brief Set photo quality prioritization. + * + * @param photoOutput the {@link Camera_PhotoOutput} instance which used to configure photo quality prioritization. + * @param qualityPrioritization the {@link Camera_PhotoQualityPrioritization} instance indicating the choice of quality or speed. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_OPERATION_NOT_ALLOWED} if operation not allowed. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 21 + */ +Camera_ErrorCode OH_PhotoOutput_SetPhotoQualityPrioritization(Camera_PhotoOutput* photoOutput, + Camera_PhotoQualityPrioritization qualityPrioritization); + #ifdef __cplusplus } #endif -- Gitee