Field trials for DSCP
Add a field trial "WebRTC-DscpFieldTrial" that allows user to set any int value to be used as tagging. This tag value will be used for all packets on the PeerConnection, whether they are audio, video, data or ICE e.g WebRTC-DscpFieldTrial/override_dscp:40/ see https://webrtc.googlesource.com/src/+/b477fc73cfd2f4c09bb9c416b170ba4b566cecaf/rtc_base/dscp.h for names of popular ints. Bug: webrtc:13622 Change-Id: Iedbedd0f918100259678eb5bc083c9bf89b343b1 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249786 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Jonas Oreland <jonaso@webrtc.org> Cr-Commit-Position: refs/heads/main@{#35848}
This commit is contained in:
parent
9a99905301
commit
dda828f707
@ -775,6 +775,16 @@ void P2PTransportChannel::SetIceConfig(const IceConfig& config) {
|
||||
|
||||
ice_controller_->SetIceConfig(config_);
|
||||
|
||||
// DSCP override, allow user to specify (any) int value
|
||||
// that will be used for tagging all packets.
|
||||
webrtc::StructParametersParser::Create("override_dscp",
|
||||
&field_trials_.override_dscp)
|
||||
->Parse(webrtc::field_trial::FindFullName("WebRTC-DscpFieldTrial"));
|
||||
|
||||
if (field_trials_.override_dscp) {
|
||||
SetOption(rtc::Socket::OPT_DSCP, *field_trials_.override_dscp);
|
||||
}
|
||||
|
||||
RTC_DCHECK(ValidateIceConfig(config_).ok());
|
||||
}
|
||||
|
||||
@ -1529,6 +1539,10 @@ void P2PTransportChannel::RememberRemoteCandidate(
|
||||
// port objects.
|
||||
int P2PTransportChannel::SetOption(rtc::Socket::Option opt, int value) {
|
||||
RTC_DCHECK_RUN_ON(network_thread_);
|
||||
if (field_trials_.override_dscp && opt == rtc::Socket::OPT_DSCP) {
|
||||
value = *field_trials_.override_dscp;
|
||||
}
|
||||
|
||||
OptionMap::iterator it = options_.find(opt);
|
||||
if (it == options_.end()) {
|
||||
options_.insert(std::make_pair(opt, value));
|
||||
|
||||
@ -61,6 +61,9 @@ struct IceFieldTrials {
|
||||
|
||||
// Stop gathering when having a strong connection.
|
||||
bool stop_gather_on_strongly_connected = true;
|
||||
|
||||
// DSCP taging.
|
||||
absl::optional<int> override_dscp;
|
||||
};
|
||||
|
||||
} // namespace cricket
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user