From: Sangchul Lee Date: Thu, 15 Sep 2022 06:05:16 +0000 (+0900) Subject: Remove deprecated symbols X-Git-Tag: accepted/tizen/unified/20220929.080313^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_7.0_unified_hotfix;p=platform%2Fcore%2Fapi%2Fsound-manager.git Remove deprecated symbols Removed symbols that have been deprecated since 4.0 are as below. - sound_device_state_e (SOUND_DEVICE_STATE_DEACTIVATED, SOUND_DEVICE_STATE_ACTIVATED) - SOUND_DEVICE_STATE_DEACTIVATED_MASK - SOUND_DEVICE_STATE_ACTIVATED_MASK - sound_manager_get_device_state() - sound_manager_add_device_state_changed_cb() - sound_manager_remove_device_state_changed_cb() [Version] 0.7.0 [Issue Type] API removal Change-Id: I53d067b6ce391f7a46e6940c2c019fe5b3775ca0 Signed-off-by: Sangchul Lee --- diff --git a/include/sound_manager.h b/include/sound_manager.h index 75b422b..186c1f1 100644 --- a/include/sound_manager.h +++ b/include/sound_manager.h @@ -216,16 +216,6 @@ typedef enum { } sound_device_io_direction_e; -/** -* @deprecated Deprecated since 4.0. -* @brief Enumeration for sound device state. -* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif -*/ -typedef enum { - SOUND_DEVICE_STATE_DEACTIVATED, /**< Deactivated state */ - SOUND_DEVICE_STATE_ACTIVATED, /**< Activated state */ -} sound_device_state_e; - /** * @brief Enumeration for sound device mask. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif @@ -236,8 +226,6 @@ typedef enum { SOUND_DEVICE_IO_DIRECTION_BOTH_MASK = 0x0004, /**< Mask for input/output devices (both directions are available) */ SOUND_DEVICE_TYPE_INTERNAL_MASK = 0x0010, /**< Mask for built-in devices */ SOUND_DEVICE_TYPE_EXTERNAL_MASK = 0x0020, /**< Mask for external devices */ - SOUND_DEVICE_STATE_DEACTIVATED_MASK = 0x1000, /**< Mask for deactivated devices (Deprecated since 4.0) */ - SOUND_DEVICE_STATE_ACTIVATED_MASK = 0x2000, /**< Mask for activated devices (Deprecated since 4.0) */ SOUND_DEVICE_ALL_MASK = 0xFFFF, /**< Mask for all devices */ } sound_device_mask_e; @@ -399,22 +387,6 @@ typedef void (*sound_device_connection_changed_cb) (sound_device_h device, bool */ typedef void (*sound_device_running_changed_cb) (sound_device_h device, bool is_running, void *user_data); -/** - * @deprecated Deprecated since 4.0. Use sound_device_running_changed_cb() instead. - * @brief Called when the state of a sound device was changed. - * @since_tizen 3.0 - * - * @remarks @a device is freed by the platform after this callback exits. - * - * @param[in] device The sound_device - * @param[in] state The state of the device - * @param[in] user_data The user data passed from the callback registration function - * @pre You should add this callback using sound_manager_add_device_state_changed_cb(). - * @see sound_manager_add_device_state_changed_cb() - * @see sound_manager_remove_device_state_changed_cb() - */ -typedef void (*sound_device_state_changed_cb) (sound_device_h device, sound_device_state_e state, void *user_data); - /** * @} */ @@ -1377,27 +1349,6 @@ int sound_manager_get_device_name(sound_device_h device, char **name); */ int sound_manager_is_device_running(sound_device_h device, bool *is_running); -/** - * @deprecated Deprecated since 4.0. Use sound_manager_is_device_running() instead. - * @brief Gets the state of the device. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * @param[in] device The device item - * @param[out] state The state of the device - * @return @c 0 on success, - * otherwise a negative error value - * @retval #SOUND_MANAGER_ERROR_NONE Success - * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @see sound_manager_get_device_list() - * @see sound_manager_get_next_device() - * @see sound_manager_get_prev_device() - * @see sound_manager_get_device_type() - * @see sound_manager_get_device_io_direction() - * @see sound_manager_get_device_id() - * @see sound_manager_get_device_name() - * @see sound_manager_free_device_list() - */ -int sound_manager_get_device_state(sound_device_h device, sound_device_state_e *state) TIZEN_DEPRECATED_API; - /** * @brief Gets the device's supported sample formats. * @since_tizen 5.0 @@ -1682,41 +1633,6 @@ int sound_manager_add_device_running_changed_cb(int device_mask, sound_device_ru */ int sound_manager_remove_device_running_changed_cb(int id); -/** - * @deprecated Deprecated since 4.0. Use sound_manager_add_device_running_changed_cb() instead. - * @brief Adds a callback function to be invoked when the state of a sound device was changed. - * @since_tizen 3.0 - * - * @param[in] device_mask Devices for which changes should be tracked, values of #sound_device_mask_e combined with bitwise 'or' - * @param[in] callback The device state changed callback function - * @param[in] user_data The user data to be passed to the callback function - * @param[out] id The callback id - * @return @c 0 on success, - * otherwise a negative error value - * @retval #SOUND_MANAGER_ERROR_NONE Success - * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system - * @post sound_device_state_changed_cb() will be invoked. - * @see sound_manager_remove_device_state_changed_cb() - * @see sound_device_state_changed_cb() - */ -int sound_manager_add_device_state_changed_cb(int device_mask, sound_device_state_changed_cb callback, void *user_data, int *id) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. Use sound_manager_remove_device_running_changed_cb() instead. - * @brief Removes a callback function invoked when the state of a sound device was changed. - * @since_tizen 3.0 - * - * @param[in] id The id of the callback to remove - * @return @c 0 on success, - * otherwise a negative error value - * @retval #SOUND_MANAGER_ERROR_NONE Success - * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system - * @see sound_manager_add_device_state_changed_cb() - */ -int sound_manager_remove_device_state_changed_cb(int id) TIZEN_DEPRECATED_API; - /** * @} */ diff --git a/include/sound_manager_internal.h b/include/sound_manager_internal.h index 8bd2b3c..cee7e34 100644 --- a/include/sound_manager_internal.h +++ b/include/sound_manager_internal.h @@ -572,24 +572,6 @@ int sound_manager_set_stream_preemptive_device(sound_stream_type_e stream_type, */ int sound_manager_get_stream_preemptive_device(sound_stream_type_e stream_type, int *in_device_id, int *out_device_id); -/** - * @internal - * @brief Gets the state of the device by id. - * @since_tizen 4.0 - * @param[in] device_id The device id - * @param[out] state The state of the device - * @return @c 0 on success, - * otherwise a negative error value - * @retval #SOUND_MANAGER_ERROR_NONE Success - * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @see sound_manager_get_device_list() - * @see sound_manager_get_next_device() - * @see sound_manager_get_prev_device() - * @see sound_manager_get_device_id() - * @see sound_manager_free_device_list() - */ -int sound_manager_get_device_state_by_id(int device_id, sound_device_state_e *state); - /** * @internal * @brief Checks if the device is running. @@ -991,7 +973,6 @@ int sound_manager_set_filter_preset(sound_stream_type_e stream_type, sound_filte * @see sound_manager_get_device_type() * @see sound_manager_get_device_io_direction() * @see sound_manager_get_device_name() - * @see sound_manager_get_device_state() * @see sound_manager_get_device_id() * @see sound_manager_get_device_product_id() * @see sound_manager_free_device_list() @@ -1018,7 +999,6 @@ int sound_manager_get_device_vendor_id(sound_device_h device, int *vendor_id); * @see sound_manager_get_device_type() * @see sound_manager_get_device_io_direction() * @see sound_manager_get_device_name() - * @see sound_manager_get_device_state() * @see sound_manager_get_device_id() * @see sound_manager_get_device_vendor_id() * @see sound_manager_free_device_list() diff --git a/include/sound_manager_internal_tv.h b/include/sound_manager_internal_tv.h index 5d4ba49..d858ce6 100644 --- a/include/sound_manager_internal_tv.h +++ b/include/sound_manager_internal_tv.h @@ -527,24 +527,6 @@ int sound_manager_set_stream_preemptive_device(sound_stream_type_e stream_type, */ int sound_manager_get_stream_preemptive_device(sound_stream_type_e stream_type, int *in_device_id, int *out_device_id); -/** - * @internal - * @brief Gets the state of the device by id. - * @since_tizen 4.0 - * @param[in] device_id The device id - * @param[out] state The state of the device - * @return @c 0 on success, - * otherwise a negative error value - * @retval #SOUND_MANAGER_ERROR_NONE Success - * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @see sound_manager_get_device_list() - * @see sound_manager_get_next_device() - * @see sound_manager_get_prev_device() - * @see sound_manager_get_device_id() - * @see sound_manager_free_device_list() - */ -int sound_manager_get_device_state_by_id(int device_id, sound_device_state_e *state); - /** * @internal * @brief Checks if the device is running. @@ -946,7 +928,6 @@ int sound_manager_set_filter_preset(sound_stream_type_e stream_type, sound_filte * @see sound_manager_get_device_type() * @see sound_manager_get_device_io_direction() * @see sound_manager_get_device_name() - * @see sound_manager_get_device_state() * @see sound_manager_get_device_id() * @see sound_manager_get_device_product_id() * @see sound_manager_free_device_list() @@ -973,7 +954,6 @@ int sound_manager_get_device_vendor_id(sound_device_h device, int *vendor_id); * @see sound_manager_get_device_type() * @see sound_manager_get_device_io_direction() * @see sound_manager_get_device_name() - * @see sound_manager_get_device_state() * @see sound_manager_get_device_id() * @see sound_manager_get_device_vendor_id() * @see sound_manager_free_device_list() diff --git a/packaging/capi-media-sound-manager.spec b/packaging/capi-media-sound-manager.spec index 5d0ccc6..a4b567e 100644 --- a/packaging/capi-media-sound-manager.spec +++ b/packaging/capi-media-sound-manager.spec @@ -1,6 +1,6 @@ Name: capi-media-sound-manager Summary: Sound Manager library -Version: 0.6.51 +Version: 0.7.0 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/sound_manager.c b/src/sound_manager.c index 89f3046..263e836 100644 --- a/src/sound_manager.c +++ b/src/sound_manager.c @@ -989,17 +989,6 @@ int sound_manager_is_device_running(sound_device_h device, bool *is_running) return _convert_sound_manager_error_code(__func__, ret); } -int sound_manager_get_device_state(sound_device_h device, sound_device_state_e *state) -{ - SM_ARG_CHECK(device); - SM_ARG_CHECK(state); - - LOGW("DEPRECATION WARNING: %s() is deprecated and will be removed from next release.", __func__); - *state = SOUND_DEVICE_STATE_DEACTIVATED; - - return SOUND_MANAGER_ERROR_NONE; -} - int sound_manager_get_supported_sample_formats(sound_device_h device, sound_sample_format_e **formats, unsigned int *num_of_elems) { int ret = SOUND_MANAGER_ERROR_NONE; @@ -1256,24 +1245,6 @@ int sound_manager_remove_device_running_changed_cb(int id) return _convert_sound_manager_error_code(__func__, ret); } -int sound_manager_add_device_state_changed_cb(int device_mask, sound_device_state_changed_cb callback, void *user_data, int *id) -{ - LOGW("DEPRECATION WARNING: %s() is deprecated and will be removed from next release.", __func__); - SM_ARG_CHECK(callback); - SM_ARG_CHECK(id); - - *id = -1; - - return SOUND_MANAGER_ERROR_NONE; -} - -int sound_manager_remove_device_state_changed_cb(int id) -{ - LOGW("DEPRECATION WARNING: %s() is deprecated and will be removed from next release.", __func__); - - return SOUND_MANAGER_ERROR_NONE; -} - int sound_manager_create_stream_ducking(sound_stream_type_e target_stream, sound_stream_ducking_state_changed_cb callback, void *user_data, sound_stream_ducking_h *stream_ducking) { int i = 0; diff --git a/src/sound_manager_internal.c b/src/sound_manager_internal.c index a6eeed7..eeb244d 100644 --- a/src/sound_manager_internal.c +++ b/src/sound_manager_internal.c @@ -326,29 +326,6 @@ int sound_manager_set_stream_preferred_device_id(sound_stream_info_h stream_info return _set_preferred_device_id((sound_stream_info_s*)stream_info, io_direction, device_id); } -int sound_manager_get_device_state_by_id(int device_id, sound_device_state_e *state) -{ - int ret = MM_ERROR_NONE; - MMSoundDevice_t device = NULL; - - SM_ARG_CHECK(state); - - LOGI("device_id[%d]", device_id); - - if ((ret = mm_sound_get_device_by_id(device_id, &device)) != MM_ERROR_NONE) { - LOGE("failed to mm_sound_get_device_by_id()"); - goto LEAVE; - } - - ret = mm_sound_get_device_state(device, (mm_sound_device_state_e*)state); - - LOGI("state[%d]", *state); - - mm_sound_free_device(device); -LEAVE: - return _convert_sound_manager_error_code(__func__, ret); -} - int sound_manager_is_device_running_by_id(int device_id, bool *is_running) { SM_ARG_CHECK(is_running); diff --git a/test/sound_manager_test.c b/test/sound_manager_test.c index 005647e..3f1e53d 100644 --- a/test/sound_manager_test.c +++ b/test/sound_manager_test.c @@ -51,7 +51,7 @@ enum { CURRENT_STATUS_FREE_DEVICE_LIST, CURRENT_STATUS_GET_DEVICE_NEXT, CURRENT_STATUS_GET_DEVICE_PREV, - CURRENT_STATUS_GET_DEVICE_STATE_BY_ID, + CURRENT_STATUS_IS_DEVICE_RUNNING_BY_ID, CURRENT_STATUS_GET_SUPPORTED_SAMPLE_FORMATS, CURRENT_STATUS_SET_SAMPLE_FORMAT, CURRENT_STATUS_GET_SAMPLE_FORMAT, @@ -137,7 +137,6 @@ sound_stream_ducking_h g_stream_ducking_h = NULL; int g_volume_cb_id; int g_internal_volume_cb_id; int g_device_conn_cb_id; -int g_device_state_cb_id; int g_device_running_cb_id; static const char *g_device_direction_str[] = {"IN", "OUT", "BOTH"}; @@ -262,7 +261,7 @@ void _interpret_main_menu(char *cmd) else if (strncmp(cmd, "gp", MAX_CMD_LEN) == 0) g_menu_state = CURRENT_STATUS_GET_DEVICE_PREV; else if (strncmp(cmd, "gd", MAX_CMD_LEN) == 0) - g_menu_state = CURRENT_STATUS_GET_DEVICE_STATE_BY_ID; + g_menu_state = CURRENT_STATUS_IS_DEVICE_RUNNING_BY_ID; else if (strncmp(cmd, "gssf", MAX_CMD_LEN) == 0) g_menu_state = CURRENT_STATUS_GET_SUPPORTED_SAMPLE_FORMATS; else if (strncmp(cmd, "ssf", MAX_CMD_LEN) == 0) @@ -450,7 +449,7 @@ void display_sub_basic() g_print("fl. Free Devices List\n"); g_print("gn. Get Next Device\t\t"); g_print("gp. Get Prev Device\n"); - g_print("gd. *Get Device State by Id\n"); + g_print("gd. *Is Device Running by Id\n"); g_print("gssf. Get Supported Sample Formats\t"); g_print("gssr. Get Supported Sample Rates\n"); g_print("ssf. Set Sample Format\t"); @@ -572,8 +571,8 @@ static void displaymenu() g_print("*** press enter to get next device from the list\n"); else if (g_menu_state == CURRENT_STATUS_GET_DEVICE_PREV) g_print("*** press enter to get previous device from the list\n"); - else if (g_menu_state == CURRENT_STATUS_GET_DEVICE_STATE_BY_ID) - g_print("*** press enter device id to get state\n"); + else if (g_menu_state == CURRENT_STATUS_IS_DEVICE_RUNNING_BY_ID) + g_print("*** press enter device id to check device running\n"); else if (g_menu_state == CURRENT_STATUS_GET_SUPPORTED_SAMPLE_FORMATS) g_print("*** press enter to get supported sample formats\n"); else if (g_menu_state == CURRENT_STATUS_SET_SAMPLE_FORMAT) @@ -1243,7 +1242,7 @@ static void interpret(char *cmd) reset_menu_state(); break; } - case CURRENT_STATUS_GET_DEVICE_STATE_BY_ID: { + case CURRENT_STATUS_IS_DEVICE_RUNNING_BY_ID: { int ret = SOUND_MANAGER_ERROR_NONE; int device_id; bool is_running; @@ -1419,7 +1418,7 @@ static void interpret(char *cmd) break; } case CURRENT_STATUS_REMOVE_DEVICE_RUNNING_CHANGED_CB: { - if (sound_manager_remove_device_state_changed_cb(g_device_running_cb_id)) + if (sound_manager_remove_device_running_changed_cb(g_device_running_cb_id)) g_print("fail to remove device running changed cb\n"); else g_print("success to remove device running changed cb\n");