[0.2.85] remove dead code 28/185628/2 accepted/tizen/unified/20180807.132237 submit/tizen/20180806.055314
authorEunhae Choi <eunhae1.choi@samsung.com>
Wed, 1 Aug 2018 07:15:14 +0000 (16:15 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Wed, 1 Aug 2018 07:21:15 +0000 (16:21 +0900)
Change-Id: I40263684dcc234ee778892d8da6521ed76cbf0ef

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

index 6da94a323fc5f61941256303269557ca53bf39ec..65a7dbe1b90647cd71aa644fe18868e871392eca 100644 (file)
@@ -90,21 +90,6 @@ typedef enum {
        PLAYER_ERROR_NOT_SUPPORTED_SUBTITLE = PLAYER_ERROR_CLASS | 0x10,           /**< Not supported subtitle format (Since 4.0) */
 } player_error_e;
 
-/**
- * @brief Enumeration for media player's interruption type.
- * @since_tizen 2.3
- */
-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 */
-       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_code_e;
-
 /**
  * @brief Enumeration for progressive download message type.
  * @since_tizen 2.3
@@ -287,12 +272,11 @@ typedef void (*player_seek_completed_cb)(void *user_data);
 /**
  * @brief Called when the media player is interrupted.
  * @since_tizen 2.3
- * @param[in]  error_code      The interrupted error code
  * @param[in]  user_data       The user data passed from the callback registration function
  * @see legacy_player_set_interrupted_cb()
  * @see legacy_player_unset_interrupted_cb()
  */
-typedef void (*player_interrupted_cb)(player_interrupted_code_e code, void *user_data);
+typedef void (*player_interrupted_cb)(void *user_data);
 
 /**
  * @brief Called when an error occurs in the media player.
@@ -1609,7 +1593,6 @@ int legacy_player_unset_completed_cb(player_h player);
  * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
  * @post  player_interrupted_cb() will be invoked.
  * @see legacy_player_unset_interrupted_cb()
- * @see #player_interrupted_code_e
  * @see legacy_player_interrupted_cb()
  */
 int legacy_player_set_interrupted_cb(player_h player, player_interrupted_cb callback, void *user_data);
index 420d954646c04e8c72c94833d41a2afb06f09814..98070d7795bffa25b42bd30bbeba517effe44862 100644 (file)
@@ -236,49 +236,6 @@ int __player_convert_error_code(int code, char *func_name)
        return ret;
 }
 
-static player_interrupted_code_e __convert_interrupted_code(int code)
-{
-       player_interrupted_code_e ret = PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT;
-       switch (code) {
-       case MM_PLAYER_FOCUS_CHANGED_COMPLETED:
-               ret = PLAYER_INTERRUPTED_COMPLETED;
-               break;
-       case MM_PLAYER_FOCUS_CHANGED_BY_MEDIA:
-       case MM_PLAYER_FOCUS_CHANGED_BY_UNKNOWN:
-               ret = PLAYER_INTERRUPTED_BY_MEDIA;
-               break;
-       case MM_PLAYER_FOCUS_CHANGED_BY_CALL:
-               ret = PLAYER_INTERRUPTED_BY_CALL;
-               break;
-       case MM_PLAYER_FOCUS_CHANGED_BY_EARJACK_UNPLUG:
-               ret = PLAYER_INTERRUPTED_BY_EARJACK_UNPLUG;
-               break;
-       case MM_PLAYER_FOCUS_CHANGED_BY_ALARM:
-               ret = PLAYER_INTERRUPTED_BY_ALARM;
-               break;
-       case MM_PLAYER_FOCUS_CHANGED_BY_NOTIFICATION:
-               ret = PLAYER_INTERRUPTED_BY_NOTIFICATION;
-               break;
-       case MM_PLAYER_FOCUS_CHANGED_BY_EMERGENCY:
-               ret = PLAYER_INTERRUPTED_BY_EMERGENCY;
-               break;
-       case MM_PLAYER_FOCUS_CHANGED_BY_RESOURCE_CONFLICT:
-       default:
-               ret = PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT;
-               break;
-       }
-       LOGE("[%s] interrupted code(%d) => ret(%d)", __FUNCTION__, code, ret);
-       return ret;
-}
-
-static player_state_e __convert_player_state(MMPlayerStateType state)
-{
-       if (state == MM_PLAYER_STATE_NONE)
-               return PLAYER_STATE_NONE;
-       else
-               return state + 1;
-}
-
 bool __player_state_validate(player_s *handle, player_state_e threshold)
 {
        if (handle->state < threshold)
@@ -425,7 +382,8 @@ static int __msg_callback(int message, void *param, void *user_data)
                break;
        case MM_MESSAGE_STATE_CHANGED:  /* 0x03 */
                LOGI("STATE CHANGED INTERNALLY - from : %d,  to : %d (CAPI State : %d)", msg->state.previous, msg->state.current, handle->state);
-               if ((handle->is_progressive_download && msg->state.previous == MM_PLAYER_STATE_NULL && msg->state.current == MM_PLAYER_STATE_READY) || (msg->state.previous == MM_PLAYER_STATE_READY && msg->state.current == MM_PLAYER_STATE_PAUSED)) {
+               if ((handle->is_progressive_download && msg->state.previous == MM_PLAYER_STATE_NULL && msg->state.current == MM_PLAYER_STATE_READY) ||
+                   (msg->state.previous == MM_PLAYER_STATE_READY && msg->state.current == MM_PLAYER_STATE_PAUSED)) {
                        LEGACY_PLAYER_USER_CB_LOCK(handle, MUSE_PLAYER_EVENT_TYPE_PREPARE);
                        if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_PREPARE]) {
                                /* asyc && prepared cb has been set */
@@ -436,10 +394,6 @@ static int __msg_callback(int message, void *param, void *user_data)
                        LEGACY_PLAYER_USER_CB_UNLOCK(handle, MUSE_PLAYER_EVENT_TYPE_PREPARE);
                }
                break;
-       case MM_MESSAGE_READY_TO_RESUME:        /* 0x05 */
-               if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_INTERRUPT])
-                       ((player_interrupted_cb)handle->user_cb[MUSE_PLAYER_EVENT_TYPE_INTERRUPT])(PLAYER_INTERRUPTED_COMPLETED, handle->user_data[MUSE_PLAYER_EVENT_TYPE_INTERRUPT]);
-               break;
        case MM_MESSAGE_BEGIN_OF_STREAM:        /* 0x104 */
                LOGI("[%s] Ready to streaming information (BOS) [current state : %d]", __FUNCTION__, handle->state);
                break;
@@ -460,23 +414,8 @@ static int __msg_callback(int message, void *param, void *user_data)
                        ((player_buffering_cb)handle->user_cb[MUSE_PLAYER_EVENT_TYPE_BUFFERING])(msg->connection.buffering, handle->user_data[MUSE_PLAYER_EVENT_TYPE_BUFFERING]);
                break;
        case MM_MESSAGE_STATE_INTERRUPTED:      /* 0x04 */
-               if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_INTERRUPT]) {
-                       int code = 0;
-                       if (msg->union_type == MM_MSG_UNION_STATE) {
-                               handle->state = __convert_player_state(msg->state.current);
-                               LOGD("update player state to %d", handle->state);
-
-                               if (handle->state == PLAYER_STATE_READY)
-                                       handle->is_stopped = TRUE;
-                               code = msg->state.code;
-                       } else if (msg->union_type == MM_MSG_UNION_CODE) {
-                               code = msg->code;
-                       } else {
-                               LOGE("invalid msg type %d", msg->union_type);
-                               break;
-                       }
-                       ((player_interrupted_cb)handle->user_cb[MUSE_PLAYER_EVENT_TYPE_INTERRUPT])(__convert_interrupted_code(code), handle->user_data[MUSE_PLAYER_EVENT_TYPE_INTERRUPT]);
-               }
+               if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_INTERRUPT])
+                       ((player_interrupted_cb)handle->user_cb[MUSE_PLAYER_EVENT_TYPE_INTERRUPT])(handle->user_data[MUSE_PLAYER_EVENT_TYPE_INTERRUPT]);
                break;
        case MM_MESSAGE_CONNECTION_TIMEOUT:     /* 0x102 */
                LOGI("[%s] PLAYER_ERROR_CONNECTION_FAILED (0x%08x) : CONNECTION_TIMEOUT", __FUNCTION__, PLAYER_ERROR_CONNECTION_FAILED);
@@ -1105,7 +1044,7 @@ int legacy_player_start(player_h player)
                        ret = mm_player_start(handle->mm_handle);
                        LOGI("[%s] stop -> start() ", __FUNCTION__);
                } else {
-                       if (handle->is_progressive_download && handle->state == PLAYER_STATE_READY)
+                       if (handle->state == PLAYER_STATE_READY)
                                ret = mm_player_start(handle->mm_handle);
                        else
                                ret = mm_player_resume(handle->mm_handle);
index 7dbe8facdc9f1b76b990d82dc6cde84bf6dc771e..c420574c699b6a6c01ef2f79d1ab1d29521734c7 100644 (file)
@@ -63,7 +63,7 @@ int legacy_player_set_pcm_extraction_mode(player_h player, bool sync, player_aud
 
        PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
 
-       ret = mm_player_set_attribute(handle->mm_handle, NULL, "pcm_extraction", TRUE, "pcm_extraction_start_msec", 0, "pcm_extraction_end_msec", 0, NULL);
+       ret = mm_player_set_attribute(handle->mm_handle, NULL, "pcm_extraction", TRUE, NULL);
        if (ret != MM_ERROR_NONE)
                return __player_convert_error_code(ret, (char *)__FUNCTION__);
 
index f8f3b4fbc22627e8dc3bac5e64b594f8cc7c48c0..ab2ee902223aec959bca9bcc47997cc0c033fbcf 100644 (file)
@@ -894,15 +894,10 @@ static void _media_stream_video_seek_cb(unsigned long long offset, void *user_da
        PLAYER_SEND_EVENT_MSG(api, ev, module, MUSE_TYPE_INT64, "offset", (INT64)offset);
 }
 
-static void _interrupted_cb(player_interrupted_code_e code, void *user_data)
+static void _interrupted_cb(void *user_data)
 {
-       muse_player_cb_e api = MUSE_PLAYER_CB_EVENT;
        muse_player_event_e ev = MUSE_PLAYER_EVENT_TYPE_INTERRUPT;
-       muse_module_h module = (muse_module_h)user_data;
-
-       LOGD("ENTER");
-
-       PLAYER_SEND_EVENT_MSG(api, ev, module, MUSE_TYPE_INT, "code", (int)code);
+       __player_callback(ev, (muse_module_h)user_data);
 }
 
 static void _set_interrupted_cb(player_h player, void *module, bool set)
index 3d83d8f19abf67399d36f65e3dd095f5df53ae78..7b6d04a8a7dc2c48af55b283504ff9dbe1087b29 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mmsvc-player
 Summary:    A Media Player module for muse server
-Version:    0.2.84
+Version:    0.2.85
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0