From 26fcdc09e6b42368248955dcb96f0445c560feb2 Mon Sep 17 00:00:00 2001 From: "sooyeon.kim" Date: Tue, 20 Sep 2016 20:55:16 +0900 Subject: [PATCH] Fix return values Change-Id: I9820f7d3766622bf79c8c1e3e72b5b4f599a966f Signed-off-by: sooyeon.kim --- org.tizen.voice.ttsnotiserver.tv.service | 5 ++++ org.tizen.voice.ttsserver.tv.service | 5 ++++ org.tizen.voice.ttssrserver.tv.service | 5 ++++ packaging/tts.spec | 10 +++++++- server/ttsd_server.c | 39 +++++++++++++------------------- 5 files changed, 40 insertions(+), 24 deletions(-) create mode 100644 org.tizen.voice.ttsnotiserver.tv.service create mode 100644 org.tizen.voice.ttsserver.tv.service create mode 100644 org.tizen.voice.ttssrserver.tv.service diff --git a/org.tizen.voice.ttsnotiserver.tv.service b/org.tizen.voice.ttsnotiserver.tv.service new file mode 100644 index 0000000..95ff1d7 --- /dev/null +++ b/org.tizen.voice.ttsnotiserver.tv.service @@ -0,0 +1,5 @@ +[D-BUS Service] +Name=org.tizen.voice.ttsnotiserver +#Exec=/bin/sh -c "buxton2ctl get user db/voice/tts_engine | awk '{print$5}' | xargs -t -i launch_app {}-noti" +#Exec=/bin/sh -c "launch_app org.tizen.tts-engine-default-noti mode noti" +Exec=/bin/sh -c "launch_app org.tizen.tts-engine-vd-noti mode noti" diff --git a/org.tizen.voice.ttsserver.tv.service b/org.tizen.voice.ttsserver.tv.service new file mode 100644 index 0000000..a30949f --- /dev/null +++ b/org.tizen.voice.ttsserver.tv.service @@ -0,0 +1,5 @@ +[D-BUS Service] +Name=org.tizen.voice.ttsserver +#Exec=/bin/sh -c "buxton2ctl get user db/voice/tts_engine | awk '{print$5}' | xargs -t -i launch_app {}" +#Exec=/bin/sh -c "launch_app org.tizen.tts-engine-default" +Exec=/bin/sh -c "launch_app org.tizen.tts-engine-vd" diff --git a/org.tizen.voice.ttssrserver.tv.service b/org.tizen.voice.ttssrserver.tv.service new file mode 100644 index 0000000..0833130 --- /dev/null +++ b/org.tizen.voice.ttssrserver.tv.service @@ -0,0 +1,5 @@ +[D-BUS Service] +Name=org.tizen.voice.ttssrserver +#Exec=/bin/sh -c "buxton2ctl get user db/voice/tts_engine | awk '{print$5}' | xargs -t -i launch_app {}-sr" +#Exec=/bin/sh -c "launch_app org.tizen.tts-engine-default-sr mode sr" +Exec=/bin/sh -c "launch_app org.tizen.tts-engine-vd-sr mode sr" diff --git a/packaging/tts.spec b/packaging/tts.spec index 661600a..3d664b9 100644 --- a/packaging/tts.spec +++ b/packaging/tts.spec @@ -79,6 +79,12 @@ rm -rf %{buildroot} mkdir -p %{buildroot}%{TZ_SYS_RO_SHARE}/license install LICENSE %{buildroot}%{TZ_SYS_RO_SHARE}/license/%{name} +%if "%{PRODUCT_TYPE}" == "TV" +mv -f org.tizen.voice.ttsserver.tv.service org.tizen.voice.ttsserver.service +mv -f org.tizen.voice.ttsnotiserver.tv.service org.tizen.voice.ttsnotiserver.service +mv -f org.tizen.voice.ttssrserver.tv.service org.tizen.voice.ttssrserver.service +%endif + %make_install %post @@ -96,7 +102,9 @@ mkdir -p %{TZ_SYS_RO_SHARE}/voice/test %{_libdir}/lib*.so %{TZ_SYS_RO_SHARE}/upgrade/scripts/501.tts_upgrade_24to30.sh %{TZ_SYS_RO_SHARE}/voice/tts/1.0/tts-config.xml -%{TZ_SYS_RO_SHARE}/dbus-1/services/org.tizen.voice* +%{TZ_SYS_RO_SHARE}/dbus-1/services/org.tizen.voice.ttsserver.service +%{TZ_SYS_RO_SHARE}/dbus-1/services/org.tizen.voice.ttsnotiserver.service +%{TZ_SYS_RO_SHARE}/dbus-1/services/org.tizen.voice.ttssrserver.service %{TZ_SYS_RO_SHARE}/voice/test/tts-test %{TZ_SYS_RO_SHARE}/license/%{name} /etc/dbus-1/system.d/tts-server.conf diff --git a/server/ttsd_server.c b/server/ttsd_server.c index c133a7e..93fdbad 100644 --- a/server/ttsd_server.c +++ b/server/ttsd_server.c @@ -202,7 +202,7 @@ int ttsd_send_result(ttse_result_event_e event, const void* data, unsigned int d SLOG(LOG_ERROR, tts_tag(), "[SERVER ERROR] uttid is NOT valid !!!! - uid(%d), uttid(%d)", uid, uttid); SLOG(LOG_DEBUG, tts_tag(), "====="); SLOG(LOG_DEBUG, tts_tag(), " "); - return 0; + return TTSD_ERROR_OPERATION_FAILED; } if (rate <= 0 || audio_type < 0 || audio_type > TTSE_AUDIO_TYPE_MAX) { @@ -210,7 +210,7 @@ int ttsd_send_result(ttse_result_event_e event, const void* data, unsigned int d SLOG(LOG_ERROR, tts_tag(), "[SERVER ERROR] audio data is invalid"); SLOG(LOG_DEBUG, tts_tag(), "====="); SLOG(LOG_DEBUG, tts_tag(), " "); - return 0; + return TTSD_ERROR_INVALID_PARAMETER; } /* add wav data */ @@ -218,9 +218,9 @@ int ttsd_send_result(ttse_result_event_e event, const void* data, unsigned int d temp_sound_data = (sound_data_s*)calloc(1, sizeof(sound_data_s)); if (NULL == temp_sound_data) { SLOG(LOG_ERROR, tts_tag(), "[SERVER ERROR] Out of memory"); - return 0; + return TTSD_ERROR_OUT_OF_MEMORY; } - + temp_sound_data->data = NULL; temp_sound_data->rate = 0; temp_sound_data->data_size = 0; @@ -271,7 +271,7 @@ int ttsd_send_result(ttse_result_event_e event, const void* data, unsigned int d /*SLOG(LOG_DEBUG, tts_tag(), "===== SYNTHESIS RESULT CALLBACK END"); SLOG(LOG_DEBUG, tts_tag(), " ");*/ - return 0; + return TTSD_ERROR_NONE; } bool __get_client_cb(int pid, int uid, app_state_e state, void* user_data) @@ -358,7 +358,7 @@ void __config_changed_cb(tts_config_type_e type, const char* str_param, int int_ ret = ttsd_engine_agent_set_default_speed(int_param); if (0 != ret) { SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail to set default speed : result(%d)", ret); - } + } } break; } @@ -371,7 +371,7 @@ void __config_changed_cb(tts_config_type_e type, const char* str_param, int int_ ret = ttsd_engine_agent_set_default_pitch(int_param); if (0 != ret) { SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail to set default pitch : result(%d)", ret); - } + } } break; } @@ -379,7 +379,7 @@ void __config_changed_cb(tts_config_type_e type, const char* str_param, int int_ default: break; } - + return; } @@ -390,7 +390,7 @@ bool __terminate_client(int pid, int uid, app_state_e state, void* user_data) return true; } -Eina_Bool ttsd_terminate_daemon(void *data) +Eina_Bool ttsd_terminate_daemon(void *data) { ttsd_data_foreach_clients(__terminate_client, NULL); return EINA_FALSE; @@ -441,7 +441,7 @@ int ttsd_initialize(ttse_request_callback_s *callback) { /* Register signal handler */ __register_sig_handler(); - + if (ttsd_config_initialize(__config_changed_cb)) { SLOG(LOG_ERROR, tts_tag(), "[Server WARNING] Fail to initialize config."); } @@ -490,7 +490,7 @@ int ttsd_finalize() iter = g_list_first(g_proc_list); } } - + ttsd_config_finalize(); ttsd_player_release(); @@ -585,7 +585,7 @@ bool __get_client_for_clean_up(int pid, int uid, app_state_e state, void* user_d { bool exist = false; int i = 0; - + GList *iter = NULL; for (i = 0; i < g_list_length(g_proc_list); i++) { iter = g_list_nth(g_proc_list, i); @@ -597,7 +597,7 @@ bool __get_client_for_clean_up(int pid, int uid, app_state_e state, void* user_d } } } - + if (false == exist) { SLOG(LOG_ERROR, tts_tag(), "uid (%d) should be removed", uid); ttsd_server_finalize(uid); @@ -664,7 +664,7 @@ int ttsd_server_finalize(int uid) ttsd_server_stop(uid); ttsd_player_stop(uid); - + ttsd_player_destroy_instance(uid); /* Need to unload voice when used voice is unregistered */ @@ -705,7 +705,7 @@ int ttsd_server_add_queue(int uid, const char* text, const char* lang, int voice SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail to select valid voice : result lang is NULL"); return TTSD_ERROR_INVALID_VOICE; } - + speak_data_s* speak_data = NULL; speak_data = (speak_data_s*)calloc(1, sizeof(speak_data_s)); if (NULL == speak_data) { @@ -937,7 +937,7 @@ int ttsd_server_get_support_voices(int uid, GList** voice_list) } /* get voice list*/ - int ret = ttsd_engine_get_voice_list(voice_list); + int ret = ttsd_engine_get_voice_list(voice_list); if (0 != ret) { SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail ttsd_server_get_support_voices() : ret(%d)", ret); return ret; @@ -1040,11 +1040,4 @@ int ttsd_set_private_data_requested_cb(ttse_private_data_requested_cb callback) return ret; } -/* -int ttsd_send_result(ttse_result_event_e event, const void* data, unsigned int data_size, ttse_audio_type_e audio_type, int rate, void* user_data) -{} - -int ttsd_send_error(ttse_error_e error, const char* msg) -{} -*/ -- 2.7.4