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

Unified Diff: webrtc/video/vie_encoder.cc

Issue 1932683002: Remove ViEEncoder::SetNetworkStatus (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@move_pacer
Patch Set: Created 4 years, 8 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
« webrtc/video/video_send_stream.cc ('K') | « webrtc/video/vie_encoder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/vie_encoder.cc
diff --git a/webrtc/video/vie_encoder.cc b/webrtc/video/vie_encoder.cc
index e45a64819ccb8b343c1958c0bf3c3f622f29f646..e18b9d7b9f2018f19a83f52606e56f541373cd74 100644
--- a/webrtc/video/vie_encoder.cc
+++ b/webrtc/video/vie_encoder.cc
@@ -95,7 +95,6 @@ ViEEncoder::ViEEncoder(uint32_t number_of_cores,
encoder_config_(),
min_transmit_bitrate_bps_(0),
last_observed_bitrate_bps_(0),
- network_is_transmitting_(true),
encoder_paused_(false),
encoder_paused_and_dropped_frame_(false),
time_last_intra_request_ms_(ssrcs.size(), -1),
@@ -133,13 +132,6 @@ 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() {
rtc::CritScope lock(&data_cs_);
encoder_paused_ = true;
@@ -275,14 +267,9 @@ int ViEEncoder::GetPaddingNeededBps() const {
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 (encoder_paused_) {
- return true;
- }
- if (video_suspended_ || last_observed_bitrate_bps_ == 0) {
- // Too low bitrate to send data.
- return true;
- }
- return !network_is_transmitting_;
+ // 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;
}
void ViEEncoder::TraceFrameDropStart() {
@@ -478,9 +465,9 @@ void ViEEncoder::OnReceivedIntraFrameRequest(uint32_t ssrc) {
void ViEEncoder::OnBitrateUpdated(uint32_t bitrate_bps,
uint8_t fraction_lost,
int64_t round_trip_time_ms) {
- LOG(LS_VERBOSE) << "OnBitrateUpdated, bitrate " << bitrate_bps
- << " packet loss " << static_cast<int>(fraction_lost)
- << " rtt " << round_trip_time_ms;
+ LOG(LS_INFO) << "OnBitrateUpdated, bitrate " << bitrate_bps << " packet loss "
+ << static_cast<int>(fraction_lost) << " rtt "
+ << round_trip_time_ms;
RTC_DCHECK(send_payload_router_);
video_sender_.SetChannelParameters(bitrate_bps, fraction_lost,
round_trip_time_ms);
« webrtc/video/video_send_stream.cc ('K') | « webrtc/video/vie_encoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698