diff options
author | Jeongmo Yang <jm80.yang@samsung.com> | 2021-06-24 14:33:55 +0900 |
---|---|---|
committer | Jeongmo Yang <jm80.yang@samsung.com> | 2021-06-24 14:34:22 +0900 |
commit | 99649e8caeb60dd9ade2fc86734027fab695445c (patch) | |
tree | a97a3128d62df4b7e073aef6229816e5f6626916 | |
parent | 8baf1454c00eb7f6f5d0ff7f3b1628d0cd9e0932 (diff) | |
download | camera-99649e8caeb60dd9ade2fc86734027fab695445c.tar.gz camera-99649e8caeb60dd9ade2fc86734027fab695445c.tar.bz2 camera-99649e8caeb60dd9ade2fc86734027fab695445c.zip |
Remove internal APIs for device list changed callbacksubmit/tizen/20210625.064135accepted/tizen/unified/20210630.144040
[Version] 0.4.60
[Issue Type] Remove
Change-Id: I4ddfda2d5ae3085df0f0b970b278859c4db6dcc7
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
-rw-r--r-- | include/camera_internal.h | 43 | ||||
-rw-r--r-- | include/camera_private.h | 2 | ||||
-rw-r--r-- | packaging/capi-media-camera.spec | 2 | ||||
-rw-r--r-- | src/camera_internal.c | 51 | ||||
-rw-r--r-- | test/camera_test.c | 46 |
5 files changed, 5 insertions, 139 deletions
diff --git a/include/camera_internal.h b/include/camera_internal.h index 2e15967..923000d 100644 --- a/include/camera_internal.h +++ b/include/camera_internal.h @@ -109,16 +109,6 @@ typedef struct camera_device_manager *camera_device_manager_h; /** * @internal - * @brief Called when the camera device list is changed. - * @since_tizen 6.0 - * @param[in] list The device list of the camera - * @param[in] user_data The user data passed from the callback registration function - * @see camera_device_manager_add_device_list_changed_cb() - */ -typedef void (*camera_device_list_changed_cb)(camera_device_list_s *list, void *user_data); - -/** - * @internal * @brief Called when the connection state of a camera device was changed. * @since_tizen 6.5 * @param[in] device The camera device @@ -274,39 +264,6 @@ int camera_device_manager_get_device_list(camera_device_manager_h manager, camer /** * @internal - * @brief Registers a callback function to be called when the camera device list changes. - * @since_tizen 6.0 - * @param[in] manager The handle to the camera device manager - * @param[in] callback The callback function to register - * @param[in] user_data The user data to be passed to the callback function - * @param[out] cb_id The id of registered callback - * @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_INVALID_OPERATION Invalid operation - * @retval #CAMERA_ERROR_OUT_OF_MEMORY Out of memory - * @post This function will invoke camera_device_list_changed_cb() when the camera device list changes. - * @see camera_device_manager_remove_device_list_changed_cb() - * @see camera_device_list_changed_cb() - */ -int camera_device_manager_add_device_list_changed_cb(camera_device_manager_h manager, camera_device_list_changed_cb callback, void *user_data, int *cb_id); - -/** - * @internal - * @brief Unregisters the callback function. - * @since_tizen 6.0 - * @param[in] manager The handle to the camera device manager - * @param[in] cb_id The id of registered callback - * @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_INVALID_OPERATION Invalid operation - * @see camera_device_manager_add_device_list_changed_cb() - */ -int camera_device_manager_remove_device_list_changed_cb(camera_device_manager_h manager, int cb_id); - -/** - * @internal * @brief Registers a callback function to be called when the connection state of camera device is changed. * @since_tizen 6.5 * @param[in] manager The handle to the camera device manager diff --git a/include/camera_private.h b/include/camera_private.h index a13a936..4704c38 100644 --- a/include/camera_private.h +++ b/include/camera_private.h @@ -230,8 +230,6 @@ typedef struct _camera_device_manager { int (*initialize)(void); int (*deinitialize)(void); int (*get_device_list)(void *list); - int (*add_device_list_changed_cb)(void *, void *, int *); - int (*remove_device_list_changed_cb)(int); int (*add_device_connection_changed_cb)(void *, void *, int *); int (*remove_device_connection_changed_cb)(int); } camera_device_manager; diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec index c2ed6b3..ac6a1dd 100644 --- a/packaging/capi-media-camera.spec +++ b/packaging/capi-media-camera.spec @@ -1,6 +1,6 @@ Name: capi-media-camera Summary: A Camera API -Version: 0.4.59 +Version: 0.4.60 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/camera_internal.c b/src/camera_internal.c index fed2275..df3b09d 100644 --- a/src/camera_internal.c +++ b/src/camera_internal.c @@ -207,8 +207,6 @@ int camera_device_manager_initialize(camera_device_manager_h *manager) {(void **)&new_manager->initialize, "cdm_initialize"}, {(void **)&new_manager->deinitialize, "cdm_deinitialize"}, {(void **)&new_manager->get_device_list, "cdm_get_device_list"}, - {(void **)&new_manager->add_device_list_changed_cb, "cdm_add_device_list_changed_cb"}, - {(void **)&new_manager->remove_device_list_changed_cb, "cdm_remove_device_list_changed_cb"}, {(void **)&new_manager->add_device_connection_changed_cb, "cdm_add_device_connection_changed_cb"}, {(void **)&new_manager->remove_device_connection_changed_cb, "cdm_remove_device_connection_changed_cb"}, }; @@ -314,55 +312,6 @@ int camera_device_manager_get_device_list(camera_device_manager_h manager, camer } -int camera_device_manager_add_device_list_changed_cb(camera_device_manager_h manager, - camera_device_list_changed_cb callback, void *user_data, int *cb_id) -{ - int ret = CAMERA_ERROR_NONE; - camera_device_manager *m = (camera_device_manager *)manager; - - if (!m || !callback || !cb_id) { - CAM_LOG_ERROR("NULL parameter[%p,%p,%p]", m, callback, cb_id); - return CAMERA_ERROR_INVALID_PARAMETER; - } - - CAM_LOG_INFO("enter"); - - ret = m->add_device_list_changed_cb(callback, user_data, cb_id); - if (ret != CAMERA_ERROR_NONE) { - CAM_LOG_ERROR("failed[0x%x]", ret); - return ret; - } - - CAM_LOG_INFO("cb_id[%d] added", *cb_id); - - return CAMERA_ERROR_NONE; -} - - -int camera_device_manager_remove_device_list_changed_cb(camera_device_manager_h manager, int cb_id) -{ - int ret = CAMERA_ERROR_NONE; - camera_device_manager *m = (camera_device_manager *)manager; - - if (!m) { - CAM_LOG_ERROR("NULL manager"); - return CAMERA_ERROR_INVALID_PARAMETER; - } - - CAM_LOG_INFO("enter - cb_id[%d]", cb_id); - - ret = m->remove_device_list_changed_cb(cb_id); - if (ret != CAMERA_ERROR_NONE) { - CAM_LOG_ERROR("failed[0x%x]", ret); - return ret; - } - - CAM_LOG_INFO("cb_id[%d] removed", cb_id); - - return CAMERA_ERROR_NONE; -} - - int camera_device_manager_add_device_connection_changed_cb(camera_device_manager_h manager, camera_device_connection_changed_cb callback, void *user_data, int *cb_id) { diff --git a/test/camera_test.c b/test/camera_test.c index e50e4d4..a84daf1 100644 --- a/test/camera_test.c +++ b/test/camera_test.c @@ -66,7 +66,6 @@ static GIOChannel *stdin_channel; static camera_device_e camera_device; static GTimer *timer; static int g_camera_device_state_changed_cb_id; -static int g_camera_device_list_changed_cb_id; static int g_camera_device_connection_changed_cb_id; static int g_camera_preview_cb_dump; static int g_camera_extra_preview_cb_dump; @@ -467,26 +466,6 @@ static void _camera_device_state_changed_cb(camera_device_e device, camera_devic return; } -static void _camera_device_list_changed_cb(camera_device_list_s *device_list, void *user_data) -{ - unsigned int i = 0; - - if (!device_list) { - g_print("NULL list"); - return; - } - - g_print("\n\tcamera device list changed[count:%d]\n", device_list->count); - - for (i = 0 ; i < device_list->count ; i++) { - g_print("\t[%d] : type[%d], index[%d], name[%s], id[%s]\n", - i, device_list->device[i].type, device_list->device[i].index, - device_list->device[i].name, device_list->device[i].id); - } - - return; -} - static void _camera_device_connection_changed_cb(camera_device_s *device, bool is_connected, void *user_data) { if (!device) { @@ -918,10 +897,8 @@ static void print_menu() g_print("\t=======================================\n"); g_print("\t '1' Initialize device manager\n"); g_print("\t '2' Get camera device list\n"); - g_print("\t '3' Add camera device list changed callback\n"); - g_print("\t '4' Remove camera device list changed callback\n"); - g_print("\t '5' Add camera device connection changed callback\n"); - g_print("\t '6' Remove camera device connection changed callback\n"); + g_print("\t '3' Add camera device connection changed callback\n"); + g_print("\t '4' Remove camera device connection changed callback\n"); g_print("\t '9' Deinitialize device manager\n"); g_print("\t 'b' back\n"); g_print("\t=======================================\n"); @@ -1727,27 +1704,12 @@ static void device_list_menu(gchar buf) device_list.device[i].name, device_list.device[i].id); } break; - case '3': /* Add device list changed callback */ - ret = camera_device_manager_add_device_list_changed_cb(g_device_manager, - _camera_device_list_changed_cb, NULL, &g_camera_device_list_changed_cb_id); - g_print("\n\tadd result[0x%x] - cb id[%d]\n", ret, g_camera_device_list_changed_cb_id); - break; - case '4': /* Remove device list changed callback */ - if (g_camera_device_list_changed_cb_id > 0) { - ret = camera_device_manager_remove_device_list_changed_cb(g_device_manager, - g_camera_device_list_changed_cb_id); - g_print("\n\tremove result[0x%x] - cb id[%d]\n", ret, g_camera_device_list_changed_cb_id); - g_camera_device_list_changed_cb_id = 0; - } else { - g_print("\n\tinvalid cb id[%d]\n", g_camera_device_list_changed_cb_id); - } - break; - case '5': /* Add device connection changed callback */ + case '3': /* Add device connection changed callback */ ret = camera_device_manager_add_device_connection_changed_cb(g_device_manager, _camera_device_connection_changed_cb, NULL, &g_camera_device_connection_changed_cb_id); g_print("\n\tadd result[0x%x] - cb id[%d]\n", ret, g_camera_device_connection_changed_cb_id); break; - case '6': /* Remove device connection changed callback */ + case '4': /* Remove device connection changed callback */ if (g_camera_device_connection_changed_cb_id > 0) { ret = camera_device_manager_remove_device_connection_changed_cb(g_device_manager, g_camera_device_connection_changed_cb_id); |