From: Gilbok Lee Date: Thu, 10 May 2018 06:29:59 +0000 (+0900) Subject: [ACR-1221] Deprecate all capi-media-video-util APIs X-Git-Tag: accepted/tizen/5.0/unified/20181102.013246^0 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fapi%2Fvideo-util.git;a=commitdiff_plain;h=e8f040e1bae06c22c09d29058e0c15c74680f38a [ACR-1221] Deprecate all capi-media-video-util APIs Change-Id: I9d090903e3c8d7be58a7357b62173e97f83ab159 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 24f9a9e..5ce8603 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,7 +44,7 @@ FOREACH(flag ${${fw_name}_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror -Wno-error=deprecated-declarations") SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") IF("${ARCH}" MATCHES "^arm.*") diff --git a/doc/video_util_doc.h b/doc/video_util_doc.h index 7c5bbb3..b478bb3 100644 --- a/doc/video_util_doc.h +++ b/doc/video_util_doc.h @@ -24,7 +24,7 @@ */ /** - * @defgroup CAPI_MEDIA_VIDEO_UTIL_MODULE Video Util + * @defgroup CAPI_MEDIA_VIDEO_UTIL_MODULE Video Util (Deprecated) * @brief The @ref CAPI_MEDIA_VIDEO_UTIL_MODULE APIs provides functions that transcode a media file. * @ingroup CAPI_MEDIA_FRAMEWORK * diff --git a/include/video_util.h b/include/video_util.h index 1b474db..0b78069 100755 --- a/include/video_util.h +++ b/include/video_util.h @@ -33,6 +33,7 @@ extern "C" { */ /** + * @deprecated Deprecated since 5.0 * @brief Creates a handle to video util. * @since_tizen 2.3 * @@ -56,9 +57,10 @@ extern "C" { * @see video_util_destroy() * */ -int video_util_create(video_util_h *handle); +int video_util_create(video_util_h *handle) TIZEN_DEPRECATED_API; /** + * @deprecated Deprecated since 5.0 * @brief Destroys a handle to video util. * @since_tizen 2.3 * @@ -82,9 +84,10 @@ int video_util_create(video_util_h *handle); * @see video_util_create() * */ -int video_util_destroy(video_util_h handle); +int video_util_destroy(video_util_h handle) TIZEN_DEPRECATED_API; /** + * @deprecated Deprecated since 5.0 * @brief Sets the video util's file path. * @since_tizen 2.3 * @@ -109,9 +112,10 @@ int video_util_destroy(video_util_h handle); * @see video_util_create() * @see video_util_destroy() */ -int video_util_set_file_path(video_util_h handle, const char *path); +int video_util_set_file_path(video_util_h handle, const char *path) TIZEN_DEPRECATED_API; /** + * @deprecated Deprecated since 5.0 * @brief Sets the video util's accurate mode. * @since_tizen 2.3 * @@ -134,9 +138,10 @@ int video_util_set_file_path(video_util_h handle, const char *path); * @see video_util_create() * @see video_util_destroy() */ -int video_util_set_accurate_mode(video_util_h handle, bool mode); +int video_util_set_accurate_mode(video_util_h handle, bool mode) TIZEN_DEPRECATED_API; /** + * @deprecated Deprecated since 5.0 * @brief Sets the video codec for encoding video stream. * @since_tizen 2.3 * @@ -160,9 +165,10 @@ int video_util_set_accurate_mode(video_util_h handle, bool mode); * @see video_util_destroy() * @see video_util_foreach_supported_video_codec() */ -int video_util_set_video_codec(video_util_h handle, video_util_video_codec_e codec); +int video_util_set_video_codec(video_util_h handle, video_util_video_codec_e codec) TIZEN_DEPRECATED_API; /** + * @deprecated Deprecated since 5.0 * @brief Sets the audio codec for encoding audio stream. * @since_tizen 2.3 * @@ -187,9 +193,10 @@ int video_util_set_video_codec(video_util_h handle, video_util_video_codec_e cod * @see video_util_destroy() * @see video_util_foreach_supported_audio_codec() */ -int video_util_set_audio_codec(video_util_h handle, video_util_audio_codec_e codec); +int video_util_set_audio_codec(video_util_h handle, video_util_audio_codec_e codec) TIZEN_DEPRECATED_API; /** + * @deprecated Deprecated since 5.0 * @brief Sets the file format for transcoding media stream. * @since_tizen 2.3 * @@ -213,9 +220,10 @@ int video_util_set_audio_codec(video_util_h handle, video_util_audio_codec_e cod * @see video_util_destroy() * @see video_util_foreach_supported_file_format() */ -int video_util_set_file_format(video_util_h handle, video_util_file_format_e format); +int video_util_set_file_format(video_util_h handle, video_util_file_format_e format) TIZEN_DEPRECATED_API; /** + * @deprecated Deprecated since 5.0 * @brief Sets the resolution(width and height). * @since_tizen 2.3 * @@ -240,9 +248,10 @@ int video_util_set_file_format(video_util_h handle, video_util_file_format_e for * @see video_util_create() * @see video_util_destroy() */ -int video_util_set_resolution(video_util_h handle, int width, int height); +int video_util_set_resolution(video_util_h handle, int width, int height) TIZEN_DEPRECATED_API; /** + * @deprecated Deprecated since 5.0 * @brief Sets the frame rate. * @since_tizen 2.3 * @@ -264,9 +273,10 @@ int video_util_set_resolution(video_util_h handle, int width, int height); * @see video_util_create() * @see video_util_destroy() */ -int video_util_set_fps(video_util_h handle, int fps); +int video_util_set_fps(video_util_h handle, int fps) TIZEN_DEPRECATED_API; /** + * @deprecated Deprecated since 5.0 * @brief Transcodes the video for given video util handle. * @since_tizen 2.3 * @@ -303,12 +313,16 @@ int video_util_set_fps(video_util_h handle, int fps); * @see video_util_get_progress_transcoding() * @see video_util_cancel_transcoding() */ -int video_util_start_transcoding(video_util_h handle, unsigned long start, unsigned long duration, const char *out_path, video_util_transcoding_progress_cb progress_cb, video_util_transcoding_completed_cb completed_cb, void *user_data); +int video_util_start_transcoding(video_util_h handle, unsigned long start, + unsigned long duration, const char *out_path, + video_util_transcoding_progress_cb progress_cb, + video_util_transcoding_completed_cb completed_cb, + void *user_data) TIZEN_DEPRECATED_API; /** + * @deprecated Deprecated since 5.0 * @brief Cancels transcoding the video for given video util handle. * @since_tizen 2.3 - * * @details This function cancels the transcoding for given video util handle.\n. * @@ -331,9 +345,10 @@ int video_util_start_transcoding(video_util_h handle, unsigned long start, unsig * @see video_util_destroy() * @see video_util_start_transcoding() */ -int video_util_cancel_transcoding(video_util_h handle); +int video_util_cancel_transcoding(video_util_h handle) TIZEN_DEPRECATED_API; /** + * @deprecated Deprecated since 5.0 * @brief Retrieves the current position and duration of the video transcoding. * @since_tizen 2.3 @@ -358,9 +373,12 @@ int video_util_cancel_transcoding(video_util_h handle); * @see video_util_create() * @see video_util_destroy() */ -int video_util_get_progress_transcoding(video_util_h handle, unsigned long *current_position, unsigned long *duration); +int video_util_get_progress_transcoding(video_util_h handle, + unsigned long *current_position, + unsigned long *duration) TIZEN_DEPRECATED_API; /** + * @deprecated Deprecated since 5.0 * @brief Retrieves all supported media formats by invoking a specific callback for each supported media format. * @since_tizen 2.3 * @@ -385,9 +403,12 @@ int video_util_get_progress_transcoding(video_util_h handle, unsigned long *curr * @see video_util_set_file_format() * @see video_util_supported_file_format_cb() */ -int video_util_foreach_supported_file_format(video_util_h handle, video_util_supported_file_format_cb callback, void *user_data); +int video_util_foreach_supported_file_format(video_util_h handle, + video_util_supported_file_format_cb callback, + void *user_data) TIZEN_DEPRECATED_API; /** + * @deprecated Deprecated since 5.0 * @brief Retrieves all supported video encoders by invoking a specific callback for each supported video encoder. * @since_tizen 2.3 * @@ -411,9 +432,12 @@ int video_util_foreach_supported_file_format(video_util_h handle, video_util_sup * @see video_util_set_video_codec() * @see video_util_supported_video_encoder_cb() */ -int video_util_foreach_supported_video_codec(video_util_h handle, video_util_supported_video_encoder_cb callback, void *user_data); +int video_util_foreach_supported_video_codec(video_util_h handle, + video_util_supported_video_encoder_cb callback, + void *user_data) TIZEN_DEPRECATED_API; /** + * @deprecated Deprecated since 5.0 * @brief Retrieves all supported audio encoders by invoking a specific callback for each supported audio encoder. * @since_tizen 2.3 * @@ -436,7 +460,9 @@ int video_util_foreach_supported_video_codec(video_util_h handle, video_util_sup * @post video_util_supported_audio_encoder_cb() will be invoked. * @see video_util_supported_audio_encoder_cb() */ -int video_util_foreach_supported_audio_codec(video_util_h handle, video_util_supported_audio_encoder_cb callback, void *user_data); +int video_util_foreach_supported_audio_codec(video_util_h handle, + video_util_supported_audio_encoder_cb callback, + void *user_data) TIZEN_DEPRECATED_API; /** * @} diff --git a/include/video_util_private.h b/include/video_util_private.h index 5645029..31b1c67 100755 --- a/include/video_util_private.h +++ b/include/video_util_private.h @@ -52,6 +52,11 @@ SECURE_LOGI(""fmt"", ##arg); \ } while (0) +#define video_util_deprecated_log(fuction) do { \ + LOGW("DEPRECATION WARNING: %s() is deprecated and will be removed "\ + "from next release.", fuction); \ + } while (0) + typedef bool(*video_util_supported_type_cb)(int type, void *user_data); typedef struct { diff --git a/include/video_util_type.h b/include/video_util_type.h index 84ff3c6..af8eb98 100755 --- a/include/video_util_type.h +++ b/include/video_util_type.h @@ -39,6 +39,7 @@ extern "C" { */ /** + * @deprecated Deprecated since 5.0 * @ingroup CAPI_MEDIA_VIDEO_UTIL_MODULE * @brief Enumeration for errors of a video util. * @since_tizen 2.3 @@ -55,6 +56,7 @@ typedef enum { } video_util_error_e; /** + * @deprecated Deprecated since 5.0 * @ingroup CAPI_MEDIA_VIDEO_UTIL_MODULE * @brief Enumeration for video codec. * @since_tizen 2.3 @@ -67,6 +69,7 @@ typedef enum { } video_util_video_codec_e; /** + * @deprecated Deprecated since 5.0 * @ingroup CAPI_MEDIA_VIDEO_UTIL_MODULE * @brief Enumeration for audio codec. * @since_tizen 2.3 @@ -78,6 +81,7 @@ typedef enum { } video_util_audio_codec_e; /** + * @deprecated Deprecated since 5.0 * @ingroup CAPI_MEDIA_VIDEO_UTIL_MODULE * @brief Enumeration for formats of a media. * @since_tizen 2.3 @@ -89,6 +93,7 @@ typedef enum { } video_util_file_format_e; /** + * @deprecated Deprecated since 5.0 * @ingroup CAPI_MEDIA_VIDEO_UTIL_MODULE * @brief Video util handle. * @since_tizen 2.3 @@ -96,6 +101,7 @@ typedef enum { typedef struct video_util_s *video_util_h; /** + * @deprecated Deprecated since 5.0 * @ingroup CAPI_MEDIA_VIDEO_UTIL_MODULE * @brief Called regularly during the video transcoding. * @since_tizen 2.3 @@ -113,6 +119,7 @@ typedef struct video_util_s *video_util_h; typedef void (*video_util_transcoding_progress_cb)(unsigned long current_position, unsigned long duration, void *user_data); /** + * @deprecated Deprecated since 5.0 * @ingroup CAPI_MEDIA_VIDEO_UTIL_MODULE * @brief Called when transcoding is finished just before storing in the file. * @since_tizen 2.3 @@ -125,6 +132,7 @@ typedef void (*video_util_transcoding_progress_cb)(unsigned long current_positio typedef void (*video_util_transcoding_completed_cb)(video_util_error_e error_code, void *user_data); /** + * @deprecated Deprecated since 5.0 * @brief Called iteratively to notify you about the supported file formats. * @since_tizen 2.3 * @@ -139,6 +147,7 @@ typedef void (*video_util_transcoding_completed_cb)(video_util_error_e error_cod typedef bool (*video_util_supported_file_format_cb)(video_util_file_format_e format, void *user_data); /** + * @deprecated Deprecated since 5.0 * @brief Called iteratively to notify you of supported video codec. * @since_tizen 2.3 * @@ -153,6 +162,7 @@ typedef bool (*video_util_supported_file_format_cb)(video_util_file_format_e for typedef bool (*video_util_supported_video_encoder_cb)(video_util_video_codec_e codec, void *user_data); /** + * @deprecated Deprecated since 5.0 * @brief Called iteratively to notify you about the supported audio codec. * @since_tizen 2.3 * diff --git a/src/video_util.c b/src/video_util.c index 425979f..fccfd68 100755 --- a/src/video_util.c +++ b/src/video_util.c @@ -296,8 +296,10 @@ static int __video_util_foreach_supported_type(video_util_type_e type, video_uti int video_util_create(video_util_h *handle) { int ret = VIDEO_UTIL_ERROR_NONE; - bool transcoder_supported = false; + + video_util_deprecated_log(__FUNCTION__); + if (0 == system_info_get_platform_bool(TRANSCODER_FEATURE_PATH, &transcoder_supported)) { if (false == transcoder_supported) { video_util_error("VIDEO_UTIL_ERROR_NOT_SUPPORTED(0x%08x)", VIDEO_UTIL_ERROR_NOT_SUPPORTED); @@ -340,6 +342,9 @@ int video_util_destroy(video_util_h handle) int ret = VIDEO_UTIL_ERROR_NONE; video_util_s *_handle = NULL; bool transcoder_supported = false; + + video_util_deprecated_log(__FUNCTION__); + if (0 == system_info_get_platform_bool(TRANSCODER_FEATURE_PATH, &transcoder_supported)) { if (false == transcoder_supported) { video_util_error("VIDEO_UTIL_ERROR_NOT_SUPPORTED(0x%08x)", VIDEO_UTIL_ERROR_NOT_SUPPORTED); @@ -372,6 +377,9 @@ int video_util_set_file_path(video_util_h handle, const char *file_path) video_util_s *_handle = NULL; bool is_busy = false; bool transcoder_supported = false; + + video_util_deprecated_log(__FUNCTION__); + if (0 == system_info_get_platform_bool(TRANSCODER_FEATURE_PATH, &transcoder_supported)) { if (false == transcoder_supported) { video_util_error("VIDEO_UTIL_ERROR_NOT_SUPPORTED(0x%08x)", VIDEO_UTIL_ERROR_NOT_SUPPORTED); @@ -421,6 +429,9 @@ int video_util_set_accurate_mode(video_util_h handle, bool accurate_mode) int ret = VIDEO_UTIL_ERROR_NONE; video_util_s *_handle = NULL; bool transcoder_supported = false; + + video_util_deprecated_log(__FUNCTION__); + if (0 == system_info_get_platform_bool(TRANSCODER_FEATURE_PATH, &transcoder_supported)) { if (false == transcoder_supported) { video_util_error("VIDEO_UTIL_ERROR_NOT_SUPPORTED(0x%08x)", VIDEO_UTIL_ERROR_NOT_SUPPORTED); @@ -448,6 +459,9 @@ int video_util_set_video_codec(video_util_h handle, video_util_video_codec_e cod video_util_s *_handle = NULL; bool is_busy = false; bool transcoder_supported = false; + + video_util_deprecated_log(__FUNCTION__); + if (0 == system_info_get_platform_bool(TRANSCODER_FEATURE_PATH, &transcoder_supported)) { if (false == transcoder_supported) { video_util_error("VIDEO_UTIL_ERROR_NOT_SUPPORTED(0x%08x)", VIDEO_UTIL_ERROR_NOT_SUPPORTED); @@ -488,6 +502,9 @@ int video_util_set_audio_codec(video_util_h handle, video_util_audio_codec_e cod video_util_s *_handle = NULL; bool is_busy = false; bool transcoder_supported = false; + + video_util_deprecated_log(__FUNCTION__); + if (0 == system_info_get_platform_bool(TRANSCODER_FEATURE_PATH, &transcoder_supported)) { if (false == transcoder_supported) { video_util_error("VIDEO_UTIL_ERROR_NOT_SUPPORTED(0x%08x)", VIDEO_UTIL_ERROR_NOT_SUPPORTED); @@ -528,6 +545,9 @@ int video_util_set_file_format(video_util_h handle, video_util_file_format_e for video_util_s *_handle = NULL; bool is_busy = false; bool transcoder_supported = false; + + video_util_deprecated_log(__FUNCTION__); + if (0 == system_info_get_platform_bool(TRANSCODER_FEATURE_PATH, &transcoder_supported)) { if (false == transcoder_supported) { video_util_error("VIDEO_UTIL_ERROR_NOT_SUPPORTED(0x%08x)", VIDEO_UTIL_ERROR_NOT_SUPPORTED); @@ -567,6 +587,9 @@ int video_util_set_resolution(video_util_h handle, int width, int height) int ret = VIDEO_UTIL_ERROR_NONE; video_util_s *_handle = NULL; bool transcoder_supported = false; + + video_util_deprecated_log(__FUNCTION__); + if (0 == system_info_get_platform_bool(TRANSCODER_FEATURE_PATH, &transcoder_supported)) { if (false == transcoder_supported) { video_util_error("VIDEO_UTIL_ERROR_NOT_SUPPORTED(0x%08x)", VIDEO_UTIL_ERROR_NOT_SUPPORTED); @@ -594,6 +617,9 @@ int video_util_set_fps(video_util_h handle, int fps) int ret = VIDEO_UTIL_ERROR_NONE; video_util_s *_handle = NULL; bool transcoder_supported = false; + + video_util_deprecated_log(__FUNCTION__); + if (0 == system_info_get_platform_bool(TRANSCODER_FEATURE_PATH, &transcoder_supported)) { if (false == transcoder_supported) { video_util_error("VIDEO_UTIL_ERROR_NOT_SUPPORTED(0x%08x)", VIDEO_UTIL_ERROR_NOT_SUPPORTED); @@ -622,6 +648,9 @@ int video_util_start_transcoding(video_util_h handle, unsigned long start, unsig mm_seek_mode_e accurate_mode = MM_SEEK_NUM; bool is_busy = false; bool transcoder_supported = false; + + video_util_deprecated_log(__FUNCTION__); + if (0 == system_info_get_platform_bool(TRANSCODER_FEATURE_PATH, &transcoder_supported)) { if (false == transcoder_supported) { video_util_error("VIDEO_UTIL_ERROR_NOT_SUPPORTED(0x%08x)", VIDEO_UTIL_ERROR_NOT_SUPPORTED); @@ -701,6 +730,9 @@ int video_util_cancel_transcoding(video_util_h handle) int ret = VIDEO_UTIL_ERROR_NONE; video_util_s *_handle = NULL; bool transcoder_supported = false; + + video_util_deprecated_log(__FUNCTION__); + if (0 == system_info_get_platform_bool(TRANSCODER_FEATURE_PATH, &transcoder_supported)) { if (false == transcoder_supported) { video_util_error("VIDEO_UTIL_ERROR_NOT_SUPPORTED(0x%08x)", VIDEO_UTIL_ERROR_NOT_SUPPORTED); @@ -735,6 +767,9 @@ int video_util_get_progress_transcoding(video_util_h handle, unsigned long *curr video_util_s *_handle = NULL; int value = 0; bool transcoder_supported = false; + + video_util_deprecated_log(__FUNCTION__); + if (0 == system_info_get_platform_bool(TRANSCODER_FEATURE_PATH, &transcoder_supported)) { if (false == transcoder_supported) { video_util_error("VIDEO_UTIL_ERROR_NOT_SUPPORTED(0x%08x)", VIDEO_UTIL_ERROR_NOT_SUPPORTED); @@ -770,6 +805,9 @@ int video_util_foreach_supported_file_format(video_util_h handle, video_util_sup int ret = VIDEO_UTIL_ERROR_NONE; video_util_s *_handle = NULL; bool transcoder_supported = false; + + video_util_deprecated_log(__FUNCTION__); + if (0 == system_info_get_platform_bool(TRANSCODER_FEATURE_PATH, &transcoder_supported)) { if (false == transcoder_supported) { video_util_error("VIDEO_UTIL_ERROR_NOT_SUPPORTED(0x%08x)", VIDEO_UTIL_ERROR_NOT_SUPPORTED); @@ -796,6 +834,9 @@ int video_util_foreach_supported_video_codec(video_util_h handle, video_util_sup int ret = VIDEO_UTIL_ERROR_NONE; video_util_s *_handle = NULL; bool transcoder_supported = false; + + video_util_deprecated_log(__FUNCTION__); + if (0 == system_info_get_platform_bool(TRANSCODER_FEATURE_PATH, &transcoder_supported)) { if (false == transcoder_supported) { video_util_error("VIDEO_UTIL_ERROR_NOT_SUPPORTED(0x%08x)", VIDEO_UTIL_ERROR_NOT_SUPPORTED); @@ -818,6 +859,9 @@ int video_util_foreach_supported_audio_codec(video_util_h handle, video_util_sup int ret = VIDEO_UTIL_ERROR_NONE; video_util_s *_handle = NULL; bool transcoder_supported = false; + + video_util_deprecated_log(__FUNCTION__); + if (0 == system_info_get_platform_bool(TRANSCODER_FEATURE_PATH, &transcoder_supported)) { if (false == transcoder_supported) { video_util_error("VIDEO_UTIL_ERROR_NOT_SUPPORTED(0x%08x)", VIDEO_UTIL_ERROR_NOT_SUPPORTED);