OLD | NEW |
---|---|
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, |
11 int sample_rate, | 11 int sample_rate, |
12 media::ChannelLayout channel_layout, | 12 media::ChannelLayout channel_layout, |
13 int frames_per_buffer, | 13 int frames_per_buffer) |
14 bool is_remote) | 14 : MediaStreamAudioSource(true), |
miu
2016/10/23 00:51:30
The value for |is_remote| was true here (from the
| |
15 : MediaStreamAudioSource(!is_remote), source_(std::move(source)), | 15 source_(std::move(source)), |
16 was_started_(false) { | 16 was_started_(false) { |
17 DVLOG(1) | 17 DVLOG(1) |
18 << "ExternalMediaStreamAudioSource::ExternalMediaStreamAudioSource()"; | 18 << "ExternalMediaStreamAudioSource::ExternalMediaStreamAudioSource()"; |
19 DCHECK(source_.get()); | 19 DCHECK(source_.get()); |
20 MediaStreamAudioSource::SetFormat(media::AudioParameters( | 20 MediaStreamAudioSource::SetFormat(media::AudioParameters( |
21 media::AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout, | 21 media::AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout, |
22 sample_rate, | 22 sample_rate, |
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 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
72 } | 72 } |
73 | 73 |
74 void ExternalMediaStreamAudioSource::OnCaptureError(const std::string& why) { | 74 void ExternalMediaStreamAudioSource::OnCaptureError(const std::string& why) { |
75 // As of this writing, this method doesn't get called for anything useful, | 75 // As of this writing, this method doesn't get called for anything useful, |
76 // and all other implementors just log the message, but don't disconnect sinks | 76 // and all other implementors just log the message, but don't disconnect sinks |
77 // or take any other action. So, just log the error. | 77 // or take any other action. So, just log the error. |
78 LOG(ERROR) << why; | 78 LOG(ERROR) << why; |
79 } | 79 } |
80 | 80 |
81 } // namespace content | 81 } // namespace content |
OLD | NEW |