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

Side by Side Diff: content/renderer/media/webaudio_capturer_source.cc

Issue 12440027: Do not pass the string device_id via IPC message to create an audio input stream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: changed the pepper code to use OpenDevice() for default device, and fixed a minor mistake in MediaS… 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/renderer/media/webaudio_capturer_source.h" 5 #include "content/renderer/media/webaudio_capturer_source.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/renderer/media/webrtc_audio_capturer.h" 8 #include "content/renderer/media/webrtc_audio_capturer.h"
9 9
10 using media::AudioBus; 10 using media::AudioBus;
(...skipping 29 matching lines...) Expand all
40 capturer_->Start(); 40 capturer_->Start();
41 } else { 41 } else {
42 // TODO(crogers): Handle more than just the mono and stereo cases. 42 // TODO(crogers): Handle more than just the mono and stereo cases.
43 LOG(WARNING) << "WebAudioCapturerSource::setFormat() : unhandled format."; 43 LOG(WARNING) << "WebAudioCapturerSource::setFormat() : unhandled format.";
44 } 44 }
45 } 45 }
46 46
47 void WebAudioCapturerSource::Initialize( 47 void WebAudioCapturerSource::Initialize(
48 const media::AudioParameters& params, 48 const media::AudioParameters& params,
49 media::AudioCapturerSource::CaptureCallback* callback, 49 media::AudioCapturerSource::CaptureCallback* callback,
50 media::AudioCapturerSource::CaptureEventHandler* event_handler) { 50 int session_id) {
51 // The downstream client should be configured the same as what WebKit 51 // The downstream client should be configured the same as what WebKit
52 // is feeding it. 52 // is feeding it.
53 DCHECK_EQ(set_format_channels_, params.channels()); 53 DCHECK_EQ(set_format_channels_, params.channels());
54 54
55 base::AutoLock auto_lock(lock_); 55 base::AutoLock auto_lock(lock_);
56 params_ = params; 56 params_ = params;
57 callback_ = callback; 57 callback_ = callback;
58 wrapper_bus_ = AudioBus::CreateWrapper(params.channels()); 58 wrapper_bus_ = AudioBus::CreateWrapper(params.channels());
59 capture_bus_ = AudioBus::Create(params); 59 capture_bus_ = AudioBus::Create(params);
60 fifo_.reset(new AudioFifo(params.channels(), kFifoSize)); 60 fifo_.reset(new AudioFifo(params.channels(), kFifoSize));
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 95
96 fifo_->Push(wrapper_bus_.get()); 96 fifo_->Push(wrapper_bus_.get());
97 int capture_frames = params_.frames_per_buffer(); 97 int capture_frames = params_.frames_per_buffer();
98 while (fifo_->frames() >= capture_frames) { 98 while (fifo_->frames() >= capture_frames) {
99 fifo_->Consume(capture_bus_.get(), 0, capture_frames); 99 fifo_->Consume(capture_bus_.get(), 0, capture_frames);
100 callback_->Capture(capture_bus_.get(), 0, 1.0); 100 callback_->Capture(capture_bus_.get(), 0, 1.0);
101 } 101 }
102 } 102 }
103 103
104 } // namespace content 104 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698