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

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

Issue 163343002: Reland 153623004: Remove the unified IO code on the browser (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixed the cras bot Created 6 years, 10 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
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/memory/shared_memory.h" 8 #include "base/memory/shared_memory.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/process/process.h" 10 #include "base/process/process.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 if (config.params.format() == media::AudioParameters::AUDIO_PCM_LOW_LATENCY) 307 if (config.params.format() == media::AudioParameters::AUDIO_PCM_LOW_LATENCY)
308 entry->controller->SetAutomaticGainControl(config.automatic_gain_control); 308 entry->controller->SetAutomaticGainControl(config.automatic_gain_control);
309 309
310 // Since the controller was created successfully, create an entry and add it 310 // Since the controller was created successfully, create an entry and add it
311 // to the map. 311 // to the map.
312 entry->stream_id = stream_id; 312 entry->stream_id = stream_id;
313 audio_entries_.insert(std::make_pair(stream_id, entry.release())); 313 audio_entries_.insert(std::make_pair(stream_id, entry.release()));
314 314
315 MediaStreamManager::SendMessageToNativeLog( 315 MediaStreamManager::SendMessageToNativeLog(
316 "Audio input stream created successfully."); 316 "Audio input stream created successfully.");
317 audio_log_->OnCreated(stream_id, audio_params, device_id, std::string()); 317 audio_log_->OnCreated(stream_id, audio_params, device_id);
318 } 318 }
319 319
320 void AudioInputRendererHost::OnRecordStream(int stream_id) { 320 void AudioInputRendererHost::OnRecordStream(int stream_id) {
321 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 321 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
322 322
323 AudioEntry* entry = LookupById(stream_id); 323 AudioEntry* entry = LookupById(stream_id);
324 if (!entry) { 324 if (!entry) {
325 SendErrorMessage(stream_id); 325 SendErrorMessage(stream_id);
326 return; 326 return;
327 } 327 }
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 // TODO(hclam): Implement a faster look up method. 416 // TODO(hclam): Implement a faster look up method.
417 for (AudioEntryMap::iterator i = audio_entries_.begin(); 417 for (AudioEntryMap::iterator i = audio_entries_.begin();
418 i != audio_entries_.end(); ++i) { 418 i != audio_entries_.end(); ++i) {
419 if (controller == i->second->controller.get()) 419 if (controller == i->second->controller.get())
420 return i->second; 420 return i->second;
421 } 421 }
422 return NULL; 422 return NULL;
423 } 423 }
424 424
425 } // namespace content 425 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/media/media_internals_unittest.cc ('k') | content/browser/renderer_host/media/audio_renderer_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698