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

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

Issue 11298006: Browser-wide audio mirroring for TabCapture API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 DCHECK(LookupById(stream_id) == NULL); 212 DCHECK(LookupById(stream_id) == NULL);
213 213
214 media::AudioParameters audio_params(params); 214 media::AudioParameters audio_params(params);
215 215
216 if (media_stream_manager_->audio_input_device_manager()-> 216 if (media_stream_manager_->audio_input_device_manager()->
217 ShouldUseFakeDevice()) { 217 ShouldUseFakeDevice()) {
218 audio_params.Reset(media::AudioParameters::AUDIO_FAKE, 218 audio_params.Reset(media::AudioParameters::AUDIO_FAKE,
219 params.channel_layout(), params.sample_rate(), 219 params.channel_layout(), params.sample_rate(),
220 params.bits_per_sample(), params.frames_per_buffer()); 220 params.bits_per_sample(), params.frames_per_buffer());
221 } 221 }
222 // TODO(justinlin): Maybe should specify using virtual device here instead.
222 223
223 DCHECK_GT(audio_params.frames_per_buffer(), 0); 224 DCHECK_GT(audio_params.frames_per_buffer(), 0);
224 uint32 buffer_size = audio_params.GetBytesPerBuffer(); 225 uint32 buffer_size = audio_params.GetBytesPerBuffer();
225 226
226 // Create a new AudioEntry structure. 227 // Create a new AudioEntry structure.
227 scoped_ptr<AudioEntry> entry(new AudioEntry()); 228 scoped_ptr<AudioEntry> entry(new AudioEntry());
228 229
229 uint32 mem_size = sizeof(media::AudioInputBufferParameters) + buffer_size; 230 uint32 mem_size = sizeof(media::AudioInputBufferParameters) + buffer_size;
230 231
231 // Create the shared memory and share it with the renderer process 232 // Create the shared memory and share it with the renderer process
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 for (SessionEntryMap::iterator it = session_entries_.begin(); 432 for (SessionEntryMap::iterator it = session_entries_.begin();
432 it != session_entries_.end(); ++it) { 433 it != session_entries_.end(); ++it) {
433 if (stream_id == it->second) { 434 if (stream_id == it->second) {
434 return it->first; 435 return it->first;
435 } 436 }
436 } 437 }
437 return 0; 438 return 0;
438 } 439 }
439 440
440 } // namespace content 441 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698