[ACR-1155] Remove deprecated API and enum 06/167706/3 accepted/tizen/unified/20180509.072957 submit/tizen/20180508.102444
authorGilbok Lee <gilbok.lee@samsung.com>
Fri, 19 Jan 2018 08:16:22 +0000 (17:16 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Tue, 8 May 2018 09:38:23 +0000 (18:38 +0900)
Change-Id: Ie0bd4e3fdb02ba8eab0af34424468acd12669a6d

doc/player_doc.h
include/player.h
src/player.c
test/player_audio_test.c
test/player_test.c

index e707952..3d2d9d0 100644 (file)
  *    <td>This function must be called before player_prepare()</td>
  * </tr>
  * <tr>
- *    <td>player_set_sound_type()</td>
- *    <td>IDLE</td>
- *    <td>This function must be called before player_prepare()</td>
- * </tr>
- * <tr>
  *    <td>player_set_mute()</td>
  *    <td>IDLE/ READY/ PLAYING/ PAUSED</td>
  *    <td>This function must be called after player_create()</td>
index 248c73d..c47eafa 100644 (file)
@@ -102,14 +102,7 @@ typedef enum {
  * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
  */
 typedef enum {
-       PLAYER_INTERRUPTED_COMPLETED = 0,           /**< Interrupt completed (Deprecated since 3.0)*/
-       PLAYER_INTERRUPTED_BY_MEDIA,                /**< Interrupted by a non-resumable media application (Deprecated since 3.0)*/
-       PLAYER_INTERRUPTED_BY_CALL,                 /**< Interrupted by an incoming call (Deprecated since 3.0)*/
-       PLAYER_INTERRUPTED_BY_EARJACK_UNPLUG,       /**< Interrupted by unplugging headphones (Deprecated since 3.0)*/
-       PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT,    /**< Interrupted by a resource conflict and the player handle will be paused or unprepared */
-       PLAYER_INTERRUPTED_BY_ALARM,                /**< Interrupted by an alarm (Deprecated since 3.0)*/
-       PLAYER_INTERRUPTED_BY_EMERGENCY,            /**< Interrupted by an emergency (Deprecated since 3.0)*/
-       PLAYER_INTERRUPTED_BY_NOTIFICATION,         /**< Interrupted by a notification (Deprecated since 3.0)*/
+       PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT = 4,    /**< Interrupted by a resource conflict and the player handle will be paused or unprepared */
 } player_interrupted_code_e;
 
 /**
@@ -682,27 +675,6 @@ int player_set_volume(player_h player, float left, float right);
 int player_get_volume(player_h player, float *left, float *right);
 
 /**
- * @deprecated Deprecated since 3.0. Use player_set_sound_stream_info() instead.
- * @brief Sets the player's volume type.
- * @since_tizen @if WEARABLE 2.3.1 @else 2.3 @endif
- * @remarks The default sound type of the player is #SOUND_TYPE_MEDIA.
- *          To get the current sound type, use sound_manager_get_current_sound_type().
- * @remarks If stream_info already exists by calling sound_manager_create_stream_info(),
- *          It will return error since 3.0.
- *
- * @param[in]   player The handle to the media player
- * @param[in]   type The sound type
- * @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_SOUND_POLICY Sound policy error
- * @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create().
- * @see sound_manager_get_current_sound_type()
- */
-int player_set_sound_type(player_h player, sound_type_e type) TIZEN_DEPRECATED_API;
-
-/**
  * @brief Sets the player's sound manager stream information.
  * @since_tizen 3.0
  * @remarks You can set sound stream information including audio routing and volume type.
index c21f067..7e0f040 100644 (file)
@@ -439,46 +439,13 @@ static void __retrieve_buffer_cb_handler(callback_cb_info_s * cb_info, _player_r
 }
 #endif
 
-static char* _convert_code_to_str(int code)
-{
-       switch (code) {
-       case PLAYER_INTERRUPTED_COMPLETED:          /* Deprecated since 3.0 */
-               return "PLAYER_INTERRUPTED_COMPLETED";
-       case PLAYER_INTERRUPTED_BY_MEDIA:           /* Deprecated since 3.0 */
-               return "PLAYER_INTERRUPTED_BY_MEDIA";
-       case PLAYER_INTERRUPTED_BY_CALL:            /* Deprecated since 3.0 */
-               return "PLAYER_INTERRUPTED_BY_CALL";
-       case PLAYER_INTERRUPTED_BY_EARJACK_UNPLUG:  /* Deprecated since 3.0 */
-               return "PLAYER_INTERRUPTED_BY_EARJACK_UNPLUG";
-       case PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT:
-               return "PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT";
-       case PLAYER_INTERRUPTED_BY_ALARM:           /* Deprecated since 3.0 */
-               return "PLAYER_INTERRUPTED_BY_ALARM";
-       case PLAYER_INTERRUPTED_BY_EMERGENCY:       /* Deprecated since 3.0 */
-               return "PLAYER_INTERRUPTED_BY_EMERGENCY";
-       case PLAYER_INTERRUPTED_BY_NOTIFICATION:    /* Deprecated since 3.0 */
-               return "PLAYER_INTERRUPTED_BY_NOTIFICATION";
-       default:
-               LOGE("Invalid interrupted code %d (Never enter here)", code);
-               return NULL;
-       }
-}
-
 static void __interrupt_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data)
 {
        int code;
        muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_INTERRUPT;
 
-       if (player_msg_get(code, recv_data->buffer)) {
-
-               if (code >= PLAYER_INTERRUPTED_COMPLETED &&
-                       code <= PLAYER_INTERRUPTED_BY_NOTIFICATION &&
-                       code != PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT) {
-                        LOGW("DEPRECATION WARNING: %s is deprecated and will be removed from next release.", _convert_code_to_str(code));
-               }
-
+       if (player_msg_get(code, recv_data->buffer))
                ((player_interrupted_cb) cb_info->user_cb[ev]) (code, cb_info->user_data[ev]);
-       }
 }
 
 static void __error_cb_handler(callback_cb_info_s * cb_info, _player_recv_data *recv_data)
@@ -2218,22 +2185,6 @@ int player_get_volume(player_h player, float *pleft, float *pright)
        return ret;
 }
 
-int player_set_sound_type(player_h player, sound_type_e type)
-{
-       PLAYER_INSTANCE_CHECK(player);
-       int ret = PLAYER_ERROR_NONE;
-       muse_player_api_e api = MUSE_PLAYER_API_SET_SOUND_TYPE;
-       player_cli_s *pc = (player_cli_s *) player;
-       char *ret_buf = NULL;
-
-       LOGD("ENTER");
-       LOGW("DEPRECATION WARNING: player_set_sound_type() is deprecated and will be removed from next release. Use player_set_sound_stream_info() instead.");
-
-       player_msg_send1(api, pc, ret_buf, ret, INT, type);
-       g_free(ret_buf);
-       return ret;
-}
-
 int player_set_sound_stream_info(player_h player, sound_stream_info_h stream_info)
 {
        PLAYER_FEATURE_CHECK(PLAYER_FEATURE_SOUND_STREAM);
index ac8493a..5c73bbc 100644 (file)
@@ -113,7 +113,6 @@ enum {
        CURRENT_STATUS_HANDLE_NUM,
        CURRENT_STATUS_FILENAME,
        CURRENT_STATUS_VOLUME,
-       CURRENT_STATUS_SOUND_TYPE,
        CURRENT_STATUS_SOUND_STREAM_INFO,
        CURRENT_STATUS_MUTE,
        CURRENT_STATUS_POSITION_TIME,
@@ -595,7 +594,7 @@ static void _player_state()
 
 static void _player_set_progressive_download()
 {
-       player_set_progressive_download_path(g_player[0], "/home/owner/test.pd");
+       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]);
 }
 
@@ -662,14 +661,6 @@ static void get_mute(bool * mute)
        g_print("                                                            ==> [Player_Audio_Test] mute = %d\n", *mute);
 }
 
-static void set_sound_type(sound_type_e type)
-{
-       if (player_set_sound_type(g_player[0], type) != PLAYER_ERROR_NONE)
-               g_print("failed to set sound type(%d)\n", type);
-       else
-               g_print("set sound type(%d) success", type);
-}
-
 void focus_callback(sound_stream_info_h stream_info,
                                        sound_stream_focus_mask_e focus_mask,
                                        sound_stream_focus_state_e focus_state,
@@ -1031,8 +1022,6 @@ void _interpret_main_menu(char *cmd)
                        float left;
                        float right;
                        get_volume(&left, &right);
-               } else if (strncmp(cmd, "z", 1) == 0) {
-                       g_menu_state = CURRENT_STATUS_SOUND_TYPE;
                } else if (strncmp(cmd, "k", 1) == 0) {
                        g_menu_state = CURRENT_STATUS_SOUND_STREAM_INFO;
                } else if (strncmp(cmd, "h", 1) == 0) {
@@ -1170,8 +1159,6 @@ static void displaymenu()
                g_print("*** input mediapath.\n");
        } else if (g_menu_state == CURRENT_STATUS_VOLUME) {
                g_print("*** input volume value.(0~1.0)\n");
-       } else if (g_menu_state == CURRENT_STATUS_SOUND_TYPE) {
-               g_print("*** input sound type.(0:SYSTEM 1:NOTIFICATION 2:ALARM 3:RINGTONE 4:MEDIA 5:CALL 6:VOIP 7:FIXED)\n");
        } else if (g_menu_state == CURRENT_STATUS_SOUND_STREAM_INFO) {
                g_print("*** input sound stream type.(0:MEDIA 1:SYSTEM 2:ALARM 3:NOTIFICATION 4:EMERGENCY 5:VOICE_INFORMATION 9:MEDIA_EXT_ONLY)\n");
        } else if (g_menu_state == CURRENT_STATUS_MUTE) {
@@ -1254,13 +1241,6 @@ static void interpret(char *cmd)
                        reset_menu_state();
                }
                break;
-       case CURRENT_STATUS_SOUND_TYPE:
-               {
-                       int type = atoi(cmd);
-                       set_sound_type(type);
-                       reset_menu_state();
-               }
-               break;
        case CURRENT_STATUS_SOUND_STREAM_INFO:
                {
                        int type = atoi(cmd);
index a6f9eaf..751884b 100644 (file)
@@ -141,7 +141,6 @@ enum {
        CURRENT_STATUS_HANDLE_NUM,
        CURRENT_STATUS_FILENAME,
        CURRENT_STATUS_VOLUME,
-       CURRENT_STATUS_SOUND_TYPE,
        CURRENT_STATUS_SOUND_STREAM_INFO,
        CURRENT_STATUS_MUTE,
        CURRENT_STATUS_POSITION_TIME,
@@ -1300,7 +1299,7 @@ static void _player_state()
 
 static void _player_set_progressive_download()
 {
-       player_set_progressive_download_path(g_player[0], "/home/owner/test.pd");
+       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]);
 }
 
@@ -1382,14 +1381,6 @@ static void get_mute(bool * mute)
        g_print("                                                            ==> [Player_Test] mute = %d\n", *mute);
 }
 
-static void set_sound_type(sound_type_e type)
-{
-       if (player_set_sound_type(g_player[0], type) != PLAYER_ERROR_NONE)
-               g_print("failed to set sound type(%d)\n", type);
-       else
-               g_print("set sound type(%d) success", type);
-}
-
 void focus_callback(sound_stream_info_h stream_info,
                                        sound_stream_focus_mask_e focus_mask,
                                        sound_stream_focus_state_e focus_state,
@@ -2156,8 +2147,6 @@ void _interpret_main_menu(char *cmd)
                        float left;
                        float right;
                        get_volume(&left, &right);
-               } else if (strncmp(cmd, "z", 1) == 0) {
-                       g_menu_state = CURRENT_STATUS_SOUND_TYPE;
                } else if (strncmp(cmd, "k", 1) == 0) {
                        g_menu_state = CURRENT_STATUS_SOUND_STREAM_INFO;
                } else if (strncmp(cmd, "h", 1) == 0) {
@@ -2393,8 +2382,6 @@ static void displaymenu()
                g_print("*** input mediapath.\n");
        } else if (g_menu_state == CURRENT_STATUS_VOLUME) {
                g_print("*** input volume value.(0~1.0)\n");
-       } else if (g_menu_state == CURRENT_STATUS_SOUND_TYPE) {
-               g_print("*** input sound type.(0:SYSTEM 1:NOTIFICATION 2:ALARM 3:RINGTONE 4:MEDIA 5:CALL 6:VOIP 7:FIXED)\n");
        } else if (g_menu_state == CURRENT_STATUS_SOUND_STREAM_INFO) {
                g_print("*** input sound stream type.(0:MEDIA 1:SYSTEM 2:ALARM 3:NOTIFICATION 4:EMERGENCY 5:VOICE_INFORMATION 9:MEDIA_EXT_ONLY)\n");
        } else if (g_menu_state == CURRENT_STATUS_MUTE) {
@@ -2529,13 +2516,6 @@ static void interpret(char *cmd)
                        reset_menu_state();
                }
                break;
-       case CURRENT_STATUS_SOUND_TYPE:
-               {
-                       int type = atoi(cmd);
-                       set_sound_type(type);
-                       reset_menu_state();
-               }
-               break;
        case CURRENT_STATUS_SOUND_STREAM_INFO:
                {
                        int type = atoi(cmd);