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 #include "content/browser/renderer_host/media/audio_input_renderer_host.h" | 5 #include "content/browser/renderer_host/media/audio_input_renderer_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/process.h" | 9 #include "base/process.h" |
10 #include "base/shared_memory.h" | 10 #include "base/shared_memory.h" |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 if (!writer->Init()) { | 263 if (!writer->Init()) { |
264 SendErrorMessage(stream_id); | 264 SendErrorMessage(stream_id); |
265 return; | 265 return; |
266 } | 266 } |
267 | 267 |
268 // If we have successfully created the SyncWriter then assign it to the | 268 // If we have successfully created the SyncWriter then assign it to the |
269 // entry and construct an AudioInputController. | 269 // entry and construct an AudioInputController. |
270 entry->writer.reset(writer.release()); | 270 entry->writer.reset(writer.release()); |
271 if (WebContentsCaptureUtil::IsWebContentsDeviceId(device_id)) { | 271 if (WebContentsCaptureUtil::IsWebContentsDeviceId(device_id)) { |
272 entry->controller = media::AudioInputController::CreateForStream( | 272 entry->controller = media::AudioInputController::CreateForStream( |
273 audio_manager_->GetWorkerLoop(), | 273 audio_manager_->GetMessageLoop(), |
274 this, | 274 this, |
275 WebContentsAudioInputStream::Create( | 275 WebContentsAudioInputStream::Create( |
276 device_id, audio_params, audio_manager_->GetWorkerLoop(), | 276 device_id, audio_params, audio_manager_->GetWorkerLoop(), |
277 audio_mirroring_manager_), | 277 audio_mirroring_manager_), |
278 entry->writer.get()); | 278 entry->writer.get()); |
279 } else { | 279 } else { |
280 // TODO(henrika): replace CreateLowLatency() with Create() as soon | 280 // TODO(henrika): replace CreateLowLatency() with Create() as soon |
281 // as satish has ensured that Speech Input also uses the default low- | 281 // as satish has ensured that Speech Input also uses the default low- |
282 // latency path. See crbug.com/112472 for details. | 282 // latency path. See crbug.com/112472 for details. |
283 entry->controller = media::AudioInputController::CreateLowLatency( | 283 entry->controller = media::AudioInputController::CreateLowLatency( |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 // TODO(hclam): Implement a faster look up method. | 398 // TODO(hclam): Implement a faster look up method. |
399 for (AudioEntryMap::iterator i = audio_entries_.begin(); | 399 for (AudioEntryMap::iterator i = audio_entries_.begin(); |
400 i != audio_entries_.end(); ++i) { | 400 i != audio_entries_.end(); ++i) { |
401 if (controller == i->second->controller.get()) | 401 if (controller == i->second->controller.get()) |
402 return i->second; | 402 return i->second; |
403 } | 403 } |
404 return NULL; | 404 return NULL; |
405 } | 405 } |
406 | 406 |
407 } // namespace content | 407 } // namespace content |
OLD | NEW |