Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 class FakeWebRtcVoiceEngine | 121 class FakeWebRtcVoiceEngine |
| 122 : public webrtc::VoEAudioProcessing, | 122 : public webrtc::VoEAudioProcessing, |
| 123 public webrtc::VoEBase, public webrtc::VoECodec, | 123 public webrtc::VoEBase, public webrtc::VoECodec, |
| 124 public webrtc::VoEHardware, | 124 public webrtc::VoEHardware, |
| 125 public webrtc::VoEVolumeControl { | 125 public webrtc::VoEVolumeControl { |
| 126 public: | 126 public: |
| 127 struct Channel { | 127 struct Channel { |
| 128 Channel() { | 128 Channel() { |
| 129 memset(&send_codec, 0, sizeof(send_codec)); | 129 memset(&send_codec, 0, sizeof(send_codec)); |
| 130 } | 130 } |
| 131 bool playout = false; | 131 bool playout = false; |
|
the sun
2016/08/04 11:56:29
remove me!
aleloi
2016/08/04 12:12:36
Done.
| |
| 132 bool vad = false; | 132 bool vad = false; |
| 133 bool codec_fec = false; | 133 bool codec_fec = false; |
| 134 int max_encoding_bandwidth = 0; | 134 int max_encoding_bandwidth = 0; |
| 135 bool opus_dtx = false; | 135 bool opus_dtx = false; |
| 136 int cn8_type = 13; | 136 int cn8_type = 13; |
| 137 int cn16_type = 105; | 137 int cn16_type = 105; |
| 138 int associate_send_channel = -1; | 138 int associate_send_channel = -1; |
| 139 std::vector<webrtc::CodecInst> recv_codecs; | 139 std::vector<webrtc::CodecInst> recv_codecs; |
| 140 webrtc::CodecInst send_codec; | 140 webrtc::CodecInst send_codec; |
| 141 int neteq_capacity = -1; | 141 int neteq_capacity = -1; |
| 142 bool neteq_fast_accelerate = false; | 142 bool neteq_fast_accelerate = false; |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 FakeWebRtcVoiceEngine() { | 145 FakeWebRtcVoiceEngine() { |
| 146 memset(&agc_config_, 0, sizeof(agc_config_)); | 146 memset(&agc_config_, 0, sizeof(agc_config_)); |
| 147 } | 147 } |
| 148 ~FakeWebRtcVoiceEngine() override { | 148 ~FakeWebRtcVoiceEngine() override { |
| 149 RTC_CHECK(channels_.empty()); | 149 RTC_CHECK(channels_.empty()); |
| 150 } | 150 } |
| 151 | 151 |
| 152 bool ec_metrics_enabled() const { return ec_metrics_enabled_; } | 152 bool ec_metrics_enabled() const { return ec_metrics_enabled_; } |
| 153 | 153 |
| 154 bool IsInited() const { return inited_; } | 154 bool IsInited() const { return inited_; } |
| 155 int GetLastChannel() const { return last_channel_; } | 155 int GetLastChannel() const { return last_channel_; } |
| 156 int GetNumChannels() const { return static_cast<int>(channels_.size()); } | 156 int GetNumChannels() const { return static_cast<int>(channels_.size()); } |
| 157 bool GetPlayout(int channel) { | |
| 158 return channels_[channel]->playout; | |
| 159 } | |
| 160 bool GetVAD(int channel) { | 157 bool GetVAD(int channel) { |
| 161 return channels_[channel]->vad; | 158 return channels_[channel]->vad; |
| 162 } | 159 } |
| 163 bool GetOpusDtx(int channel) { | 160 bool GetOpusDtx(int channel) { |
| 164 return channels_[channel]->opus_dtx; | 161 return channels_[channel]->opus_dtx; |
| 165 } | 162 } |
| 166 bool GetCodecFEC(int channel) { | 163 bool GetCodecFEC(int channel) { |
| 167 return channels_[channel]->codec_fec; | 164 return channels_[channel]->codec_fec; |
| 168 } | 165 } |
| 169 int GetMaxEncodingBandwidth(int channel) { | 166 int GetMaxEncodingBandwidth(int channel) { |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 238 for (const auto& ch : channels_) { | 235 for (const auto& ch : channels_) { |
| 239 if (ch.second->associate_send_channel == channel) { | 236 if (ch.second->associate_send_channel == channel) { |
| 240 ch.second->associate_send_channel = -1; | 237 ch.second->associate_send_channel = -1; |
| 241 } | 238 } |
| 242 } | 239 } |
| 243 delete channels_[channel]; | 240 delete channels_[channel]; |
| 244 channels_.erase(channel); | 241 channels_.erase(channel); |
| 245 return 0; | 242 return 0; |
| 246 } | 243 } |
| 247 WEBRTC_STUB(StartReceive, (int channel)); | 244 WEBRTC_STUB(StartReceive, (int channel)); |
| 248 WEBRTC_FUNC(StartPlayout, (int channel)) { | 245 WEBRTC_FUNC(StartPlayout, (int channel)) { |
|
the sun
2016/08/04 11:56:29
Remove impl. Make it a WEBRTC_STUB().
aleloi
2016/08/04 12:12:35
Done.
| |
| 249 if (playout_fail_channel_ != channel) { | 246 if (playout_fail_channel_ != channel) { |
| 250 WEBRTC_CHECK_CHANNEL(channel); | 247 WEBRTC_CHECK_CHANNEL(channel); |
| 251 channels_[channel]->playout = true; | 248 channels_[channel]->playout = true; |
| 252 return 0; | 249 return 0; |
| 253 } else { | 250 } else { |
| 254 // When playout_fail_channel_ == channel, fail the StartPlayout on this | 251 // When playout_fail_channel_ == channel, fail the StartPlayout on this |
| 255 // channel. | 252 // channel. |
| 256 return -1; | 253 return -1; |
| 257 } | 254 } |
| 258 } | 255 } |
| 259 WEBRTC_STUB(StartSend, (int channel)); | 256 WEBRTC_STUB(StartSend, (int channel)); |
| 260 WEBRTC_STUB(StopReceive, (int channel)); | 257 WEBRTC_STUB(StopReceive, (int channel)); |
| 261 WEBRTC_FUNC(StopPlayout, (int channel)) { | 258 WEBRTC_FUNC(StopPlayout, (int channel)) { |
|
the sun
2016/08/04 11:56:29
Same, make it a WEBRTC_STUB().
aleloi
2016/08/04 12:12:36
Done.
| |
| 262 WEBRTC_CHECK_CHANNEL(channel); | 259 WEBRTC_CHECK_CHANNEL(channel); |
| 263 channels_[channel]->playout = false; | 260 channels_[channel]->playout = false; |
| 264 return 0; | 261 return 0; |
| 265 } | 262 } |
| 266 WEBRTC_STUB(StopSend, (int channel)); | 263 WEBRTC_STUB(StopSend, (int channel)); |
| 267 WEBRTC_STUB(GetVersion, (char version[1024])); | 264 WEBRTC_STUB(GetVersion, (char version[1024])); |
| 268 WEBRTC_STUB(LastError, ()); | 265 WEBRTC_STUB(LastError, ()); |
| 269 WEBRTC_FUNC(AssociateSendChannel, (int channel, | 266 WEBRTC_FUNC(AssociateSendChannel, (int channel, |
| 270 int accociate_send_channel)) { | 267 int accociate_send_channel)) { |
| 271 WEBRTC_CHECK_CHANNEL(channel); | 268 WEBRTC_CHECK_CHANNEL(channel); |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 576 bool ns_enabled_ = false; | 573 bool ns_enabled_ = false; |
| 577 bool agc_enabled_ = false; | 574 bool agc_enabled_ = false; |
| 578 bool highpass_filter_enabled_ = false; | 575 bool highpass_filter_enabled_ = false; |
| 579 bool stereo_swapping_enabled_ = false; | 576 bool stereo_swapping_enabled_ = false; |
| 580 bool typing_detection_enabled_ = false; | 577 bool typing_detection_enabled_ = false; |
| 581 webrtc::EcModes ec_mode_ = webrtc::kEcDefault; | 578 webrtc::EcModes ec_mode_ = webrtc::kEcDefault; |
| 582 webrtc::AecmModes aecm_mode_ = webrtc::kAecmSpeakerphone; | 579 webrtc::AecmModes aecm_mode_ = webrtc::kAecmSpeakerphone; |
| 583 webrtc::NsModes ns_mode_ = webrtc::kNsDefault; | 580 webrtc::NsModes ns_mode_ = webrtc::kNsDefault; |
| 584 webrtc::AgcModes agc_mode_ = webrtc::kAgcDefault; | 581 webrtc::AgcModes agc_mode_ = webrtc::kAgcDefault; |
| 585 webrtc::AgcConfig agc_config_; | 582 webrtc::AgcConfig agc_config_; |
| 586 int playout_fail_channel_ = -1; | 583 int playout_fail_channel_ = -1; |
|
the sun
2016/08/04 11:56:29
Remove me too!
aleloi
2016/08/04 12:12:35
Done.
| |
| 587 FakeAudioProcessing audio_processing_; | 584 FakeAudioProcessing audio_processing_; |
| 588 }; | 585 }; |
| 589 | 586 |
| 590 } // namespace cricket | 587 } // namespace cricket |
| 591 | 588 |
| 592 #endif // WEBRTC_MEDIA_ENGINE_FAKEWEBRTCVOICEENGINE_H_ | 589 #endif // WEBRTC_MEDIA_ENGINE_FAKEWEBRTCVOICEENGINE_H_ |
| OLD | NEW |