[common][v0.3.20] apply API deprecation policy 40/88440/2
authorEunhae Choi <eunhae1.choi@samsung.com>
Mon, 19 Sep 2016 06:11:01 +0000 (15:11 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Mon, 19 Sep 2016 06:16:48 +0000 (15:16 +0900)
Change-Id: I1add6a9c4213501dcce89fe4beb44e0df38cf853

include/common/player.h
include/wearable/player.h
packaging/capi-media-player.spec
src/player.c

index 8726c5f..ea10af7 100644 (file)
@@ -617,7 +617,7 @@ int player_get_volume(player_h player, float *left, float *right);
  * @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);
+int player_set_sound_type(player_h player, sound_type_e type) TIZEN_DEPRECATED_API;
 
 /**
  * @brief Sets the player's sound manager stream information.
index cdafc2b..bf7951e 100755 (executable)
@@ -615,7 +615,7 @@ int player_get_volume(player_h player, float *left, float *right);
  * @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);
+int player_set_sound_type(player_h player, sound_type_e type) TIZEN_DEPRECATED_API;
 
 /**
  * @brief Sets the player's sound manager stream information.
index 73b003b..2e5f216 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-player
 Summary:    A Media Player API
-Version:    0.3.19
+Version:    0.3.20
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index cf77518..961f881 100644 (file)
@@ -419,13 +419,46 @@ static void __complete_cb_handler(callback_cb_info_s * cb_info, char *recvMsg)
        ((player_completed_cb) cb_info->user_cb[ev]) (cb_info->user_data[ev]);
 }
 
+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, char *recvMsg)
 {
        int code;
        muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_INTERRUPT;
 
-       if (player_msg_get(code, recvMsg))
+       if (player_msg_get(code, recvMsg)) {
+
+               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));
+               }
+
                ((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, char *recvMsg)
@@ -1758,6 +1791,7 @@ int player_set_sound_type(player_h player, sound_type_e type)
        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_audio_policy_info() instead.");
 
        player_msg_send1(api, pc, ret_buf, ret, INT, type);
        g_free(ret_buf);