Fix return value of tts_get_max_text_size() 61/252161/7
authorSuyeon Hwang <stom.hwang@samsung.com>
Mon, 25 Jan 2021 05:18:05 +0000 (14:18 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Thu, 18 Mar 2021 07:58:30 +0000 (16:58 +0900)
Change-Id: I83c7cfd0c2df8b034bef051ebf2df862a0f20eeb
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
client/tts.c
include/tts.h

index d09f268af7a72fb73d1c2874906d6c1fd5fd2970..62667bb5b89dacc821cf884d69aa1021cad6aa52 100644 (file)
@@ -874,8 +874,7 @@ int tts_get_max_text_size(tts_h tts, unsigned int* size)
 
        if (0 != tts_config_mgr_get_max_text_size(size)) {
                SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to get max text size");
-               // TODO: fix return value to operation failed
-               return TTS_ERROR_INVALID_PARAMETER;
+               return TTS_ERROR_OPERATION_FAILED;
        }
 
        g_max_text_size = (int)*size;
index e6f4b18b981f8eac87d0f640dca83206072ae670..15922d628cede613705cba7a5b72923c117f6d86 100644 (file)
@@ -236,7 +236,7 @@ typedef void (*tts_engine_changed_cb)(tts_h tts, const char* engine_id, const ch
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @remarks If the function succeeds, @a tts handle must be released with tts_destroy().
  * @param[out] tts The TTS handle
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_OUT_OF_MEMORY Out of memory
@@ -254,7 +254,7 @@ int tts_create(tts_h* tts);
  * @brief Destroys the handle and disconnects the daemon.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @param[in] tts The TTS handle
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -270,7 +270,7 @@ int tts_destroy(tts_h tts);
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @param[in] tts The TTS handle
  * @param[in] mode The mode
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -288,7 +288,7 @@ int tts_set_mode(tts_h tts, tts_mode_e mode);
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @param[in] tts The TTS handle
  * @param[out] mode The mode
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -310,7 +310,7 @@ int tts_get_mode(tts_h tts, tts_mode_e* mode);
  *          However, if the user wants to apply the 3rd party's engine, the credential may be necessary. In that case, please follow the policy provided by the corresponding engine.
  * @param[in] tts The TTS handle
  * @param[in] credential The app credential
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Success
  * @retval #TTS_ERROR_INVALID_STATE Invalid state
@@ -326,7 +326,7 @@ int tts_set_credential(tts_h tts, const char* credential);
  * @brief Connects the daemon asynchronously.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @param[in] tts The TTS handle
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -344,7 +344,7 @@ int tts_prepare(tts_h tts);
  * @brief Disconnects the daemon.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @param[in] tts The TTS handle
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -363,7 +363,7 @@ int tts_unprepare(tts_h tts);
  * @param[in] tts The TTS handle
  * @param[in] callback The callback function to invoke
  * @param[in] user_data The user data to be passed to the callback function
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -383,7 +383,7 @@ int tts_foreach_supported_voices(tts_h tts, tts_supported_voice_cb callback, voi
  * @param[in] tts The TTS handle
  * @param[out] language Language specified as an ISO 3166 alpha-2 two letter country-code followed by ISO 639-1 for the two-letter language code (for example, "ko_KR" for Korean, "en_US" for American English)
  * @param[out] voice_type The voice type
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -406,7 +406,7 @@ int tts_get_default_voice(tts_h tts, char** language, int* voice_type);
  * @param[in] tts The TTS handle
  * @param[in] key The field name of private data
  * @param[in] data The data for set
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -430,7 +430,7 @@ int tts_set_private_data(tts_h tts, const char* key, const char* data);
  * @param[in] tts The TTS handle
  * @param[in] key The field name of private data
  * @param[out] data The data field of private data
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_STATE Invalid state
@@ -449,11 +449,12 @@ int tts_get_private_data(tts_h tts, const char* key, char** data);
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @param[in] tts The TTS handle
  * @param[out] size The maximum byte size for text
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #TTS_ERROR_INVALID_STATE Invalid state
+ * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
  * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
  * @pre The state should be #TTS_STATE_READY.
  * @see tts_add_text()
@@ -466,7 +467,7 @@ int tts_get_max_text_size(tts_h tts, unsigned int* size);
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @param[in] tts The TTS handle
  * @param[out] state The current state of TTS
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -485,7 +486,7 @@ int tts_get_state(tts_h tts, tts_state_e* state);
  * @param[out] min The minimum speed value
  * @param[out] normal The normal speed value
  * @param[out] max The maximum speed value
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -505,7 +506,7 @@ int tts_get_speed_range(tts_h tts, int* min, int* normal, int* max);
  *          A successful call will allocate @a err_msg, which must be released by calling free() when it is no longer required.
  * @param[in] tts The TTS handle
  * @param[out] err_msg The current error message
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -527,7 +528,7 @@ int tts_get_error_message(tts_h tts, char** err_msg);
  * @param[in] voice_type The voice type selected from the tts_foreach_supported_voices() (e.g. #TTS_VOICE_TYPE_AUTO, #TTS_VOICE_TYPE_FEMALE)
  * @param[in] speed A speaking speed (e.g. #TTS_SPEED_AUTO or the value from tts_get_speed_range())
  * @param[out] utt_id The utterance ID passed to the callback function
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -547,7 +548,7 @@ int tts_add_text(tts_h tts, const char* text, const char* language, int voice_ty
  * @brief Starts synthesizing voice from the text and plays the synthesized audio data.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @param[in] tts The TTS handle
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -573,7 +574,7 @@ int tts_play(tts_h tts);
  * @brief Stops playing the utterance and clears the queue.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @param[in] tts The TTS handle
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -593,7 +594,7 @@ int tts_stop(tts_h tts);
  * @brief Pauses the currently playing utterance.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @param[in] tts The TTS handle
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -639,7 +640,7 @@ int tts_repeat(tts_h tts, char** text_repeat, int* utt_id);
  * @param[in] tts The TTS handle
  * @param[in] callback The callback function to register
  * @param[in] user_data The user data to be passed to the callback function
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -656,7 +657,7 @@ int tts_set_state_changed_cb(tts_h tts, tts_state_changed_cb callback, void* use
  * @brief Unregisters the callback function.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @param[in] tts The TTS handle
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -674,7 +675,7 @@ int tts_unset_state_changed_cb(tts_h tts);
  * @param[in] tts The TTS handle
  * @param[in] callback The callback function to register
  * @param[in] user_data The user data to be passed to the callback function
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -691,7 +692,7 @@ int tts_set_utterance_started_cb(tts_h tts, tts_utterance_started_cb callback, v
  * @brief Unregisters the callback function.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @param[in] tts The TTS handle
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -709,7 +710,7 @@ int tts_unset_utterance_started_cb(tts_h tts);
  * @param[in] tts The TTS handle
  * @param[in] callback The callback function to register
  * @param[in] user_data The user data to be passed to the callback function
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -726,7 +727,7 @@ int tts_set_utterance_completed_cb(tts_h tts, tts_utterance_completed_cb callbac
  * @brief Unregisters the callback function.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @param[in] tts The TTS handle
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -744,7 +745,7 @@ int tts_unset_utterance_completed_cb(tts_h tts);
  * @param[in] tts The TTS handle
  * @param[in] callback The callback function to register
  * @param[in] user_data The user data to be passed to the callback function
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -761,7 +762,7 @@ int tts_set_error_cb(tts_h tts, tts_error_cb callback, void* user_data);
  * @brief Unregisters the callback function.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @param[in] tts The TTS handle
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -779,7 +780,7 @@ int tts_unset_error_cb(tts_h tts);
  * @param[in] tts The TTS handle
  * @param[in] callback The callback function to register
  * @param[in] user_data The user data to be passed to the callback function
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -796,7 +797,7 @@ int tts_set_default_voice_changed_cb(tts_h tts, tts_default_voice_changed_cb cal
  * @brief Unregisters the callback function.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @param[in] tts The TTS handle
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -814,7 +815,7 @@ int tts_unset_default_voice_changed_cb(tts_h tts);
  * @param[in] tts The TTS handle
  * @param[in] callback The callback function to register
  * @param[in] user_data The user data to be passed to the callback function
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
@@ -831,7 +832,7 @@ int tts_set_engine_changed_cb(tts_h tts, tts_engine_changed_cb callback, void* u
  * @brief Unregisters the callback function.
  * @since_tizen @if MOBILE 3.0 @elseif WEARABLE 2.3.2 @endif
  * @param[in] tts The TTS handle
- * @return @c 0 on success, 
+ * @return @c 0 on success,
  *         otherwise a negative error value
  * @retval #TTS_ERROR_NONE Successful
  * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter