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

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

Issue 12387006: Pass more detailed audio hardware configuration information to the renderer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 9 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
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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 if (LookupById(stream_id) != NULL) { 225 if (LookupById(stream_id) != NULL) {
226 SendErrorMessage(stream_id); 226 SendErrorMessage(stream_id);
227 return; 227 return;
228 } 228 }
229 229
230 media::AudioParameters audio_params(params); 230 media::AudioParameters audio_params(params);
231 231
232 if (media_stream_manager_->audio_input_device_manager()-> 232 if (media_stream_manager_->audio_input_device_manager()->
233 ShouldUseFakeDevice()) { 233 ShouldUseFakeDevice()) {
234 audio_params.Reset(media::AudioParameters::AUDIO_FAKE, 234 audio_params.Reset(media::AudioParameters::AUDIO_FAKE,
235 params.channel_layout(), 0, params.sample_rate(), 235 params.channel_layout(), params.channels(), 0,
236 params.sample_rate(),
236 params.bits_per_sample(), params.frames_per_buffer()); 237 params.bits_per_sample(), params.frames_per_buffer());
237 } 238 }
238 239
239 uint32 buffer_size = audio_params.GetBytesPerBuffer(); 240 uint32 buffer_size = audio_params.GetBytesPerBuffer();
240 241
241 // Create a new AudioEntry structure. 242 // Create a new AudioEntry structure.
242 scoped_ptr<AudioEntry> entry(new AudioEntry()); 243 scoped_ptr<AudioEntry> entry(new AudioEntry());
243 244
244 uint32 segment_size = 245 uint32 segment_size =
245 sizeof(media::AudioInputBufferParameters) + buffer_size; 246 sizeof(media::AudioInputBufferParameters) + buffer_size;
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 for (SessionEntryMap::iterator it = session_entries_.begin(); 468 for (SessionEntryMap::iterator it = session_entries_.begin();
468 it != session_entries_.end(); ++it) { 469 it != session_entries_.end(); ++it) {
469 if (stream_id == it->second) { 470 if (stream_id == it->second) {
470 return it->first; 471 return it->first;
471 } 472 }
472 } 473 }
473 return 0; 474 return 0;
474 } 475 }
475 476
476 } // namespace content 477 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_message_filter.h » ('j') | media/audio/mac/audio_manager_mac.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698