diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index 14bf57d0e8db0487e37e1284e4d51c8171d11de2..eecc0d386bda05a25aab781ca73cc34da243689e 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 ccb9e291ab9a8363dcaf9a7027f76a0fbfcd3930..99c2328e2ff7da18babba04915d2ac98c3be8212 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 731e8e2033ef501c17a4588fce170cba2ac5711f..d96589b3cdf00f1eb7595da37fa52e449bb24146 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