| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "content/renderer/media/speech_recognition_audio_sink.h" | 5 #include "content/renderer/media/speech_recognition_audio_sink.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/memory/shared_memory.h" | 11 #include "base/memory/shared_memory.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "content/renderer/media/media_stream_audio_source.h" | 13 #include "content/renderer/media/media_stream_audio_source.h" |
| 14 #include "media/audio/audio_parameters.h" | |
| 15 #include "media/base/audio_fifo.h" | 14 #include "media/base/audio_fifo.h" |
| 15 #include "media/base/audio_parameters.h" |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 | 18 |
| 19 SpeechRecognitionAudioSink::SpeechRecognitionAudioSink( | 19 SpeechRecognitionAudioSink::SpeechRecognitionAudioSink( |
| 20 const blink::WebMediaStreamTrack& track, | 20 const blink::WebMediaStreamTrack& track, |
| 21 const media::AudioParameters& params, | 21 const media::AudioParameters& params, |
| 22 const base::SharedMemoryHandle memory, | 22 const base::SharedMemoryHandle memory, |
| 23 std::unique_ptr<base::SyncSocket> socket, | 23 std::unique_ptr<base::SyncSocket> socket, |
| 24 const OnStoppedCB& on_stopped_cb) | 24 const OnStoppedCB& on_stopped_cb) |
| 25 : track_(track), | 25 : track_(track), |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 } | 174 } |
| 175 | 175 |
| 176 media::AudioInputBuffer* | 176 media::AudioInputBuffer* |
| 177 SpeechRecognitionAudioSink::GetAudioInputBuffer() const { | 177 SpeechRecognitionAudioSink::GetAudioInputBuffer() const { |
| 178 DCHECK(capture_thread_checker_.CalledOnValidThread()); | 178 DCHECK(capture_thread_checker_.CalledOnValidThread()); |
| 179 DCHECK(shared_memory_.memory()); | 179 DCHECK(shared_memory_.memory()); |
| 180 return static_cast<media::AudioInputBuffer*>(shared_memory_.memory()); | 180 return static_cast<media::AudioInputBuffer*>(shared_memory_.memory()); |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace content | 183 } // namespace content |
| OLD | NEW |