Add tizen tts support 55/184955/5
authork2.nagaraju <k2.nagaraju@samsung.com>
Tue, 24 Jul 2018 12:35:27 +0000 (18:05 +0530)
committerjaekuk lee <juku1999@samsung.com>
Wed, 25 Jul 2018 06:11:30 +0000 (06:11 +0000)
Electron currently uses the chromium tts engine.
Added tizen tts support.

Change-Id: Ie7e0231f2cc2a280a3c0c4d4df72c18378ee6193
Signed-off-by: k2.nagaraju <k2.nagaraju@samsung.com>
atom/browser/atom_browser_client.cc
atom/common/common_message_generator.h
atom/renderer/renderer_client_base.cc
efl/build/system.gyp
filenames.gypi
packaging/electron-efl.spec
wrt.gyp

index 6fefad7..1f5aee5 100644 (file)
@@ -28,7 +28,6 @@
 #include "chrome/browser/printing/printing_message_filter.h"
 #include "chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.h"
 #include "chrome/browser/renderer_host/pepper/widevine_cdm_message_filter.h"
-#include "chrome/browser/speech/tts_message_filter.h"
 #include "content/common/resource_request_body_impl.h"
 #include "content/public/browser/browser_ppapi_host.h"
 #include "content/public/browser/client_certificate_delegate.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "v8/include/v8.h"
 
+#if defined(OS_TIZEN)
+#include "content/browser/speech/tts_message_filter_efl.h"
+#else
+#include "chrome/browser/speech/tts_message_filter.h"
+#endif
+
 namespace atom {
 
 namespace {
@@ -130,7 +135,11 @@ void AtomBrowserClient::RenderProcessWillLaunch(
     content::RenderProcessHost* host) {
   int process_id = host->GetID();
   host->AddFilter(new printing::PrintingMessageFilter(process_id));
+#if defined(OS_TIZEN)
+  host->AddFilter(new content::TtsMessageFilterEfl());
+#else
   host->AddFilter(new TtsMessageFilter(process_id, host->GetBrowserContext()));
+#endif
   host->AddFilter(
       new WidevineCdmMessageFilter(process_id, host->GetBrowserContext()));
 
index a63c40b..f2c65cd 100644 (file)
@@ -6,7 +6,9 @@
 
 #include "atom/common/api/api_messages.h"
 #include "chrome/common/print_messages.h"
-#include "chrome/common/tts_messages.h"
 #include "chrome/common/widevine_cdm_messages.h"
 #include "chrome/common/chrome_utility_messages.h"
 #include "components/pdf/common/pdf_messages.h"
+#if !defined(OS_TIZEN)
+#include "chrome/common/tts_messages.h"
+#endif
index 4d3675e..51720d0 100644 (file)
 #include "base/strings/sys_string_conversions.h"
 #endif
 
+#if defined(OS_TIZEN)
+#include "content/common/tts_messages_efl.h"
+#include "content/renderer/tts_dispatcher_efl.h"
+#endif
+
 #if defined(OS_WIN)
 #include <shlobj.h>
 #endif
@@ -160,7 +165,11 @@ void RendererClientBase::DidClearWindowObject(
 
 blink::WebSpeechSynthesizer* RendererClientBase::OverrideSpeechSynthesizer(
     blink::WebSpeechSynthesizerClient* client) {
+#if defined(OS_TIZEN)
+  return new content::TtsDispatcherEfl(client);
+#else
   return new TtsDispatcher(client);
+#endif
 }
 
 bool RendererClientBase::OverrideCreatePlugin(
index 2d41270..ebbc965 100644 (file)
         }],
       ],
     }, # appcore-watch
+    {
+      'target_name': 'tts',
+      'type': 'none',
+      'conditions': [
+        ['is_tizen==1', {
+          'direct_dependent_settings': {
+            'cflags': [
+              '<!@(<(pkg-config) --cflags tts)',
+            ],
+          },
+          'link_settings': {
+            'ldflags': [
+              '<!@(<(pkg-config) --libs-only-L --libs-only-other tts)',
+            ],
+            'libraries': [
+              '<!@(<(pkg-config) --libs-only-l tts)',
+            ],
+          },
+        }],
+      ],
+    }, # tts
   ],
 }
index 0535fab..9b53138 100644 (file)
       'chromium_src/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.h',
       'chromium_src/chrome/browser/renderer_host/pepper/widevine_cdm_message_filter.cc',
       'chromium_src/chrome/browser/renderer_host/pepper/widevine_cdm_message_filter.h',
-      'chromium_src/chrome/browser/speech/tts_controller.h',
-      'chromium_src/chrome/browser/speech/tts_controller_impl.cc',
-      'chromium_src/chrome/browser/speech/tts_controller_impl.h',
-      'chromium_src/chrome/browser/speech/tts_linux.cc',
-      'chromium_src/chrome/browser/speech/tts_mac.mm',
-      'chromium_src/chrome/browser/speech/tts_message_filter.cc',
-      'chromium_src/chrome/browser/speech/tts_message_filter.h',
-      'chromium_src/chrome/browser/speech/tts_platform.cc',
-      'chromium_src/chrome/browser/speech/tts_platform.h',
-      'chromium_src/chrome/browser/speech/tts_win.cc',
       'chromium_src/chrome/browser/ssl/security_state_tab_helper.cc',
       'chromium_src/chrome/browser/ssl/security_state_tab_helper.h',
       'chromium_src/chrome/browser/ui/browser_dialogs.h',
       'chromium_src/chrome/common/pref_names.h',
       'chromium_src/chrome/common/print_messages.cc',
       'chromium_src/chrome/common/print_messages.h',
-      'chromium_src/chrome/common/tts_messages.h',
-      'chromium_src/chrome/common/tts_utterance_request.cc',
-      'chromium_src/chrome/common/tts_utterance_request.h',
       'chromium_src/chrome/common/widevine_cdm_messages.h',
       'chromium_src/chrome/common/widevine_cdm_constants.cc',
       'chromium_src/chrome/common/widevine_cdm_constants.h',
       'chromium_src/chrome/renderer/printing/print_web_view_helper.h',
       'chromium_src/chrome/renderer/spellchecker/spellcheck_worditerator.cc',
       'chromium_src/chrome/renderer/spellchecker/spellcheck_worditerator.h',
-      'chromium_src/chrome/renderer/tts_dispatcher.cc',
-      'chromium_src/chrome/renderer/tts_dispatcher.h',
       'chromium_src/chrome/utility/utility_message_handler.h',
       'chromium_src/components/pdf/common/pdf_messages.h',
       'chromium_src/components/pdf/renderer/pepper_pdf_host.cc',
       'vi', 'zh-CN', 'zh-TW',
     ],
     'conditions': [
+      ['is_tizen==0', {
+        'app_sources': [
+          'chromium_src/chrome/browser/speech/tts_controller.h',
+          'chromium_src/chrome/browser/speech/tts_controller_impl.cc',
+          'chromium_src/chrome/browser/speech/tts_controller_impl.h',
+          'chromium_src/chrome/browser/speech/tts_linux.cc',
+          'chromium_src/chrome/browser/speech/tts_mac.mm',
+          'chromium_src/chrome/browser/speech/tts_message_filter.cc',
+          'chromium_src/chrome/browser/speech/tts_message_filter.h',
+          'chromium_src/chrome/browser/speech/tts_platform.cc',
+          'chromium_src/chrome/browser/speech/tts_platform.h',
+          'chromium_src/chrome/browser/speech/tts_win.cc',
+          'chromium_src/chrome/common/tts_messages.h',
+          'chromium_src/chrome/common/tts_utterance_request.cc',
+          'chromium_src/chrome/common/tts_utterance_request.h',
+          'chromium_src/chrome/renderer/tts_dispatcher.cc',
+          'chromium_src/chrome/renderer/tts_dispatcher.h',
+        ],
+      }],
+    ],
+    'conditions': [
       ['OS=="win"', {
         'app_sources': [
           'atom/browser/resources/win/resource.h',
index a646f07..3fd098d 100755 (executable)
@@ -51,6 +51,7 @@ BuildRequires: pkgconfig(pkgmgr-info)
 BuildRequires: pkgconfig(sqlite3)
 BuildRequires: pkgconfig(uuid)
 BuildRequires: pkgconfig(ttrace)
+BuildRequires: pkgconfig(tts)
 %if "%{?TIZEN_PRODUCT_TV}" == "1"
 BuildRequires: pkgconfig(capi-media-player)
 BuildRequires: pkgconfig(vd-win-util)
diff --git a/wrt.gyp b/wrt.gyp
index 36af553..1e978f6 100644 (file)
--- a/wrt.gyp
+++ b/wrt.gyp
@@ -21,6 +21,7 @@
         '<(DEPTH)/efl/build/system.gyp:launchpad',
         '<(DEPTH)/efl/build/system.gyp:capi-appfw-application',
         '<(DEPTH)/efl/build/system.gyp:elementary',
+        '<(DEPTH)/efl/build/system.gyp:tts',
         'electron_shell_copy',
       ],
       'sources': [