#define MEDIA_CONTENT_PATH_PHONE MEDIA_ROOT_PATH_INTERNAL /**< File path prefix of files stored in phone */
#define MEDIA_CONTENT_PATH_MMC MEDIA_ROOT_PATH_SDCARD /**< File path prefix of files stored in mmc card */
-#define MEDIA_CONTENT_THUMB_DEFAULT_PATH tzplatform_mkpath(TZ_USER_DATA, "file-manager-service/.thumb/thumb_default.png")
+#define MEDIA_CONTENT_THUMB_DEFAULT_PATH tzplatform_mkpath(TZ_SYS_DATA, "file-manager-service/.thumb/thumb_default.png")
#define MEDIA_CONTENT_INSERT_FILES_PATH tzplatform_mkpath(TZ_USER_DATA, "file-manager-service/")
#define MAX_QUERY_SIZE 4096
Name: capi-content-media-content
Summary: A Media content library in SLP C API
-Version: 0.2.58
+Version: 0.2.59
Release: 0
Group: Multimedia/API
License: Apache-2.0
int ret = MEDIA_CONTENT_ERROR_NONE;
//DB will be updated by Media Server.
- ret = media_svc_request_update_db(query_str);
+ ret = media_svc_request_update_db(query_str,tzplatform_getuid(TZ_USER_NAME));
return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
{
if(db_handle == NULL)
{
- ret = media_svc_connect(&db_handle);
+ ret = media_svc_connect(&db_handle,tzplatform_getuid(TZ_USER_NAME));
}
ret = _content_error_capi(MEDIA_CONTENT_TYPE, ret);
ret = media_svc_check_item_exist_by_path(_content_get_db_handle(), path);
if (ret == MEDIA_INFO_ERROR_NONE) {
/* Refresh */
- ret = media_svc_refresh_item(_content_get_db_handle(), storage_type, path);
+ ret = media_svc_refresh_item(_content_get_db_handle(), storage_type, path, tzplatform_getuid(TZ_USER_NAME));
if (ret < 0) {
media_content_error("media_svc_refresh_item failed : %d", ret);
return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
} else if (ret == MEDIA_INFO_ERROR_DATABASE_NO_RECORD) {
/* Insert */
- ret = media_svc_insert_item_immediately(_content_get_db_handle(), storage_type, path);
+ ret = media_svc_insert_item_immediately(_content_get_db_handle(), storage_type, path, tzplatform_getuid(TZ_USER_NAME));
if (ret < 0) {
media_content_error("media_svc_insert_item_immediately failed : %d", ret);
return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
} else {
/* This means this path has to be deleted */
media_content_debug("This path doesn't exists in file system... So now start to delete it from DB");
- ret = media_svc_delete_item_by_path(_content_get_db_handle(), path);
+ ret = media_svc_delete_item_by_path(_content_get_db_handle(), path, tzplatform_getuid(TZ_USER_NAME));
if (ret < 0) {
media_content_error("media_svc_delete_item_by_path failed : %d", ret);
return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
cb_data->callback = callback;
cb_data->user_data = user_data;
- ret = media_directory_scanning_async(path, is_recursive, _media_content_scan_cb, cb_data);
+ ret = media_directory_scanning_async(path, is_recursive, _media_content_scan_cb, cb_data, tzplatform_getuid(TZ_USER_NAME));
if (ret < 0) {
media_content_error("media_directory_scanning_async failed : %d", ret);
}
int _media_db_get_group_count(filter_h filter, group_list_e group_type, int *group_count)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
+ int ret_view = MEDIA_CONTENT_ERROR_NONE;
sqlite3_stmt *stmt = NULL;
filter_s *_filter = NULL;
char select_query[DEFAULT_QUERY_SIZE];
}
SQLITE3_FINALIZE(stmt);
-
return ret;
}
int _media_db_get_media_group_count(media_group_e group, filter_h filter, int *group_count)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
+ int ret_view = MEDIA_CONTENT_ERROR_NONE;
sqlite3_stmt *stmt = NULL;
filter_s *_filter = NULL;
char select_query[DEFAULT_QUERY_SIZE];
}
SQLITE3_FINALIZE(stmt);
-
return ret;
}
int _media_db_get_media_group(media_group_e group, filter_h filter, media_group_cb callback, void *user_data)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
+ int ret_view = MEDIA_CONTENT_ERROR_NONE;
char select_query[DEFAULT_QUERY_SIZE];
char *condition_query = NULL;
char *option_query = NULL;
}
SQLITE3_FINALIZE(stmt);
-
return ret;
}
int _media_db_get_album(filter_h filter, media_album_cb callback, void *user_data)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
+ int ret_view = MEDIA_CONTENT_ERROR_NONE;
char select_query[DEFAULT_QUERY_SIZE];
char *condition_query = NULL;
char *option_query = NULL;
}
SQLITE3_FINALIZE(stmt);
-
return ret;
}
int _media_db_get_folder(filter_h filter, media_folder_cb callback, void *user_data)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
+ int ret_view = MEDIA_CONTENT_ERROR_NONE;
char select_query[DEFAULT_QUERY_SIZE];
char *condition_query = NULL;
char *option_query = NULL;
sqlite3_stmt *stmt = NULL;
filter_s *_filter = NULL;
+
memset(select_query, 0x00, sizeof(select_query));
}
SQLITE3_FINALIZE(stmt);
-
return ret;
}
int _media_db_get_playlist(filter_h filter, media_playlist_cb callback, void *user_data)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
+ int ret_view = MEDIA_CONTENT_ERROR_NONE;
char select_query[DEFAULT_QUERY_SIZE];
char *condition_query = NULL;
char *option_query = NULL;
}
SQLITE3_FINALIZE(stmt);
-
return ret;
}
int _media_db_get_playlist_item(int playlist_id, filter_h filter, playlist_member_cb callback, void *user_data)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
+ int ret_view = MEDIA_CONTENT_ERROR_NONE;
char select_query[DEFAULT_QUERY_SIZE];
char *condition_query = NULL;
char *option_query = NULL;
}
SQLITE3_FINALIZE(stmt);
-
return ret;
}
int _media_db_get_tag(const char *media_id, filter_h filter, media_tag_cb callback, void *user_data)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
+ int ret_view = MEDIA_CONTENT_ERROR_NONE;
char select_query[DEFAULT_QUERY_SIZE];
char *condition_query = NULL;
char *option_query = NULL;
}
SQLITE3_FINALIZE(stmt);
-
return ret;
}
int _media_db_get_bookmark(const char *media_id, filter_h filter, media_bookmark_cb callback, void *user_data)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
+ int ret_view = MEDIA_CONTENT_ERROR_NONE;
char select_query[DEFAULT_QUERY_SIZE];
char *condition_query = NULL;
char *option_query = NULL;
}
SQLITE3_FINALIZE(stmt);
-
return ret;
}
int _media_db_get_group_item_count_by_id(int group_id, filter_h filter, group_list_e group_type, int *item_count)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
+ int ret_view = MEDIA_CONTENT_ERROR_NONE;
sqlite3_stmt *stmt = NULL;
filter_s *_filter = NULL;
char select_query[DEFAULT_QUERY_SIZE];
SAFE_FREE(option_query);
}
*/
+
ret = _content_query_prepare(&stmt, select_query, condition_query, option_query);
SAFE_FREE(condition_query);
SAFE_FREE(option_query);
}
SQLITE3_FINALIZE(stmt);
-
return ret;
}
int _media_db_get_group_item_count(const char *group_name, filter_h filter, group_list_e group_type, int *item_count)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
+ int ret_view = MEDIA_CONTENT_ERROR_NONE;
sqlite3_stmt *stmt = NULL;
filter_s *_filter = NULL;
char complete_select_query[DEFAULT_QUERY_SIZE];
}
SQLITE3_FINALIZE(stmt);
-
return ret;
}
int _media_db_get_group_item_by_id(int group_id, filter_h filter, media_info_cb callback, void *user_data, group_list_e group_type)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
+ int ret_view = MEDIA_CONTENT_ERROR_NONE;
char select_query[DEFAULT_QUERY_SIZE];
char *condition_query = NULL;
char *option_query = NULL;
}
SQLITE3_FINALIZE(stmt);
-
return ret;
}
int _media_db_get_group_item(const char *group_name, filter_h filter, media_info_cb callback, void *user_data, group_list_e group_type)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
+ int ret_view = MEDIA_CONTENT_ERROR_NONE;
char complete_select_query[DEFAULT_QUERY_SIZE];
char *select_query = NULL;
char *condition_query = NULL;
}
SQLITE3_FINALIZE(stmt);
-
return ret;
}
int _media_db_get_media_group_item_count(const char *group_name, media_group_e group, filter_h filter, int *item_count)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
+ int ret_view = MEDIA_CONTENT_ERROR_NONE;
sqlite3_stmt *stmt = NULL;
filter_s *_filter = NULL;
char complete_select_query[DEFAULT_QUERY_SIZE];
}
SQLITE3_FINALIZE(stmt);
-
return ret;
}
int _media_db_get_media_group_item(const char *group_name, media_group_e group, filter_h filter, media_info_cb callback, void *user_data)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
+ int ret_view = MEDIA_CONTENT_ERROR_NONE;
char complete_select_query[DEFAULT_QUERY_SIZE];
char *select_query = NULL;
char *condition_query = NULL;
}
SQLITE3_FINALIZE(stmt);
-
return ret;
}
int media_folder_get_folder_from_db(const char *folder_id, media_folder_h *folder)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
+ int ret_view = MEDIA_CONTENT_ERROR_NONE;
sqlite3_stmt *stmt = NULL;
char select_query[DEFAULT_QUERY_SIZE];
}
SQLITE3_FINALIZE(stmt);
-
return ret;
}
sqlite3_free(where_sql);
/* Do folder rename operation using libmedia-service */
- ret = media_svc_rename_folder(_content_get_db_handle(), g_src_path, _folder->path);
+ ret = media_svc_rename_folder(_content_get_db_handle(), g_src_path, _folder->path, tzplatform_getuid(TZ_USER_NAME));
return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
}
else
static int __media_info_get_media_info_from_db(char *path, media_info_h media)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
+ int ret_view = MEDIA_CONTENT_ERROR_NONE;
sqlite3_stmt *stmt = NULL;
char *select_query = NULL;
media_info_s *_media = (media_info_s*)media;
static int __media_info_get_media_path_by_id_from_db(const char *media_id, char **path)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
+ int ret_view = MEDIA_CONTENT_ERROR_NONE;
sqlite3_stmt *stmt = NULL;
char *select_query = NULL;
}
SQLITE3_FINALIZE(stmt);
-
return ret;
}
}
media_content_debug("media_svc_insert_item_immediately: %s", _path);
- ret = media_svc_insert_item_immediately(_content_get_db_handle(), storage_type, _path);
+ ret = media_svc_insert_item_immediately(_content_get_db_handle(), storage_type, _path, tzplatform_getuid(TZ_USER_NAME));
if (ret < 0) {
media_content_error("media_svc_insert_item_immediately failed : %d (%s)", ret, _path);
_cb_data->insert_list_path = strdup(list_path);
if(insert_type == MEDIA_BATCH_INSERT_NORMAL)
- ret = media_files_register(list_path, __media_info_insert_completed_cb, _cb_data);
+ ret = media_files_register(list_path, __media_info_insert_completed_cb, _cb_data, tzplatform_getuid(TZ_USER_NAME));
else if(insert_type == MEDIA_BATCH_INSERT_BURSTSHOT)
- ret = media_burstshot_register(list_path, __media_info_insert_completed_cb, _cb_data);
+ ret = media_burstshot_register(list_path, __media_info_insert_completed_cb, _cb_data, tzplatform_getuid(TZ_USER_NAME));
else
ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
return ret;
}
- ret = media_svc_delete_item_by_path(_content_get_db_handle(), path);
+ ret = media_svc_delete_item_by_path(_content_get_db_handle(), path, tzplatform_getuid(TZ_USER_NAME));
SAFE_FREE(path);
return _content_error_capi(ret,MEDIA_CONTENT_TYPE);
int media_info_get_media_from_db(const char *media_id, media_info_h *media)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
+ int ret_view = MEDIA_CONTENT_ERROR_NONE;
char select_query[DEFAULT_QUERY_SIZE];
sqlite3_stmt *stmt = NULL;
}
SQLITE3_FINALIZE(stmt);
-
return ret;
}
return ret;
}
- ret = media_svc_refresh_item(_content_get_db_handle(), storage_type, file_path);
+ ret = media_svc_refresh_item(_content_get_db_handle(), storage_type, file_path, tzplatform_getuid(TZ_USER_NAME));
SAFE_FREE(file_path);
media_info_destroy(media);
ret = _media_util_get_store_type_by_path(dst_path, &dst_storage_type);
media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
- ret = media_svc_move_item(_content_get_db_handle(), src_storage_type, _media->file_path, dst_storage_type, dst_path);
+ ret = media_svc_move_item(_content_get_db_handle(), src_storage_type, _media->file_path, dst_storage_type, dst_path, tzplatform_getuid(TZ_USER_NAME));
return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
}
_thumb_cb->user_data = user_data;
_thumb_cb->thumbnail_completed_cb = callback;
- ret = thumbnail_request_from_db_async(_media->file_path, (ThumbFunc)__media_info_thumbnail_completed_cb, (void *)_thumb_cb);
+ ret = thumbnail_request_from_db_async(_media->file_path, (ThumbFunc)__media_info_thumbnail_completed_cb, (void *)_thumb_cb, tzplatform_getuid(TZ_USER_NAME));
ret = _content_error_capi(MEDIA_THUMBNAIL_TYPE, ret);
}
else
if(_media != NULL && STRING_VALID(_media->media_id) && STRING_VALID(_media->file_path))
{
- ret = thumbnail_request_cancel_media(_media->file_path);
+ ret = thumbnail_request_cancel_media(_media->file_path, tzplatform_getuid(TZ_USER_NAME));
ret = _content_error_capi(MEDIA_THUMBNAIL_TYPE, ret);
}
else