From: minje.ahn Date: Mon, 18 Dec 2023 06:09:53 +0000 (+0900) Subject: [ACR-1810] Deprecate all APIs X-Git-Tag: accepted/tizen/unified/20240105.105500^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_9.0_unified;p=platform%2Fcore%2Fapi%2Fmetadata-editor.git [ACR-1810] Deprecate all APIs Change-Id: I1fb19baaf45b4584fc2479fec235d92ff00a2e49 Signed-off-by: minje.ahn --- diff --git a/doc/metadata_editor_doc.h b/doc/metadata_editor_doc.h index f5161b7..cc1f34f 100755 --- a/doc/metadata_editor_doc.h +++ b/doc/metadata_editor_doc.h @@ -25,7 +25,7 @@ */ /** - * @defgroup CAPI_MEDIA_METADATA_EDITOR_MODULE Metadata Editor + * @defgroup CAPI_MEDIA_METADATA_EDITOR_MODULE Metadata Editor (Deprecated) * @ingroup CAPI_MEDIA_FRAMEWORK */ diff --git a/include/metadata_editor.h b/include/metadata_editor.h index 4109ef2..7076e9e 100755 --- a/include/metadata_editor.h +++ b/include/metadata_editor.h @@ -37,6 +37,7 @@ extern "C" { /** + * @deprecated Deprecated since 9.0. * @brief Creates metadata. * @since_tizen 2.4 * @@ -49,10 +50,11 @@ extern "C" { * @retval #METADATA_EDITOR_ERROR_OUT_OF_MEMORY Out of memory * @see metadata_editor_destroy() */ -int metadata_editor_create(metadata_editor_h *metadata); +int metadata_editor_create(metadata_editor_h *metadata) TIZEN_DEPRECATED_API; /** + * @deprecated Deprecated since 9.0. * @brief Sets file path to read or write metadata. * @since_tizen 2.4 * @@ -72,10 +74,11 @@ int metadata_editor_create(metadata_editor_h *metadata); * @see metadata_editor_create() * @see metadata_editor_destroy() */ -int metadata_editor_set_path(metadata_editor_h metadata, const char *path); +int metadata_editor_set_path(metadata_editor_h metadata, const char *path) TIZEN_DEPRECATED_API; /** + * @deprecated Deprecated since 9.0. * @brief Gets the metadata corresponding to the attribute. * @since_tizen 2.4 * @@ -98,10 +101,11 @@ int metadata_editor_set_path(metadata_editor_h metadata, const char *path); * @see metadata_editor_set_path() * @see metadata_editor_destroy() */ -int metadata_editor_get_metadata(metadata_editor_h metadata, metadata_editor_attr_e attribute, char **value); +int metadata_editor_get_metadata(metadata_editor_h metadata, metadata_editor_attr_e attribute, char **value) TIZEN_DEPRECATED_API; /** + * @deprecated Deprecated since 9.0. * @brief Sets the attribute of the metadata. * @details This function set the attribute of the metadata for updating the metadata. \n * If @a attribute is #METADATA_EDITOR_ATTR_PICTURE_NUM, this function returns #METADATA_EDITOR_ERROR_INVALID_PARAMETER. @@ -127,10 +131,11 @@ int metadata_editor_get_metadata(metadata_editor_h metadata, metadata_editor_att * @see metadata_editor_update_metadata() * @see metadata_editor_destroy() */ -int metadata_editor_set_metadata(metadata_editor_h metadata, metadata_editor_attr_e attribute, const char *value); +int metadata_editor_set_metadata(metadata_editor_h metadata, metadata_editor_attr_e attribute, const char *value) TIZEN_DEPRECATED_API; /** + * @deprecated Deprecated since 9.0. * @brief Updates the modified metadata. * @details This function update the metadata in the media file that is modified by metadata_editor_set_metadata(). * @since_tizen 2.4 @@ -150,9 +155,10 @@ int metadata_editor_set_metadata(metadata_editor_h metadata, metadata_editor_att * @see metadata_editor_set_path() * @see metadata_editor_destroy() */ -int metadata_editor_update_metadata(metadata_editor_h metadata); +int metadata_editor_update_metadata(metadata_editor_h metadata) TIZEN_DEPRECATED_API; /** + * @deprecated Deprecated since 9.0. * @brief Gets the picture in the media file. * @details If there is no picture or if the @a index is invalid, this function returns #METADATA_EDITOR_ERROR_INVALID_PARAMETER.\n * You can get picture number by using metadata_editor_get_metadata() and index starts with 0. @@ -178,9 +184,10 @@ int metadata_editor_update_metadata(metadata_editor_h metadata); * @see metadata_editor_set_path() * @see metadata_editor_destroy() */ -int metadata_editor_get_picture(metadata_editor_h metadata, int index, void **picture, int *size, char **mime_type); +int metadata_editor_get_picture(metadata_editor_h metadata, int index, void **picture, int *size, char **mime_type) TIZEN_DEPRECATED_API; /** + * @deprecated Deprecated since 9.0. * @brief Appends the picture to the media file. * @since_tizen 2.4 * @@ -207,9 +214,10 @@ int metadata_editor_get_picture(metadata_editor_h metadata, int index, void **pi * @see metadata_editor_update_metadata() * @see metadata_editor_destroy() */ -int metadata_editor_append_picture(metadata_editor_h metadata, const char *picture_path); +int metadata_editor_append_picture(metadata_editor_h metadata, const char *picture_path) TIZEN_DEPRECATED_API; /** + * @deprecated Deprecated since 9.0. * @brief Removes artwork image from media file. * @since_tizen 2.4 * @@ -231,9 +239,10 @@ int metadata_editor_append_picture(metadata_editor_h metadata, const char *pictu * @see metadata_editor_update_metadata() * @see metadata_editor_destroy() */ -int metadata_editor_remove_picture(metadata_editor_h metadata, int index); +int metadata_editor_remove_picture(metadata_editor_h metadata, int index) TIZEN_DEPRECATED_API; /** + * @deprecated Deprecated since 9.0. * @brief Destroys metadata. * @since_tizen 2.4 * @@ -245,7 +254,7 @@ int metadata_editor_remove_picture(metadata_editor_h metadata, int index); * @pre Create metadata handle by calling metadata_editor_create() * @see metadata_editor_create() */ -int metadata_editor_destroy(metadata_editor_h metadata); +int metadata_editor_destroy(metadata_editor_h metadata) TIZEN_DEPRECATED_API; /** * @} diff --git a/include/metadata_editor_private.h b/include/metadata_editor_private.h index d194f18..317bd2c 100755 --- a/include/metadata_editor_private.h +++ b/include/metadata_editor_private.h @@ -51,6 +51,10 @@ extern "C" { SECURE_LOGD(FONT_COLOR_CYAN"" fmt "" FONT_COLOR_RESET, ##arg); \ } while (0) +#define ME_WARN(fmt, arg...) do { \ + LOGW(FONT_COLOR_GREEN"" fmt "" FONT_COLOR_RESET, ##arg); \ + } while (0) + #define ME_RETVM_IF(expr, val, fmt, arg...) do { \ if ((expr)) { \ LOGE(FONT_COLOR_RED"" fmt "" FONT_COLOR_RESET, ##arg); \ diff --git a/include/metadata_editor_type.h b/include/metadata_editor_type.h index 4c5b0cc..a083b3a 100755 --- a/include/metadata_editor_type.h +++ b/include/metadata_editor_type.h @@ -41,6 +41,7 @@ extern "C" { /** * @ingroup CAPI_MEDIA_METADATA_EDITOR_MODULE + * @deprecated Deprecated since 9.0. * @brief The enumerations of media metadata error. * @since_tizen 2.4 */ @@ -58,6 +59,7 @@ typedef enum { /** * @ingroup CAPI_MEDIA_METADATA_EDITOR_MODULE + * @deprecated Deprecated since 9.0. * @brief The enumerations of attribute. * @since_tizen 2.4 */ @@ -79,6 +81,7 @@ typedef enum { /** * @ingroup CAPI_MEDIA_METADATA_EDITOR_MODULE + * @deprecated Deprecated since 9.0. * @brief The handle of media metadata. * @since_tizen 2.4 */ diff --git a/src/metadata_editor.cpp b/src/metadata_editor.cpp index 4bfb53e..09c2096 100755 --- a/src/metadata_editor.cpp +++ b/src/metadata_editor.cpp @@ -38,7 +38,7 @@ using namespace TagLib; #define MIME_TYPE_JPEG "image/jpeg" #define MIME_TYPE_PNG "image/png" - +// LCOV_EXCL_START static String __get_file_ext(const char *file_path) { String s = String(file_path, String::UTF8); @@ -488,6 +488,7 @@ class OggFileTypeResolver : public FileRef::FileTypeResolver { extern "C" int metadata_editor_create(metadata_editor_h *metadata) { + ME_WARN("DEPRECATION WARNING: metadata_editor_create() is deprecated and will be removed from next release."); ME_RETVM_IF(!metadata, METADATA_EDITOR_ERROR_INVALID_PARAMETER, "Invalid metadata"); metadata_editor_s* _metadata = (metadata_editor_s*)malloc(sizeof(metadata_editor_s)); @@ -500,6 +501,7 @@ extern "C" int metadata_editor_create(metadata_editor_h *metadata) extern "C" int metadata_editor_destroy(metadata_editor_h metadata) { + ME_WARN("DEPRECATION WARNING: metadata_editor_destroy() is deprecated and will be removed from next release."); auto _metadata = static_cast(metadata); ME_RETVM_IF(!_metadata, METADATA_EDITOR_ERROR_INVALID_PARAMETER, "Invalid metadata"); @@ -512,6 +514,7 @@ extern "C" int metadata_editor_destroy(metadata_editor_h metadata) extern "C" int metadata_editor_set_path(metadata_editor_h metadata, const char *path) { + ME_WARN("DEPRECATION WARNING: metadata_editor_set_path() is deprecated and will be removed from next release."); int ret = METADATA_EDITOR_ERROR_NONE; auto _metadata = static_cast(metadata); ME_RETVM_IF(!_metadata, METADATA_EDITOR_ERROR_INVALID_PARAMETER, "Invalid metadata"); @@ -547,6 +550,7 @@ extern "C" int metadata_editor_set_path(metadata_editor_h metadata, const char * extern "C" int metadata_editor_append_picture(metadata_editor_h metadata, const char *path) { + ME_WARN("DEPRECATION WARNING: metadata_editor_append_picture() is deprecated and will be removed from next release."); int ret = METADATA_EDITOR_ERROR_NONE; auto _metadata = static_cast(metadata); ME_RETV_IF(__is_valid_handle(_metadata, true), METADATA_EDITOR_ERROR_INVALID_PARAMETER); @@ -562,6 +566,7 @@ extern "C" int metadata_editor_append_picture(metadata_editor_h metadata, const extern "C" int metadata_editor_remove_picture(metadata_editor_h metadata, int index) { + ME_WARN("DEPRECATION WARNING: metadata_editor_remove_picture() is deprecated and will be removed from next release."); auto _metadata = static_cast(metadata); ME_RETV_IF(__is_valid_handle(_metadata, true), METADATA_EDITOR_ERROR_INVALID_PARAMETER); @@ -570,6 +575,7 @@ extern "C" int metadata_editor_remove_picture(metadata_editor_h metadata, int in extern "C" int metadata_editor_get_picture(metadata_editor_h metadata, int index, void **picture, int *size, char **mime_type) { + ME_WARN("DEPRECATION WARNING: metadata_editor_get_picture() is deprecated and will be removed from next release."); auto _metadata = static_cast(metadata); ME_RETV_IF(__is_valid_handle(_metadata, false), METADATA_EDITOR_ERROR_INVALID_PARAMETER); ME_RETVM_IF(!picture, METADATA_EDITOR_ERROR_INVALID_PARAMETER, "Invalid picture"); @@ -613,6 +619,7 @@ static const char * __get_attr_str(metadata_editor_attr_e attribute) extern "C" int metadata_editor_set_metadata(metadata_editor_h metadata, metadata_editor_attr_e attribute, const char *value) { + ME_WARN("DEPRECATION WARNING: metadata_editor_set_metadata() is deprecated and will be removed from next release."); auto _metadata = static_cast(metadata); ME_RETV_IF(__is_valid_handle(_metadata, true), METADATA_EDITOR_ERROR_INVALID_PARAMETER); @@ -621,6 +628,7 @@ extern "C" int metadata_editor_set_metadata(metadata_editor_h metadata, metadata extern "C" int metadata_editor_get_metadata(metadata_editor_h metadata, metadata_editor_attr_e attribute, char **value) { + ME_WARN("DEPRECATION WARNING: metadata_editor_get_metadata() is deprecated and will be removed from next release."); auto _metadata = static_cast(metadata); ME_RETV_IF(__is_valid_handle(_metadata, false), METADATA_EDITOR_ERROR_INVALID_PARAMETER); ME_RETVM_IF(!value, METADATA_EDITOR_ERROR_INVALID_PARAMETER, "Invalid value"); @@ -636,6 +644,7 @@ extern "C" int metadata_editor_get_metadata(metadata_editor_h metadata, metadata extern "C" int metadata_editor_update_metadata(metadata_editor_h metadata) { + ME_WARN("DEPRECATION WARNING: metadata_editor_update_metadata() is deprecated and will be removed from next release."); auto _metadata = static_cast(metadata); ME_RETV_IF(__is_valid_handle(_metadata, true), METADATA_EDITOR_ERROR_INVALID_PARAMETER); @@ -643,4 +652,5 @@ extern "C" int metadata_editor_update_metadata(metadata_editor_h metadata) return METADATA_EDITOR_ERROR_OPERATION_FAILED; return METADATA_EDITOR_ERROR_NONE; -} \ No newline at end of file +} +// LCOV_EXCL_STOP \ No newline at end of file