diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index 5e32272de8224dc06daee1d5598c4e975ee05f3c..86a86f9c1d0fc7f11b2e2627ee7b80489b397244 100644 --- a/multimedia/camera_framework/camera.h +++ b/multimedia/camera_framework/camera.h @@ -147,6 +147,20 @@ typedef enum Camera_Status { CAMERA_STATUS_UNAVAILABLE = 3 } Camera_Status; +/** + * @brief Enum for scence mode. + * + * @since 12 + * @version 1.0 + */ +typedef enum Camera_SceneMode { + /** + * Secure photo mode. + * @since 12 + */ + SECURE_PHOTO = 12 +} Camera_SceneMode; + /** * @brief Enum for camera position. * diff --git a/multimedia/camera_framework/camera.ndk.json b/multimedia/camera_framework/camera.ndk.json index a840a259ba8d250cf7c5b077f60b6bcc2e4b7696..dce55f28d42f467c4212450e6c79adcf01521c75 100644 --- a/multimedia/camera_framework/camera.ndk.json +++ b/multimedia/camera_framework/camera.ndk.json @@ -10,6 +10,10 @@ { "first_introduced": "11", "name": "OH_CameraInput_Open" + }, + { + "first_introduced": "12", + "name": "OH_CameraInput_OpenSecureCamera" }, { "first_introduced": "11", @@ -91,6 +95,14 @@ "first_introduced": "11", "name": "OH_CaptureSession_UnregisterCallback" }, + { + "first_introduced": "12", + "name": "OH_CaptureSession_SetSessionMode" + }, + { + "first_introduced": "12", + "name": "OH_CaptureSession_AddSecureOutput" + }, { "first_introduced": "11", "name": "OH_CaptureSession_BeginConfig" diff --git a/multimedia/camera_framework/camera_input.h b/multimedia/camera_framework/camera_input.h index 248de5e94bf0fc352915c7e0a21c00d69a919d78..874fd8a74e642ab2968dcbd9dd53cde91f25035a 100644 --- a/multimedia/camera_framework/camera_input.h +++ b/multimedia/camera_framework/camera_input.h @@ -120,6 +120,21 @@ 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. + * @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 12 + */ +Camera_ErrorCode OH_CameraInput_OpenSecureCamera(Camera_Input* cameraInput, uint64_t* secureSeqId); + /** * @brief Close camera. * diff --git a/multimedia/camera_framework/capture_session.h b/multimedia/camera_framework/capture_session.h index b054a5d3549007fa8683ae196fde0e6df022a2f5..b6f2cc0aa724f2457d8d3d890cc4139e204435c6 100644 --- a/multimedia/camera_framework/capture_session.h +++ b/multimedia/camera_framework/capture_session.h @@ -125,6 +125,32 @@ Camera_ErrorCode OH_CaptureSession_RegisterCallback(Camera_CaptureSession* sessi Camera_ErrorCode OH_CaptureSession_UnregisterCallback(Camera_CaptureSession* session, CaptureSession_Callbacks* callback); +/** + * @brief Specifies the specific mode. + * + * @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_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. + * + * @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_SESSION_CONFIG_LOCKED} if session config locked. + * @since 12 + */ +Camera_ErrorCode OH_CaptureSession_AddSecureOutput(Camera_CaptureSession* session, Camera_PreviewOutput* previewOutput); + /** * @brief Begin capture session config. *