| 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 183     return channels_[channel]->max_encoding_bandwidth; | 183     return channels_[channel]->max_encoding_bandwidth; | 
| 184   } | 184   } | 
| 185   int GetSendCNPayloadType(int channel, bool wideband) { | 185   int GetSendCNPayloadType(int channel, bool wideband) { | 
| 186     return (wideband) ? | 186     return (wideband) ? | 
| 187         channels_[channel]->cn16_type : | 187         channels_[channel]->cn16_type : | 
| 188         channels_[channel]->cn8_type; | 188         channels_[channel]->cn8_type; | 
| 189   } | 189   } | 
| 190   void set_fail_create_channel(bool fail_create_channel) { | 190   void set_fail_create_channel(bool fail_create_channel) { | 
| 191     fail_create_channel_ = fail_create_channel; | 191     fail_create_channel_ = fail_create_channel; | 
| 192   } | 192   } | 
| 193   int AddChannel(const webrtc::Config& config) { | 193   int AddChannel(const webrtc::AudioCodingModule::Config& acm_config) { | 
| 194     if (fail_create_channel_) { | 194     if (fail_create_channel_) { | 
| 195       return -1; | 195       return -1; | 
| 196     } | 196     } | 
| 197     Channel* ch = new Channel(); | 197     Channel* ch = new Channel(); | 
| 198     auto db = webrtc::acm2::RentACodec::Database(); | 198     auto db = webrtc::acm2::RentACodec::Database(); | 
| 199     ch->recv_codecs.assign(db.begin(), db.end()); | 199     ch->recv_codecs.assign(db.begin(), db.end()); | 
| 200     if (config.Get<webrtc::NetEqCapacityConfig>().enabled) { | 200     ch->neteq_capacity = acm_config.neteq_config.max_packets_in_buffer; | 
| 201       ch->neteq_capacity = config.Get<webrtc::NetEqCapacityConfig>().capacity; | 201     ch->neteq_fast_accelerate = acm_config.neteq_config.enable_fast_accelerate; | 
| 202     } |  | 
| 203     ch->neteq_fast_accelerate = |  | 
| 204         config.Get<webrtc::NetEqFastAccelerate>().enabled; |  | 
| 205     channels_[++last_channel_] = ch; | 202     channels_[++last_channel_] = ch; | 
| 206     return last_channel_; | 203     return last_channel_; | 
| 207   } | 204   } | 
| 208 | 205 | 
| 209   int GetNumSetSendCodecs() const { return num_set_send_codecs_; } | 206   int GetNumSetSendCodecs() const { return num_set_send_codecs_; } | 
| 210 | 207 | 
| 211   int GetAssociateSendChannel(int channel) { | 208   int GetAssociateSendChannel(int channel) { | 
| 212     return channels_[channel]->associate_send_channel; | 209     return channels_[channel]->associate_send_channel; | 
| 213   } | 210   } | 
| 214 | 211 | 
| (...skipping 15 matching lines...) Expand all  Loading... | 
| 230     inited_ = false; | 227     inited_ = false; | 
| 231     return 0; | 228     return 0; | 
| 232   } | 229   } | 
| 233   webrtc::AudioProcessing* audio_processing() override { | 230   webrtc::AudioProcessing* audio_processing() override { | 
| 234     return &audio_processing_; | 231     return &audio_processing_; | 
| 235   } | 232   } | 
| 236   webrtc::AudioDeviceModule* audio_device_module() override { | 233   webrtc::AudioDeviceModule* audio_device_module() override { | 
| 237     return nullptr; | 234     return nullptr; | 
| 238   } | 235   } | 
| 239   WEBRTC_FUNC(CreateChannel, ()) { | 236   WEBRTC_FUNC(CreateChannel, ()) { | 
| 240     webrtc::Config empty_config; | 237     return AddChannel(webrtc::AudioCodingModule::Config()); | 
| 241     return AddChannel(empty_config); |  | 
| 242   } | 238   } | 
| 243   WEBRTC_FUNC(CreateChannel, (const webrtc::Config& config)) { | 239   WEBRTC_FUNC(CreateChannel, | 
| 244     return AddChannel(config); | 240               (const webrtc::AudioCodingModule::Config& acm_config)) { | 
|  | 241     return AddChannel(acm_config); | 
| 245   } | 242   } | 
| 246   WEBRTC_FUNC(DeleteChannel, (int channel)) { | 243   WEBRTC_FUNC(DeleteChannel, (int channel)) { | 
| 247     WEBRTC_CHECK_CHANNEL(channel); | 244     WEBRTC_CHECK_CHANNEL(channel); | 
| 248     for (const auto& ch : channels_) { | 245     for (const auto& ch : channels_) { | 
| 249       if (ch.second->associate_send_channel == channel) { | 246       if (ch.second->associate_send_channel == channel) { | 
| 250         ch.second->associate_send_channel = -1; | 247         ch.second->associate_send_channel = -1; | 
| 251       } | 248       } | 
| 252     } | 249     } | 
| 253     delete channels_[channel]; | 250     delete channels_[channel]; | 
| 254     channels_.erase(channel); | 251     channels_.erase(channel); | 
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 576   webrtc::AecmModes aecm_mode_ = webrtc::kAecmSpeakerphone; | 573   webrtc::AecmModes aecm_mode_ = webrtc::kAecmSpeakerphone; | 
| 577   webrtc::NsModes ns_mode_ = webrtc::kNsDefault; | 574   webrtc::NsModes ns_mode_ = webrtc::kNsDefault; | 
| 578   webrtc::AgcModes agc_mode_ = webrtc::kAgcDefault; | 575   webrtc::AgcModes agc_mode_ = webrtc::kAgcDefault; | 
| 579   webrtc::AgcConfig agc_config_; | 576   webrtc::AgcConfig agc_config_; | 
| 580   FakeAudioProcessing audio_processing_; | 577   FakeAudioProcessing audio_processing_; | 
| 581 }; | 578 }; | 
| 582 | 579 | 
| 583 }  // namespace cricket | 580 }  // namespace cricket | 
| 584 | 581 | 
| 585 #endif  // WEBRTC_MEDIA_ENGINE_FAKEWEBRTCVOICEENGINE_H_ | 582 #endif  // WEBRTC_MEDIA_ENGINE_FAKEWEBRTCVOICEENGINE_H_ | 
| OLD | NEW | 
|---|