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

Unified Diff: webrtc/media/engine/fakewebrtcvoiceengine.h

Issue 2307533004: Moving/renaming webrtc/common.h. (Closed)
Patch Set: rebase Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/config.h ('k') | webrtc/media/engine/webrtcvoiceengine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/fakewebrtcvoiceengine.h
diff --git a/webrtc/media/engine/fakewebrtcvoiceengine.h b/webrtc/media/engine/fakewebrtcvoiceengine.h
index 9b5440c17b1f5b421626987050478fd893568c85..33ea7cafc5e99d6194b7a8f6d54960ab8c11c39f 100644
--- a/webrtc/media/engine/fakewebrtcvoiceengine.h
+++ b/webrtc/media/engine/fakewebrtcvoiceengine.h
@@ -154,7 +154,7 @@ class FakeWebRtcVoiceEngine
int associate_send_channel = -1;
std::vector<webrtc::CodecInst> recv_codecs;
webrtc::CodecInst send_codec;
- int neteq_capacity = -1;
+ size_t neteq_capacity = 0;
bool neteq_fast_accelerate = false;
};
@@ -190,21 +190,6 @@ class FakeWebRtcVoiceEngine
void set_fail_create_channel(bool fail_create_channel) {
fail_create_channel_ = fail_create_channel;
}
- int AddChannel(const webrtc::Config& config) {
- if (fail_create_channel_) {
- return -1;
- }
- Channel* ch = new Channel();
- auto db = webrtc::acm2::RentACodec::Database();
- ch->recv_codecs.assign(db.begin(), db.end());
- if (config.Get<webrtc::NetEqCapacityConfig>().enabled) {
- ch->neteq_capacity = config.Get<webrtc::NetEqCapacityConfig>().capacity;
- }
- ch->neteq_fast_accelerate =
- config.Get<webrtc::NetEqFastAccelerate>().enabled;
- channels_[++last_channel_] = ch;
- return last_channel_;
- }
int GetNumSetSendCodecs() const { return num_set_send_codecs_; }
@@ -237,11 +222,20 @@ class FakeWebRtcVoiceEngine
return nullptr;
}
WEBRTC_FUNC(CreateChannel, ()) {
- webrtc::Config empty_config;
- return AddChannel(empty_config);
+ return CreateChannel(webrtc::VoEBase::ChannelConfig());
}
- WEBRTC_FUNC(CreateChannel, (const webrtc::Config& config)) {
- return AddChannel(config);
+ WEBRTC_FUNC(CreateChannel, (const webrtc::VoEBase::ChannelConfig& config)) {
+ if (fail_create_channel_) {
+ return -1;
+ }
+ Channel* ch = new Channel();
+ auto db = webrtc::acm2::RentACodec::Database();
+ ch->recv_codecs.assign(db.begin(), db.end());
+ ch->neteq_capacity = config.acm_config.neteq_config.max_packets_in_buffer;
+ ch->neteq_fast_accelerate =
+ config.acm_config.neteq_config.enable_fast_accelerate;
+ channels_[++last_channel_] = ch;
+ return last_channel_;
}
WEBRTC_FUNC(DeleteChannel, (int channel)) {
WEBRTC_CHECK_CHANNEL(channel);
@@ -547,7 +541,7 @@ class FakeWebRtcVoiceEngine
void EnableStereoChannelSwapping(bool enable) override {
stereo_swapping_enabled_ = enable;
}
- int GetNetEqCapacity() const {
+ size_t GetNetEqCapacity() const {
auto ch = channels_.find(last_channel_);
ASSERT(ch != channels_.end());
return ch->second->neteq_capacity;
« no previous file with comments | « webrtc/config.h ('k') | webrtc/media/engine/webrtcvoiceengine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698