Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1269)

Unified Diff: content/browser/speech/speech_recognition_dispatcher_host.cc

Issue 549373003: Binding media stream audio track to speech recognition [browser] Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Wait with no timeout Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/speech/speech_recognition_dispatcher_host.cc
diff --git a/content/browser/speech/speech_recognition_dispatcher_host.cc b/content/browser/speech/speech_recognition_dispatcher_host.cc
index f920c51e779d6632c6eab3f1c8ee304080c789aa..b20208bc343581a553c290fe16e702d777234350 100644
--- a/content/browser/speech/speech_recognition_dispatcher_host.cc
+++ b/content/browser/speech/speech_recognition_dispatcher_host.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "base/lazy_instance.h"
+#include "base/sync_socket.h"
#include "content/browser/browser_plugin/browser_plugin_guest.h"
#include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
@@ -17,6 +18,7 @@
#include "content/public/browser/speech_recognition_session_config.h"
#include "content/public/browser/speech_recognition_session_context.h"
#include "content/public/common/content_switches.h"
+#include "media/audio/audio_parameters.h"
namespace content {
@@ -167,6 +169,9 @@ void SpeechRecognitionDispatcherHost::OnStartRequestOnIO(
config.continuous = params.continuous;
config.interim_results = params.interim_results;
config.event_listener = AsWeakPtr();
+ config.using_audio_track = params.using_audio_track;
+ // TODO(burnik): This needs to be tested on Windows.
+ config.peer_process_handle = PeerHandle();
int session_id = SpeechRecognitionManager::GetInstance()->CreateSession(
config);
@@ -277,4 +282,18 @@ void SpeechRecognitionDispatcherHost::OnEnvironmentEstimationComplete(
int session_id) {
}
+void SpeechRecognitionDispatcherHost::OnAudioReceiverReady(
+ int session_id,
+ const media::AudioParameters& params,
+ const base::SharedMemoryHandle memory,
+ const base::SyncSocket::TransitDescriptor socket) {
+ const SpeechRecognitionSessionContext& context =
+ SpeechRecognitionManager::GetInstance()->GetSessionContext(session_id);
+ Send(new SpeechRecognitionMsg_AudioReceiverReady(context.render_view_id,
+ context.request_id,
+ params,
+ memory,
+ socket));
+}
+
} // namespace content
« no previous file with comments | « content/browser/speech/speech_recognition_dispatcher_host.h ('k') | content/browser/speech/speech_recognition_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698