All UHD APIs can be replaced with public APIs.
Change-Id: Ia8d532b39d403d21ebc068031e717f23a56299db
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
#include <media_content_type_product.h>
#include <media_pvr.h>
-#include <media_uhd.h>
#ifdef __cplusplus
extern "C" {
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
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"
#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
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;
#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"
#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);
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);
+++ /dev/null
-/*
-* 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__ */
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
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;
+++ /dev/null
- /*
- * 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