diff options
author | Jeongmo Yang <jm80.yang@samsung.com> | 2020-11-04 12:18:17 +0900 |
---|---|---|
committer | Jeongmo Yang <jm80.yang@samsung.com> | 2020-11-06 12:48:17 +0900 |
commit | 78f4da3c13c72076995bcf910462eab1a3023da6 (patch) | |
tree | bb86f82f57e59b629690b59a87d5e02021489098 /include | |
parent | e31cd045f6cbaa6e6ac6b614c41310b187cd0aeb (diff) | |
download | camera-78f4da3c13c72076995bcf910462eab1a3023da6.tar.gz camera-78f4da3c13c72076995bcf910462eab1a3023da6.tar.bz2 camera-78f4da3c13c72076995bcf910462eab1a3023da6.zip |
Add new internal APIssubmit/tizen/20201106.064606accepted/tizen/unified/20201109.123508
- int camera_create_network(camera_device_e device, camera_h *camera);
: API to create network camera handle
- int camera_get_device_list(camera_device_list_s *list);
: API to get device list
[Version] 0.4.42
[Issue Type] New feature
Change-Id: I4a9413a75100421b82b71a4e2fd4dfffea33beab
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/camera_internal.h | 53 | ||||
-rw-r--r-- | include/camera_private.h | 1 |
2 files changed, 54 insertions, 0 deletions
diff --git a/include/camera_internal.h b/include/camera_internal.h index a9ac503..d43dcbd 100644 --- a/include/camera_internal.h +++ b/include/camera_internal.h @@ -41,6 +41,9 @@ extern "C" { #endif /* BUFFER_MAX_PLANE_NUM */ #define BUFFER_MAX_PLANE_NUM 4 +#define CAMERA_DEVICE_MAX ((CAMERA_DEVICE_CAMERA9 + 1) * 2) +#define DEVICE_NAME_MAX_LENGTH 64 +#define DEVICE_ID_MAX_LENGTH 64 typedef struct _camera_stream_data_s { union { @@ -81,6 +84,25 @@ typedef struct _camera_stream_data_s { int elevation[BUFFER_MAX_PLANE_NUM]; /**< Elevation of each plane */ } camera_stream_data_s; + +typedef enum { + CAMERA_DEVICE_TYPE_BUILTIN = 0, /**< Built-in camera */ + CAMERA_DEVICE_TYPE_USB, /**< USB connected camera */ + CAMERA_DEVICE_TYPE_NETWORK /**< Network camera */ +} camera_device_type_e; + +typedef struct _camera_device_s { + camera_device_type_e type; + camera_device_e index; + char name[DEVICE_NAME_MAX_LENGTH]; + char id[DEVICE_ID_MAX_LENGTH]; +} camera_device_s; + +typedef struct _camera_device_list_s { + unsigned int count; + camera_device_s device[CAMERA_DEVICE_MAX]; +} camera_device_list_s; + /** * @brief Start the evas rendering. * @@ -147,6 +169,37 @@ void camera_create_preview_frame(camera_stream_data_s *stream, int num_buffer_fd tbm_bo_handle *buffer_bo_handle, tbm_bo_handle *data_bo_handle, camera_preview_data_s *frame); /** + * @brief Creates a new camera handle for controlling a network camera. + * @since_tizen 6.0 + * @remarks A @a camera must be released using camera_destroy(). + * @param[in] device The network camera to access + * @param[out] camera A newly returned handle to the camera + * @return @c 0 on success, otherwise a negative error value + * @retval #CAMERA_ERROR_NONE Successful + * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CAMERA_ERROR_OUT_OF_MEMORY Out of memory + * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation + * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported + * @post If it succeeds, the camera state will be #CAMERA_STATE_CREATED. + * + * @see camera_destroy() + */ +int camera_create_network(camera_device_e device, camera_h *camera); + +/** + * @brief Gets a list of available camera devices. + * @since_tizen 6.0 + * @param[out] list A list of available camera devices + * @return @c 0 on success, otherwise a negative error value + * @retval #CAMERA_ERROR_NONE Successful + * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CAMERA_ERROR_OUT_OF_MEMORY Out of memory + * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation + * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported + */ +int camera_get_device_list(camera_device_list_s *list); + +/** * @} */ #ifdef __cplusplus diff --git a/include/camera_private.h b/include/camera_private.h index 7a171de..30d5a68 100644 --- a/include/camera_private.h +++ b/include/camera_private.h @@ -232,6 +232,7 @@ int _camera_start_evas_rendering(camera_h camera); int _camera_stop_evas_rendering(camera_h camera, bool keep_screen); int _camera_independent_request(int api, int device_type, const char *key, int *value); int _camera_set_display(camera_h camera, mm_display_type_e type, void *display); +int _camera_create_private(camera_device_e device, bool is_network, camera_h *camera); typedef bool (*camera_supported_cb_param1)(int param, void *user_data); typedef bool (*camera_supported_cb_param2)(int param1, int param2, void *user_data); |