return TTS_ERROR_NONE;
}
-int tts_destroy(tts_h tts)
+static int destroy_tts_handle(tts_h tts)
{
- RETV_IF(TTS_ERROR_NONE != __tts_get_feature_enabled(), TTS_ERROR_NOT_SUPPORTED);
-
- SLOG(LOG_INFO, TAG_TTSC, "@@@ Destroy TTS");
-
+ SLOG(LOG_INFO, TAG_TTSC, "Destroy TTS handle");
tts_client_s* client = tts_client_get(tts);
RETVM_IF(NULL == client, TTS_ERROR_INVALID_PARAMETER, "[ERROR] A handle is not valid. tts(%p)", tts);
}
}
- SLOG(LOG_DEBUG, TAG_TTSC, "@@@");
return TTS_ERROR_NONE;
}
+static void *destroy_tts_handle_on_main_thread(void* data)
+{
+ SLOG(LOG_INFO, TAG_TTSC, "Destroy on main thread synchronously");
+ tts_h tts = (tts_h)data;
+
+ int ret = destroy_tts_handle(tts);
+ intptr_t p_ret = (intptr_t)ret;
+
+ return (void *)p_ret;
+}
+
+int tts_destroy(tts_h tts)
+{
+ RETV_IF(TTS_ERROR_NONE != __tts_get_feature_enabled(), TTS_ERROR_NOT_SUPPORTED);
+ SLOG(LOG_INFO, TAG_TTSC, "@@@ Destroy TTS");
+
+ intptr_t ret = (intptr_t)ecore_main_loop_thread_safe_call_sync(destroy_tts_handle_on_main_thread, (void *)tts);
+ SLOG(LOG_INFO, TAG_TTSC, "Return value: (%d/%s)", (int)ret, get_error_message((int)ret));
+
+ SLOG(LOG_DEBUG, TAG_TTSC, "@@@");
+ return (int)ret;
+}
+
int tts_set_mode(tts_h tts, tts_mode_e mode)
{
RETV_IF(TTS_ERROR_NONE != __tts_get_feature_enabled(), TTS_ERROR_NOT_SUPPORTED);