diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index eecc0d386bda05a25aab781ca73cc34da243689e..c880b8439096fec86fc6ea213299b8a712ab189c 100644 --- a/multimedia/camera_framework/camera.h +++ b/multimedia/camera_framework/camera.h @@ -1101,6 +1101,57 @@ typedef enum Camera_QualityPrioritization { POWER_BALANCE = 1 } Camera_QualityPrioritization; +/** + * @brief Enum for camera concurrent type. + * + * @since 16 + * @version 1.0 + */ +typedef enum Camera_ConcurrentType { + /** + * Cameras concurrency with limited capability. + */ + CAMERA_CONCURRENT_TYPE_LIMITED_CAPABILITY = 0, + + /** + * Cameras concurrenct with full capability. + */ + CAMERA_CONCURRENT_TYPE_FULL_CAPABILITY = 1 +} Camera_ConcurrentType; + +/** + * @brief Concurrency capability infos. + * + * @since 16 + * @version 1.0 + */ +typedef struct Camera_ConcurrentInfo { + /** + * Camera instance. + */ + Camera_Device camera; + + /** + * Supported concurrent type. + */ + Camera_ConcurrentType type; + + /** + * Supported Modes. + */ + Camera_SceneMode* sceneModes; + + /** + * Supported outputCapabilities + */ + Camera_OutputCapability* outputCapabilities; + + /** + * Supported outputCapabilities size. + */ + uint32_t modeAndCapabilitySize; +} Camera_ConcurrentInfo; + #ifdef __cplusplus } #endif diff --git a/multimedia/camera_framework/camera.ndk.json b/multimedia/camera_framework/camera.ndk.json index 8543be5773013b7d4bd011d456467f2f80692cdc..eae79f139bea0ce6725dfc65b5560b43f2cc9f1b 100644 --- a/multimedia/camera_framework/camera.ndk.json +++ b/multimedia/camera_framework/camera.ndk.json @@ -650,5 +650,17 @@ { "first_introduced": "14", "name": "OH_CaptureSession_SetQualityPrioritization" + }, + { + "first_introduced": "16", + "name": "OH_CameraInput_OpenConcurrentCameras" + }, + { + "first_introduced": "16", + "name": "OH_CameraManager_GetCameraDevice" + }, + { + "first_introduced": "16", + "name": "OH_CameraManager_GetCameraConcurrentInfos" } ] diff --git a/multimedia/camera_framework/camera_input.h b/multimedia/camera_framework/camera_input.h index 1438eda3e638e708da24a7d723f72e2ef7ecee53..dd768f42be59529739b5a56351849628490343a2 100644 --- a/multimedia/camera_framework/camera_input.h +++ b/multimedia/camera_framework/camera_input.h @@ -135,6 +135,20 @@ Camera_ErrorCode OH_CameraInput_Open(Camera_Input* cameraInput); */ Camera_ErrorCode OH_CameraInput_OpenSecureCamera(Camera_Input* cameraInput, uint64_t* secureSeqId); +/** + * @brief Open camera with specified concurrent type. + * + * @param cameraInput the {@link Camera_Input} instance to be opened. + * @param type the {@link Camera_ConcurrentType} instance. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_CONFLICT_CAMERA} if can not use camera cause of conflict. + * {@link #CAMERA_DEVICE_DISABLED} if camera disabled cause of security reason. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 16 + */ +Camera_ErrorCode OH_CameraInput_OpenConcurrentCameras(Camera_Input* cameraInput, Camera_ConcurrentType type); + /** * @brief Close camera. * diff --git a/multimedia/camera_framework/camera_manager.h b/multimedia/camera_framework/camera_manager.h index 71a8f46166f73fda9dea770d94b460e813e77c5b..42623cd98a796858245078273d662d59027f8f0d 100644 --- a/multimedia/camera_framework/camera_manager.h +++ b/multimedia/camera_framework/camera_manager.h @@ -470,6 +470,39 @@ Camera_ErrorCode OH_CameraManager_IsTorchSupportedByTorchMode(Camera_Manager* ca Camera_ErrorCode OH_CameraManager_SetTorchMode(Camera_Manager* cameraManager, Camera_TorchMode torchMode); +/** + * @brief Queries a specified device based on position and type. + * + * @param cameraManager the {@link Camera_Manager} instance. + * @param position the {@link Camera_Position} instance. + * @param type the {@link Camera_Type} instance. + * @param camera the {@link Camera_Device} to be set. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 16 + */ +Camera_ErrorCode OH_CameraManager_GetCameraDevice(Camera_Manager* cameraManager, Camera_Position position, + Camera_Type type, Camera_Device* camera); + +/** + * @brief Obtains the concurrent information of specified cameras, the empty return means concurrency is not supported. + * + * @param cameraManager the {@link Camera_Manager} instance. + * @param camera the {@link Camera_Device} instance. + * @param deviceSize length of the input device array. + * @param cameraConcurrentInfo the {@link Camera_ConcurrentInfo} to be set. + * @param infoSize length of the returned concurrency information array. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_SERVICE_FATAL_ERROR} if camera service fatal error. + * @since 16 + */ +Camera_ErrorCode OH_CameraManager_GetCameraConcurrentInfos(Camera_Manager* cameraManager, const Camera_Device* camera, + uint32_t deviceSize, + Camera_ConcurrentInfo** cameraConcurrentInfo, + uint32_t* infoSize); + #ifdef __cplusplus } #endif