From a736b7cafaa3f629487443420b5d8b84b3efe894 Mon Sep 17 00:00:00 2001 From: inhyeok Date: Thu, 16 Jul 2015 14:40:25 +0900 Subject: [PATCH] Modify error naming for not supported stream types [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 --- include/wav_player.h | 11 ++++++++--- packaging/capi-media-wav-player.spec | 2 +- src/wav_player.c | 5 +++++ src/wav_player_private.c | 4 ++++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/include/wav_player.h b/include/wav_player.h index 19de4a6..b43818f 100644 --- a/include/wav_player.h +++ b/include/wav_player.h @@ -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() diff --git a/packaging/capi-media-wav-player.spec b/packaging/capi-media-wav-player.spec index be0f345..f690a00 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.11 +Version: 0.1.12 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/wav_player.c b/src/wav_player.c index 7c8daf4..e7d68b8 100755 --- a/src/wav_player.c +++ b/src/wav_player.c @@ -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); diff --git a/src/wav_player_private.c b/src/wav_player_private.c index b856fd5..71ebebe 100755 --- a/src/wav_player_private.c +++ b/src/wav_player_private.c @@ -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"; -- 2.34.1