face detection related processing is not performed
[platform/core/api/media-content.git] / src / media_info.c
index 1d4b48f..e593c17 100644 (file)
 */
 
 #include <media_info.h>
-#include <media-thumbnail.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_thumbnail_completed_cb(int error, const char *path, 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);
 
-static int __media_info_get_media_path_by_id_from_db(const char *media_id, char **path)
-{
-       int ret = MEDIA_CONTENT_ERROR_NONE;
-       sqlite3_stmt *stmt = NULL;
-       char *select_query = NULL;
-
-       content_retip_if_fail(STRING_VALID(media_id));
-
-       select_query = sqlite3_mprintf(SELECT_MEDIA_PATH_BY_ID, media_id);
-
-       ret = _content_get_result(select_query, &stmt);
-       SQLITE3_SAFE_FREE(select_query);
-       content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
-
-       if (sqlite3_step(stmt) == SQLITE_ROW) {
-               *path = g_strdup((const char *)sqlite3_column_text(stmt, 0));
-       } else {
-               content_error("There's no media with this ID : %s", media_id);
-               *path = NULL;
-               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
-       }
-
-       SQLITE3_FINALIZE(stmt);
-
-       return ret;
-}
-
 static void __media_info_insert_completed_cb(media_request_result_s *result, void *user_data)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
@@ -79,37 +48,7 @@ static void __media_info_insert_completed_cb(media_request_result_s *result, voi
 
        return;
 }
-
-static void __media_info_thumbnail_completed_cb(int error, const char *path, void *user_data)
-{
-       int error_value = MEDIA_CONTENT_ERROR_NONE;
-
-       media_thumbnail_cb_s *_thumb_cb = (media_thumbnail_cb_s *)user_data;
-       media_info_s *media = NULL;
-
-       if (_thumb_cb != NULL) {
-               media = _thumb_cb->handle;
-
-               if (media != NULL) {
-                       g_free(media->thumbnail_path);
-
-                       if (STRING_VALID(path))
-                               media->thumbnail_path = g_strdup(path);
-                       else
-                               media->thumbnail_path = g_strdup(MEDIA_CONTENT_EMPTY_STRING);
-               }
-
-               content_debug("error [%d], thumbnail_path [%s]", error, path);
-               error_value = _content_error_capi(error);
-               if (_thumb_cb->thumbnail_completed_cb)
-                       _thumb_cb->thumbnail_completed_cb(error_value, path, _thumb_cb->user_data);
-       }
-
-       g_free(_thumb_cb);
-
-       return;
-}
-
+// LCOV_EXCL_START
 static bool __media_info_isFaceRecognition_feature_supported(void)
 {
        bool isFaceRecognitionSupported = false;
@@ -124,24 +63,7 @@ static bool __media_info_isFaceRecognition_feature_supported(void)
        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,
@@ -513,14 +435,39 @@ int media_info_get_media_info_by_path_from_db(const char* path, media_info_h* me
 
        return ret;
 }
-#endif
+
+static int __media_info_get_media_path_by_id_from_db(const char *media_id, char **path)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       sqlite3_stmt *stmt = NULL;
+       char *select_query = NULL;
+
+       content_retip_if_fail(STRING_VALID(media_id));
+
+       select_query = sqlite3_mprintf(SELECT_MEDIA_PATH_BY_ID, media_id);
+
+       ret = _content_get_result(select_query, &stmt);
+       SQLITE3_SAFE_FREE(select_query);
+       content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       if (sqlite3_step(stmt) == SQLITE_ROW) {
+               *path = g_strdup((const char *)sqlite3_column_text(stmt, 0));
+       } else {
+               content_error("There's no media with this ID : %s", media_id);
+               *path = NULL;
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       SQLITE3_FINALIZE(stmt);
+
+       return ret;
+}
 
 int media_info_delete_from_db(const char *media_id)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
        char *path = NULL;
        char *storage_id = NULL;
-       content_warn("DEPRECATION WARNING: media_info_delete_from_db() is deprecated and will be removed from next release. Use media_content_scan_file() instead.");
 
        content_retip_if_fail(STRING_VALID(media_id));
 
@@ -544,6 +491,7 @@ int media_info_delete_from_db(const char *media_id)
 
        return _content_error_capi(ret);
 }
+#endif
 
 int media_info_destroy(media_info_h media)
 {
@@ -738,9 +686,10 @@ int media_info_foreach_media_from_db(filter_h filter, media_info_cb callback, vo
 
        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);
 
@@ -749,12 +698,13 @@ int media_info_get_tag_count_from_db(const char *media_id, filter_h filter, int
 
 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));
@@ -770,9 +720,10 @@ int media_info_foreach_bookmark_from_db(const char *media_id, filter_h filter, m
 
        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);
 
@@ -781,12 +732,13 @@ int media_info_get_face_count_from_db(const char *media_id, filter_h filter, int
 
 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;
@@ -1003,9 +955,10 @@ int media_info_get_modified_time(media_info_h media, time_t* time)
 
        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);
@@ -1015,7 +968,7 @@ int media_info_get_timeline(media_info_h media, time_t* time)
 
        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;
@@ -1039,9 +992,10 @@ int media_info_get_title(media_info_h media, char **title)
 
        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);
@@ -1054,6 +1008,7 @@ int media_info_get_description(media_info_h media, char **description)
 
 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);
@@ -1065,6 +1020,7 @@ int media_info_get_longitude(media_info_h media, double* longitude)
 }
 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);
@@ -1077,6 +1033,7 @@ int media_info_get_latitude(media_info_h media, double* latitude)
 
 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);
@@ -1089,6 +1046,7 @@ int media_info_get_altitude(media_info_h media, double *altitude)
 
 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);
@@ -1101,6 +1059,7 @@ int media_info_get_rating(media_info_h media, int *rating)
 
 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);
@@ -1111,21 +1070,9 @@ int media_info_get_favorite(media_info_h media, bool* favorite)
        return MEDIA_CONTENT_ERROR_NONE;
 }
 
-int media_info_get_storage_id(media_info_h media, char **storage_id)
-{
-       content_warn("DEPRECATION WARNING: media_info_get_storage_id() is deprecated and will be removed from next release.");
-       media_info_s *_media = (media_info_s*)media;
-
-       content_retip_if_fail(media);
-       content_retip_if_fail(storage_id);
-
-       *storage_id = g_strdup(_media->storage_uuid);
-
-       return MEDIA_CONTENT_ERROR_NONE;
-}
-
 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);
@@ -1138,6 +1085,7 @@ int media_info_is_drm(media_info_h media, bool *is_drm)
 
 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);
@@ -1147,20 +1095,7 @@ int media_info_is_360_content(media_info_h media, bool *is_360)
 
        return MEDIA_CONTENT_ERROR_NONE;
 }
-
-int media_info_get_storage_type(media_info_h media, media_content_storage_e *storage_type)
-{
-       content_warn("DEPRECATION WARNING: media_info_get_storage_type() is deprecated and will be removed from next release. Use storage_get_type_dev() instead.");
-       media_info_s *_media = (media_info_s*)media;
-
-       content_retip_if_fail(media);
-       content_retip_if_fail(storage_type);
-
-       *storage_type = _media->storage_type;
-
-       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)
 {
@@ -1360,9 +1295,10 @@ int media_info_get_media_from_db_by_path(const char *path, 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);
@@ -1377,6 +1313,7 @@ int media_info_set_favorite(media_info_h media, bool favorite)
 
 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;
@@ -1403,7 +1340,7 @@ int media_info_update_to_db(media_info_h media)
 
        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;
@@ -1465,33 +1402,6 @@ int media_info_move_to_db(media_info_h media, const char* dst_path)
        return ret;
 }
 
-int media_info_create_thumbnail(media_info_h media, media_thumbnail_completed_cb callback, void *user_data)
-{
-       content_warn("DEPRECATION WARNING: media_info_create_thumbnail() is deprecated and will be removed from next release. Use media_info_generate_thumbnail() instead.");
-       int ret = MEDIA_CONTENT_ERROR_NONE;
-       static unsigned int req_id = 0;
-       media_info_s *_media = (media_info_s*)media;
-
-       content_retip_if_fail(media);
-       content_retip_if_fail(callback);
-       content_retip_if_fail(STRING_VALID(_media->media_id));
-       content_retip_if_fail(_media->file_path);
-
-       media_thumbnail_cb_s *_thumb_cb = g_new0(media_thumbnail_cb_s, 1);
-
-       req_id++;
-       _media->request_id = req_id;
-
-       _thumb_cb->handle = _media;
-       _thumb_cb->user_data = user_data;
-       _thumb_cb->thumbnail_completed_cb = callback;
-
-       ret = thumbnail_request_from_db_async(_media->request_id, _media->file_path, (ThumbFunc)__media_info_thumbnail_completed_cb, (void *)_thumb_cb, _content_get_uid());
-       ret = _content_error_capi(ret);
-
-       return ret;
-}
-
 int media_info_generate_thumbnail(media_info_h media)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
@@ -1519,25 +1429,10 @@ int media_info_generate_thumbnail(media_info_h media)
 
        return ret;
 }
-
-int media_info_cancel_thumbnail(media_info_h media)
-{
-       int ret = MEDIA_CONTENT_ERROR_NONE;
-       content_warn("DEPRECATION WARNING: media_info_cancel_thumbnail() is deprecated and will be removed from next release.");
-       media_info_s *_media = (media_info_s*)media;
-
-       content_retip_if_fail(media);
-       content_retip_if_fail(STRING_VALID(_media->media_id));
-       content_retip_if_fail(_media->request_id > 0);
-
-       ret = thumbnail_request_cancel_media(_media->request_id);
-       return _content_error_capi(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()) {
@@ -1555,23 +1450,12 @@ int media_info_start_face_detection(media_info_h media, media_face_detection_com
                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()) {
@@ -1583,6 +1467,6 @@ int media_info_cancel_face_detection(media_info_h media)
        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);
-}
\ No newline at end of file
+       return MEDIA_CONTENT_ERROR_NONE;
+}
+// LCOV_EXCL_STOP
\ No newline at end of file