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

Unified Diff: webrtc/video/video_send_stream.cc

Issue 1978783002: Revert of Remove ViEEncoder::SetNetworkStatus (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@move_pacer
Patch Set: Created 4 years, 7 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/modules/congestion_controller/include/congestion_controller.h ('k') | webrtc/video/vie_encoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/video_send_stream.cc
diff --git a/webrtc/video/video_send_stream.cc b/webrtc/video/video_send_stream.cc
index f673a98a3e1797ffc297bc904d9bea47ccd12dd4..840991b4baceadf16fe026bd02915d816aa84da8 100644
--- a/webrtc/video/video_send_stream.cc
+++ b/webrtc/video/video_send_stream.cc
@@ -491,6 +491,21 @@
}
}
+void VideoSendStream::SignalNetworkState(NetworkState state) {
+ // When network goes up, enable RTCP status before setting transmission state.
+ // When it goes down, disable RTCP afterwards. This ensures that any packets
+ // sent due to the network state changed will not be dropped.
+ if (state == kNetworkUp) {
+ for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_)
+ rtp_rtcp->SetRTCPStatus(config_.rtp.rtcp_mode);
+ }
+ vie_encoder_.SetNetworkTransmissionState(state == kNetworkUp);
+ if (state == kNetworkDown) {
+ for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_)
+ rtp_rtcp->SetRTCPStatus(RtcpMode::kOff);
+ }
+}
+
bool VideoSendStream::DeliverRtcp(const uint8_t* packet, size_t length) {
for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_)
rtp_rtcp->IncomingRtcpPacket(packet, length);
@@ -764,13 +779,6 @@
return rtp_states;
}
-void VideoSendStream::SignalNetworkState(NetworkState state) {
- for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) {
- rtp_rtcp->SetRTCPStatus(state == kNetworkUp ? config_.rtp.rtcp_mode
- : RtcpMode::kOff);
- }
-}
-
int VideoSendStream::GetPaddingNeededBps() const {
return vie_encoder_.GetPaddingNeededBps();
}
« no previous file with comments | « webrtc/modules/congestion_controller/include/congestion_controller.h ('k') | webrtc/video/vie_encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698