Remove UHD related code 67/314667/1 accepted/tizen/unified/20240911.104737 accepted/tizen/unified/dev/20240913.055441 accepted/tizen/unified/x/20240912.013839
authorMinje Ahn <minje.ahn@samsung.com>
Wed, 17 Jul 2024 06:08:32 +0000 (15:08 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Wed, 17 Jul 2024 06:08:32 +0000 (15:08 +0900)
All UHD APIs can be replaced with public APIs.

Change-Id: Ia8d532b39d403d21ebc068031e717f23a56299db
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
include_product/media_content_product.h
include_product/media_content_type_product.h
include_product/media_info_private.h
include_product/media_uhd.h [deleted file]
packaging/capi-content-media-content.spec
src/media_db.c
src/media_uhd.c [deleted file]

index a835127052c8c74b68ed9098c44f3959aa0fcb60..12dcd91a13c4fefcff70d1e07e9717ed79ae1c00 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <media_content_type_product.h>
 #include <media_pvr.h>
-#include <media_uhd.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -102,9 +101,8 @@ int media_info_set_played_count(media_info_h media, int played_count);
 int media_info_set_played_position(media_info_h media, int played_position);
 
 /**
- * @brief Gets the content's played time parameter.
- * @details Function returns content's elapsed playback time parameter as period
- *          starting from the beginning of the track.
+ * @brief Gets the content's played time.
+ * @details Gets the latest played(opened) time of the content.
  *
  * @param[in] media The handle to the media info
  * @param[out] played_time The elapsed time of the content
index 0a5519f100dca04f4a60af3d63d0ea0ff25f40c6..ed93ce7df972af5db15860e511c73967b25987fc 100644 (file)
@@ -81,9 +81,7 @@ typedef bool (*media_group_and_count_cb)(const char *group_name, int count, void
 typedef void (*media_scan_completed_cb_v2)(media_content_error_e error, media_content_complete_phase_e complete_phase, void * user_data);
 
 typedef void *media_pvr_h;
-typedef void *media_uhd_h;
 typedef bool (*media_pvr_cb)(media_pvr_h pvr, void *user_data);
-typedef bool (*media_uhd_cb)(media_uhd_h uhd, void *user_data);
 
 #define MEDIA_PLAYED_COUNT "played_count"
 #define MEDIA_LAST_PLAYED_TIME "last_played_time"
@@ -136,11 +134,6 @@ typedef bool (*media_uhd_cb)(media_uhd_h uhd, void *user_data);
 #define PVR_TVMODE                                     "tvmode"
 #define PVR_PLAY_COUNT                         "play_count"
 #define PVR_PRIVATE_DATA                       "private_data"
-#define UHD_CONTENT_TITLE                      "content_title"
-#define UHD_RELEASE_DATE                       "release_date"
-#define UHD_FILE_NAME                          "file_name"
-#define UHD_FOLDER_ID                          "folder_id"
-#define UHD_PLAYED_COUNT                       "played_count"
 
 
 #ifdef __cplusplus
index 5f033302f33b8b6dac994e1368a13c20118b3891..ccfce32bf555fdab62b4527cf6e0dc0baf221dcc 100644 (file)
@@ -358,19 +358,6 @@ typedef struct {
        unsigned int service_profile;
 } media_pvr_s;
 
-typedef struct {
-       char *media_id;
-       char *path;
-       unsigned long long size;
-       char *content_id;
-       char *content_title;
-       char *file_name;
-       char* release_date;
-       time_t modified_time;
-       int played_position;
-       int played_count;
-} media_uhd_s;
-
 typedef struct {
        media_insert_completed_cb insert_completed_cb;
        char *insert_list_path;
@@ -405,7 +392,6 @@ typedef struct _media_content_scan_cb_data_v2 {
 #define DB_TABLE_FACE                  "face"
 #define DB_TABLE_FACE_SCAN_LIST        "face_scan_list"
 #define DB_TABLE_PVR                           "pvr"
-#define DB_TABLE_UHD                                           "uhd"
 
 /* DB View */
 #define DB_VIEW_PLAYLIST       "playlist_view"
@@ -599,13 +585,6 @@ typedef struct _media_content_scan_cb_data_v2 {
 #define SELECT_PVR_GROUP_AND_COUNT_BY_STORAGE_ID               "SELECT %s, COUNT(*) FROM "DB_TABLE_PVR" WHERE storage_uuid='%s'"
 #define SELECT_PVR_GROUP_AND_COUNT                                             "SELECT %s, COUNT(*) FROM "DB_TABLE_PVR" "SELECT_VALID_STORAGE_FROM_PVR
 
-#define SELECT_VALID_STORAGE_FROM_UHD  "WHERE storage_uuid IN (SELECT storage_id FROM "DB_TABLE_STORAGE" WHERE validity=1)"
-
-#define SELECT_UHD_LIST                                        "SELECT * FROM "DB_TABLE_UHD" "SELECT_VALID_STORAGE_FROM_UHD
-#define SELECT_UHD_LIST_BY_STORAGE_ID  SELECT_UHD_LIST" AND storage_uuid='%s'"
-#define SELECT_UHD_FROM_UHD                            "SELECT * FROM "DB_TABLE_UHD" WHERE media_id='%q'"
-#define UPDATE_UHD_META_FROM_UHD               "UPDATE "DB_TABLE_UHD" SET content_title=%Q, played_position=%d, played_count=%d WHERE media_id='%q'"
-
 int _content_query_prepare(const char *select_query, const char *condition_query, const char *option_query, sqlite3_stmt **stmt);
 int _content_get_result(const char *query, sqlite3_stmt **stmt);
 int _content_error_capi(int internal_error);
@@ -634,8 +613,6 @@ int _media_db_get_media_group_item(const char *group_name, filter_h filter, medi
 int _media_db_get_storage_id_by_media_id(const char *media_id, char **storage_id);
 int _media_db_get_pvr(filter_h filter, media_pvr_cb callback, void *user_data);
 void _media_pvr_item_get_detail(sqlite3_stmt* stmt, media_pvr_h pvr);
-int _media_db_get_uhd(filter_h filter, media_uhd_cb callback, void *user_data);
-void _media_uhd_item_get_detail(sqlite3_stmt* stmt, media_uhd_h uhd);
 int _media_db_get_storage(filter_h filter, media_storage_cb callback, void *user_data);
 int _media_filter_build_condition(bool is_full, const char *condition, media_content_collation_e collate_type, char **result);
 int _media_filter_build_option(filter_h filter, char **result);
diff --git a/include_product/media_uhd.h b/include_product/media_uhd.h
deleted file mode 100644 (file)
index 21aedfc..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* 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.
-*/
-
-
-#ifndef __TIZEN_MEDIA_UHD_H__
-#define __TIZEN_MEDIA_UHD_H__
-
-#include <media_content_type.h>
-#include <media_content_type_product.h>
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-int media_uhd_foreach_media_from_db(filter_h filter, media_uhd_cb callback, void *user_data);
-int media_uhd_destroy(media_uhd_h uhd);
-int media_uhd_clone(media_uhd_h *dst, media_uhd_h src);
-
-int media_uhd_get_uhd_from_db(const char *media_id, media_uhd_h *uhd);
-int media_uhd_get_media_id(media_uhd_h uhd, char **media_id);
-int media_uhd_get_path(media_uhd_h uhd, char **path);
-int media_uhd_get_size(media_uhd_h uhd, unsigned long long *size);
-int media_uhd_get_content_id(media_uhd_h uhd, char **content_id);
-int media_uhd_get_content_title(media_uhd_h uhd, char **content_title);
-int media_uhd_get_file_name(media_uhd_h uhd, char **file_name);
-int media_uhd_get_release_date(media_uhd_h uhd, char **release_date);
-int media_uhd_get_modified_time(media_uhd_h uhd, time_t *modified_time);
-int media_uhd_get_played_position(media_uhd_h uhd, int *played_position);
-int media_uhd_get_played_count(media_uhd_h uhd, int *played_count);
-
-int media_uhd_set_played_position(media_uhd_h uhd, int played_position);
-int media_uhd_set_content_title(media_uhd_h uhd, const char *content_title);
-int media_uhd_set_played_count(media_uhd_h uhd, int played_count);
-
-int media_uhd_update_to_db(media_uhd_h uhd);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __TIZEN_MEDIA_UHD_H__ */
index 5140d7c5dc57c397e3aaee684ca8c9cebb339f9e..336b43aba1ddc62fa516aedc279ede02af15cc83 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-content-media-content
 Summary:    A Media content library in Tizen Native API
-Version:    0.5.8
+Version:    0.5.9
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index b0bb3045d0d4e3306150ce7318eff1ab51e65e4b..88c71198364de1f69ef65659f21391bf9df77469 100644 (file)
@@ -1369,78 +1369,6 @@ int _media_db_get_pvr(filter_h filter, media_pvr_cb callback, void *user_data)
        return ret;
 }
 
-typedef enum {
-       MEDIA_UHD_MEDIA_ID = 0,
-       MEDIA_UHD_STORAGE_ID,
-       MEDIA_UHD_PATH,
-       MEDIA_UHD_SIZE,
-       MEDIA_UHD_CONTENT_ID,
-       MEDIA_UHD_CONTENT_TITLE,
-       MEDIA_UHD_FILE_NAME,
-       MEDIA_UHD_FOLDER_ID,
-       MEDIA_UHD_RELEASE_DATE,
-       MEDIA_UHD_MODIFIED_TIME,
-       MEDIA_UHD_PLAYED_POSITION,
-       MEDIA_UHD_PLAYED_COUNT,
-} media_uhd_field_e;
-
-void _media_uhd_item_get_detail(sqlite3_stmt* stmt, media_uhd_h uhd)
-{
-       media_uhd_s *_uhd = (media_uhd_s*)uhd;
-
-       _uhd->media_id = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_UHD_MEDIA_ID));
-       _uhd->path = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_UHD_PATH));
-       _uhd->size = (unsigned long long)sqlite3_column_int64(stmt, MEDIA_UHD_SIZE);
-       _uhd->content_id = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_UHD_CONTENT_ID));
-       _uhd->content_title = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_UHD_CONTENT_TITLE));
-       _uhd->file_name = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_UHD_FILE_NAME));
-       _uhd->release_date = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_UHD_RELEASE_DATE));
-       _uhd->modified_time = sqlite3_column_int(stmt, MEDIA_UHD_MODIFIED_TIME);
-       _uhd->played_position = sqlite3_column_int(stmt, MEDIA_UHD_PLAYED_POSITION);
-       _uhd->played_count = sqlite3_column_int(stmt, MEDIA_UHD_PLAYED_COUNT);
-
-       return;
-}
-
-int _media_db_get_uhd(filter_h filter, media_uhd_cb callback, void *user_data)
-{
-       int ret = MEDIA_CONTENT_ERROR_NONE;
-       char select_query[DEFAULT_QUERY_SIZE] = {0, };
-       char *condition_query = NULL;
-       char *option_query = NULL;
-       sqlite3_stmt *stmt = NULL;
-       filter_s *_filter = (filter_s *)filter;
-
-       if (_filter && STRING_VALID(_filter->storage_id))
-               snprintf(select_query, sizeof(select_query), SELECT_UHD_LIST_BY_STORAGE_ID, _filter->storage_id);
-       else
-               g_strlcat(select_query, SELECT_UHD_LIST, sizeof(select_query));
-
-       ret = __media_db_make_query(filter, &condition_query, &option_query);
-       content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
-
-       ret = _content_query_prepare(select_query, condition_query, option_query, &stmt);
-       g_free(condition_query);
-       g_free(option_query);
-       content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
-
-       while (sqlite3_step(stmt) == SQLITE_ROW) {
-               media_uhd_s *_uhd = g_new0(media_uhd_s, 1);
-
-               _media_uhd_item_get_detail(stmt, (media_uhd_h)_uhd);
-
-               if (callback((media_uhd_h)_uhd, user_data) == false) {
-                       media_uhd_destroy((media_uhd_h) _uhd);
-                       break;
-               }
-               media_uhd_destroy((media_uhd_h) _uhd);
-       }
-
-       sqlite3_finalize(stmt);
-
-       return ret;
-}
-
 int _media_db_get_storage(filter_h filter, media_storage_cb callback, void *user_data)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
diff --git a/src/media_uhd.c b/src/media_uhd.c
deleted file mode 100644 (file)
index 5a9b282..0000000
+++ /dev/null
@@ -1,276 +0,0 @@
- /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.
- */
-#ifdef _USE_TVPD_MODE
-#include <media_info_private.h>
-#include <media_util_private.h>
-#include <media_uhd.h>
-
-int media_uhd_foreach_media_from_db(filter_h filter, media_uhd_cb callback, void *user_data)
-{
-       content_retip_if_fail(callback);
-
-       return _media_db_get_uhd(filter, callback, user_data);
-}
-
-int media_uhd_destroy(media_uhd_h uhd)
-{
-       media_uhd_s *_uhd = (media_uhd_s*)uhd;
-
-       content_retip_if_fail(uhd);
-
-       g_free(_uhd->media_id);
-       g_free(_uhd->path);
-       g_free(_uhd->content_id);
-       g_free(_uhd->content_title);
-       g_free(_uhd->file_name);
-       g_free(_uhd->release_date);
-       g_free(_uhd);
-
-       return MEDIA_CONTENT_ERROR_NONE;
-}
-
-int media_uhd_clone(media_uhd_h *dst, media_uhd_h src)
-{
-       media_uhd_s *_src = (media_uhd_s*)src;
-
-       content_retip_if_fail(dst);
-       content_retip_if_fail(src);
-
-       media_uhd_s *_dst = g_new0(media_uhd_s, 1);
-
-       _dst->media_id = g_strdup(_src->media_id);
-       _dst->path = g_strdup(_src->path);
-       _dst->content_id = g_strdup(_src->content_id);
-       _dst->content_title = g_strdup(_src->content_title);
-       _dst->release_date = g_strdup(_src->release_date);
-       _dst->file_name = g_strdup(_src->file_name);
-       _dst->size = _src->size;
-       _dst->modified_time = _src->modified_time;
-       _dst->played_position = _src->played_position;
-       _dst->played_count = _src->played_count;
-
-       *dst = (media_uhd_h)_dst;
-
-       return MEDIA_CONTENT_ERROR_NONE;
-}
-
-int media_uhd_get_uhd_from_db(const char *media_id, media_uhd_h *uhd)
-{
-       int ret = MEDIA_CONTENT_ERROR_NONE;
-       char *select_query = NULL;
-       sqlite3_stmt *stmt = NULL;
-
-       content_retip_if_fail(STRING_VALID(media_id));
-       content_retip_if_fail(uhd);
-
-       select_query = sqlite3_mprintf(SELECT_UHD_FROM_UHD, media_id);
-
-       ret = _content_get_result(select_query, &stmt);
-       sqlite3_free(select_query);
-       content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
-
-       media_uhd_s *_uhd = NULL;
-
-       if (sqlite3_step(stmt) == SQLITE_ROW) {
-               _uhd = g_new0(media_uhd_s, 1);
-
-               _media_uhd_item_get_detail(stmt, (media_uhd_h)_uhd);
-
-               *uhd = (media_uhd_h)_uhd;
-       } else {
-               content_error("Nonexistent media id[%s]", media_id);
-               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
-       }
-
-       sqlite3_finalize(stmt);
-
-       return ret;
-}
-
-int media_uhd_get_media_id(media_uhd_h uhd, char **media_id)
-{
-       media_uhd_s *_uhd = (media_uhd_s*)uhd;
-
-       content_retip_if_fail(uhd);
-       content_retip_if_fail(media_id);
-
-       *media_id = g_strdup(_uhd->media_id);
-
-       return MEDIA_CONTENT_ERROR_NONE;
-}
-
-int media_uhd_get_path(media_uhd_h uhd, char **path)
-{
-       media_uhd_s *_uhd = (media_uhd_s*)uhd;
-
-       content_retip_if_fail(uhd);
-       content_retip_if_fail(path);
-
-       *path = g_strdup(_uhd->path);
-
-       return MEDIA_CONTENT_ERROR_NONE;
-}
-
-int media_uhd_get_size(media_uhd_h uhd, unsigned long long *size)
-{
-       media_uhd_s *_uhd = (media_uhd_s*)uhd;
-
-       content_retip_if_fail(uhd);
-       content_retip_if_fail(size);
-
-       *size = _uhd->size;
-
-       return MEDIA_CONTENT_ERROR_NONE;
-}
-
-int media_uhd_get_content_id(media_uhd_h uhd, char **content_id)
-{
-       media_uhd_s *_uhd = (media_uhd_s*)uhd;
-
-       content_retip_if_fail(uhd);
-       content_retip_if_fail(content_id);
-
-       *content_id = g_strdup(_uhd->content_id);
-
-       return MEDIA_CONTENT_ERROR_NONE;
-}
-
-int media_uhd_get_content_title(media_uhd_h uhd, char **content_title)
-{
-       media_uhd_s *_uhd = (media_uhd_s*)uhd;
-
-       content_retip_if_fail(uhd);
-       content_retip_if_fail(content_title);
-
-       *content_title = g_strdup(_uhd->content_title);
-
-       return MEDIA_CONTENT_ERROR_NONE;
-}
-
-int media_uhd_get_file_name(media_uhd_h uhd, char **file_name)
-{
-       media_uhd_s *_uhd = (media_uhd_s*)uhd;
-
-       content_retip_if_fail(uhd);
-       content_retip_if_fail(file_name);
-
-       *file_name = g_strdup(_uhd->file_name);
-
-       return MEDIA_CONTENT_ERROR_NONE;
-}
-
-int media_uhd_get_release_date(media_uhd_h uhd, char **release_date)
-{
-       media_uhd_s *_uhd = (media_uhd_s*)uhd;
-
-       content_retip_if_fail(uhd);
-       content_retip_if_fail(release_date);
-
-       *release_date = g_strdup(_uhd->release_date);
-
-       return MEDIA_CONTENT_ERROR_NONE;
-}
-
-int media_uhd_get_modified_time(media_uhd_h uhd, time_t *modified_time)
-{
-       media_uhd_s *_uhd = (media_uhd_s*)uhd;
-
-       content_retip_if_fail(uhd);
-       content_retip_if_fail(modified_time);
-
-       *modified_time = _uhd->modified_time;
-
-       return MEDIA_CONTENT_ERROR_NONE;
-}
-
-int media_uhd_get_played_position(media_uhd_h uhd, int *played_position)
-{
-       media_uhd_s *_uhd = (media_uhd_s*)uhd;
-
-       content_retip_if_fail(uhd);
-       content_retip_if_fail(played_position);
-
-       *played_position = _uhd->played_position;
-
-       return MEDIA_CONTENT_ERROR_NONE;
-}
-
-int media_uhd_get_played_count(media_uhd_h uhd, int *played_count)
-{
-       media_uhd_s *_uhd = (media_uhd_s*)uhd;
-
-       content_retip_if_fail(uhd);
-       content_retip_if_fail(played_count);
-
-       *played_count = _uhd->played_count;
-
-       return MEDIA_CONTENT_ERROR_NONE;
-}
-
-int media_uhd_set_played_position(media_uhd_h uhd, int played_position)
-{
-       media_uhd_s *_uhd = (media_uhd_s*)uhd;
-
-       content_retip_if_fail(uhd);
-       content_retip_if_fail(played_position);
-
-       _uhd->played_position = played_position;
-
-       return MEDIA_CONTENT_ERROR_NONE;
-}
-
-int media_uhd_set_content_title(media_uhd_h uhd, const char *content_title)
-{
-       media_uhd_s *_uhd = (media_uhd_s*)uhd;
-
-       content_retip_if_fail(uhd);
-       content_retip_if_fail(STRING_VALID(content_title));
-
-       g_free(_uhd->content_title);
-       _uhd->content_title = g_strdup(content_title);
-
-       return MEDIA_CONTENT_ERROR_NONE;
-}
-
-int media_uhd_set_played_count(media_uhd_h uhd, int played_count)
-{
-       media_uhd_s *_uhd = (media_uhd_s*)uhd;
-
-       content_retip_if_fail(uhd);
-
-       _uhd->played_count = played_count;
-
-       return MEDIA_CONTENT_ERROR_NONE;
-}
-
-int media_uhd_update_to_db(media_uhd_h uhd)
-{
-       int ret = MEDIA_CONTENT_ERROR_NONE;
-       media_uhd_s *_uhd = (media_uhd_s*)uhd;
-       char *update_query = NULL;
-
-       content_retip_if_fail(uhd);
-       content_retip_if_fail(STRING_VALID(_uhd->media_id));
-       content_retip_if_fail(STRING_VALID(_uhd->path));
-
-       update_query = sqlite3_mprintf(UPDATE_UHD_META_FROM_UHD, _uhd->content_title, _uhd->played_position, _uhd->played_count, _uhd->media_id);
-
-       ret = _content_query_sql(update_query);
-       sqlite3_free(update_query);
-
-       return ret;
-}
-#endif