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

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

Issue 23752002: Always set need_audio_processing_ to true in WebRtcLocalAudioTrack. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Update tests Created 7 years, 3 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
« no previous file with comments | « no previous file | content/renderer/media/webrtc_local_audio_track_unittest.cc » ('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/renderer/media/webrtc_local_audio_track.h" 5 #include "content/renderer/media/webrtc_local_audio_track.h"
6 6
7 #include "content/renderer/media/webrtc_audio_capturer.h" 7 #include "content/renderer/media/webrtc_audio_capturer.h"
8 #include "content/renderer/media/webrtc_audio_capturer_sink_owner.h" 8 #include "content/renderer/media/webrtc_audio_capturer_sink_owner.h"
9 #include "third_party/libjingle/source/talk/media/base/audiorenderer.h" 9 #include "third_party/libjingle/source/talk/media/base/audiorenderer.h"
10 10
(...skipping 16 matching lines...) Expand all
27 const scoped_refptr<WebRtcAudioCapturer>& capturer, 27 const scoped_refptr<WebRtcAudioCapturer>& capturer,
28 webrtc::AudioSourceInterface* track_source) 28 webrtc::AudioSourceInterface* track_source)
29 : webrtc::MediaStreamTrack<webrtc::AudioTrackInterface>(label), 29 : webrtc::MediaStreamTrack<webrtc::AudioTrackInterface>(label),
30 capturer_(capturer), 30 capturer_(capturer),
31 track_source_(track_source), 31 track_source_(track_source),
32 need_audio_processing_(!capturer->device_id().empty()) { 32 need_audio_processing_(!capturer->device_id().empty()) {
33 // The capturer with a valid device id is using microphone as source, 33 // The capturer with a valid device id is using microphone as source,
34 // and APM (AudioProcessingModule) is turned on only for microphone data. 34 // and APM (AudioProcessingModule) is turned on only for microphone data.
35 DCHECK(capturer.get()); 35 DCHECK(capturer.get());
36 DVLOG(1) << "WebRtcLocalAudioTrack::WebRtcLocalAudioTrack()"; 36 DVLOG(1) << "WebRtcLocalAudioTrack::WebRtcLocalAudioTrack()";
37
38 // TODO(tommi): Remove this, feed audio constraints to WebRtcLocalAudioTrack
39 // and check the constraints. This is here to fix a recent regression whereby
40 // audio processing is not enabled for WebAudio regardless of the hard coded
41 // audio constraints. For more info: http://crbug.com/277134
42 need_audio_processing_ = true;
37 } 43 }
38 44
39 WebRtcLocalAudioTrack::~WebRtcLocalAudioTrack() { 45 WebRtcLocalAudioTrack::~WebRtcLocalAudioTrack() {
40 DCHECK(thread_checker_.CalledOnValidThread()); 46 DCHECK(thread_checker_.CalledOnValidThread());
41 DVLOG(1) << "WebRtcLocalAudioTrack::~WebRtcLocalAudioTrack()"; 47 DVLOG(1) << "WebRtcLocalAudioTrack::~WebRtcLocalAudioTrack()";
42 // Users might not call Stop() on the track. 48 // Users might not call Stop() on the track.
43 Stop(); 49 Stop();
44 } 50 }
45 51
46 void WebRtcLocalAudioTrack::CaptureData(const int16* audio_data, 52 void WebRtcLocalAudioTrack::CaptureData(const int16* audio_data,
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 base::AutoLock auto_lock(lock_); 195 base::AutoLock auto_lock(lock_);
190 sinks = sinks_; 196 sinks = sinks_;
191 capturer_ = NULL; 197 capturer_ = NULL;
192 } 198 }
193 199
194 for (SinkList::const_iterator it = sinks.begin(); it != sinks.end(); ++it) 200 for (SinkList::const_iterator it = sinks.begin(); it != sinks.end(); ++it)
195 (*it)->Reset(); 201 (*it)->Reset();
196 } 202 }
197 203
198 } // namespace content 204 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/webrtc_local_audio_track_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698