Pause/resume pacer from Call instead of via SendStreams.

BUG=webrtc:5073

Review URL: https://codereview.webrtc.org/1398443007

Cr-Commit-Position: refs/heads/master@{#10271}
This commit is contained in:
stefan
2015-10-14 03:12:59 -07:00
committed by Commit bot
parent b79472a4fb
commit 457a61db61
4 changed files with 11 additions and 5 deletions

View File

@ -396,6 +396,7 @@ void Call::SignalNetworkState(NetworkState state) {
// to guarantee a consistent state across streams.
rtc::CritScope lock(&network_enabled_crit_);
network_enabled_ = state == kNetworkUp;
channel_group_->SignalNetworkState(state);
{
ReadLockScoped write_lock(*send_crit_);
for (auto& kv : video_send_ssrcs_) {

View File

@ -422,6 +422,14 @@ void ChannelGroup::SetChannelRembStatus(bool sender,
}
}
void ChannelGroup::SignalNetworkState(NetworkState state) {
if (state == kNetworkUp) {
pacer_->Resume();
} else {
pacer_->Pause();
}
}
void ChannelGroup::OnNetworkChanged(uint32_t target_bitrate_bps,
uint8_t fraction_loss,
int64_t rtt) {

View File

@ -69,6 +69,8 @@ class ChannelGroup : public BitrateObserver {
void SetChannelRembStatus(bool sender, bool receiver, ViEChannel* channel);
void SignalNetworkState(NetworkState state);
BitrateController* GetBitrateController() const;
CallStats* GetCallStats() const;
RemoteBitrateEstimator* GetRemoteBitrateEstimator() const;

View File

@ -185,11 +185,6 @@ void ViEEncoder::SetNetworkTransmissionState(bool is_transmitting) {
CriticalSectionScoped cs(data_cs_.get());
network_is_transmitting_ = is_transmitting;
}
if (is_transmitting) {
pacer_->Resume();
} else {
pacer_->Pause();
}
}
void ViEEncoder::Pause() {