Apply DEPRECATION macro 66/89066/1
authorSeungbae Shin <seungbae.shin@samsung.com>
Thu, 22 Sep 2016 03:41:50 +0000 (12:41 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Thu, 22 Sep 2016 03:47:09 +0000 (12:47 +0900)
[Version] 0.1.21
[Profile] Common
[Issue Type] Deprecation

Change-Id: I27a6f56915d82db7b6489561712b79a61c6e06ee

include/wav_player.h
packaging/capi-media-wav-player.spec
src/wav_player.c

index cb03f8b..bf056b3 100644 (file)
@@ -98,7 +98,7 @@ typedef void (*wav_player_playback_completed_cb)(int id, void *user_data);
  * @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);
+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.
index 1758108..373c4ba 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       capi-media-wav-player
 Summary:    A wav player library in Tizen C API
-Version:    0.1.20
+Version:    0.1.21
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index eaf5ee2..2d4b96d 100755 (executable)
 #include "wav_player.h"
 #include "wav_player_private.h"
 
-int wav_player_start(const char *path, sound_type_e type, wav_player_playback_completed_cb cb, void *user_data,  int * id)
+#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;
@@ -38,6 +42,8 @@ int wav_player_start(const char *path, sound_type_e type, wav_player_playback_co
        _completed_cb = NULL;
        _cb_data *cb_data = NULL;
 
+       DEPRECATED_WARN_INSTEAD("wav_player_start_with_stream_info");
+
        if (path == NULL)
                return _convert_wav_player_error_code(__func__, WAV_PLAYER_ERROR_INVALID_PARAMETER);
 
@@ -46,7 +52,6 @@ int wav_player_start(const char *path, sound_type_e type, wav_player_playback_co
 
        m_path[0] = '\0';
        if (path[0] != '/') {
-
                if (getcwd(m_path, PATH_MAX) != NULL)
                        strncat(m_path, "/", PATH_MAX-strlen(m_path));
        }
@@ -62,7 +67,6 @@ int wav_player_start(const char *path, sound_type_e type, wav_player_playback_co
        }
 
        ret = mm_sound_play_sound(m_path, type, _completed_cb , cb_data, &player);
-
        if (ret == 0 && id != NULL)
                *id = player;