Revert "Add ability to emulate degraded network in Call via field trial"

This reverts commit 31a12c557dcd84a31f9c3f2d8858d9646c2a3135.

Reason for revert: Breaks downstream project.

Original change's description:
> Add ability to emulate degraded network in Call via field trial
> 
> This is especially useful in Chrome, allowing use to emulate network
> conditions in incoming or outgoing media without the need for platform
> specific tools or hacks. It also doesn't interfere with the rest of the
> network traffic.
> 
> Also includes some refactorings.
> 
> Bug: webrtc:8910
> Change-Id: I2656a2d4218acbe7f8ffd669de19a02275735438
> Reviewed-on: https://webrtc-review.googlesource.com/33013
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22418}

TBR=sprang@webrtc.org,stefan@webrtc.org,philipel@webrtc.org

Change-Id: I22bda6da01c2ff5abd6f408c5ee9e4fba21294f2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8910
Reviewed-on: https://webrtc-review.googlesource.com/61700
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22419}
This commit is contained in:
Ilya Nikolaevskiy
2018-03-14 10:51:50 +00:00
committed by Commit Bot
parent 31a12c557d
commit 16cba5c18d
13 changed files with 482 additions and 1130 deletions

View File

@ -292,24 +292,19 @@ class Call : public webrtc::Call,
// single mapping from ssrc to a more abstract receive stream, with
// accessor methods for all configuration we need at this level.
struct ReceiveRtpConfig {
explicit ReceiveRtpConfig(const webrtc::AudioReceiveStream::Config& config)
: extensions(config.rtp.extensions),
use_send_side_bwe(UseSendSideBwe(config)) {}
explicit ReceiveRtpConfig(const webrtc::VideoReceiveStream::Config& config)
: extensions(config.rtp.extensions),
use_send_side_bwe(UseSendSideBwe(config)) {}
explicit ReceiveRtpConfig(const FlexfecReceiveStream::Config& config)
: extensions(config.rtp_header_extensions),
use_send_side_bwe(UseSendSideBwe(config)) {}
ReceiveRtpConfig() = default; // Needed by std::map
ReceiveRtpConfig(const std::vector<RtpExtension>& extensions,
bool use_send_side_bwe)
: extensions(extensions), use_send_side_bwe(use_send_side_bwe) {}
// Registered RTP header extensions for each stream. Note that RTP header
// extensions are negotiated per track ("m= line") in the SDP, but we have
// no notion of tracks at the Call level. We therefore store the RTP header
// extensions per SSRC instead, which leads to some storage overhead.
const RtpHeaderExtensionMap extensions;
RtpHeaderExtensionMap extensions;
// Set if both RTP extension the RTCP feedback message needed for
// send side BWE are negotiated.
const bool use_send_side_bwe;
bool use_send_side_bwe = false;
};
std::map<uint32_t, ReceiveRtpConfig> receive_rtp_config_
RTC_GUARDED_BY(receive_crit_);
@ -646,7 +641,8 @@ webrtc::AudioReceiveStream* Call::CreateAudioReceiveStream(
module_process_thread_.get(), config, config_.audio_state, event_log_);
{
WriteLockScoped write_lock(*receive_crit_);
receive_rtp_config_.emplace(config.rtp.remote_ssrc, config);
receive_rtp_config_[config.rtp.remote_ssrc] =
ReceiveRtpConfig(config.rtp.extensions, UseSendSideBwe(config));
audio_receive_streams_.insert(receive_stream);
ConfigureSync(config.sync_group);
@ -795,6 +791,8 @@ webrtc::VideoReceiveStream* Call::CreateVideoReceiveStream(
module_process_thread_.get(), call_stats_.get());
const webrtc::VideoReceiveStream::Config& config = receive_stream->config();
ReceiveRtpConfig receive_config(config.rtp.extensions,
UseSendSideBwe(config));
{
WriteLockScoped write_lock(*receive_crit_);
if (config.rtp.rtx_ssrc) {
@ -802,9 +800,9 @@ webrtc::VideoReceiveStream* Call::CreateVideoReceiveStream(
// stream. Since the transport_send_cc negotiation is per payload
// type, we may get an incorrect value for the rtx stream, but
// that is unlikely to matter in practice.
receive_rtp_config_.emplace(config.rtp.rtx_ssrc, config);
receive_rtp_config_[config.rtp.rtx_ssrc] = receive_config;
}
receive_rtp_config_.emplace(config.rtp.remote_ssrc, config);
receive_rtp_config_[config.rtp.remote_ssrc] = receive_config;
video_receive_streams_.insert(receive_stream);
ConfigureSync(config.sync_group);
}
@ -867,7 +865,8 @@ FlexfecReceiveStream* Call::CreateFlexfecReceiveStream(
RTC_DCHECK(receive_rtp_config_.find(config.remote_ssrc) ==
receive_rtp_config_.end());
receive_rtp_config_.emplace(config.remote_ssrc, config);
receive_rtp_config_[config.remote_ssrc] =
ReceiveRtpConfig(config.rtp_header_extensions, UseSendSideBwe(config));
}
// TODO(brandtr): Store config in RtcEventLog here.
@ -1313,7 +1312,7 @@ void Call::OnRecoveredPacket(const uint8_t* packet, size_t length) {
// deregistering in the |receive_rtp_config_| map is protected by that lock.
// So by not passing the packet on to demuxing in this case, we prevent
// incoming packets to be passed on via the demuxer to a receive stream
// which is being torn down.
// which is being torned down.
return;
}
parsed_packet.IdentifyExtensions(it->second.extensions);