| Index: webrtc/video/vie_encoder.cc
|
| diff --git a/webrtc/video/vie_encoder.cc b/webrtc/video/vie_encoder.cc
|
| index 256e09365234fe3194cc660fb50e96b4e839ec66..e2ac52126ed40ec9a38951650a5383704fc32696 100644
|
| --- a/webrtc/video/vie_encoder.cc
|
| +++ b/webrtc/video/vie_encoder.cc
|
| @@ -63,6 +63,7 @@
|
| encoder_config_(),
|
| min_transmit_bitrate_bps_(0),
|
| last_observed_bitrate_bps_(0),
|
| + network_is_transmitting_(true),
|
| encoder_paused_(true),
|
| encoder_paused_and_dropped_frame_(false),
|
| module_process_thread_(module_process_thread),
|
| @@ -84,6 +85,13 @@
|
|
|
| ViEEncoder::~ViEEncoder() {
|
| module_process_thread_->DeRegisterModule(&video_sender_);
|
| +}
|
| +
|
| +void ViEEncoder::SetNetworkTransmissionState(bool is_transmitting) {
|
| + {
|
| + rtc::CritScope lock(&data_cs_);
|
| + network_is_transmitting_ = is_transmitting;
|
| + }
|
| }
|
|
|
| void ViEEncoder::Pause() {
|
| @@ -214,9 +222,13 @@
|
| bool ViEEncoder::EncoderPaused() const {
|
| // Pause video if paused by caller or as long as the network is down or the
|
| // pacer queue has grown too large in buffered mode.
|
| - // If the pacer queue has grown to large or the network is down,
|
| - // last_observed_bitrate_bps_ will be 0.
|
| - return encoder_paused_ || video_suspended_ || last_observed_bitrate_bps_ == 0;
|
| + if (encoder_paused_) {
|
| + return true;
|
| + }
|
| + if (video_suspended_ || last_observed_bitrate_bps_ == 0) {
|
| + return true;
|
| + }
|
| + return !network_is_transmitting_;
|
| }
|
|
|
| void ViEEncoder::TraceFrameDropStart() {
|
|
|