remove session backward compatibility codes 73/174673/2
authorGilbok Lee <gilbok.lee@samsung.com>
Tue, 3 Apr 2018 10:38:35 +0000 (19:38 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Wed, 4 Apr 2018 04:58:34 +0000 (13:58 +0900)
Change-Id: I86b14452c5cb2ad1a8727db7f96827db8baca8fc

legacy/include/legacy_player.h
legacy/src/legacy_player.c
muse/src/muse_player.c
packaging/mmsvc-player.spec

index 13ace07..89d99ae 100644 (file)
@@ -607,27 +607,6 @@ int legacy_player_set_volume(player_h player, float left, float right);
 int legacy_player_get_volume(player_h player, float *left, float *right);
 
 /**
- * @deprecated Deprecated since 3.0. Use legacy_player_set_sound_stream_info() instead.
- * @brief Sets the player's volume type.
- * @since_tizen 2.3
- * @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 legacy_player_create().
- * @see sound_manager_get_current_sound_type()
- */
-int legacy_player_set_sound_type(player_h player, sound_type_e type);
-
-/**
  * @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.
@@ -2062,19 +2041,6 @@ int legacy_player_set_roi_area(player_h player, int x, int y, int w, int h);
 int legacy_player_set_sound_stream_info_for_mused(player_h player, char *stream_type, int stream_index);
 
 /**
- * @brief Registers sound process id to ASM server
- * @since_tizen 3.0
- * @param[in] player The handle to the media player
- * @param[in] pid The sound process id
- * @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 legacy_player_sound_register(player_h player, int pid);
-
-/**
  * @brief Gets time out time from muse-server
  * @since_tizen 3.0
  * @param[in] player The handle to the media player
index 21c0947..029ee43 100644 (file)
@@ -25,9 +25,6 @@
 #include <sound_manager.h>
 #include <sound_manager_internal.h>
 #include <dlog.h>
-#ifdef TIZEN_FEATURE_ASM
-#include <mm_session_private.h>
-#endif
 #include "muse_player.h"
 #include "legacy_player.h"
 #include "legacy_player_private.h"
@@ -1028,70 +1025,7 @@ int legacy_player_get_volume(player_h player, float *left, float *right)
                return PLAYER_ERROR_NONE;
        }
 }
-#ifdef TIZEN_FEATURE_ASM
-int legacy_player_set_sound_type(player_h player, sound_type_e type)
-{
-       PLAYER_INSTANCE_CHECK(player);
-       player_s *handle = (player_s *)player;
-
-       PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
-
-       char *stream_type = NULL;
-       int stream_index = -1;
-       int ret = 0;
-       int pid = -1;
-       int session_type = 0;
-       int session_flags = 0;
-
-       ret = mm_player_get_client_pid(handle->mm_handle, &pid);
-       if (ret != MM_ERROR_NONE)
-               return __player_convert_error_code(ret, (char *)__FUNCTION__);
 
-       /* read session information */
-       ret = _mm_session_util_read_information(pid, &session_type, &session_flags);
-       if (ret == MM_ERROR_NONE) {
-               /* in this case, this process is using stream info created by using sound-manager,
-                * we're going to skip working on backward compatibility of session. */
-               if (session_type == MM_SESSION_TYPE_REPLACED_BY_STREAM)
-                       return PLAYER_ERROR_SOUND_POLICY;
-       } else if (ret == MM_ERROR_INVALID_HANDLE) { /* if there is no session */
-               /* convert volume_type to stream_type */
-               switch (type) {
-               case SOUND_TYPE_SYSTEM:
-                       stream_type = "system";
-                       break;
-               case SOUND_TYPE_NOTIFICATION:
-                       stream_type = "notification";
-                       break;
-               case SOUND_TYPE_ALARM:
-                       stream_type = "alarm";
-                       break;
-               case SOUND_TYPE_RINGTONE:
-                       stream_type = "ringtone-voip";
-                       break;
-               case SOUND_TYPE_MEDIA:
-               case SOUND_TYPE_CALL:
-                       stream_type = "media";
-                       break;
-               case SOUND_TYPE_VOIP:
-                       stream_type = "voip";
-                       break;
-               case SOUND_TYPE_VOICE:
-                       stream_type = "voice-information";
-                       break;
-               default:
-                       LOGW("check the value[%d].\n", type);
-                       return PLAYER_ERROR_INVALID_PARAMETER;
-               }
-               LOGI("[%s] sound type = %s", __FUNCTION__, stream_type);
-
-               ret = mm_player_set_attribute(handle->mm_handle, NULL, "sound_stream_type", stream_type, strlen(stream_type), "sound_stream_index", stream_index, (char *)NULL);
-               if (ret == MM_ERROR_NONE)
-                       return PLAYER_ERROR_NONE;
-       }
-       return __player_convert_error_code(ret, (char *)__FUNCTION__);
-}
-#endif
 int legacy_player_set_sound_stream_info(player_h player, sound_stream_info_h stream_info)
 {
        PLAYER_INSTANCE_CHECK(player);
@@ -2697,21 +2631,6 @@ int legacy_player_set_sound_stream_info_for_mused(player_h player, char *stream_
                return PLAYER_ERROR_NONE;
 }
 
-int legacy_player_sound_register(player_h player, int pid)
-{
-       PLAYER_INSTANCE_CHECK(player);
-       player_s *handle = (player_s *)player;
-       int ret;
-
-       PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
-
-       ret = mm_player_sound_register(handle->mm_handle, pid);
-       if (ret != MM_ERROR_NONE)
-               return __player_convert_error_code(ret, (char *)__FUNCTION__);
-
-       return PLAYER_ERROR_NONE;
-}
-
 int legacy_player_get_timeout_for_muse(player_h player, int *timeout)
 {
        PLAYER_INSTANCE_CHECK(player);
index dd9e835..5b15925 100644 (file)
@@ -1271,10 +1271,6 @@ int player_disp_create(muse_module_h module)
        if (ret != PLAYER_ERROR_NONE)
                goto ERROR;
 
-       ret = legacy_player_sound_register(muse_player->player_handle, pid);
-       if (ret != PLAYER_ERROR_NONE)
-               goto ERROR;
-
        muse_player->total_size_of_buffers = DEFAULT_VDEC_TOTAL_SIZE_OF_BUFFER;
        muse_player->extra_size_of_buffers = DEFAULT_VDEC_EXTRA_SIZE_OF_BUFFER;
        g_mutex_init(&muse_player->list_lock);
@@ -1603,18 +1599,15 @@ int player_disp_get_volume(muse_module_h module)
        return ret;
 }
 
+/* TODO: It will be removed */
 int player_disp_set_sound_type(muse_module_h module)
 {
        int ret = PLAYER_ERROR_NONE;
        muse_player_api_e api = MUSE_PLAYER_API_SET_SOUND_TYPE;
-       muse_player_handle_s *muse_player = NULL;
        int type;
 
-       muse_player = (muse_player_handle_s *)muse_server_ipc_get_handle(module);
        player_msg_get(type, muse_server_module_get_msg(module));
-#ifdef TIZEN_FEATURE_ASM
-       ret = legacy_player_set_sound_type(muse_player->player_handle, (sound_type_e)type);
-#endif
+       LOGW("DEPRECATION WARNING: We remove subfunction, It return ERROR_NONE.");
        player_msg_return(api, ret, module);
 
        return ret;
index 370223f..29f9dc3 100644 (file)
@@ -17,7 +17,6 @@ BuildRequires:  pkgconfig(capi-media-tool)
 BuildRequires:  pkgconfig(libtbm)
 BuildRequires:  pkgconfig(ttrace)
 BuildRequires:  pkgconfig(capi-system-info)
-BuildRequires:  pkgconfig(mm-session)
 BuildRequires:  pkgconfig(libtzplatform-config)
 
 Requires(post): /sbin/ldconfig