} data;
} camera_preview_data_s;
+
+/**
+ * @brief Maximum length of the camera device name.
+ * @since_tizen 7.0
+ */
+#define CAMERA_DEVICE_NAME_MAX_LENGTH 64
+
+/**
+ * @brief Maximum length of the camera device ID.
+ * @since_tizen 7.0
+ */
+#define CAMERA_DEVICE_ID_MAX_LENGTH 64
+
+/**
+ * @brief The structure type for the camera device.
+ * @since_tizen 7.0
+ */
+typedef struct _camera_device_s {
+ camera_device_type_e type; /**< The type of camera device */
+ camera_device_e index; /**< The index of camera device */
+ char name[CAMERA_DEVICE_NAME_MAX_LENGTH]; /**< The name of camera device */
+ char id[CAMERA_DEVICE_ID_MAX_LENGTH]; /**< The ID of camera device */
+ int extra_stream_num; /**< The extra preview stream number of camera device */
+} camera_device_s;
+
/**
* @brief The Camera handle.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
/**
* @brief Called when the connection state of a camera device was changed.
* @since_tizen 7.0
- * @param[in] type The device type
- * @param[in] device The device index
- * @param[in] name The device name
- * @param[in] id The device ID
- * @param[in] extra_preview_stream_num The number of extra preview stream
+ * @param[in] device The camera device
* @param[in] is_connected The state of device connection: (@c true = connected, @c false = disconnected)
* @param[in] user_data The user data passed from the callback registration function
* @see camera_device_manager_add_device_connection_changed_cb()
* @see camera_device_manager_remove_device_connection_changed_cb()
*/
-typedef void (*camera_device_connection_changed_cb)(camera_device_type_e type, camera_device_e device,
- const char *name, const char *id, int extra_preview_stream_num, bool is_connected, void *user_data);
+typedef void (*camera_device_connection_changed_cb)(camera_device_s *device, bool is_connected, void *user_data);
/**
* @brief Called when the extra preview frame is delivered from the camera device.
/**
* @brief Called once for the each supported device.
* @since_tizen 7.0
- * @param[in] type The device type
- * @param[in] device The device index
- * @param[in] name The device name
- * @param[in] id The device ID
- * @param[in] extra_preview_stream_num The number of extra preview stream
- * @param[in] user_data The user data passed from the foreach function
+ * @param[in] device The camera device
+ * @param[in] user_data The user data passed from the foreach function
* @return @c true to continue with the next iteration of the loop, \n otherwise @c false to break out of the loop
- * @pre camera_foreach_supported_device() will invoke this callback.
- * @see camera_foreach_supported_device()
+ * @pre camera_device_manager_foreach_supported_device() will invoke this callback.
+ * @see camera_device_manager_foreach_supported_device()
*/
-typedef bool (*camera_supported_device_cb)(camera_device_type_e type, camera_device_e device,
- const char *name, const char *id, int extra_preview_stream_num, void *user_data);
+typedef bool (*camera_supported_device_cb)(camera_device_s *device, void *user_data);
/**
* @}
i, device->type, device->index,
device->name, device->id, device->extra_stream_num);
- if (!callback(device->type, device->index, device->name,
- device->id, device->extra_stream_num, user_data)) {
+ if (!callback(device, user_data)) {
CAM_LOG_WARNING("callback is stopped[called:%u,total:%u]",
i + 1, device_list.count);
break;
g_print("\n\tcamera device[%d] state changed to %d\n", device, state);
}
-static void _camera_device_connection_changed_cb(camera_device_type_e type, camera_device_e device,
- const char *name, const char *id, int extra_preview_stream_num, bool is_connected, void *user_data)
+static void _camera_device_connection_changed_cb(camera_device_s *device, bool is_connected, void *user_data)
{
g_print("\n\tcamera device changed[is_connected:%d][Type:%d,index:%d,name:%s,id:%s,exstream:%d]\n",
- is_connected, type, device, name, id, extra_preview_stream_num);
+ is_connected, device->type, device->index, device->name, device->id, device->extra_stream_num);
}
-static bool _camera_supported_device_cb(camera_device_type_e type, camera_device_e device,
- const char *name, const char *id, int extra_preview_stream_num, void *user_data)
+static bool _camera_supported_device_cb(camera_device_s *device, void *user_data)
{
g_print("\n\tcamera supported device[Type:%d,index:%d,name:%s,id:%s,exstream:%d]\n",
- type, device, name, id, extra_preview_stream_num);
+ device->type, device->index, device->name, device->id, device->extra_stream_num);
return true;
}