• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# camera_device.h
2<!--Kit: Camera Kit-->
3<!--Subsystem: Multimedia-->
4<!--Owner: @qano-->
5<!--SE: @leo_ysl-->
6<!--TSE: @xchaosioda-->
7
8## Overview
9
10The file declares the basic concepts of the camera device.
11
12**File to include**: <ohcamera/camera_device.h>
13
14**Library**: libohcamera.so
15
16**System capability**: SystemCapability.Multimedia.Camera.Core
17
18**Since**: 12
19
20**Related module**: [OH_Camera](capi-oh-camera.md)
21
22## Summary
23
24### Functions
25
26| Name| Description|
27| -- | -- |
28| [Camera_ErrorCode OH_CameraDevice_GetCameraOrientation(Camera_Device* camera, uint32_t* orientation)](#oh_cameradevice_getcameraorientation) | Obtains the sensor direction of a camera device.|
29| [Camera_ErrorCode OH_CameraDevice_GetHostDeviceName(Camera_Device* camera, char** hostDeviceName)](#oh_cameradevice_gethostdevicename) | Obtains the name of a remote device.|
30| [Camera_ErrorCode OH_CameraDevice_GetHostDeviceType(Camera_Device* camera, Camera_HostDeviceType* hostDeviceType)](#oh_cameradevice_gethostdevicetype) | Obtains the type of a remote device.|
31
32## Function Description
33
34### OH_CameraDevice_GetCameraOrientation()
35
36```
37Camera_ErrorCode OH_CameraDevice_GetCameraOrientation(Camera_Device* camera, uint32_t* orientation)
38```
39
40**Description**
41
42Obtains the sensor direction of a camera device.
43
44**Since**: 12
45
46
47**Parameters**
48
49| Name| Description|
50| -- | -- |
51| [Camera_Device](capi-oh-camera-camera-device.md)* camera | Pointer to the camera device.|
52| uint32_t* orientation | Pointer to the sensor direction obtained.|
53
54**Returns**
55
56| Type| Description|
57| -- | -- |
58| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful.<br>**CAMERA_CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.<br>**CAMERA_SERVICE_FATAL_ERROR**: A fatal error occurs in the camera service.|
59
60### OH_CameraDevice_GetHostDeviceName()
61
62```
63Camera_ErrorCode OH_CameraDevice_GetHostDeviceName(Camera_Device* camera, char** hostDeviceName)
64```
65
66**Description**
67
68Obtains the name of a remote device.
69
70**Since**: 15
71
72
73**Parameters**
74
75| Name| Description|
76| -- | -- |
77| [Camera_Device](capi-oh-camera-camera-device.md)* camera | Pointer to the camera device.|
78| char** hostDeviceName | Double pointer to the name of the remote device.|
79
80**Returns**
81
82| Type| Description|
83| -- | -- |
84| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful, and the remote device name is returned.<br>**CAMERA_CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.<br>**CAMERA_SERVICE_FATAL_ERROR**: A fatal error occurs in the camera service.|
85
86### OH_CameraDevice_GetHostDeviceType()
87
88```
89Camera_ErrorCode OH_CameraDevice_GetHostDeviceType(Camera_Device* camera, Camera_HostDeviceType* hostDeviceType)
90```
91
92**Description**
93
94Obtains the type of a remote device.
95
96**Since**: 15
97
98
99**Parameters**
100
101| Name| Description|
102| -- | -- |
103| [Camera_Device](capi-oh-camera-camera-device.md)* camera | Pointer to the camera device.|
104| [Camera_HostDeviceType](capi-camera-h.md#camera_hostdevicetype)* hostDeviceType | Pointer to the type of the remote device.|
105
106**Returns**
107
108| Type| Description|
109| -- | -- |
110| [Camera_ErrorCode](capi-camera-h.md#camera_errorcode) | **CAMERA_OK**: The operation is successful, and the remote device name is returned.<br>**CAMERA_CAMERA_INVALID_ARGUMENT**: A parameter is missing or the parameter type is incorrect.<br>**CAMERA_SERVICE_FATAL_ERROR**: A fatal error occurs in the camera service.|
111