| Index: webrtc/video/video_send_stream.cc
|
| diff --git a/webrtc/video/video_send_stream.cc b/webrtc/video/video_send_stream.cc
|
| index 40871af1211d7c5d94c73eea4f9fdf7cdd701995..cecc7e9b399645d511ec14c27c0977b5cdd18839 100644
|
| --- a/webrtc/video/video_send_stream.cc
|
| +++ b/webrtc/video/video_send_stream.cc
|
| @@ -491,8 +491,25 @@ VideoSendStream::~VideoSendStream() {
|
| }
|
| }
|
|
|
| -VideoCaptureInput* VideoSendStream::Input() {
|
| - return &input_;
|
| +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);
|
| + return true;
|
| }
|
|
|
| void VideoSendStream::Start() {
|
| @@ -514,6 +531,10 @@ void VideoSendStream::Stop() {
|
| payload_router_.set_active(false);
|
| }
|
|
|
| +VideoCaptureInput* VideoSendStream::Input() {
|
| + return &input_;
|
| +}
|
| +
|
| bool VideoSendStream::EncoderThreadFunction(void* obj) {
|
| static_cast<VideoSendStream*>(obj)->EncoderProcess();
|
| // We're done, return false to abort.
|
| @@ -580,12 +601,6 @@ void VideoSendStream::ReconfigureVideoEncoder(
|
| encoder_wakeup_event_.Set();
|
| }
|
|
|
| -bool VideoSendStream::DeliverRtcp(const uint8_t* packet, size_t length) {
|
| - for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_)
|
| - rtp_rtcp->IncomingRtcpPacket(packet, length);
|
| - return true;
|
| -}
|
| -
|
| VideoSendStream::Stats VideoSendStream::GetStats() {
|
| return stats_proxy_.GetStats();
|
| }
|
| @@ -714,21 +729,6 @@ std::map<uint32_t, RtpState> VideoSendStream::GetRtpStates() const {
|
| return rtp_states;
|
| }
|
|
|
| -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);
|
| - }
|
| -}
|
| -
|
| int VideoSendStream::GetPaddingNeededBps() const {
|
| return vie_encoder_.GetPaddingNeededBps();
|
| }
|
|
|