From: minje.ahn Date: Tue, 4 Oct 2022 03:43:30 +0000 (+0900) Subject: [ACR-1736] Remove deprecated APIs X-Git-Tag: accepted/tizen/unified/20230221.085051^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen_8.0;p=platform%2Fcore%2Fapi%2Fthumbnail-util.git [ACR-1736] Remove deprecated APIs Change-Id: I8741271b4b496ed82d0db51ca9bce74fb064f31e Signed-off-by: minje.ahn --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 5761e67..5ad6e59 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ SET(submodule "thumbnail-util") SET(fw_name "${project_prefix}-${service}-${submodule}") # for package file -SET(dependents "dlog glib-2.0 capi-base-common media-thumbnail libmedia-utils") +SET(dependents "capi-base-common media-thumbnail libmedia-utils") SET(pc_dependents "capi-base-common") PROJECT(${fw_name}) diff --git a/include/thumbnail_util.h b/include/thumbnail_util.h index 9132d72..64d4766 100755 --- a/include/thumbnail_util.h +++ b/include/thumbnail_util.h @@ -34,148 +34,6 @@ extern "C" { * @{ */ -/** - * @deprecated Deprecated since 5.0. - * @brief Creates thumbnail info handle. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif - * @remarks The @a thumb info should be released using thumbnail_util_destroy(). - * - * @param[in] thumb The handle to thumbnail info - * - * @return @c 0 on success, otherwise a negative error value - * - * @retval #THUMBNAIL_UTIL_ERROR_NONE Successful - * @retval #THUMBNAIL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #THUMBNAIL_UTIL_ERROR_OUT_OF_MEMORY Out of memory - * - * @see thumbnail_util_destroy() - */ -int thumbnail_util_create(thumbnail_h *thumb) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 5.0. Use thumbnail_util_extract_to_file() or thumbnail_util_extract_to_buffer() instead. - * @brief Extracts the thumbnail for the given media, asynchronously. - * @details This function extracts the thumbnail for given media item and calls registered - * callback function for completion of extracting the thumbnail.\n - * You can distinguish generated thumbnails by @a request_id. Therefore, the @a request_id must be maintained until the request is completed. \n - * And the @a request_id is also used to cancel the request. - * - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif - * - * @remarks The @a request_id should be released using free(). \n - * %http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage. \n - * %http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n - * If you don't set the size, the thumbnail size will be set default size. Default size is 320x240. \n - * Color space of the generated thumbnail is BGRA. \n - * Since 3.0, %http://tizen.org/privilege/content.write privilege is not required. \n - * - * @param[in] thumb The thumbnail info handle - * @param[in] callback The callback function to be invoked - * @param[in] user_data The user data to be passed to the callback function - * @param[out] request_id The request id for the thumbnail extraction request - * - * @return @c 0 on success, otherwise a negative error value - * - * @retval #THUMBNAIL_UTIL_ERROR_NONE Successful - * @retval #THUMBNAIL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #THUMBNAIL_UTIL_ERROR_PERMISSION_DENIED Permission denied - * - * @pre Create a thumbnail info handle by calling thumbnail_util_create(). \n - * The content path that you want to generate thumbnail must be set by calling thumbnail_util_set_path(). - * @post Thumbnail extraction result except canceled is provided by thumbnail_extracted_cb(). - * @see thumbnail_util_create() - * @see thumbnail_util_set_path() - * @see thumbnail_util_set_size() - * @see thumbnail_extracted_cb() - * @see thumbnail_util_cancel() - * @see thumbnail_util_destroy() - */ -int thumbnail_util_extract(thumbnail_h thumb, thumbnail_extracted_cb callback, void *user_data, char **request_id) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 5.0. - * @brief Sets the path of original media file. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif - * - * @param[in] thumb The thumbnail info handle - * @param[in] path The path of the original media file - * - * @return @c 0 on success, otherwise a negative error value - * - * @retval #THUMBNAIL_UTIL_ERROR_NONE Successful - * @retval #THUMBNAIL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter - * - * @pre Create a thumbnail info handle by calling thumbnail_util_create(). - * @see thumbnail_util_create() - * @see thumbnail_util_set_size() - * @see thumbnail_util_destroy() - */ -int thumbnail_util_set_path(thumbnail_h thumb, const char *path) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 5.0. - * @brief Sets the size of thumbnail to be extracted. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif - * @remarks If you don't set the size, the thumbnail size will be set default size. Default size is 320x240. \n - * If the set width is not a multiple of 8, it can be changed by inner process. the width will be a multiple of 8 greater than the set value. - * - * @param[in] thumb The thumbnail info handle - * @param[in] width The width of the thumbnail - * @param[in] height The height of the thumbnail - * - * @return @c 0 on success, otherwise a negative error value - * - * @retval #THUMBNAIL_UTIL_ERROR_NONE Successful - * @retval #THUMBNAIL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter - * - * @pre Create a thumbnail info handle by calling thumbnail_util_create(). - * @see thumbnail_util_create() - * @see thumbnail_util_set_path() - * @see thumbnail_util_destroy() - * - */ -int thumbnail_util_set_size(thumbnail_h thumb, int width, int height) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 5.0. - * @brief Cancels the thumbnail extraction request for the given media. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif - * @remarks If there is no request to be canceled, this function returns #THUMBNAIL_UTIL_ERROR_INVALID_OPERATION - * - * @param[in] thumb The media thumbnail info handle - * @param[in] request_id The generated request id by thumbnail extraction request - * - * @return @c 0 on success, otherwise a negative error value - * - * @retval #THUMBNAIL_UTIL_ERROR_NONE Successful - * @retval #THUMBNAIL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter - * - * @pre It is available before thumbnail_extracted_cb() is called. - * @see thumbnail_util_extract() - */ -int thumbnail_util_cancel(thumbnail_h thumb, const char *request_id) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 5.0. - * @brief Destroys thumbnail info handle. - * @details The function frees all resources related to the thumbnail info handle. This handle - * can no longer be used to perform any operations. New thumbnail info handle has to - * be created before the next usage. - * - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif - * - * @param[in] thumb The thumbnail info handle - * - * @return @c 0 on success, otherwise a negative error value - * - * @retval #THUMBNAIL_UTIL_ERROR_NONE Successful - * @retval #THUMBNAIL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter - * - * @pre Create a thumbnail info handle by calling thumbnail_util_create(). - * @see thumbnail_util_create() - */ -int thumbnail_util_destroy(thumbnail_h thumb) TIZEN_DEPRECATED_API; - /** * @brief Extracts the thumbnail for the given media into a file, synchronously. * @details This function creates thumbnail from a given media file. \n diff --git a/include/thumbnail_util_private.h b/include/thumbnail_util_private.h deleted file mode 100755 index ff25077..0000000 --- a/include/thumbnail_util_private.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - - - -#ifndef __TIZEN_MULTIMEDIA_THUMBNAIL_UTIL_PRIVATE_H__ -#define __TIZEN_MULTIMEDIA_THUMBNAIL_UTIL_PRIVATE_H__ - - -#include -#include -#include -#include -#include -#include - - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#ifdef LOG_TAG -#undef LOG_TAG -#endif - -#define LOG_TAG "CAPI_MEDIA_THUMBNAIL_UTIL" - -typedef struct { - int request_id; -} thumbnail_s; - -#define FONT_COLOR_RESET "\033[0m" -#define FONT_COLOR_GREEN "\033[32m" - -#define THUMB_WARN(fmt, arg...) do { \ - LOGW(FONT_COLOR_GREEN""fmt""FONT_COLOR_RESET, ##arg); \ - } while (0) - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /*__TIZEN_MULTIMEDIA_THUMBNAIL_UTIL_PRIVATE_H__*/ diff --git a/include/thumbnail_util_type.h b/include/thumbnail_util_type.h index 7d8ddde..ef1fd5d 100755 --- a/include/thumbnail_util_type.h +++ b/include/thumbnail_util_type.h @@ -52,45 +52,6 @@ typedef enum { THUMBNAIL_UTIL_ERROR_UNSUPPORTED_CONTENT = THUMBNAIL_UTIL_ERROR_CLASS | 0x01, /**< Unsupported Content (Since 4.0) */ } thumbnail_util_error_e; - -/** - * @ingroup CAPI_MEDIA_THUMBNAIL_UTIL_MODULE - * @deprecated Deprecated since 5.0. - * @brief The structure type for the thumbnail info handle. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif - */ -typedef struct thumbnail_s *thumbnail_h; - - -/** - * @ingroup CAPI_MEDIA_THUMBNAIL_UTIL_MODULE - * @deprecated Deprecated since 5.0. - * @brief Called when creating the thumbnail. - * @details This callback is called for completion of generating the thumbnail. - * The following error codes can be received: \n - * #THUMBNAIL_UTIL_ERROR_NONE : Successful - * #THUMBNAIL_UTIL_ERROR_INVALID_PARAMETER : Invalid parameter - * #THUMBNAIL_UTIL_ERROR_PERMISSION_DENIED : Permission denied - * - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif - * - * @remarks Color space of the generated thumbnail is BGRA. \n - * The callback is called in a separate thread(not in the main loop). \n - * The @a thumb_data should be released using free(). - * - * @param[in] error The error code - * @param[in] request_id The generated request id by thumbnail extraction request - * @param[in] thumb_width The width of the thumbnail which is generated - * @param[in] thumb_height The height of the thumbnail which is generated - * @param[in] thumb_data The raw data of the thumbnail which is generated - * @param[in] thumb_size The size of the thumbnail which is generated - * @param[in] user_data The user data passed from the thumbnail_util_extract() function - * - * @pre thumbnail_util_extract() calls this callback. - * @see thumbnail_util_extract() - */ -typedef void (*thumbnail_extracted_cb)(thumbnail_util_error_e error, const char *request_id, int thumb_width, int thumb_height, unsigned char *thumb_data, int thumb_size, void *user_data); - /** * @} */ diff --git a/packaging/capi-media-thumbnail-util.spec b/packaging/capi-media-thumbnail-util.spec index 43921d0..0b37d3d 100644 --- a/packaging/capi-media-thumbnail-util.spec +++ b/packaging/capi-media-thumbnail-util.spec @@ -1,13 +1,11 @@ Name: capi-media-thumbnail-util Summary: A media thumbnail util library in Tizen Native API -Version: 0.1.30 +Version: 0.2.0 Release: 0 Group: Multimedia/API License: Apache-2.0 Source0: %{name}-%{version}.tar.gz BuildRequires: cmake -BuildRequires: pkgconfig(dlog) -BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(libmedia-utils) BuildRequires: pkgconfig(capi-base-common) BuildRequires: pkgconfig(media-thumbnail) diff --git a/src/thumbnail_util.c b/src/thumbnail_util.c index e7ba103..2acc7a1 100644 --- a/src/thumbnail_util.c +++ b/src/thumbnail_util.c @@ -15,9 +15,8 @@ */ #include -#include #include -#include +#include // LCOV_EXCL_START static int __thumbnail_util_error_capi(int internal_error) @@ -37,44 +36,7 @@ static int __thumbnail_util_error_capi(int internal_error) return THUMBNAIL_UTIL_ERROR_INVALID_OPERATION; } } - -int thumbnail_util_create(thumbnail_h *thumb) -{ - THUMB_WARN("DEPRECATION WARNING: thumbnail_util_create() is deprecated and will be removed from next release."); - return THUMBNAIL_UTIL_ERROR_NONE; -} - -int thumbnail_util_extract(thumbnail_h thumb, thumbnail_extracted_cb callback, void *user_data, char **request_id) -{ - THUMB_WARN("DEPRECATION WARNING: thumbnail_util_extract() is deprecated and will be removed from next release. Use thumbnail_util_extract_to_file() or thumbnail_util_extract_to_buffer() instead."); - return THUMBNAIL_UTIL_ERROR_NONE; -} - -int thumbnail_util_set_path(thumbnail_h thumb, const char *path) -{ - THUMB_WARN("DEPRECATION WARNING: thumbnail_util_set_path() is deprecated and will be removed from next release."); - return THUMBNAIL_UTIL_ERROR_NONE; -} - -int thumbnail_util_set_size(thumbnail_h thumb, int width, int height) -{ - THUMB_WARN("DEPRECATION WARNING: thumbnail_util_set_size() is deprecated and will be removed from next release."); - return THUMBNAIL_UTIL_ERROR_NONE; -} - -int thumbnail_util_cancel(thumbnail_h thumb, const char *request_id) -{ - THUMB_WARN("DEPRECATION WARNING: thumbnail_util_cancel() is deprecated and will be removed from next release."); - return THUMBNAIL_UTIL_ERROR_NONE; -} - -int thumbnail_util_destroy(thumbnail_h thumb) -{ - THUMB_WARN("DEPRECATION WARNING: thumbnail_util_destroy() is deprecated and will be removed from next release."); - return THUMBNAIL_UTIL_ERROR_NONE; -} // LCOV_EXCL_STOP - int thumbnail_util_extract_to_buffer(const char *path, unsigned int width, unsigned int height, unsigned char **thumb_buffer, size_t *thumb_size, unsigned int *thumb_width, unsigned int *thumb_height) { int ret = create_thumbnail_to_buffer(path, width, height, thumb_buffer, thumb_size, thumb_width, thumb_height);