Improve readability of media_audio
[platform/core/api/media-content.git] / src / media_image.c
index 6c4468b..16ad32a 100755 (executable)
@@ -33,8 +33,6 @@ int image_meta_destroy(image_meta_h image)
 
        SAFE_FREE(_image->media_id);
        SAFE_FREE(_image->date_taken);
-       SAFE_FREE(_image->title);
-       SAFE_FREE(_image->burst_id);
        SAFE_FREE(_image->exposure_time);
        SAFE_FREE(_image->model);
        SAFE_FREE(_image);
@@ -60,16 +58,6 @@ int image_meta_clone(image_meta_h *dst, image_meta_h src)
                media_content_retv_free_image_if(_dst->date_taken == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, (image_meta_h)_dst);
        }
 
-       if (STRING_VALID(_src->title)) {
-               _dst->title = strdup(_src->title);
-               media_content_retv_free_image_if(_dst->title == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, (image_meta_h)_dst);
-       }
-
-       if (STRING_VALID(_src->burst_id)) {
-               _dst->burst_id = strdup(_src->burst_id);
-               media_content_retv_free_image_if(_dst->burst_id == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, (image_meta_h)_dst);
-       }
-
        if (STRING_VALID(_src->exposure_time)) {
                _dst->exposure_time = strdup(_src->exposure_time);
                media_content_retv_free_image_if(_dst->exposure_time == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, (image_meta_h)_dst);
@@ -187,28 +175,6 @@ int image_meta_get_date_taken(image_meta_h image, char **date_taken)
        return ret;
 }
 
-int image_meta_get_burst_id(image_meta_h image, char **burst_id)
-{
-       int ret = MEDIA_CONTENT_ERROR_NONE;
-       media_content_warn("DEPRECATION WARNING: image_meta_get_burst_id() is deprecated and will be removed from next release.");
-       image_meta_s *_image = (image_meta_s*)image;
-
-       if (_image && burst_id) {
-               if (STRING_VALID(_image->burst_id)) {
-                       *burst_id = strdup(_image->burst_id);
-                       media_content_retvm_if(*burst_id == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
-               } else {
-                       *burst_id = NULL;
-               }
-               ret = MEDIA_CONTENT_ERROR_NONE;
-       } else {
-               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
-               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
-       }
-
-       return ret;
-}
-
 int image_meta_get_exposure_time(image_meta_h image, char **exposure_time)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
@@ -283,27 +249,6 @@ int image_meta_get_model(image_meta_h image, char **model)
        return ret;
 }
 
-int image_meta_is_burst_shot(image_meta_h image, bool *is_burst_shot)
-{
-       int ret = MEDIA_CONTENT_ERROR_NONE;
-       media_content_warn("DEPRECATION WARNING: image_meta_is_burst_shot() is deprecated and will be removed from next release.");
-       image_meta_s *_image = (image_meta_s*)image;
-
-       if (_image && is_burst_shot) {
-               if (STRING_VALID(_image->burst_id))
-                       *is_burst_shot = true;
-               else
-                       *is_burst_shot = false;
-
-               ret = MEDIA_CONTENT_ERROR_NONE;
-       } else {
-               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
-               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
-       }
-
-       return ret;
-}
-
 int image_meta_set_orientation(image_meta_h image, media_content_orientation_e orientation)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
@@ -333,13 +278,15 @@ int image_meta_update_to_db(image_meta_h image)
        char *sql = NULL;
 
        if (_image != NULL && STRING_VALID(_image->media_id)) {
-               char storage_id[MEDIA_CONTENT_UUID_SIZE+1] = {0,};
-               memset(storage_id, 0x00, sizeof(storage_id));
-
-               ret = _media_db_get_storage_id_by_media_id(_image->media_id, storage_id);
+#ifdef _USE_TVPD_MODE
+               char *storage_id = NULL;
+               ret = _media_db_get_storage_id_by_media_id(_image->media_id, &storage_id);
                media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
-
                sql = sqlite3_mprintf(UPDATE_IMAGE_META_FROM_MEDIA, storage_id, _image->orientation, _image->media_id);
+               SAFE_FREE(storage_id);
+#else
+               sql = sqlite3_mprintf(UPDATE_IMAGE_META_FROM_MEDIA, _image->orientation, _image->media_id);
+#endif
                ret = _content_query_sql(sql);
                SQLITE3_SAFE_FREE(sql);
        } else {