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

Side by Side Diff: content/browser/renderer_host/media/audio_input_renderer_host.cc

Issue 17122006: Rejigger audio capture pipeline to work with separate main+worker threads (Mac). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Replace use of scoped_refptr<Worker> with simple DeleteSoon() scheme. Created 7 years, 6 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/renderer_host/media/web_contents_audio_input_stream.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 if (!writer->Init()) { 261 if (!writer->Init()) {
262 SendErrorMessage(stream_id); 262 SendErrorMessage(stream_id);
263 return; 263 return;
264 } 264 }
265 265
266 // If we have successfully created the SyncWriter then assign it to the 266 // If we have successfully created the SyncWriter then assign it to the
267 // entry and construct an AudioInputController. 267 // entry and construct an AudioInputController.
268 entry->writer.reset(writer.release()); 268 entry->writer.reset(writer.release());
269 if (WebContentsCaptureUtil::IsWebContentsDeviceId(device_id)) { 269 if (WebContentsCaptureUtil::IsWebContentsDeviceId(device_id)) {
270 entry->controller = media::AudioInputController::CreateForStream( 270 entry->controller = media::AudioInputController::CreateForStream(
271 audio_manager_->GetWorkerLoop(), 271 audio_manager_->GetMessageLoop(),
272 this, 272 this,
273 WebContentsAudioInputStream::Create( 273 WebContentsAudioInputStream::Create(
274 device_id, audio_params, audio_manager_->GetWorkerLoop()), 274 device_id, audio_params, audio_manager_->GetWorkerLoop()),
275 entry->writer.get()); 275 entry->writer.get());
276 } else { 276 } else {
277 // TODO(henrika): replace CreateLowLatency() with Create() as soon 277 // TODO(henrika): replace CreateLowLatency() with Create() as soon
278 // as satish has ensured that Speech Input also uses the default low- 278 // as satish has ensured that Speech Input also uses the default low-
279 // latency path. See crbug.com/112472 for details. 279 // latency path. See crbug.com/112472 for details.
280 entry->controller = media::AudioInputController::CreateLowLatency( 280 entry->controller = media::AudioInputController::CreateLowLatency(
281 audio_manager_, 281 audio_manager_,
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 // TODO(hclam): Implement a faster look up method. 395 // TODO(hclam): Implement a faster look up method.
396 for (AudioEntryMap::iterator i = audio_entries_.begin(); 396 for (AudioEntryMap::iterator i = audio_entries_.begin();
397 i != audio_entries_.end(); ++i) { 397 i != audio_entries_.end(); ++i) {
398 if (controller == i->second->controller.get()) 398 if (controller == i->second->controller.get())
399 return i->second; 399 return i->second;
400 } 400 }
401 return NULL; 401 return NULL;
402 } 402 }
403 403
404 } // namespace content 404 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/media/web_contents_audio_input_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698