* @{
*/
-/**
- * @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
+++ /dev/null
-/*
-* 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 <unistd.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <thumbnail_util_type.h>
-#include <dlog.h>
-
-
-#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__*/
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);
-
/**
* @}
*/
*/
#include <thumbnail_util.h>
-#include <thumbnail_util_private.h>
#include <media-thumbnail.h>
-#include <media-util.h>
+#include <media-util-err.h>
// LCOV_EXCL_START
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);