From a2a53460c449f5b72f6dc68db4a223caf877bef6 Mon Sep 17 00:00:00 2001 From: kerongfeng Date: Fri, 12 Apr 2024 08:38:12 +0000 Subject: [PATCH 01/10] add ndk interface for securecamera Signed-off-by: kerongfeng --- multimedia/camera_framework/camera.h | 14 ++++++++++ multimedia/camera_framework/camera.ndk.json | 12 +++++++-- multimedia/camera_framework/camera_input.h | 15 +++++++++++ multimedia/camera_framework/capture_session.h | 26 +++++++++++++++++++ 4 files changed, 65 insertions(+), 2 deletions(-) diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index 5e32272de..b6b8bb2f2 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 camera mode.. + * @since 12 + */ + SECURE = 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 a840a259b..8af8af6d4 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", @@ -92,8 +96,12 @@ "name": "OH_CaptureSession_UnregisterCallback" }, { - "first_introduced": "11", - "name": "OH_CaptureSession_BeginConfig" + "first_introduced": "12", + "name": "OH_CaptureSession_SetSessionMode" + }, + { + "first_introduced": "12", + "name": "OH_CaptureSession_AddSecureOutput" }, { "first_introduced": "11", diff --git a/multimedia/camera_framework/camera_input.h b/multimedia/camera_framework/camera_input.h index 248de5e94..874fd8a74 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 b054a5d35..b6f2cc0aa 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. * -- Gitee From 57b1a65a803c66ab1ebb51a87fc746117d9123cd Mon Sep 17 00:00:00 2001 From: kerongfeng Date: Fri, 12 Apr 2024 08:47:53 +0000 Subject: [PATCH 02/10] add ndk interface for camera_framework Signed-off-by: kerongfeng --- multimedia/camera_framework/camera.ndk.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/multimedia/camera_framework/camera.ndk.json b/multimedia/camera_framework/camera.ndk.json index 8af8af6d4..dce55f28d 100644 --- a/multimedia/camera_framework/camera.ndk.json +++ b/multimedia/camera_framework/camera.ndk.json @@ -103,6 +103,10 @@ "first_introduced": "12", "name": "OH_CaptureSession_AddSecureOutput" }, + { + "first_introduced": "11", + "name": "OH_CaptureSession_BeginConfig" + }, { "first_introduced": "11", "name": "OH_CaptureSession_CommitConfig" -- Gitee From 0e95e31c0c73335bf7a4f1071e1503618e4b5825 Mon Sep 17 00:00:00 2001 From: kerongfeng Date: Fri, 12 Apr 2024 09:45:42 +0000 Subject: [PATCH 03/10] add ndk interface in camera_framework Signed-off-by: kerongfeng --- multimedia/camera_framework/camera.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index b6b8bb2f2..ba853435d 100644 --- a/multimedia/camera_framework/camera.h +++ b/multimedia/camera_framework/camera.h @@ -613,6 +613,12 @@ typedef struct Camera_Device { * Camera connection type attribute. */ Camera_Connection connectionType; + + /** + * Camera orientation degree. + * Range of valid values: 0, 90, 180, 270 + */ + uint32_t cameraOrientation; } Camera_Device; /** -- Gitee From 4008fb8365c1b3287696508bb0ffa8e94f8ce252 Mon Sep 17 00:00:00 2001 From: kerongfeng Date: Wed, 17 Apr 2024 02:30:26 +0000 Subject: [PATCH 04/10] add ndk interface Signed-off-by: kerongfeng --- multimedia/camera_framework/camera.h | 1 + 1 file changed, 1 insertion(+) diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index ba853435d..57d5c0ee8 100644 --- a/multimedia/camera_framework/camera.h +++ b/multimedia/camera_framework/camera.h @@ -617,6 +617,7 @@ typedef struct Camera_Device { /** * Camera orientation degree. * Range of valid values: 0, 90, 180, 270 + * @since 12 */ uint32_t cameraOrientation; } Camera_Device; -- Gitee From 8aa5d3e39cb71f86430d94ea5265d3f3beaabbfa Mon Sep 17 00:00:00 2001 From: kerongfeng Date: Wed, 17 Apr 2024 02:43:11 +0000 Subject: [PATCH 05/10] add ndk interface Signed-off-by: kerongfeng --- multimedia/camera_framework/camera.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index 57d5c0ee8..43a595155 100644 --- a/multimedia/camera_framework/camera.h +++ b/multimedia/camera_framework/camera.h @@ -615,8 +615,7 @@ typedef struct Camera_Device { Camera_Connection connectionType; /** - * Camera orientation degree. - * Range of valid values: 0, 90, 180, 270 + * @brief Camera orientation degree. Range of valid values: 0, 90, 180, 270 * @since 12 */ uint32_t cameraOrientation; -- Gitee From 2ba8f9e83e3a451050e60ee95b0da2e18c9f874d Mon Sep 17 00:00:00 2001 From: kerongfeng Date: Wed, 8 May 2024 09:35:51 +0000 Subject: [PATCH 06/10] add ndk interface Signed-off-by: kerongfeng --- multimedia/camera_framework/camera.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index 43a595155..7c80007c8 100644 --- a/multimedia/camera_framework/camera.h +++ b/multimedia/camera_framework/camera.h @@ -158,7 +158,7 @@ typedef enum Camera_SceneMode { * Secure camera mode.. * @since 12 */ - SECURE = 12 + SECURE = 15 } Camera_SceneMode; /** -- Gitee From 7766516318386560f4ec620ea8fb881de053dfcb Mon Sep 17 00:00:00 2001 From: kerongfeng Date: Wed, 22 May 2024 04:12:14 +0000 Subject: [PATCH 07/10] add ndk interface for securecamera Signed-off-by: kerongfeng --- multimedia/camera_framework/camera.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index 7c80007c8..527d403c4 100644 --- a/multimedia/camera_framework/camera.h +++ b/multimedia/camera_framework/camera.h @@ -158,7 +158,7 @@ typedef enum Camera_SceneMode { * Secure camera mode.. * @since 12 */ - SECURE = 15 + SECURE_PHOTO = 12 } Camera_SceneMode; /** -- Gitee From 27be8c464fadbecea857fc55c3b81a6ec02089b8 Mon Sep 17 00:00:00 2001 From: kerongfeng Date: Wed, 22 May 2024 04:14:13 +0000 Subject: [PATCH 08/10] add ndk interface for securecamera Signed-off-by: kerongfeng --- multimedia/camera_framework/camera.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index 527d403c4..e63af8fe5 100644 --- a/multimedia/camera_framework/camera.h +++ b/multimedia/camera_framework/camera.h @@ -613,12 +613,6 @@ typedef struct Camera_Device { * Camera connection type attribute. */ Camera_Connection connectionType; - - /** - * @brief Camera orientation degree. Range of valid values: 0, 90, 180, 270 - * @since 12 - */ - uint32_t cameraOrientation; } Camera_Device; /** -- Gitee From 48c90b0d8c5605826cc676559734df0cf7474011 Mon Sep 17 00:00:00 2001 From: kerongfeng Date: Wed, 5 Jun 2024 03:49:34 +0000 Subject: [PATCH 09/10] add ndk interface for securecamera Signed-off-by: kerongfeng --- multimedia/camera_framework/camera.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index e63af8fe5..11e81456b 100644 --- a/multimedia/camera_framework/camera.h +++ b/multimedia/camera_framework/camera.h @@ -155,7 +155,7 @@ typedef enum Camera_Status { */ typedef enum Camera_SceneMode { /** - * Secure camera mode.. + * Secure camera mode. * @since 12 */ SECURE_PHOTO = 12 -- Gitee From bc4d2d6411811760994f7264d8d0e1f067fcf105 Mon Sep 17 00:00:00 2001 From: kerongfeng Date: Wed, 5 Jun 2024 06:47:28 +0000 Subject: [PATCH 10/10] add ndk interface for securecamera Signed-off-by: kerongfeng --- multimedia/camera_framework/camera.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index 11e81456b..86a86f9c1 100644 --- a/multimedia/camera_framework/camera.h +++ b/multimedia/camera_framework/camera.h @@ -155,7 +155,7 @@ typedef enum Camera_Status { */ typedef enum Camera_SceneMode { /** - * Secure camera mode. + * Secure photo mode. * @since 12 */ SECURE_PHOTO = 12 -- Gitee