[TFIVE-15] Remove media content deprecated APIs 04/170504/1 submit/tizen/20180221.065502
authorVikas Kumar Agrawal <vikas.ag@samsung.com>
Tue, 20 Feb 2018 09:38:05 +0000 (15:08 +0530)
committerVikas Kumar Agrawal <vikas.ag@samsung.com>
Tue, 20 Feb 2018 09:38:05 +0000 (15:08 +0530)
Change-Id: I34a11d5d553cd903f3c10e56cd03effdc171f175

CMakeLists.txt
sound-player/CMakeLists.txt
src/common/include/mp-item.h
src/common/include/mp-media-info.h
src/common/mp-edit-callback.c
src/common/mp-item.c [deleted file]
src/common/mp-media-info.c
src/common/mp-play.c

index 513c3fc..432bdbc 100755 (executable)
@@ -58,7 +58,6 @@ SET(COMMON_SRCS
        src/core/mp-view-mgr.c
        src/common/mp-common.c
        src/common/mp-edit-callback.c
-       src/common/mp-item.c
        src/common/mp-menu.c
        src/common/mp-ug-launch.c
        src/common/mp-widget.c
index 49d93c4..a664374 100755 (executable)
@@ -83,7 +83,6 @@ SET(SRCS
        ${CMAKE_SOURCE_DIR}/src/core/mp-volume.c
        ${CMAKE_SOURCE_DIR}/src/core/mp-view-mgr.c
 
-       ${CMAKE_SOURCE_DIR}/src/common/mp-item.c
        ${CMAKE_SOURCE_DIR}/src/common/mp-menu.c
        ${CMAKE_SOURCE_DIR}/src/common/mp-ug-launch.c
        ${CMAKE_SOURCE_DIR}/src/common/mp-widget.c
index c339c68..985ec35 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <Elementary.h>
 #include <mp-define.h>
-bool mp_item_update_db(char *fid);
+
 
 int mp_item_share_by_bt(const char *formed_path, int file_cnt);
 
index 0fb5756..eb439f8 100644 (file)
@@ -147,9 +147,6 @@ extern "C" {
        int mp_media_info_get_sample_rate(mp_media_info_h media,
                                                                          int *sample_rate);
        int mp_media_info_get_duration(mp_media_info_h media, int *duration);
-       int mp_media_info_get_played_time(mp_media_info_h media,
-                                                                         time_t * time);
-       int mp_media_info_get_played_count(mp_media_info_h media, int *count);
        int mp_media_info_get_added_time(mp_media_info_h media, time_t * time);
        int mp_media_info_get_playlist_member_id(mp_media_info_h media,
                                                                                         int *member_id);
@@ -161,8 +158,6 @@ extern "C" {
        int mp_media_info_set_favorite_media_db_only(mp_media_info_h media,
                                                                                                 bool favorite);
        int mp_media_info_set_favorite(mp_media_info_h media, bool favorite);
-       int mp_media_info_set_played_time(mp_media_info_h media, time_t time);
-       int mp_media_info_set_played_count(mp_media_info_h media, int count);
        int mp_media_info_set_added_time(mp_media_info_h media, time_t time);
 //int mp_media_info_set_cloud_thumbnail_path(mp_media_info_h media, const char *path);
 
index def6957..d02d635 100644 (file)
@@ -585,21 +585,11 @@ inline static int _delete_track(mp_media_info_h item_handle)
                        MP_CHECK_VAL(ret == 0, -1);
                        break;
                }
-       case MP_TRACK_BY_PLAYED_TIME:{
-                       ret = mp_media_info_set_played_time(item_handle, 0);
-                       MP_CHECK_VAL(ret == 0, -1);
-                       break;
-               }
        case MP_TRACK_BY_FAVORITE:{
                        ret = mp_media_info_set_favorite(item_handle, 0);
                        MP_CHECK_VAL(ret == 0, -1);
                        break;
                }
-       case MP_TRACK_BY_PLAYED_COUNT:{
-                       ret = mp_media_info_set_played_count(item_handle, 0);
-                       MP_CHECK_VAL(ret == 0, -1);
-                       break;
-               }
        default:{
                        ret = mp_media_info_get_media_id(item_handle, &fid);
                        ret = mp_media_info_get_file_path(item_handle, &uri);
diff --git a/src/common/mp-item.c b/src/common/mp-item.c
deleted file mode 100644 (file)
index 1205846..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <sys/time.h>
-#include <glib.h>
-#include <fcntl.h>
-
-#include "music.h"
-#include "mp-item.h"
-#include "mp-menu.h"
-#include "mp-ug-launch.h"
-#include "mp-player-debug.h"
-
-bool mp_item_update_db(char *fid)
-{
-
-       mp_media_info_h media;
-       int count = 0;
-       bool ret = FALSE;
-
-       ret = mp_media_info_create(&media, fid);
-       if (ret != 0) {
-               mp_media_info_destroy(media);
-               return false;
-       }
-
-       time_t current_time = time(NULL);
-       mp_media_info_get_played_count(media, &count);
-
-       mp_media_info_set_played_count(media, ++count);
-       mp_media_info_set_played_time(media, current_time);
-
-       mp_media_info_destroy(media);
-
-       return TRUE;
-}
index 2c0344a..1b6b251 100644 (file)
@@ -1540,32 +1540,6 @@ int mp_media_info_get_duration(mp_media_info_h media, int *duration)
        return res;
 }
 
-int mp_media_info_get_played_time(mp_media_info_h media, time_t * time)
-{
-       int res = MEDIA_CONTENT_ERROR_NONE;
-       MP_CHECK_VAL(media, -1);
-       MP_CHECK_VAL(media->s.meta, -1);
-
-       res = audio_meta_get_played_time(media->s.meta, time);
-       if (res != MEDIA_CONTENT_ERROR_NONE) {
-               ERROR_TRACE("Error code 0x%x", res);
-       }
-       return res;
-}
-
-int mp_media_info_get_played_count(mp_media_info_h media, int *count)
-{
-       int res = MEDIA_CONTENT_ERROR_NONE;
-       MP_CHECK_VAL(media, -1);
-       MP_CHECK_VAL(media->s.meta, -1);
-
-       res = audio_meta_get_played_count(media->s.meta, count);
-       if (res != MEDIA_CONTENT_ERROR_NONE) {
-               ERROR_TRACE("Error code 0x%x", res);
-       }
-       return res;
-}
-
 int mp_media_info_get_added_time(mp_media_info_h media, time_t * time)
 {
        int res = MEDIA_CONTENT_ERROR_NONE;
@@ -1635,42 +1609,6 @@ int mp_media_info_set_favorite(mp_media_info_h media, bool favorite)
        return res;
 }
 
-int mp_media_info_set_played_time(mp_media_info_h media, time_t time)
-{
-       int res = MEDIA_CONTENT_ERROR_NONE;
-       MP_CHECK_VAL(media, -1);
-       MP_CHECK_VAL(media->s.meta, -1);
-
-       res = audio_meta_set_played_time(media->s.meta, time);
-       if (res != MEDIA_CONTENT_ERROR_NONE) {
-               ERROR_TRACE("Error code 0x%x", res);
-               return res;
-       }
-       res = audio_meta_update_to_db(media->s.meta);
-       if (res != MEDIA_CONTENT_ERROR_NONE) {
-               ERROR_TRACE("Error code 0x%x", res);
-       }
-       return res;
-}
-
-int mp_media_info_set_played_count(mp_media_info_h media, int count)
-{
-       int res = MEDIA_CONTENT_ERROR_NONE;
-       MP_CHECK_VAL(media, -1);
-       MP_CHECK_VAL(media->s.meta, -1);
-
-       res = audio_meta_set_played_count(media->s.meta, count);
-       if (res != MEDIA_CONTENT_ERROR_NONE) {
-               ERROR_TRACE("Error code 0x%x", res);
-               return res;
-       }
-       res = audio_meta_update_to_db(media->s.meta);
-       if (res != MEDIA_CONTENT_ERROR_NONE) {
-               ERROR_TRACE("Error code 0x%x", res);
-       }
-       return res;
-}
-
 int mp_media_info_set_added_time(mp_media_info_h media, time_t time)
 {
        int res = MEDIA_CONTENT_ERROR_NONE;
index df36e97..1897c89 100644 (file)
@@ -55,14 +55,6 @@ static Eina_Bool _mp_play_set_pos(void *data)
        return EINA_TRUE;
 }
 
-static Eina_Bool _mp_item_update_db_idler(void *data)
-{
-       if (!mp_item_update_db(data)) {
-               WARN_TRACE("Error when update db");
-       }
-       return ECORE_CALLBACK_CANCEL;
-}
-
 //this function should be called in player ready state.
 bool mp_play_start_in_ready_state(void *data)
 {
@@ -110,12 +102,6 @@ bool mp_play_start_in_ready_state(void *data)
        }
 #endif
 
-       if (current_item->uid) {
-
-               if (current_item->track_type == MP_TRACK_URI) {
-                       ecore_idler_add(_mp_item_update_db_idler, current_item->uid);
-               }
-       }
 #ifndef MP_SOUND_PLAYER
        mp_view_mgr_post_event(GET_VIEW_MGR, MP_PLAY_TIME_COUNT_UPDATED);
 #endif