*/
#include <media_info.h>
-#include <media-util-dcm.h>
#include <media_info_private.h>
#include <media_util_private.h>
#include <system_info.h>
static void __media_info_insert_completed_cb(media_request_result_s *result, void *user_data);
-static void __media_info_face_completed_cb(int error, const int face_count, void *user_data);
static int __media_info_insert_batch(const char **path_array, unsigned int array_length, media_insert_completed_cb completed_cb, void *user_data);
static int __media_info_check_file_validity(const char *path);
return;
}
-
+// LCOV_EXCL_START
static bool __media_info_isFaceRecognition_feature_supported(void)
{
bool isFaceRecognitionSupported = false;
return isFaceRecognitionSupported;
}
-static void __media_info_face_completed_cb(int error, const int face_count, void *user_data)
-{
- int error_value = MEDIA_CONTENT_ERROR_NONE;
-
- media_face_cb_s *_face_cb = (media_face_cb_s *)user_data;
-
- if (_face_cb != NULL) {
- content_debug("error [%d], face_count [%d]", error, face_count);
- error_value = _content_error_capi(error);
- if (_face_cb->face_completed_cb)
- _face_cb->face_completed_cb(error_value, face_count, _face_cb->user_data);
- }
-
- g_free(_face_cb);
-
- return;
-}
-
+// LCOV_EXCL_STOP
static int __media_info_insert_batch(const char **path_array,
unsigned int array_length,
media_insert_completed_cb completed_cb,
content_error("media_files_register failed : %d", ret);
if (unlink(list_path) < 0)
content_stderror("failed to delete");
+ g_free(_cb_data);
return _content_error_capi(ret);
}
_media->rating = (int)sqlite3_column_int(stmt, MEDIA_INFO_RATING);
_media->favourite = (int)sqlite3_column_int(stmt, MEDIA_INFO_FAVOURITE);
_media->is_drm = (int)sqlite3_column_int(stmt, MEDIA_INFO_IS_DRM);
- _media->storage_type = (int)sqlite3_column_int(stmt, MEDIA_INFO_STORAGE_TYPE);
_media->longitude = (double)sqlite3_column_double(stmt, MEDIA_INFO_LONGITUDE);
_media->latitude = (double)sqlite3_column_double(stmt, MEDIA_INFO_LATITUDE);
_media->altitude = (double)sqlite3_column_double(stmt, MEDIA_INFO_ALTITUDE);
_media->book_meta = g_new0(book_meta_s, 1);
_media->book_meta->subject = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_GENRE));
- _media->book_meta->author = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_COMPOSER));
+ _media->book_meta->author = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_ARTIST));
_media->book_meta->date = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_RECORDED_DATE));
_media->book_meta->publisher = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_COPYRIGHT));
}
{
char storage_id[MEDIA_CONTENT_UUID_SIZE+1] = {0, };
int ret = MEDIA_CONTENT_ERROR_NONE;
- ms_user_storage_type_e storage_type = MS_USER_STORAGE_INTERNAL;
int modified_time = 0;
content_retip_if_fail(STRING_VALID(path));
return _content_error_capi(ret);
}
- ret = ms_user_get_storage_type(_content_get_uid(), path, &storage_type);
- if (ret != MS_MEDIA_ERR_NONE) {
- content_sec_error("ms_user_get_storage_type failed : %d", ret);
- return _content_error_capi(ret);
- }
-
/* Get modified time for check exists */
ret = media_svc_get_modified_time(_content_get_db_handle(), storage_id, path, &modified_time);
if (ret == MS_MEDIA_ERR_NONE) {
/* Refresh if need */
if (modified_time != _media_util_get_file_time(path)) {
- ret = media_svc_refresh_item(_content_get_db_handle(), false, storage_id, storage_type, path, _content_get_uid());
+ ret = media_svc_refresh_item(_content_get_db_handle(), false, storage_id, path, _content_get_uid());
if (ret != MS_MEDIA_ERR_NONE) {
content_error("media_svc_refresh_item failed : %d", ret);
return _content_error_capi(ret);
content_sec_debug("media_svc_check_item_exist_by_path : no record : %s", path);
content_retvm_if(!_media_util_check_support_media_type(path), MEDIA_CONTENT_ERROR_NOT_SUPPORTED, "Unsupported media type");
- ret = media_svc_insert_item_immediately(_content_get_db_handle(), storage_id, storage_type, path, _content_get_uid());
+ ret = media_svc_insert_item_immediately(_content_get_db_handle(), storage_id, path, _content_get_uid());
if (ret != MS_MEDIA_ERR_NONE) {
if (ret == MS_MEDIA_ERR_DB_CONSTRAINT_FAIL) {
content_sec_error("This item is already inserted. This may be normal operation because other process already did this (%s)", path);
g_free(_media->thumbnail_path);
g_free(_media->description);
g_free(_media->title);
-#ifdef _USE_TVPD_MODE
- g_free(_media->modified_month);
-#endif
g_free(_media->storage_uuid);
if (_media->image_meta) {
_dst->description = g_strdup(_src->description);
_dst->title = g_strdup(_src->title);
_dst->storage_uuid = g_strdup(_src->storage_uuid);
-#ifdef _USE_TVPD_MODE
- _dst->modified_month = g_strdup(_src->modified_month);
-#endif
_dst->media_type = _src->media_type;
_dst->size = _src->size;
_dst->added_time = _src->added_time;
_dst->rating = _src->rating;
_dst->favourite = _src->favourite;
_dst->is_drm = _src->is_drm;
- _dst->storage_type = _src->storage_type;
_dst->request_id = _src->request_id;
_dst->face_request_id = _src->face_request_id;
_dst->is_360 = _src->is_360;
return _media_db_get_group_item(NULL, filter, callback, user_data, MEDIA_GROUP_NONE);
}
-
+// LCOV_EXCL_START
int media_info_get_tag_count_from_db(const char *media_id, filter_h filter, int *tag_count)
{
+ content_warn("DEPRECATION WARNING: media_info_get_tag_count_from_db() is deprecated and will be removed from next release.");
content_retip_if_fail(STRING_VALID(media_id));
content_retip_if_fail(tag_count);
int media_info_foreach_tag_from_db(const char *media_id, filter_h filter, media_tag_cb callback, void *user_data)
{
+ content_warn("DEPRECATION WARNING: media_info_foreach_tag_from_db() is deprecated and will be removed from next release.");
content_retip_if_fail(STRING_VALID(media_id));
content_retip_if_fail(callback);
return _media_db_get_tag(media_id, filter, callback, user_data);
}
-
+// LCOV_EXCL_STOP
int media_info_get_bookmark_count_from_db(const char *media_id, filter_h filter, int *bookmark_count)
{
content_retip_if_fail(STRING_VALID(media_id));
return _media_db_get_bookmark(media_id, filter, callback, user_data);
}
-
+// LCOV_EXCL_START
int media_info_get_face_count_from_db(const char *media_id, filter_h filter, int *face_count)
{
+ content_warn("DEPRECATION WARNING: media_info_get_face_count_from_db() is deprecated and will be removed from next release.");
content_retip_if_fail(STRING_VALID(media_id));
content_retip_if_fail(face_count);
int media_info_foreach_face_from_db(const char *media_id, filter_h filter, media_face_cb callback, void *user_data)
{
+ content_warn("DEPRECATION WARNING: media_info_foreach_face_from_db() is deprecated and will be removed from next release.");
content_retip_if_fail(STRING_VALID(media_id));
content_retip_if_fail(callback);
return _media_db_get_face(media_id, filter, callback, user_data);
}
-
+// LCOV_EXCL_STOP
int media_info_get_image(media_info_h media, image_meta_h *image)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
int media_info_get_video(media_info_h media, video_meta_h *video)
{
+ content_warn("DEPRECATION WARNING: media_info_get_video() is deprecated and will be removed from next release.");
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
return MEDIA_CONTENT_ERROR_NONE;
}
-
+// LCOV_EXCL_START
int media_info_get_timeline(media_info_h media, time_t* time)
{
+ content_warn("DEPRECATION WARNING: media_info_get_timeline() is deprecated and will be removed from next release.");
media_info_s *_media = (media_info_s*)media;
content_retip_if_fail(media);
return MEDIA_CONTENT_ERROR_NONE;
}
-
+// LCOV_EXCL_STOP
int media_info_get_thumbnail_path(media_info_h media, char **path)
{
media_info_s *_media = (media_info_s*)media;
return MEDIA_CONTENT_ERROR_NONE;
}
-
+// LCOV_EXCL_START
int media_info_get_description(media_info_h media, char **description)
{
+ content_warn("DEPRECATION WARNING: media_info_get_description() is deprecated and will be removed from next release.");
media_info_s *_media = (media_info_s*)media;
content_retip_if_fail(media);
int media_info_get_longitude(media_info_h media, double* longitude)
{
+ content_warn("DEPRECATION WARNING: media_info_get_longitude() is deprecated and will be removed from next release.");
media_info_s *_media = (media_info_s*)media;
content_retip_if_fail(media);
}
int media_info_get_latitude(media_info_h media, double* latitude)
{
+ content_warn("DEPRECATION WARNING: media_info_get_latitude() is deprecated and will be removed from next release.");
media_info_s *_media = (media_info_s*)media;
content_retip_if_fail(media);
int media_info_get_altitude(media_info_h media, double *altitude)
{
+ content_warn("DEPRECATION WARNING: media_info_get_altitude() is deprecated and will be removed from next release.");
media_info_s *_media = (media_info_s*)media;
content_retip_if_fail(media);
int media_info_get_rating(media_info_h media, int *rating)
{
+ content_warn("DEPRECATION WARNING: media_info_get_rating() is deprecated and will be removed from next release.");
media_info_s *_media = (media_info_s*)media;
content_retip_if_fail(media);
int media_info_get_favorite(media_info_h media, bool* favorite)
{
+ content_warn("DEPRECATION WARNING: media_info_get_favorite() is deprecated and will be removed from next release.");
media_info_s *_media = (media_info_s*)media;
content_retip_if_fail(media);
int media_info_is_drm(media_info_h media, bool *is_drm)
{
+ content_warn("DEPRECATION WARNING: media_info_is_drm() is deprecated and will be removed from next release.");
media_info_s *_media = (media_info_s*)media;
content_retip_if_fail(media);
int media_info_is_360_content(media_info_h media, bool *is_360)
{
+ content_warn("DEPRECATION WARNING: media_info_is_360_content() is deprecated and will be removed from next release.");
media_info_s *_media = (media_info_s*)media;
content_retip_if_fail(media);
return MEDIA_CONTENT_ERROR_NONE;
}
-
+// LCOV_EXCL_STOP
#ifdef _USE_TVPD_MODE
int media_info_get_played_count(media_info_h media, int *played_count)
{
return MEDIA_CONTENT_ERROR_NONE;
}
-
-int media_info_get_stitched_engine(media_info_h media, int *stitched_info)
-{
- media_info_s *_media = (media_info_s*)media;
-
- content_retip_if_fail(media);
- content_retip_if_fail(stitched_info);
-
- *stitched_info = _media->stitched_info & 0x0000FFFF;
-
- return MEDIA_CONTENT_ERROR_NONE;
-}
-
-int media_info_get_modified_month(media_info_h media, char **modified_month)
-{
- media_info_s *_media = (media_info_s*)media;
-
- content_retip_if_fail(media);
- content_retip_if_fail(modified_month);
-
- *modified_month = g_strdup(_media->modified_month);
-
- return MEDIA_CONTENT_ERROR_NONE;
-}
-
#endif
int media_info_get_media_from_db(const char *media_id, media_info_h *media)
return ret;
}
-
+// LCOV_EXCL_START
int media_info_set_favorite(media_info_h media, bool favorite)
{
+ content_warn("DEPRECATION WARNING: media_info_set_favorite() is deprecated and will be removed from next release.");
media_info_s *_media = (media_info_s*)media;
content_retip_if_fail(media);
int media_info_update_to_db(media_info_h media)
{
+ content_warn("DEPRECATION WARNING: media_info_update_to_db() is deprecated and will be removed from next release.");
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_s *_media = (media_info_s*)media;
char *sql = NULL;
/* Send notification for this update */
content_debug("Update is successful. Send notification for this");
if (_media->file_path && _media->mime_type)
- media_svc_publish_noti(MS_MEDIA_ITEM_UPDATE, _media->file_path, _media->media_type, _media->media_id, _media->mime_type);
+ media_svc_publish_update_noti(_media->file_path, _media->media_type, _media->media_id, _media->mime_type);
else
content_error("Can't Send Noti : path or mime type is NULL");
}
return ret;
}
-
+// LCOV_EXCL_STOP
int media_info_move_to_db(media_info_h media, const char* dst_path)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
_media->display_name = g_strdup(_info->display_name);
SAFE_FREE(_media->file_path);
_media->file_path = g_strdup(_info->file_path);
- _media->storage_type = _info->storage_type;
SAFE_FREE(_media->storage_uuid);
_media->storage_uuid = g_strdup(_info->storage_uuid);
SAFE_FREE(_media->thumbnail_path);
return ret;
}
-
+// LCOV_EXCL_START
int media_info_start_face_detection(media_info_h media, media_face_detection_completed_cb callback, void *user_data)
{
- int ret = MEDIA_CONTENT_ERROR_NONE;
- static unsigned int req_id = 0;
+ content_warn("DEPRECATION WARNING: media_info_start_face_detection() is deprecated and will be removed from next release.");
media_info_s *_media = (media_info_s*)media;
if (!__media_info_isFaceRecognition_feature_supported()) {
return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
- media_face_cb_s *_face_cb = g_new0(media_face_cb_s, 1);
-
- req_id++;
- _media->face_request_id = req_id;
-
- _face_cb->user_data = user_data;
- _face_cb->face_completed_cb = callback;
-
- ret = dcm_request_extract_face_async(_media->face_request_id, _media->file_path, (FaceFunc)__media_info_face_completed_cb, (void *)_face_cb, _content_get_uid());
- ret = _content_error_capi(ret);
-
- return ret;
+ return MEDIA_CONTENT_ERROR_NONE;
}
int media_info_cancel_face_detection(media_info_h media)
{
- int ret = MEDIA_CONTENT_ERROR_NONE;
+ content_warn("DEPRECATION WARNING: media_info_cancel_face_detection() is deprecated and will be removed from next release.");
media_info_s *_media = (media_info_s*)media;
if (!__media_info_isFaceRecognition_feature_supported()) {
content_retip_if_fail(STRING_VALID(_media->media_id));
content_retip_if_fail(_media->face_request_id > 0);
- ret = dcm_request_cancel_face(_media->face_request_id);
- return _content_error_capi(ret);
+ return MEDIA_CONTENT_ERROR_NONE;
}
+// LCOV_EXCL_STOP
\ No newline at end of file