Modify error naming for not supported stream types 01/44001/9
authorinhyeok <i_bc.kim@samsung.com>
Thu, 16 Jul 2015 05:40:25 +0000 (14:40 +0900)
committerinhyeok <i_bc.kim@samsung.com>
Fri, 17 Jul 2015 05:09:47 +0000 (14:09 +0900)
[Version] Release 0.1.12
[Profile] Common
[Issue Type] Modification
Voice Recognition and VOIP stream types are not supported in wav-player
WAV_PLAYER_ERROR_NOT_SUPPORTED_TYPE will be given if these types are used.

Change-Id: I0e37d00616bbd48190c1268feb2fbb2a87c2d1ba
Signed-off-by: inhyeok <i_bc.kim@samsung.com>
include/wav_player.h
packaging/capi-media-wav-player.spec
src/wav_player.c
src/wav_player_private.c

index 19de4a6..b43818f 100644 (file)
@@ -49,8 +49,8 @@ typedef enum
     WAV_PLAYER_ERROR_NONE                 = TIZEN_ERROR_NONE,                  /**< Successful */
     WAV_PLAYER_ERROR_INVALID_PARAMETER    = TIZEN_ERROR_INVALID_PARAMETER,     /**< Invalid parameter */
     WAV_PLAYER_ERROR_INVALID_OPERATION    = TIZEN_ERROR_INVALID_OPERATION,     /**< Invalid operation */
-    WAV_PLAYER_ERROR_NOT_SUPPORTED        = TIZEN_ERROR_NOT_SUPPORTED,         /**< Not supported (Since 3.0) */
-    WAV_PLAYER_ERROR_FORMAT_NOT_SUPPORTED = TIZEN_ERROR_WAV_PLAYER | 0x01      /**< Format not supported */
+    WAV_PLAYER_ERROR_FORMAT_NOT_SUPPORTED = TIZEN_ERROR_WAV_PLAYER | 0x01,     /**< Format not supported */
+    WAV_PLAYER_ERROR_NOT_SUPPORTED_TYPE   = TIZEN_ERROR_WAV_PLAYER | 0x02      /**< Not supported (Since 3.0) */
 } wav_player_error_e;
 
 /**
@@ -93,6 +93,7 @@ typedef void (*wav_player_playback_completed_cb)(int id, void *user_data);
  * @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()
@@ -103,6 +104,9 @@ int wav_player_start(const char *path, sound_type_e type, wav_player_playback_co
 /**
  * @brief Plays a WAV file with stream information of sound-manager.
  * @since_tizen 3.0
+ *
+ * @remarks Voice Recognition and VOIP stream types are not supported in this API.
+ *
  * @param[in] path     The file path to play
  * @param[in] stream_info      The sound stream information handle
  * @param[in] callback The callback function to be invoked when a WAV file is no longer being played
@@ -114,7 +118,8 @@ int wav_player_start(const char *path, sound_type_e type, wav_player_playback_co
  * @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_NOT_SUPPORTED Not supported
+ * @retval #WAV_PLAYER_ERROR_FORMAT_NOT_SUPPORTED Not supported format
+ * @retval #WAV_PLAYER_ERROR_NOT_SUPPORTED_TYPE Not supported stream type
  *
  * @post       It invokes wav_player_playback_completed_cb() when a WAV file is no longer being played.
  * @see wav_player_stop()
index be0f345..f690a00 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       capi-media-wav-player
 Summary:    A wav player library in Tizen C API
-Version:    0.1.11
+Version:    0.1.12
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 7c8daf4..e7d68b8 100755 (executable)
@@ -88,10 +88,15 @@ int wav_player_start_with_stream_info(const char *path, sound_stream_info_h stre
        _cb_data *cb_data = NULL;
        char *stream_type = NULL;
        int stream_id;
+       bool result = false;
 
        if( path == NULL)
                return __convert_wav_player_error_code(__func__, WAV_PLAYER_ERROR_INVALID_PARAMETER);
 
+       ret = sound_manager_is_available_stream_information(stream_info, NATIVE_API_WAV_PLAYER, &result);
+       if ( !result )
+               return __convert_wav_player_error_code(__func__, WAV_PLAYER_ERROR_NOT_SUPPORTED_TYPE);
+
        ret = sound_manager_get_type_from_stream_information(stream_info, &stream_type);
        if( ret )
                return __convert_wav_player_error_code(__func__, ret);
index b856fd5..71ebebe 100755 (executable)
@@ -51,6 +51,10 @@ int __convert_wav_player_error_code(const char *func, int code)
                        ret = WAV_PLAYER_ERROR_FORMAT_NOT_SUPPORTED;
                        errorstr = "FORMAT_NOT_SUPPORTED";
                        break;
+               case WAV_PLAYER_ERROR_NOT_SUPPORTED_TYPE:
+                       ret = WAV_PLAYER_ERROR_NOT_SUPPORTED_TYPE;
+                       errorstr = "NOT_SUPPORTED_TYPE";
+                       break;
                default:
                        ret = WAV_PLAYER_ERROR_INVALID_OPERATION;
                        errorstr = "INVALID_OPERATION";