 Chromium Code Reviews
 Chromium Code Reviews Issue 499233003:
  Binding media stream audio track to speech recognition [renderer]  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 499233003:
  Binding media stream audio track to speech recognition [renderer]  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| OLD | NEW | 
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 // Multiply-included message file, hence no include guard. | 5 // Multiply-included message file, hence no include guard. | 
| 6 | 6 | 
| 7 #include <string> | 7 #include <string> | 
| 8 | 8 | 
| 9 #include "base/memory/shared_memory.h" | |
| 10 #include "base/native_sync_socket.h" | |
| 11 #include "base/process/process_handle.h" | |
| 9 #include "content/public/common/speech_recognition_error.h" | 12 #include "content/public/common/speech_recognition_error.h" | 
| 10 #include "content/public/common/speech_recognition_grammar.h" | 13 #include "content/public/common/speech_recognition_grammar.h" | 
| 11 #include "content/public/common/speech_recognition_result.h" | 14 #include "content/public/common/speech_recognition_result.h" | 
| 12 #include "ipc/ipc_message_macros.h" | 15 #include "ipc/ipc_message_macros.h" | 
| 13 #include "ipc/ipc_param_traits.h" | 16 #include "ipc/ipc_param_traits.h" | 
| 17 #include "media/audio/audio_parameters.h" | |
| 14 #include "ui/gfx/rect.h" | 18 #include "ui/gfx/rect.h" | 
| 15 | 19 | 
| 20 #if defined(OS_POSIX) | |
| 21 #include "base/file_descriptor_posix.h" | |
| 22 #endif | |
| 23 | |
| 16 #define IPC_MESSAGE_START SpeechRecognitionMsgStart | 24 #define IPC_MESSAGE_START SpeechRecognitionMsgStart | 
| 17 | 25 | 
| 18 IPC_ENUM_TRAITS_MAX_VALUE(content::SpeechAudioErrorDetails, | 26 IPC_ENUM_TRAITS_MAX_VALUE(content::SpeechAudioErrorDetails, | 
| 19 content::SPEECH_AUDIO_ERROR_DETAILS_LAST) | 27 content::SPEECH_AUDIO_ERROR_DETAILS_LAST) | 
| 20 IPC_ENUM_TRAITS_MAX_VALUE(content::SpeechRecognitionErrorCode, | 28 IPC_ENUM_TRAITS_MAX_VALUE(content::SpeechRecognitionErrorCode, | 
| 21 content::SPEECH_RECOGNITION_ERROR_LAST) | 29 content::SPEECH_RECOGNITION_ERROR_LAST) | 
| 22 | 30 | 
| 23 IPC_STRUCT_TRAITS_BEGIN(content::SpeechRecognitionError) | 31 IPC_STRUCT_TRAITS_BEGIN(content::SpeechRecognitionError) | 
| 24 IPC_STRUCT_TRAITS_MEMBER(code) | 32 IPC_STRUCT_TRAITS_MEMBER(code) | 
| 25 IPC_STRUCT_TRAITS_MEMBER(details) | 33 IPC_STRUCT_TRAITS_MEMBER(details) | 
| (...skipping 29 matching lines...) Expand all Loading... | |
| 55 // Speech grammars to use. | 63 // Speech grammars to use. | 
| 56 IPC_STRUCT_MEMBER(content::SpeechRecognitionGrammarArray, grammars) | 64 IPC_STRUCT_MEMBER(content::SpeechRecognitionGrammarArray, grammars) | 
| 57 // URL of the page (or iframe if applicable). | 65 // URL of the page (or iframe if applicable). | 
| 58 IPC_STRUCT_MEMBER(std::string, origin_url) | 66 IPC_STRUCT_MEMBER(std::string, origin_url) | 
| 59 // Maximum number of hypotheses allowed for each results. | 67 // Maximum number of hypotheses allowed for each results. | 
| 60 IPC_STRUCT_MEMBER(uint32, max_hypotheses) | 68 IPC_STRUCT_MEMBER(uint32, max_hypotheses) | 
| 61 // Whether the user requested continuous recognition or not. | 69 // Whether the user requested continuous recognition or not. | 
| 62 IPC_STRUCT_MEMBER(bool, continuous) | 70 IPC_STRUCT_MEMBER(bool, continuous) | 
| 63 // Whether the user requested interim results or not. | 71 // Whether the user requested interim results or not. | 
| 64 IPC_STRUCT_MEMBER(bool, interim_results) | 72 IPC_STRUCT_MEMBER(bool, interim_results) | 
| 73 // Wheter user has set an audio track as input | |
| 74 IPC_STRUCT_MEMBER(bool, using_audio_track) | |
| 75 // Process handle for the renderer | |
| 76 IPC_STRUCT_MEMBER(base::ProcessHandle, peer_process_handle) | |
| 65 IPC_STRUCT_END() | 77 IPC_STRUCT_END() | 
| 66 | 78 | 
| 67 | 79 | 
| 68 // Requests the speech recognition service to start speech recognition. | 80 // Requests the speech recognition service to start speech recognition. | 
| 69 IPC_MESSAGE_CONTROL1(SpeechRecognitionHostMsg_StartRequest, | 81 IPC_MESSAGE_CONTROL1(SpeechRecognitionHostMsg_StartRequest, | 
| 70 SpeechRecognitionHostMsg_StartRequest_Params) | 82 SpeechRecognitionHostMsg_StartRequest_Params) | 
| 71 | 83 | 
| 72 // Requests the speech recognition service to abort speech recognition on | 84 // Requests the speech recognition service to abort speech recognition on | 
| 73 // behalf of the given |render_view_id| and |request_id|. If there are no | 85 // behalf of the given |render_view_id| and |request_id|. If there are no | 
| 74 // sessions associated with the |request_id| in the render view, this call | 86 // sessions associated with the |request_id| in the render view, this call | 
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 107 | 119 | 
| 108 IPC_MESSAGE_ROUTED1(SpeechRecognitionMsg_AudioStarted, int /* request_id */) | 120 IPC_MESSAGE_ROUTED1(SpeechRecognitionMsg_AudioStarted, int /* request_id */) | 
| 109 | 121 | 
| 110 IPC_MESSAGE_ROUTED1(SpeechRecognitionMsg_SoundStarted, int /* request_id */) | 122 IPC_MESSAGE_ROUTED1(SpeechRecognitionMsg_SoundStarted, int /* request_id */) | 
| 111 | 123 | 
| 112 IPC_MESSAGE_ROUTED1(SpeechRecognitionMsg_SoundEnded, int /* request_id */) | 124 IPC_MESSAGE_ROUTED1(SpeechRecognitionMsg_SoundEnded, int /* request_id */) | 
| 113 | 125 | 
| 114 IPC_MESSAGE_ROUTED1(SpeechRecognitionMsg_AudioEnded, int /* request_id */) | 126 IPC_MESSAGE_ROUTED1(SpeechRecognitionMsg_AudioEnded, int /* request_id */) | 
| 115 | 127 | 
| 116 IPC_MESSAGE_ROUTED1(SpeechRecognitionMsg_Ended, int /* request_id */) | 128 IPC_MESSAGE_ROUTED1(SpeechRecognitionMsg_Ended, int /* request_id */) | 
| 129 | |
| 130 IPC_MESSAGE_ROUTED5(SpeechRecognitionMsg_AudioTrackReady, | |
| 
tommi (sloooow) - chröme
2014/08/29 11:25:30
is this approach the same as what we do elsewhere
 
no longer working on chromium
2014/08/29 12:23:06
I have the same concern here, Tommi, FYI, our exis
 
burnik
2014/08/29 13:26:16
I think it would be ok if we had |base::SyncSocket
 | |
| 131 int /* request_id */, | |
| 132 media::AudioParameters /* params */, | |
| 133 base::SharedMemoryHandle /* memory */, | |
| 134 base::NativeSyncSocket::Descriptor /* socket */, | |
| 135 int /* length */) | |
| OLD | NEW |