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

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

Issue 2645613005: MediaStreamTrack: Add echo-cancellation and device-id to getSettings (Closed)
Patch Set: Created 3 years, 11 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/external_media_stream_audio_source.h" 5 #include "content/renderer/media/external_media_stream_audio_source.h"
6 6
7 namespace content { 7 namespace content {
8 8
9 ExternalMediaStreamAudioSource::ExternalMediaStreamAudioSource( 9 ExternalMediaStreamAudioSource::ExternalMediaStreamAudioSource(
10 scoped_refptr<media::AudioCapturerSource> source, 10 scoped_refptr<media::AudioCapturerSource> source,
(...skipping 12 matching lines...) Expand all
23 16, // Legacy parameter (data is always in 32-bit float format). 23 16, // Legacy parameter (data is always in 32-bit float format).
24 frames_per_buffer)); 24 frames_per_buffer));
25 } 25 }
26 26
27 ExternalMediaStreamAudioSource::~ExternalMediaStreamAudioSource() { 27 ExternalMediaStreamAudioSource::~ExternalMediaStreamAudioSource() {
28 DVLOG(1) 28 DVLOG(1)
29 << "ExternalMediaStreamAudioSource::~ExternalMediaStreamAudioSource()"; 29 << "ExternalMediaStreamAudioSource::~ExternalMediaStreamAudioSource()";
30 EnsureSourceIsStopped(); 30 EnsureSourceIsStopped();
31 } 31 }
32 32
33 void ExternalMediaStreamAudioSource::getSettings(
34 blink::WebMediaStreamTrack::Settings& settings) {
35 // This source type does not support echo cancellation.
36 settings.setEchoCancellation(false);
37 }
38
33 bool ExternalMediaStreamAudioSource::EnsureSourceIsStarted() { 39 bool ExternalMediaStreamAudioSource::EnsureSourceIsStarted() {
34 DCHECK(thread_checker_.CalledOnValidThread()); 40 DCHECK(thread_checker_.CalledOnValidThread());
35 if (was_started_) 41 if (was_started_)
36 return true; 42 return true;
37 VLOG(1) << "Starting externally-provided " 43 VLOG(1) << "Starting externally-provided "
38 << (is_local_source() ? "local" : "remote") 44 << (is_local_source() ? "local" : "remote")
39 << " source with audio parameters={" 45 << " source with audio parameters={"
40 << GetAudioParameters().AsHumanReadableString() << "}."; 46 << GetAudioParameters().AsHumanReadableString() << "}.";
41 source_->Initialize(GetAudioParameters(), this, -1); 47 source_->Initialize(GetAudioParameters(), this, -1);
42 source_->Start(); 48 source_->Start();
(...skipping 26 matching lines...) Expand all
69 *audio_bus, 75 *audio_bus,
70 base::TimeTicks::Now() - 76 base::TimeTicks::Now() -
71 base::TimeDelta::FromMilliseconds(audio_delay_milliseconds)); 77 base::TimeDelta::FromMilliseconds(audio_delay_milliseconds));
72 } 78 }
73 79
74 void ExternalMediaStreamAudioSource::OnCaptureError(const std::string& why) { 80 void ExternalMediaStreamAudioSource::OnCaptureError(const std::string& why) {
75 StopSourceOnError(why); 81 StopSourceOnError(why);
76 } 82 }
77 83
78 } // namespace content 84 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698