From 9952efe61d588b8517115785d6a8dbe0d56e2f02 Mon Sep 17 00:00:00 2001 From: cold Date: Wed, 17 Jul 2024 20:20:59 +0800 Subject: [PATCH] add camera ndk api Signed-off-by: cold --- multimedia/camera_framework/camera.h | 186 +++++++++++++++++- multimedia/camera_framework/camera.ndk.json | 80 ++++++++ multimedia/camera_framework/camera_input.h | 3 +- multimedia/camera_framework/camera_manager.h | 84 ++++++++ multimedia/camera_framework/capture_session.h | 119 ++++++++++- multimedia/camera_framework/photo_output.h | 21 ++ multimedia/camera_framework/preview_output.h | 21 ++ multimedia/camera_framework/video_output.h | 21 ++ 8 files changed, 525 insertions(+), 10 deletions(-) diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index 86a86f9c1..b83918af3 100644 --- a/multimedia/camera_framework/camera.h +++ b/multimedia/camera_framework/camera.h @@ -113,6 +113,12 @@ typedef enum Camera_ErrorCode { */ CAMERA_DEVICE_PREEMPTED = 7400109, + /** + * Unresolved conflicts with current configurations. + * @since 12 + */ + CAMERA_UNRESOLVED_CONFLICTS_WITH_CURRENT_CONFIGURATIONS = 7400110, + /** * Camera service fatal error. */ @@ -154,9 +160,18 @@ typedef enum Camera_Status { * @version 1.0 */ typedef enum Camera_SceneMode { + /** + * Normal photo mode. + */ + NORMAL_PHOTO = 1, + + /** + * Normal video mode. + */ + NORMAL_VIDEO = 2, + /** * Secure photo mode. - * @since 12 */ SECURE_PHOTO = 12 } Camera_SceneMode; @@ -260,7 +275,19 @@ typedef enum Camera_Format { /** * JPEG Format. */ - CAMERA_FORMAT_JPEG = 2000 + CAMERA_FORMAT_JPEG = 2000, + + /** + * YCBCR P010 Format. + * @since 12 + */ + CAMERA_FORMAT_YCBCR_P010 = 2001, + + /** + * YCRCB P010 Format. + * @since 12 + */ + CAMERA_FORMAT_YCRCB_P010 = 2002 } Camera_Format; /** @@ -462,6 +489,94 @@ typedef enum Camera_MetadataObjectType { FACE_DETECTION = 0 } Camera_MetadataObjectType; +/** + * @brief Enum for torch mode. + * + * @since 12 + * @version 1.0 + */ +typedef enum Camera_TorchMode { + /** + * The device torch is always off. + */ + OFF = 0, + + /** + * The device torch is always on. + */ + ON = 1, + + /** + * The device continuously monitors light levels and + * uses the torch when necessary. + */ + AUTO = 2 +} Camera_TorchMode; + +/** + * @brief Enum for smooth zoom mode. + * + * @since 12 + * @version 1.0 + */ +typedef enum Camera_SmoothZoomMode { + /** + * Normal zoom mode. + */ + NORMAL = 0 +} Camera_SmoothZoomMode; + +/** + * @brief Enum for preconfig type. + * + * @since 12 + * @version 1.0 + */ +typedef enum Camera_PreconfigType { + /** + * The preconfig type is 720P. + */ + PRECONFIG_720P = 0, + + /** + * The preconfig type is 1080P. + */ + PRECONFIG_1080P = 1, + + /** + * The preconfig type is 4K. + */ + PRECONFIG_4K = 2, + + /** + * The preconfig type is high quality. + */ + PRECONFIG_HIGH_QUALITY = 3 +} Camera_PreconfigType; + +/** + * @brief Enum for preconfig ratio. + * + * @since 12 + * @version 1.0 + */ +typedef enum Camera_PreconfigRatio { + /** + * The preconfig ratio is 1:1. + */ + PRECONFIG_RATIO_1_1 = 0, + + /** + * The preconfig ratio 4:3. + */ + PRECONFIG_RATIO_4_3 = 1, + + /** + * The preconfig ratio 16:9. + */ + PRECONFIG_RATIO_16_9 = 2 +} Camera_PreconfigRatio; + /** * @brief Size parameter. * @@ -789,6 +904,73 @@ typedef struct Camera_MetadataObject { Camera_Rect* boundingBox; } Camera_MetadataObject; +/** + * @brief Torch Status Info. + * + * @since 12 + * @version 1.0 + */ +typedef struct Camera_TorchStatusInfo { + /** + * is torch available. + */ + bool isTorchAvailable; + + /** + * is torch active. + */ + bool isTorchActive; + + /** + * the current torch brightness level. + */ + int32_t torchLevel; +} Camera_TorchStatusInfo; + +/** + * @brief SmoothZoomInfo object. + * + * @since 12 + * @version 1.0 + */ +typedef struct Camera_SmoothZoomInfo { + /** + * The duration of smooth zoom. + */ + int32_t duration; +} Camera_SmoothZoomInfo; + +/** + * @brief Capture start info. + * + * @since 12 + * @version 1.0 + */ +typedef struct Camera_CaptureStartInfo { + /** + * Capture id. + */ + int32_t captureId; + + /** + * Time(in milliseconds) is the shutter time for the photo. + */ + int64_t time; +} Camera_CaptureStartInfo; + +/** + * @brief Frame shutter end callback info. + * + * @since 12 + * @version 1.0 + */ +typedef struct Camera_FrameShutterEndInfo { + /** + * Capture id. + */ + int32_t captureId; +} Camera_FrameShutterEndInfo; + /** * @brief Creates a CameraManager instance. * diff --git a/multimedia/camera_framework/camera.ndk.json b/multimedia/camera_framework/camera.ndk.json index 50c0bd1cc..e9080df44 100644 --- a/multimedia/camera_framework/camera.ndk.json +++ b/multimedia/camera_framework/camera.ndk.json @@ -43,6 +43,10 @@ "first_introduced": "11", "name": "OH_CameraManager_GetSupportedCameraOutputCapability" }, + { + "first_introduced": "12", + "name": "OH_CameraManager_GetSupportedCameraOutputCapabilityWithSceneMode" + }, { "first_introduced": "11", "name": "OH_CameraManager_DeleteSupportedCameraOutputCapability" @@ -67,18 +71,38 @@ "first_introduced": "11", "name": "OH_CameraManager_CreatePreviewOutput" }, + { + "first_introduced": "12", + "name": "OH_CameraManager_CreatePreviewOutputUsedInPreconfig" + }, { "first_introduced": "11", "name": "OH_CameraManager_CreatePhotoOutput" }, + { + "first_introduced": "12", + "name": "OH_CameraManager_CreatePhotoOutputUsedInPreconfig" + }, { "first_introduced": "11", "name": "OH_CameraManager_CreateVideoOutput" }, + { + "first_introduced": "12", + "name": "OH_CameraManager_CreateVideoOutputUsedInPreconfig" + }, { "first_introduced": "11", "name": "OH_CameraManager_CreateMetadataOutput" }, + { + "first_introduced": "12", + "name": "OH_CameraManager_GetSupportedSceneModes" + }, + { + "first_introduced": "12", + "name": "OH_CameraManager_DeleteSupportedSceneModes" + }, { "first_introduced": "11", "name": "OH_Camera_GetCameraManager" @@ -255,6 +279,38 @@ "first_introduced": "11", "name": "OH_CaptureSession_SetVideoStabilizationMode" }, + { + "first_introduced": "12", + "name": "OH_CaptureSession_CanAddInput" + }, + { + "first_introduced": "12", + "name": "OH_CaptureSession_CanAddPreviewOutput" + }, + { + "first_introduced": "12", + "name": "OH_CaptureSession_CanAddPhotoOutput" + }, + { + "first_introduced": "12", + "name": "OH_CaptureSession_CanAddVideoOutput" + }, + { + "first_introduced": "12", + "name": "OH_CaptureSession_CanPreconfig" + }, + { + "first_introduced": "12", + "name": "OH_CaptureSession_CanPreconfigWithRatio" + }, + { + "first_introduced": "12", + "name": "OH_CaptureSession_Preconfig" + }, + { + "first_introduced": "12", + "name": "OH_CaptureSession_PreconfigWithRatio" + }, { "first_introduced": "11", "name": "OH_MetadataOutput_RegisterCallback" @@ -342,5 +398,29 @@ { "first_introduced": "12", "name": "OH_CameraDevice_GetCameraOrientation" + }, + { + "first_introduced": "12", + "name": "OH_PhotoOutput_GetActiveProfile" + }, + { + "first_introduced": "12", + "name": "OH_PreviewOutput_GetActiveProfile" + }, + { + "first_introduced": "12", + "name": "OH_VideoOutput_GetActiveProfile" + }, + { + "first_introduced": "12", + "name": "OH_PhotoOutput_DeleteProfile" + }, + { + "first_introduced": "12", + "name": "OH_PreviewOutput_DeleteProfile" + }, + { + "first_introduced": "12", + "name": "OH_VideoOutput_DeleteProfile" } ] diff --git a/multimedia/camera_framework/camera_input.h b/multimedia/camera_framework/camera_input.h index 874fd8a74..c5abb7604 100644 --- a/multimedia/camera_framework/camera_input.h +++ b/multimedia/camera_framework/camera_input.h @@ -120,12 +120,11 @@ Camera_ErrorCode OH_CameraInput_UnregisterCallback(Camera_Input* cameraInput, Ca */ Camera_ErrorCode OH_CameraInput_Open(Camera_Input* cameraInput); - /** * @brief Open camera. * * @param cameraInput the {@link Camera_Input} instance to be opened. - * @param secureSeqId which indicates SequenceId that secure camera is on. + * @param secureSeqId which indicates SequenceId that secure camera is on. * @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. diff --git a/multimedia/camera_framework/camera_manager.h b/multimedia/camera_framework/camera_manager.h index dbed87a0f..71b3508e7 100644 --- a/multimedia/camera_framework/camera_manager.h +++ b/multimedia/camera_framework/camera_manager.h @@ -139,6 +139,22 @@ Camera_ErrorCode OH_CameraManager_DeleteSupportedCameras(Camera_Manager* cameraM Camera_ErrorCode OH_CameraManager_GetSupportedCameraOutputCapability(Camera_Manager* cameraManager, const Camera_Device* camera, Camera_OutputCapability** cameraOutputCapability); +/** + * @brief Gets supported output capability for specific camera and specific sceneMode. + * + * @param cameraManager the {@link Camera_Manager} instance. + * @param camera the {@link Camera_Device} to be queryed. + * @param sceneMode the {@link Camera_SceneMode} to be queryed. + * @param cameraOutputCapability the supported {@link Camera_OutputCapability} will be filled + * if the method call succeeds. + * @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 12 + */ +Camera_ErrorCode OH_CameraManager_GetSupportedCameraOutputCapabilityWithSceneMode(Camera_Manager* cameraManager, + const Camera_Device* camera, Camera_SceneMode sceneMode, Camera_OutputCapability** cameraOutputCapability); + /** * @brief Delete the supported output capability. * @@ -222,6 +238,20 @@ Camera_ErrorCode OH_CameraManager_CreateCameraInput_WithPositionAndType(Camera_M Camera_ErrorCode OH_CameraManager_CreatePreviewOutput(Camera_Manager* cameraManager, const Camera_Profile* profile, const char* surfaceId, Camera_PreviewOutput** previewOutput); +/** + * @brief Create a preview output instance used in preconfig. + * + * @param cameraManager the {@link Camera_Manager} instance. + * @param surfaceId the which use to create {@link Camera_PreviewOutput}. + * @param previewOutput the {@link Camera_PreviewOutput} will be created if the method call succeeds. + * @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 12 + */ +Camera_ErrorCode OH_CameraManager_CreatePreviewOutputUsedInPreconfig(Camera_Manager* cameraManager, + const char* surfaceId, Camera_PreviewOutput** previewOutput); + /** * @brief Create a photo output instance. * @@ -237,6 +267,20 @@ Camera_ErrorCode OH_CameraManager_CreatePreviewOutput(Camera_Manager* cameraMana Camera_ErrorCode OH_CameraManager_CreatePhotoOutput(Camera_Manager* cameraManager, const Camera_Profile* profile, const char* surfaceId, Camera_PhotoOutput** photoOutput); +/** + * @brief Create a photo output instance used in preconfig. + * + * @param cameraManager the {@link Camera_Manager} instance. + * @param surfaceId the which use to create {@link Camera_PhotoOutput}. + * @param photoOutput the {@link Camera_PhotoOutput} will be created if the method call succeeds. + * @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 12 + */ +Camera_ErrorCode OH_CameraManager_CreatePhotoOutputUsedInPreconfig(Camera_Manager* cameraManager, + const char* surfaceId, Camera_PhotoOutput** photoOutput); + /** * @brief Create a video output instance. * @@ -252,6 +296,20 @@ Camera_ErrorCode OH_CameraManager_CreatePhotoOutput(Camera_Manager* cameraManage Camera_ErrorCode OH_CameraManager_CreateVideoOutput(Camera_Manager* cameraManager, const Camera_VideoProfile* profile, const char* surfaceId, Camera_VideoOutput** videoOutput); +/** + * @brief Create a video output instance used in preconfig. + * + * @param cameraManager the {@link Camera_Manager} instance. + * @param surfaceId the which use to create {@link Camera_VideoOutput}. + * @param videoOutput the {@link Camera_VideoOutput} will be created if the method call succeeds. + * @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 12 + */ +Camera_ErrorCode OH_CameraManager_CreateVideoOutputUsedInPreconfig(Camera_Manager* cameraManager, + const char* surfaceId, Camera_VideoOutput** videoOutput); + /** * @brief Create a metadata output instance. * @@ -266,6 +324,32 @@ Camera_ErrorCode OH_CameraManager_CreateVideoOutput(Camera_Manager* cameraManage Camera_ErrorCode OH_CameraManager_CreateMetadataOutput(Camera_Manager* cameraManager, const Camera_MetadataObjectType* profile, Camera_MetadataOutput** metadataOutput); +/** + * @brief Gets supported scene mode for specific camera. + * + * @param camera the {@link Camera_Device} to be queryed. + * @param sceneModes the supported {@link Camera_SceneMode} will be filled if the method call succeeds. + * @param size the size of supported {@link Camera_SceneMode} list will be filled if the method call succeeds. + * @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 12 + */ +Camera_ErrorCode OH_CameraManager_GetSupportedSceneModes(Camera_Device* camera, + Camera_SceneMode** sceneModes, uint32_t* size); + +/** + * @brief Delete the supported scene mode. + * + * @param cameraManager the {@link Camera_Manager} instance. + * @param sceneModes the {@link Camera_SceneMode} to be deleted. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_CameraManager_DeleteSupportedSceneModes(Camera_Manager* cameraManager, + Camera_SceneMode* sceneModes); + #ifdef __cplusplus } #endif diff --git a/multimedia/camera_framework/capture_session.h b/multimedia/camera_framework/capture_session.h index b6f2cc0aa..be76c0f22 100644 --- a/multimedia/camera_framework/capture_session.h +++ b/multimedia/camera_framework/capture_session.h @@ -131,21 +131,21 @@ Camera_ErrorCode OH_CaptureSession_UnregisterCallback(Camera_CaptureSession* ses * @param session the {@link Camera_CaptureSession} instance. * @param sceneMode the {@link CaptureSession_SceneMode} instance. * @return {@link #CAMERA_OK} if the method call succeeds. - * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. - * {@link #OPERATION_NOT_ALLOWED} if operation not allowed. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_OPERATION_NOT_ALLOWED} if operation not allowed. * {@link #CAMERA_SESSION_CONFIG_LOCKED} if session config locked. * @since 12 */ Camera_ErrorCode OH_CaptureSession_SetSessionMode(Camera_CaptureSession* session, Camera_SceneMode sceneMode); - + /** - * @brief Specifies the specific mode. The default mode is the photomode. + * @brief Add Secure output for camera. * * @param session the {@link Camera_CaptureSession} instance. * @param previewOutput the target {@link Camera_PreviewOutput} to Set as a secure flow. * @return {@link #CAMERA_OK} if the method call succeeds. - * {@link #INVALID_ARGUMENT} if parameter missing or parameter type incorrect. - * {@link #OPERATION_NOT_ALLOWED} if operation not allowed. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * {@link #CAMERA_OPERATION_NOT_ALLOWED} if operation not allowed. * {@link #CAMERA_SESSION_CONFIG_LOCKED} if session config locked. * @since 12 */ @@ -622,6 +622,113 @@ Camera_ErrorCode OH_CaptureSession_GetVideoStabilizationMode(Camera_CaptureSessi Camera_ErrorCode OH_CaptureSession_SetVideoStabilizationMode(Camera_CaptureSession* session, Camera_VideoStabilizationMode mode); +/** + * @brief Determines whether the camera input can be added into the session. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param cameraInput the target {@link Camera_Input} to set. + * @param isSuccess the result of whether the camera input can be added into the session. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_CaptureSession_CanAddInput(Camera_CaptureSession* session, + Camera_Input* cameraInput, bool* isSuccess); + +/** + * @brief Determines whether the camera preview output can be added into the session. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param cameraOutput the target {@link Camera_PreviewOutput} to set. + * @param isSuccess the result of whether the camera preview output can be added into the session. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_CaptureSession_CanAddPreviewOutput(Camera_CaptureSession* session, + Camera_PreviewOutput* cameraOutput, bool* isSuccess); + +/** + * @brief Determines whether the camera photo output can be added into the session. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param cameraOutput the target {@link Camera_PhotoOutput} to set. + * @param isSuccess the result of whether the camera photo output can be added into the session. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_CaptureSession_CanAddPhotoOutput(Camera_CaptureSession* session, + Camera_PhotoOutput* cameraOutput, bool* isSuccess); + +/** + * @brief Determines whether the camera video output can be added into the session. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param cameraOutput the target {@link Camera_VideoOutput} to set. + * @param isSuccess the result of whether the camera video output can be added into the session. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_CaptureSession_CanAddVideoOutput(Camera_CaptureSession* session, + Camera_VideoOutput* cameraOutput, bool* isSuccess); + +/** + * @brief Check the preconfig type is supported or not. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param preconfigType the target {@link Camera_PreconfigType} to set. + * @param canPreconfig the result of whether the preconfig type is supported. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_CaptureSession_CanPreconfig(Camera_CaptureSession* session, + Camera_PreconfigType preconfigType, bool* canPreconfig); + +/** + * @brief Check the preconfig type with ratio is supported or not. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param preconfigType the target {@link Camera_PreconfigType} to set. + * @param preconfigRatio the target {@link Camera_PreconfigRatio} to set. + * @param canPreconfig the result of whether the preconfig type with ratio is supported. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_CaptureSession_CanPreconfigWithRatio(Camera_CaptureSession* session, + Camera_PreconfigType preconfigType, Camera_PreconfigRatio preconfigRatio, + bool* canPreconfig); + +/** + * @brief Set the preconfig type. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param preconfigType the target {@link Camera_PreconfigType} to set. + * @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 12 + */ +Camera_ErrorCode OH_CaptureSession_Preconfig(Camera_CaptureSession* session, + Camera_PreconfigType preconfigType); + +/** + * @brief Set the preconfig type with ratio. + * + * @param session the {@link Camera_CaptureSession} instance. + * @param preconfigType the target {@link Camera_PreconfigType} to set. + * @param preconfigRatio the target {@link Camera_PreconfigRatio} to set. + * @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 12 + */ +Camera_ErrorCode OH_CaptureSession_PreconfigWithRatio(Camera_CaptureSession* session, + Camera_PreconfigType preconfigType, Camera_PreconfigRatio preconfigRatio); + #ifdef __cplusplus } #endif diff --git a/multimedia/camera_framework/photo_output.h b/multimedia/camera_framework/photo_output.h index 3c32b972a..273455d17 100644 --- a/multimedia/camera_framework/photo_output.h +++ b/multimedia/camera_framework/photo_output.h @@ -194,6 +194,27 @@ Camera_ErrorCode OH_PhotoOutput_Release(Camera_PhotoOutput* photoOutput); */ Camera_ErrorCode OH_PhotoOutput_IsMirrorSupported(Camera_PhotoOutput* photoOutput, bool* isSupported); +/** + * @brief Get active profiles. + * + * @param photoOutput the {@link Camera_PhotoOutput} instance which used to get active profiles. + * @param profile the active {@link Camera_Profile} will be filled if the method call succeeds. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_PhotoOutput_GetActiveProfile(Camera_PhotoOutput* photoOutput, Camera_Profile** profile); + +/** + * @brief Delete photo profile instance. + * + * @param profile the {@link Camera_Profile} instance to deleted. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_PhotoOutput_DeleteProfile(Camera_Profile* profile); + #ifdef __cplusplus } #endif diff --git a/multimedia/camera_framework/preview_output.h b/multimedia/camera_framework/preview_output.h index 96b267f9c..3fa3dcced 100644 --- a/multimedia/camera_framework/preview_output.h +++ b/multimedia/camera_framework/preview_output.h @@ -167,6 +167,27 @@ Camera_ErrorCode OH_PreviewOutput_Stop(Camera_PreviewOutput* previewOutput); */ Camera_ErrorCode OH_PreviewOutput_Release(Camera_PreviewOutput* previewOutput); +/** + * @brief Get active profiles. + * + * @param previewOutput the {@link Camera_PreviewOutput} instance which used to get active profiles. + * @param profile the active {@link Camera_Profile} will be filled if the method call succeeds. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_PreviewOutput_GetActiveProfile(Camera_PreviewOutput* previewOutput, Camera_Profile** profile); + +/** + * @brief Delete preview profile instance. + * + * @param profile the {@link Camera_Profile} instance to deleted. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_PreviewOutput_DeleteProfile(Camera_Profile* profile); + #ifdef __cplusplus } #endif diff --git a/multimedia/camera_framework/video_output.h b/multimedia/camera_framework/video_output.h index 8b50c44bc..07bee9ceb 100644 --- a/multimedia/camera_framework/video_output.h +++ b/multimedia/camera_framework/video_output.h @@ -165,6 +165,27 @@ Camera_ErrorCode OH_VideoOutput_Stop(Camera_VideoOutput* videoOutput); */ Camera_ErrorCode OH_VideoOutput_Release(Camera_VideoOutput* videoOutput); +/** + * @brief Get active profiles. + * + * @param videoOutput the {@link Camera_VideoOutput} instance which used to get active profiles. + * @param profile the active {@link Camera_VideoProfile} will be filled if the method call succeeds. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_VideoOutput_GetActiveProfile(Camera_VideoOutput* videoOutput, Camera_VideoProfile** profile); + +/** + * @brief Delete video profile instance. + * + * @param profile the {@link Camera_VideoProfile} instance to deleted. + * @return {@link #CAMERA_OK} if the method call succeeds. + * {@link #CAMERA_INVALID_ARGUMENT} if parameter missing or parameter type incorrect. + * @since 12 + */ +Camera_ErrorCode OH_VideoOutput_DeleteProfile(Camera_VideoProfile* profile); + #ifdef __cplusplus } #endif -- Gitee