camera_device.h

Overview

Defines the basic APIs of the camera device.

File to include: <ohcamera/camera_device.h>

Library: libohcamera.so

System capability: SystemCapability.Multimedia.Camera.Core

Since: 12

Related module: OH_Camera

Summary

Functions

Name Description
Camera_ErrorCode OH_CameraDevice_GetCameraOrientation(Camera_Device* camera, uint32_t* orientation) Obtains the sensor direction of a camera device.
Camera_ErrorCode OH_CameraDevice_GetHostDeviceName(Camera_Device* camera, char** hostDeviceName) Obtains the name of a remote device.
Camera_ErrorCode OH_CameraDevice_GetHostDeviceType(Camera_Device* camera, Camera_HostDeviceType* hostDeviceType) Obtains the type of a remote device.
Camera_ErrorCode OH_CameraDevice_GetLensEquivalentFocalLengths(const Camera_Device* camera, uint32_t** equivalentFocalLengths, uint32_t* size) Obtains the equivalent focal length of a camera.
Camera_ErrorCode OH_CameraDevice_IsLogicalCamera(const Camera_Device* camera, bool* isLogicalCamera) Checks whether a camera is a logical camera (consisting of multiple physical cameras).
Camera_ErrorCode OH_CameraDevice_GetLogicalCameraConstituentCameraDevices(const Camera_Device* logicalCamera, Camera_Device** constituentCameras, uint32_t* size) Obtains all physical cameras that constitute a logical camera by calling OH_CameraDevice_DeleteConstituentCameraDevices.
Camera_ErrorCode OH_CameraDevice_DeleteConstituentCameraDevices(const Camera_Device* logicalCamera, Camera_Device* constituentCameras, uint32_t size) Deletes all physical cameras that constitute a logical camera.
Camera_ErrorCode OH_CameraDevice_GetLensFocalLength(const Camera_Device* camera, float* lensFocalLength) Obtains the focal length of a camera.
Camera_ErrorCode OH_CameraDevice_GetMinimumFocusDistance(const Camera_Device* camera, float* minimumFocusDistance) Obtains the minimum focus distance of a camera.
Camera_ErrorCode OH_CameraDevice_GetLensDistortion(const Camera_Device* camera, float** lens, uint32_t* size) Obtains the distortion parameters of a camera.
Camera_ErrorCode OH_CameraDevice_GetIntrinsicCalibration(const Camera_Device* camera, float** intrinsicCalibration, uint32_t* size) Obtains the intrinsic calibration parameters of a camera.
Camera_ErrorCode OH_CameraDevice_GetSensorPhysicalSize(const Camera_Device* camera, float* width, float* height) Obtains the physical dimensions of a camera sensor.
Camera_ErrorCode OH_CameraDevice_GetSensorPixelArraySize(const Camera_Device* camera, uint32_t* width, uint32_t* height) Obtains the pixel array dimensions of a camera sensor.
Camera_ErrorCode OH_CameraDevice_GetSensorColorFilterArrangement(const Camera_Device* camera, OH_Camera_SensorColorFilterArrangement* sensorCFA) Obtains the color filter array arrangement of a camera sensor.

Function Description

OH_CameraDevice_GetCameraOrientation()

Camera_ErrorCode OH_CameraDevice_GetCameraOrientation(Camera_Device* camera, uint32_t* orientation)

Description

Obtains the sensor direction of a camera device.

Since: 12

Parameters

Name Description
Camera_Device* camera Pointer to the camera device.
uint32_t* orientation Pointer to the sensor direction obtained.

Returns

Type Description
Camera_ErrorCode CAMERA_OK: The operation is successful.
CAMERA_CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.
CAMERA_SERVICE_FATAL_ERROR: The camera service is abnormal.

OH_CameraDevice_GetHostDeviceName()

Camera_ErrorCode OH_CameraDevice_GetHostDeviceName(Camera_Device* camera, char** hostDeviceName)

Description

Obtains the name of a remote device.

Since: 15

Parameters

Name Description
Camera_Device* camera Pointer to the camera device.
char** hostDeviceName Double pointer to the name of the remote device.

Returns

Type Description
Camera_ErrorCode CAMERA_OK: The operation is successful, and the remote device name is returned.
CAMERA_CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.
CAMERA_SERVICE_FATAL_ERROR: The camera service is abnormal.

OH_CameraDevice_GetHostDeviceType()

Camera_ErrorCode OH_CameraDevice_GetHostDeviceType(Camera_Device* camera, Camera_HostDeviceType* hostDeviceType)

Description

Obtains the type of a remote device.

Since: 15

Parameters

Name Description
Camera_Device* camera Pointer to the camera device.
Camera_HostDeviceType* hostDeviceType Pointer to the type of the remote device.

Returns

Type Description
Camera_ErrorCode CAMERA_OK: The operation is successful, and the remote device name is returned.
CAMERA_CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.
CAMERA_SERVICE_FATAL_ERROR: The camera service is abnormal.

OH_CameraDevice_GetLensEquivalentFocalLengths()

Camera_ErrorCode OH_CameraDevice_GetLensEquivalentFocalLengths(const Camera_Device* camera, uint32_t** equivalentFocalLengths, uint32_t* size)

Description

Obtains the equivalent focal length of a camera.

Since: 24

Parameters

Name Description
const Camera_Device* camera Pointer to the camera device.
uint32_t** equivalentFocalLengths Array of equivalent focal lengths.
uint32_t* size Array size.

Returns

Type Description
Camera_ErrorCode CAMERA_OK: The operation is successful.
CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.
CAMERA_SERVICE_FATAL_ERROR: The camera service is abnormal.

OH_CameraDevice_IsLogicalCamera()

Camera_ErrorCode OH_CameraDevice_IsLogicalCamera(const Camera_Device* camera, bool* isLogicalCamera)

Description

Checks whether a camera is a logical camera (consisting of multiple physical cameras).

Since: 24

Parameters

Name Description
const Camera_Device* camera Pointer to the camera device.
bool* isLogicalCamera Boolean indicating whether the camera is a logical camera.

Returns

Type Description
Camera_ErrorCode CAMERA_OK: The operation is successful.
CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.
CAMERA_SERVICE_FATAL_ERROR: The camera service is abnormal.

OH_CameraDevice_GetLogicalCameraConstituentCameraDevices()

Camera_ErrorCode OH_CameraDevice_GetLogicalCameraConstituentCameraDevices(const Camera_Device* logicalCamera, Camera_Device** constituentCameras, uint32_t* size)

Description

Obtains all physical cameras that constitute a logical camera by calling OH_CameraDevice_DeleteConstituentCameraDevices.

Since: 24

Parameters

Name Description
const Camera_Device* logicalCamera Pointer to the logical camera device.
Camera_Device** constituentCameras Array of pointers to the physical cameras that constitute the logical camera.
uint32_t* size Array size.

Returns

Type Description
Camera_ErrorCode CAMERA_OK: The operation is successful.
CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.
CAMERA_SERVICE_FATAL_ERROR: The camera service is abnormal.

OH_CameraDevice_DeleteConstituentCameraDevices()

Camera_ErrorCode OH_CameraDevice_DeleteConstituentCameraDevices(const Camera_Device* logicalCamera, Camera_Device* constituentCameras, uint32_t size)

Description

Deletes all physical cameras that constitute a logical camera.

Since: 24

Parameters

Name Description
const Camera_Device* logicalCamera Pointer to the logical camera device.
Camera_Device* constituentCameras Array of pointers to the physical cameras that constitute the logical camera.
uint32_t size Array size.

Returns

Type Description
Camera_ErrorCode CAMERA_OK: The operation is successful.
CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.

OH_CameraDevice_GetLensFocalLength()

Camera_ErrorCode OH_CameraDevice_GetLensFocalLength(const Camera_Device* camera, float* lensFocalLength)

Description

Obtains the focal length of a camera.

Since: 24

Parameters

Name Description
const Camera_Device* camera Pointer to the camera device.
float* lensFocalLength Focal length.

Returns

Type Description
Camera_ErrorCode CAMERA_OK: The operation is successful.
CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.
CAMERA_SERVICE_FATAL_ERROR: The camera service is abnormal.

OH_CameraDevice_GetMinimumFocusDistance()

Camera_ErrorCode OH_CameraDevice_GetMinimumFocusDistance(const Camera_Device* camera, float* minimumFocusDistance)

Description

Obtains the minimum focus distance of a camera.

Since: 24

Parameters

Name Description
const Camera_Device* camera Pointer to the camera device.
float* minimumFocusDistance Minimum focus distance.

Returns

Type Description
Camera_ErrorCode CAMERA_OK: The operation is successful.
CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.
CAMERA_SERVICE_FATAL_ERROR: The camera service is abnormal.

OH_CameraDevice_GetLensDistortion()

Camera_ErrorCode OH_CameraDevice_GetLensDistortion(const Camera_Device* camera, float** lens, uint32_t* size)

Description

Obtains the distortion parameters of a camera.

Since: 24

Parameters

Name Description
const Camera_Device* camera Pointer to the camera device.
float** lens Array of lens distortion parameters.
uint32_t* size Array size.

Returns

Type Description
Camera_ErrorCode CAMERA_OK: The operation is successful.
CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.
CAMERA_SERVICE_FATAL_ERROR: The camera service is abnormal.

OH_CameraDevice_GetIntrinsicCalibration()

Camera_ErrorCode OH_CameraDevice_GetIntrinsicCalibration(const Camera_Device* camera, float** intrinsicCalibration, uint32_t* size)

Description

Obtains the intrinsic calibration parameters of a camera.

Since: 24

Parameters

Name Description
const Camera_Device* camera Pointer to the camera device.
float** intrinsicCalibration Array of intrinsic calibration parameters.
uint32_t* size Array size.

Returns

Type Description
Camera_ErrorCode CAMERA_OK: The operation is successful.
CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.
CAMERA_SERVICE_FATAL_ERROR: The camera service is abnormal.

OH_CameraDevice_GetSensorPhysicalSize()

Camera_ErrorCode OH_CameraDevice_GetSensorPhysicalSize(const Camera_Device* camera, float* width, float* height)

Description

Obtains the physical dimensions of a camera sensor.

Since: 24

Parameters

Name Description
const Camera_Device* camera Pointer to the camera device.
float* width Sensor width, in millimeters.
float* height Sensor height, in millimeters.

Returns

Type Description
Camera_ErrorCode CAMERA_OK: The operation is successful.
CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.
CAMERA_SERVICE_FATAL_ERROR: The camera service is abnormal.

OH_CameraDevice_GetSensorPixelArraySize()

Camera_ErrorCode OH_CameraDevice_GetSensorPixelArraySize(const Camera_Device* camera, uint32_t* width, uint32_t* height)

Description

Obtains the pixel array dimensions of a camera sensor.

Since: 24

Parameters

Name Description
const Camera_Device* camera Pointer to the camera device.
uint32_t* width Pixel array width, in pixels.
uint32_t* height Pixel array height, in pixels.

Returns

Type Description
Camera_ErrorCode CAMERA_OK: The operation is successful.
CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.
CAMERA_SERVICE_FATAL_ERROR: The camera service is abnormal.

OH_CameraDevice_GetSensorColorFilterArrangement()

Camera_ErrorCode OH_CameraDevice_GetSensorColorFilterArrangement(const Camera_Device* camera, OH_Camera_SensorColorFilterArrangement* sensorCFA)

Description

Obtains the color filter array arrangement of a camera sensor.

Since: 24

Parameters

Name Description
const Camera_Device* camera Pointer to the camera device.
OH_Camera_SensorColorFilterArrangement* sensorCFA Arrangement modes of the sensor color filter.

Returns

Type Description
Camera_ErrorCode CAMERA_OK: The operation is successful.
CAMERA_INVALID_ARGUMENT: A parameter is missing or the parameter type is incorrect.
CAMERA_SERVICE_FATAL_ERROR: The camera service is abnormal.