From: Seungbae Shin Date: Wed, 15 Nov 2017 07:55:47 +0000 (+0900) Subject: Remove 3.0 deprecated API X-Git-Tag: submit/tizen/20180227.071248^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F79%2F160279%2F5;p=platform%2Fcore%2Fapi%2Fwav-player.git Remove 3.0 deprecated API Please refer following deprecation policy. https://developer.tizen.org/development/training/native-application/understanding-tizen-programming/api-versioning-and-deprecation-policy-tizen-platform [Version] 0.2.0 [Issue Type] Deprecation Change-Id: I12ca26e413963ee98ec1c0c904a06cdf8f860e94 --- diff --git a/doc/wave_player_doc.h b/doc/wav_player_doc.h similarity index 96% rename from doc/wave_player_doc.h rename to doc/wav_player_doc.h index 3660786..6a04c2f 100755 --- a/doc/wave_player_doc.h +++ b/doc/wav_player_doc.h @@ -38,7 +38,7 @@ * \#include * * @section CAPI_MEDIA_WAV_PLAYER_OVERVIEW Overview - * The @ref CAPI_MEDIA_WAV_PLAYER_MODULE API allows you to simply play and stop a wav file. To play a certain wav file, call wave_player_start() with a path to the .wav file. + * The @ref CAPI_MEDIA_WAV_PLAYER_MODULE API allows you to simply play and stop a wav file. To play a certain wav file, call wav_player_start_new() with a path to the .wav file. * When playing a wav file is finished, wav_player_playback_completed_cb() will be invoked. */ diff --git a/include/wav_player.h b/include/wav_player.h index e407f40..6d1adba 100644 --- a/include/wav_player.h +++ b/include/wav_player.h @@ -68,38 +68,10 @@ typedef enum { * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @param[in] id The completed wav player ID * @param[in] user_data The user data passed from the callback registration function - * @see wav_player_start() + * @see wav_player_start_new() */ typedef void (*wav_player_playback_completed_cb)(int id, void *user_data); - -/** - * @deprecated Deprecated since 3.0. Use wav_player_start_new() instead. - * @brief Plays a WAV file. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @remarks Sound can be mixed with other sounds if you don't control the sound session in sound-manager module since 3.0.\n - * You can refer to @ref CAPI_MEDIA_SOUND_MANAGER_MODULE. - * - * @param[in] path The file path to play - * @param[in] type The sound type - * @param[in] callback The callback function to invoke when a WAV file is finished playing - * @param[in] user_data The user data to be passed to the callback function - * @param[out] id The WAV player ID ( can be set to NULL ) - * - * @return @c 0 on success, - * otherwise a negative error value - * @retval #WAV_PLAYER_ERROR_NONE Successful - * @retval #WAV_PLAYER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #WAV_PLAYER_ERROR_INVALID_OPERATION Invalid operation - * @retval #WAV_PLAYER_ERROR_FORMAT_NOT_SUPPORTED Not supported format - * - * @post It invokes wav_player_playback_completed_cb() when a WAV file has finished playing. - * @see wav_player_stop() - * @see wav_player_playback_completed_cb() - */ -int wav_player_start(const char *path, sound_type_e type, wav_player_playback_completed_cb callback, void *user_data, int *id) TIZEN_DEPRECATED_API; - /** * @brief Plays a WAV file with stream information of sound-manager. * @since_tizen 3.0 @@ -138,7 +110,7 @@ int wav_player_start_new(const char *path, sound_stream_info_h stream_info, wav_ * @retval #WAV_PLAYER_ERROR_INVALID_PARAMETER Invalid parameter * @retval #WAV_PLAYER_ERROR_INVALID_OPERATION Invalid operation * - * @see wav_player_start() + * @see wav_player_start_new() */ int wav_player_stop(int id); diff --git a/packaging/capi-media-wav-player.spec b/packaging/capi-media-wav-player.spec index 019f1a2..4ddd87b 100755 --- a/packaging/capi-media-wav-player.spec +++ b/packaging/capi-media-wav-player.spec @@ -1,6 +1,6 @@ Name: capi-media-wav-player Summary: A wav player library in Tizen C API -Version: 0.1.26 +Version: 0.2.0 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/wav_player.c b/src/wav_player.c index 5ef7529..45dc42d 100755 --- a/src/wav_player.c +++ b/src/wav_player.c @@ -29,53 +29,6 @@ #include "wav_player.h" #include "wav_player_private.h" -#define DEPRECATED_WARN_INSTEAD(msg) do { \ - LOGW("DEPRECATION WARNING: %s() is deprecated and will be removed from next release. Use %s() instead.", __func__, msg); \ -} while (0) - -int wav_player_start(const char *path, sound_type_e type, wav_player_playback_completed_cb cb, void *user_data, int *id) -{ - int ret = MM_ERROR_NONE; - int player = -1; - char m_path[PATH_MAX]; - void (*_completed_cb)(void *, int); - _completed_cb = NULL; - _cb_data *cb_data = NULL; - - DEPRECATED_WARN_INSTEAD("wav_player_start_new"); - - if (path == NULL) - return _convert_wav_player_error_code(__func__, WAV_PLAYER_ERROR_INVALID_PARAMETER); - - if (type >= SOUND_TYPE_NUM) - return _convert_wav_player_error_code(__func__, WAV_PLAYER_ERROR_INVALID_PARAMETER); - - m_path[0] = '\0'; - if (path[0] != '/') { - if (getcwd(m_path, PATH_MAX) != NULL) - strncat(m_path, "/", PATH_MAX - strlen(m_path) - 1); - } - strncat(m_path, path, PATH_MAX - strlen(m_path) - 1); - - if (cb) { - _completed_cb = _internal_complete_cb; - cb_data = (_cb_data *)malloc(sizeof(_cb_data)); - if (cb_data == NULL) - return _convert_wav_player_error_code(__func__, WAV_PLAYER_ERROR_INVALID_OPERATION); - cb_data->cb = cb; - cb_data->user_data = user_data; - } - - ret = mm_sound_play_sound(m_path, type, _completed_cb , cb_data, &player); - if (ret == 0 && id != NULL) - *id = player; - - if (ret != 0 && cb_data != NULL) - free(cb_data); - - return _convert_wav_player_error_code(__func__, ret); -} - int wav_player_start_new(const char *path, sound_stream_info_h stream_info, wav_player_playback_completed_cb callback, void *user_data, int *id) { return _start_with_stream_info(path, stream_info, 1, callback, user_data, id); diff --git a/test/wav_player_test.c b/test/wav_player_test.c index 4732d11..522139c 100644 --- a/test/wav_player_test.c +++ b/test/wav_player_test.c @@ -97,7 +97,7 @@ void wav_play_test(const char* file_path, int iterate, int stream_type) printf("Play Wav, File Path : %s, Iterate : %d\n", file_path, iterate); ret = wav_player_start_loop(file_path, stream_info, iterate, _player_stop_cb, (void*)stream_info, &gid); - printf("wav_player_start(id=%d) ret = %d\n", gid, ret); + printf("wav_player_start_loop(id=%d) ret = %d\n", gid, ret); if (ret) { sound_manager_destroy_stream_information(stream_info); return;