From 29be49ca708ac84921c651e971bc8f81594c7dea Mon Sep 17 00:00:00 2001 From: wangdongyusky <15222869+wangdongyusky@user.noreply.gitee.com> Date: Tue, 17 Dec 2024 10:59:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9C=E7=A8=8B=E8=AE=BE=E5=A4=87=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=8E=B7=E5=8F=96=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangdongyusky --- multimedia/camera_framework/camera.h | 23 ++++++++++++++++++ multimedia/camera_framework/camera.ndk.json | 8 +++++++ multimedia/camera_framework/camera_device.h | 26 +++++++++++++++++++++ 3 files changed, 57 insertions(+) diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index 14bf57d0e..eecc0d386 100644 --- a/multimedia/camera_framework/camera.h +++ b/multimedia/camera_framework/camera.h @@ -579,6 +579,29 @@ typedef enum Camera_PreconfigRatio { PRECONFIG_RATIO_16_9 = 2 } Camera_PreconfigRatio; +/** + * @brief Enum for remote camera device type. + * + * @since 15 + * @version 1.0 + */ +typedef enum Camera_HostDeviceType { + /** + * Indicates an unknown device camera. + */ + HOST_DEVICE_TYPE_UNKNOWN_TYPE = 0, + + /** + * Indicates a smartphone camera. + */ + HOST_DEVICE_TYPE_PHONE = 0x0E, + + /** + * Indicates tablet camera. + */ + HOST_DEVICE_TYPE_TABLET = 0x11 +} Camera_HostDeviceType; + /** * @brief Size parameter. * diff --git a/multimedia/camera_framework/camera.ndk.json b/multimedia/camera_framework/camera.ndk.json index ccb9e291a..99c2328e2 100644 --- a/multimedia/camera_framework/camera.ndk.json +++ b/multimedia/camera_framework/camera.ndk.json @@ -599,6 +599,14 @@ "first_introduced": "12", "name": "OH_CameraDevice_GetCameraOrientation" }, + { + "first_introduced": "15", + "name": "OH_CameraDevice_GetHostDeviceName" + }, + { + "first_introduced": "15", + "name": "OH_CameraDevice_GetHostDeviceType" + }, { "first_introduced": "12", "name": "OH_PhotoNative_GetMainImage" diff --git a/multimedia/camera_framework/camera_device.h b/multimedia/camera_framework/camera_device.h index 731e8e203..d96589b3c 100644 --- a/multimedia/camera_framework/camera_device.h +++ b/multimedia/camera_framework/camera_device.h @@ -60,6 +60,32 @@ extern "C" { */ Camera_ErrorCode OH_CameraDevice_GetCameraOrientation(Camera_Device* camera, uint32_t* orientation); +/** + * @brief Gets remote device name attribute for a camera device. + * + * @param camera the {@link Camera_Device} which use to get attributes. + * @param hostDeviceName the remote device name attribute 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 15 + */ +Camera_ErrorCode OH_CameraDevice_GetHostDeviceName(Camera_Device* camera, char** hostDeviceName); + + +/** + * @brief Gets the remote device type attribute for a camera device. + * + * @param camera the {@link Camera_Device} which use to get attributes. + * @param hostDeviceType the {@link Camera_HostDeviceType} which remote device type attribute + 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 15 + */ +Camera_ErrorCode OH_CameraDevice_GetHostDeviceType(Camera_Device* camera, Camera_HostDeviceType* hostDeviceType); + #ifdef __cplusplus } #endif -- Gitee