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:
@ -396,6 +396,7 @@ void Call::SignalNetworkState(NetworkState state) {
|
|||||||
// to guarantee a consistent state across streams.
|
// to guarantee a consistent state across streams.
|
||||||
rtc::CritScope lock(&network_enabled_crit_);
|
rtc::CritScope lock(&network_enabled_crit_);
|
||||||
network_enabled_ = state == kNetworkUp;
|
network_enabled_ = state == kNetworkUp;
|
||||||
|
channel_group_->SignalNetworkState(state);
|
||||||
{
|
{
|
||||||
ReadLockScoped write_lock(*send_crit_);
|
ReadLockScoped write_lock(*send_crit_);
|
||||||
for (auto& kv : video_send_ssrcs_) {
|
for (auto& kv : video_send_ssrcs_) {
|
||||||
|
@ -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,
|
void ChannelGroup::OnNetworkChanged(uint32_t target_bitrate_bps,
|
||||||
uint8_t fraction_loss,
|
uint8_t fraction_loss,
|
||||||
int64_t rtt) {
|
int64_t rtt) {
|
||||||
|
@ -69,6 +69,8 @@ class ChannelGroup : public BitrateObserver {
|
|||||||
|
|
||||||
void SetChannelRembStatus(bool sender, bool receiver, ViEChannel* channel);
|
void SetChannelRembStatus(bool sender, bool receiver, ViEChannel* channel);
|
||||||
|
|
||||||
|
void SignalNetworkState(NetworkState state);
|
||||||
|
|
||||||
BitrateController* GetBitrateController() const;
|
BitrateController* GetBitrateController() const;
|
||||||
CallStats* GetCallStats() const;
|
CallStats* GetCallStats() const;
|
||||||
RemoteBitrateEstimator* GetRemoteBitrateEstimator() const;
|
RemoteBitrateEstimator* GetRemoteBitrateEstimator() const;
|
||||||
|
@ -185,11 +185,6 @@ void ViEEncoder::SetNetworkTransmissionState(bool is_transmitting) {
|
|||||||
CriticalSectionScoped cs(data_cs_.get());
|
CriticalSectionScoped cs(data_cs_.get());
|
||||||
network_is_transmitting_ = is_transmitting;
|
network_is_transmitting_ = is_transmitting;
|
||||||
}
|
}
|
||||||
if (is_transmitting) {
|
|
||||||
pacer_->Resume();
|
|
||||||
} else {
|
|
||||||
pacer_->Pause();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViEEncoder::Pause() {
|
void ViEEncoder::Pause() {
|
||||||
|
Reference in New Issue
Block a user