From 6f2a44eb07e686f30452b67bb4dcfc36a9d9e2c1 Mon Sep 17 00:00:00 2001 From: Eunhae Choi Date: Thu, 8 Nov 2018 14:42:24 +0900 Subject: [PATCH] [ACR-1315] Remove Deprecated API since 4.0 Change-Id: I4cbf6ad3704c7780cb4ae31497e7b045aff8d17c --- doc/player_doc.h | 6 -- include/player.h | 102 ---------------------- src/player.c | 182 +-------------------------------------- test/player_audio_test.c | 23 ----- test/player_test.c | 23 ----- 5 files changed, 1 insertion(+), 335 deletions(-) diff --git a/doc/player_doc.h b/doc/player_doc.h index 9bb3837..e1075dd 100644 --- a/doc/player_doc.h +++ b/doc/player_doc.h @@ -308,12 +308,6 @@ * called during content buffering * * - * player_set_progressive_download_message_cb() - * player_unset_progressive_download_message_cb() - * player_pd_message_cb() - * called when a progressive download starts or completes - * - * * player_set_subtitle_updated_cb() * player_unset_subtitle_updated_cb() * player_subtitle_updated_cb() diff --git a/include/player.h b/include/player.h index 0f59ada..e6df6ab 100644 --- a/include/player.h +++ b/include/player.h @@ -105,33 +105,12 @@ typedef enum { PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT = 4, /**< Interrupted by a resource conflict and the player handle will be paused or unprepared */ } player_interrupted_code_e; -/** - * @brief Enumeration for progressive download message type. - * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif - */ -typedef enum { - PLAYER_PD_STARTED = 0, /**< Progressive download is started */ - PLAYER_PD_COMPLETED, /**< Progressive download is completed */ -} player_pd_message_type_e; - /** * @brief Enumeration for display type. * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif */ typedef enum { PLAYER_DISPLAY_TYPE_OVERLAY = 0, /**< Overlay surface display */ - PLAYER_DISPLAY_TYPE_OBSOLETE_EVAS_WNONE = 1, - /**< Obsolete. Acts as #PLAYER_DISPLAY_TYPE_NONE on Wearable, - #PLAYER_DISPLAY_TYPE_EVAS in all other cases. - This symbol was added for backward compatibility reasons. - It should not be used. (Deprecated since 4.0) */ - - PLAYER_DISPLAY_TYPE_OBSOLETE_NONE_WEVAS = 2, - /**< Obsolete. Acts as #PLAYER_DISPLAY_TYPE_EVAS on Wearable 3.0 and later, - #PLAYER_DISPLAY_TYPE_NONE in all other cases. - This symbol was added for backward compatibility reasons. - It should not be used. (Deprecated since 4.0) */ - PLAYER_DISPLAY_TYPE_EVAS = 3, /**< Evas image object surface display (Since 4.0) */ PLAYER_DISPLAY_TYPE_NONE = 4, /**< This disposes of buffers (Since 4.0) */ } player_display_type_e; @@ -431,14 +410,6 @@ typedef void (*player_video_stream_changed_cb) (int width, int height, int fps, */ typedef void (*player_buffering_cb)(int percent, void *user_data); -/** - * @brief Called when progressive download is started or completed. - * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif - * @param[in] type The message type for progressive download - * @param[in] user_data The user data passed from the callback registration function - */ -typedef void (*player_pd_message_cb)(player_pd_message_type_e type, void *user_data); - /** * @brief Called to notify the streaming variant information. * @details The adaptive streaming protocol(hls, mpeg dash) can support variant stream condition. @@ -805,7 +776,6 @@ int player_start(player_h player); * @retval #PLAYER_ERROR_SOUND_POLICY Sound policy error * @pre The player state must be set to #PLAYER_STATE_PLAYING by calling player_start() or set to #PLAYER_STATE_PAUSED by calling player_pause(). * @post The player state will be #PLAYER_STATE_READY. - * @post The downloading will be aborted if you use progressive download. * @see player_start() * @see player_pause() */ @@ -1932,78 +1902,6 @@ int player_set_buffering_cb(player_h player, player_buffering_cb callback, void */ int player_unset_buffering_cb(player_h player); -/** - * @deprecated Deprecated since 4.0. - * @brief Sets a path to download, progressively. - * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif - * @remarks Progressive download will be started when you invoke player_start(). - * @remarks This function must be called before calling the player_prepare() or player_prepare_async() to reflect the download path when the player is building. - * @remarks The mediastorage privilege(http://tizen.org/privilege/mediastorage) must be added if any files are used to download and play located in the internal storage. - * @remarks The externalstorage privilege(http://tizen.org/privilege/externalstorage) must be added if any files are used to download and play located in the external storage. - * - * @param[in] player The handle to the media player - * @param[in] path The absolute path to download - * @return @c 0 on success, - * otherwise a negative error value - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation - * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state - * @if WEARABLE @retval #PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE Unsupported feature @endif - * @retval #PLAYER_ERROR_PERMISSION_DENIED Permission denied - * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare(). - */ -int player_set_progressive_download_path(player_h player, const char *path) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. - * @brief Gets the status of progressive download. - * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif - * @param[in] player The handle to the media player - * @param[out] current The current download position (bytes) - * @param[out] total_size The total size of the file (bytes) - * @return @c 0 on success, - * otherwise a negative error value - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation - * @retval #PLAYER_ERROR_INVALID_STATE Invalid player state - * @pre The progressive download path must be set by calling player_set_progressive_download_path(). - * @pre The player state must be set to #PLAYER_STATE_PLAYING by calling player_start() or set to #PLAYER_STATE_PAUSED by calling player_pause(). - */ -int player_get_progressive_download_status(player_h player, unsigned long *current, unsigned long *total_size) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. - * @brief Sets a callback function to be invoked when progressive download is started or completed. - * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif - * @param[in] player The handle to the media player - * @param[in] callback The callback function to register - * @param[in] user_data The user data to be passed to the callback function - * @return @c 0 on success, - * otherwise a negative error value - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation - * @if WEARABLE @retval #PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE Unsupported feature @endif - * @pre The path to download must be set by calling player_set_progressive_download_path(). - * @post player_pd_message_cb() will be invoked. - */ -int player_set_progressive_download_message_cb(player_h player, player_pd_message_cb callback, void *user_data) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. - * @brief Unsets the progressive download message callback function. - * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif - * @param[in] player The handle to the media player - * @return @c 0 on success, - * otherwise a negative error value - * @retval #PLAYER_ERROR_NONE Successful - * @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation - */ -int player_unset_progressive_download_message_cb(player_h player) TIZEN_DEPRECATED_API; - /** * @} */ diff --git a/src/player.c b/src/player.c index f20bb27..1faf842 100644 --- a/src/player.c +++ b/src/player.c @@ -48,14 +48,6 @@ #ifndef M_PI #define M_PI 3.14159265358979323846 #endif -typedef enum { - TIZEN_PROFILE_UNKNOWN = 0, - TIZEN_PROFILE_MOBILE = 0x1, - TIZEN_PROFILE_WEARABLE = 0x2, - TIZEN_PROFILE_TV = 0x4, - TIZEN_PROFILE_IVI = 0x8, - TIZEN_PROFILE_COMMON = 0x10, -} tizen_profile_t; typedef struct { tbm_fd tfd[MUSE_NUM_FD]; @@ -147,40 +139,6 @@ int _player_send_msg_async(int send_fd, char* msg) return PLAYER_ERROR_NONE; } -static tizen_profile_t _get_tizen_profile() -{ - char *profileName; - static tizen_profile_t profile = TIZEN_PROFILE_UNKNOWN; - - if (__builtin_expect(profile != TIZEN_PROFILE_UNKNOWN, 1)) - return profile; - - system_info_get_platform_string("http://tizen.org/feature/profile", &profileName); - switch (*profileName) { - case 'm': - case 'M': - profile = TIZEN_PROFILE_MOBILE; - break; - case 'w': - case 'W': - profile = TIZEN_PROFILE_WEARABLE; - break; - case 't': - case 'T': - profile = TIZEN_PROFILE_TV; - break; - case 'i': - case 'I': - profile = TIZEN_PROFILE_IVI; - break; - default: // common or unknown ==> ALL ARE COMMON. - profile = TIZEN_PROFILE_COMMON; - } - free(profileName); - - return profile; -} - static int _get_current_state(player_cli_s *pc, player_state_e *pstate) { PLAYER_INSTANCE_CHECK(pc); @@ -1064,15 +1022,6 @@ static void __video_frame_render_error_cb_handler(callback_cb_info_s * cb_info, { } -static void __pd_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data) -{ - int type; - muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_PD; - - if (player_msg_get(type, recv_data->buffer)) - ((player_pd_message_cb) cb_info->user_cb[ev]) (type, cb_info->user_data[ev]); -} - static void __supported_audio_effect_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data) { } @@ -1199,7 +1148,6 @@ static void (*_user_callbacks[MUSE_PLAYER_EVENT_TYPE_NUM]) (callback_cb_info_s * __media_packet_video_frame_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME */ __audio_frame_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_AUDIO_FRAME */ __video_frame_render_error_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_VIDEO_FRAME_RENDER_ERROR */ - __pd_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_PD */ __supported_audio_effect_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_SUPPORTED_AUDIO_EFFECT */ __supported_audio_effect_preset_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_SUPPORTED_AUDIO_EFFECT_PRESET */ __missed_plugin_cb_handler, /* MUSE_PLAYER_EVENT_TYPE_MISSED_PLUGIN */ @@ -1273,7 +1221,6 @@ static bool _player_need_sync_context(int event_id) { if ((event_id == MUSE_PLAYER_EVENT_TYPE_INTERRUPT) || (event_id == MUSE_PLAYER_EVENT_TYPE_BUFFERING) || - (event_id == MUSE_PLAYER_EVENT_TYPE_PD) || (event_id == MUSE_PLAYER_EVENT_TYPE_COMPLETE) || (event_id == MUSE_PLAYER_EVENT_TYPE_ERROR) || (event_id == MUSE_PLAYER_EVENT_TYPE_SERVICE_DISCONNECTED) || @@ -2913,18 +2860,6 @@ int _player_convert_display_type(player_display_type_e type, player_private_disp case PLAYER_DISPLAY_TYPE_OVERLAY: *out_type = PLAYER_PRIVATE_DISPLAY_TYPE_OVERLAY; break; - case PLAYER_DISPLAY_TYPE_OBSOLETE_EVAS_WNONE: - if (_get_tizen_profile() == TIZEN_PROFILE_WEARABLE) - *out_type = PLAYER_PRIVATE_DISPLAY_TYPE_NONE; - else - *out_type = PLAYER_PRIVATE_DISPLAY_TYPE_EVAS; - break; - case PLAYER_DISPLAY_TYPE_OBSOLETE_NONE_WEVAS: - if (_get_tizen_profile() == TIZEN_PROFILE_WEARABLE) - *out_type = PLAYER_PRIVATE_DISPLAY_TYPE_EVAS; - else - *out_type = PLAYER_PRIVATE_DISPLAY_TYPE_NONE; - break; case PLAYER_DISPLAY_TYPE_EVAS: *out_type = PLAYER_PRIVATE_DISPLAY_TYPE_EVAS; break; @@ -2950,7 +2885,7 @@ int player_set_display(player_h player, player_display_type_e type, player_displ wl_win_msg_type wl_win; char *wl_win_msg = (char *)&wl_win; unsigned int wl_surface_id; - player_private_display_type_e conv_type; + player_private_display_type_e conv_type = PLAYER_DISPLAY_TYPE_NONE; unsigned int (*p_disp_set_wl_display)(int, void *) = NULL; int arr_msg_len = 0; #ifdef TIZEN_FEATURE_EVAS_RENDERER @@ -2974,10 +2909,6 @@ int player_set_display(player_h player, player_display_type_e type, player_displ PLAYER_VIDEO_SUPPORTABLE_CHECK(pc); LOGD("ENTER type: %d", type); - if (type == PLAYER_DISPLAY_TYPE_OBSOLETE_EVAS_WNONE || - type == PLAYER_DISPLAY_TYPE_OBSOLETE_NONE_WEVAS) { - LOGW("DEPRECATION WARNING: display type(%d) is deprecated and will be removed from next release. Use newly defined type value instead.", type); - } /* before setting display, player state have to be checked. */ PLAYER_STATE_CHECK(pc, PLAYER_STATE_IDLE); @@ -3891,62 +3822,6 @@ int player_set_subtitle_position_offset(player_h player, int milliseconds) return ret; } -int player_set_progressive_download_path(player_h player, const char *path) -{ - PLAYER_INSTANCE_CHECK(player); - PLAYER_NULL_ARG_CHECK(path); - int ret = PLAYER_ERROR_NONE; - muse_player_api_e api = MUSE_PLAYER_API_SET_PROGRESSIVE_DOWNLOAD_PATH; - player_cli_s *pc = (player_cli_s *) player; - char *ret_buf = NULL; - char dw_path[MAX_URL_LEN] = {0, }; - - LOGD("ENTER"); - LOGW("DEPRECATION WARNING: player_set_progressive_download_path() is deprecated and will be removed from next release."); - - if (!_player_check_network_availability()) - return PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE; - - if (_player_get_valid_path(path, dw_path) != PLAYER_ERROR_NONE) - return PLAYER_ERROR_INVALID_PARAMETER; - - PLAYER_SEND_MSG(api, pc, ret_buf, ret, MUSE_TYPE_STRING, "dw_path", (const char*)dw_path); - g_free(ret_buf); - return ret; -} - -int player_get_progressive_download_status(player_h player, unsigned long *pcurrent, unsigned long *ptotal_size) -{ - PLAYER_INSTANCE_CHECK(player); - PLAYER_NULL_ARG_CHECK(pcurrent && ptotal_size); - int ret = PLAYER_ERROR_NONE; - muse_player_api_e api = MUSE_PLAYER_API_GET_PROGRESSIVE_DOWNLOAD_STATUS; - player_cli_s *pc = (player_cli_s *) player; - char *ret_buf = NULL; - unsigned long current, total_size; - - LOGD("ENTER"); - LOGW("DEPRECATION WARNING: player_get_progressive_download_status() is deprecated and will be removed from next release."); - - PLAYER_SEND_MSG(api, pc, ret_buf, ret); - if (ret == PLAYER_ERROR_NONE) { - bool ret_val = true; - ret_val = _player_get_param_value(ret_buf, - MUSE_TYPE_POINTER, "current", (void *)¤t, - MUSE_TYPE_POINTER, "total_size", (void *)&total_size, - INVALID_MUSE_TYPE_VALUE); - if (ret_val) { - *pcurrent = current; - *ptotal_size = total_size; - } else { - ret = PLAYER_ERROR_INVALID_OPERATION; - } - } - g_free(ret_buf); - return ret; - -} - int player_capture_video(player_h player, player_video_captured_cb callback, void *user_data) { PLAYER_INSTANCE_CHECK(player); @@ -4125,61 +4000,6 @@ int player_unset_subtitle_updated_cb(player_h player) return __unset_callback(MUSE_PLAYER_EVENT_TYPE_SUBTITLE, player); } -int player_set_progressive_download_message_cb(player_h player, player_pd_message_cb callback, void *user_data) -{ - PLAYER_INSTANCE_CHECK(player); - PLAYER_NULL_ARG_CHECK(callback); - int ret = PLAYER_ERROR_NONE; - player_cli_s *pc = (player_cli_s *) player; - muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK; - char *ret_buf = NULL; - muse_player_event_e type = MUSE_PLAYER_EVENT_TYPE_PD; - int set = 1; - - LOGD("ENTER"); - LOGW("DEPRECATION WARNING: player_set_progressive_download_message_cb() is deprecated and will be removed from next release."); - - if (!_player_check_network_availability()) - return PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE; - - PLAYER_SEND_MSG(api, pc, ret_buf, ret, - MUSE_TYPE_INT, "type", type, - MUSE_TYPE_INT, "set", set); - - if (ret == PLAYER_ERROR_NONE) { - pc->cb_info->user_cb[type] = callback; - pc->cb_info->user_data[type] = user_data; - LOGI("Event type : %d ", type); - } - - g_free(ret_buf); - return ret; -} - -int player_unset_progressive_download_message_cb(player_h player) -{ - PLAYER_INSTANCE_CHECK(player); - int ret = PLAYER_ERROR_NONE; - player_cli_s *pc = (player_cli_s *) player; - muse_player_api_e api = MUSE_PLAYER_API_SET_CALLBACK; - char *ret_buf = NULL; - muse_player_event_e type = MUSE_PLAYER_EVENT_TYPE_PD; - int set = 0; - - LOGD("ENTER"); - LOGW("DEPRECATION WARNING: player_unset_progressive_download_message_cb() is deprecated and will be removed from next release."); - - set_null_user_cb_lock(pc->cb_info, type); - - PLAYER_SEND_MSG(api, pc, ret_buf, ret, - MUSE_TYPE_INT, "type", type, - MUSE_TYPE_INT, "set", set); - - g_free(ret_buf); - return ret; - -} - int player_set_media_packet_video_frame_decoded_cb(player_h player, player_media_packet_video_decoded_cb callback, void *user_data) { PLAYER_INSTANCE_CHECK(player); diff --git a/test/player_audio_test.c b/test/player_audio_test.c index 5c73bbc..0a08a9c 100644 --- a/test/player_audio_test.c +++ b/test/player_audio_test.c @@ -165,11 +165,6 @@ static void _audio_frame_decoded_cb_ex(player_audio_raw_data_s * audio_raw_frame #endif } -static void progress_down_cb(player_pd_message_type_e type, void *user_data) -{ - g_print("[Player_Audio_Test] progress_down_cb!!!! type : %d\n", type); -} - static void buffering_cb(int percent, void *user_data) { g_print("[Player_Audio_Test] buffering_cb!!!! percent : %d\n", percent); @@ -592,20 +587,6 @@ static void _player_state() g_print(" ==> [Player_Audio_Test] Current Player State : %d\n", state); } -static void _player_set_progressive_download() -{ - player_set_progressive_download_path(g_player[0], "/tmp/test.pd"); - player_set_progressive_download_message_cb(g_player[0], progress_down_cb, (void *)g_player[0]); -} - -static void _player_get_progressive_download_status() -{ - int bRet = 0; - unsigned long curr = 0, total = 0; - bRet = player_get_progressive_download_status(g_player[0], &curr, &total); - g_print("player_get_progressive_download_status return[%d] ==> [Player_Audio_Test] progressive download status : %lu/%lu\n", bRet, curr, total); -} - static void set_next_uri(char * uri) { if (TIZEN_TV) { @@ -1062,10 +1043,6 @@ void _interpret_main_menu(char *cmd) _player_unprepare(); } else if (strncmp(cmd, "dt", 2) == 0) { _player_destroy(); - } else if (strncmp(cmd, "sp", 2) == 0) { - _player_set_progressive_download(); - } else if (strncmp(cmd, "gp", 2) == 0) { - _player_get_progressive_download_status(); } else if (strncmp(cmd, "mp", 2) == 0) { g_memory_playback = (g_memory_playback ? FALSE : TRUE); g_print("memory playback = %d\n", g_memory_playback); diff --git a/test/player_test.c b/test/player_test.c index b089e06..42d5b18 100644 --- a/test/player_test.c +++ b/test/player_test.c @@ -603,11 +603,6 @@ static void _audio_frame_decoded_cb_ex(player_audio_raw_data_s * audio_raw_frame #endif } -static void progress_down_cb(player_pd_message_type_e type, void *user_data) -{ - g_print("[Player_Test] progress_down_cb!!!! type : %d\n", type); -} - static void buffering_cb(int percent, void *user_data) { g_print("[Player_Test] buffering_cb!!!! percent : %d\n", percent); @@ -1278,20 +1273,6 @@ static void _player_state() g_print(" ==> [Player_Test] Current Player State : %d\n", state); } -static void _player_set_progressive_download() -{ - player_set_progressive_download_path(g_player[0], "/tmp/test.pd"); - player_set_progressive_download_message_cb(g_player[0], progress_down_cb, (void *)g_player[0]); -} - -static void _player_get_progressive_download_status() -{ - int bRet = 0; - unsigned long curr = 0, total = 0; - bRet = player_get_progressive_download_status(g_player[0], &curr, &total); - g_print("player_get_progressive_download_status return[%d] ==> [Player_Test] progressive download status : %lu/%lu\n", bRet, curr, total); -} - static void _player_enable_tsurf_pool(void) { bool enabled = FALSE; @@ -2227,10 +2208,6 @@ void _interpret_main_menu(char *cmd) _player_unprepare(); } else if (strncmp(cmd, "dt", 2) == 0) { _player_destroy(); - } else if (strncmp(cmd, "sp", 2) == 0) { - _player_set_progressive_download(); - } else if (strncmp(cmd, "gp", 2) == 0) { - _player_get_progressive_download_status(); } else if (strncmp(cmd, "mp", 2) == 0) { g_memory_playback = (g_memory_playback ? FALSE : TRUE); g_print("memory playback = %d\n", g_memory_playback); -- 2.34.1