Skip to content

Commit

Permalink
Update default libwebrtc fieldTrial string.
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Voityuk committed Dec 2, 2022
1 parent 036b9fd commit e545675
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion node/src/Worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export type WorkerSettings =
*
* NOTE: For advanced users only. An invalid value will make the worker crash.
* Default value is
* "WebRTC-Bwe-AlrLimitedBackoff/Enabled/".
* "WebRTC-Bwe-AlrLimitedBackoff/Enabled/WebRTC-Bwe-LossBasedBweV2/Enabled:true,CandidateFactors:1.02|1.0|0.95,DelayBasedCandidate:true,HigherBwBiasFactor:0.0002,HigherLogBwBiasFactor:0.02,ObservationDurationLowerBound:250ms,InstantUpperBoundBwBalance:75kbps,BwRampupUpperBoundFactor:1000000.0,InstantUpperBoundTemporalWeightFactor:0.9,TemporalWeightFactor:0.9,MaxIncreaseFactor:1.3,NewtonStepSize:0.75,InherentLossUpperBoundBwBalance:75kbps,LossThresholdOfHighBandwidthPreference:0.15,NotIncreaseIfInherentLossLessThanAverageLoss:true,TrendlineIntegrationEnabled:true,SendingRateSmoothingFactor:0.6/".
*/
libwebrtcFieldTrials?: string;

Expand Down
2 changes: 1 addition & 1 deletion rust/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ pub struct WorkerSettings {
///
/// NOTE: For advanced users only. An invalid value will make the worker crash.
/// Default value is
/// "WebRTC-Bwe-AlrLimitedBackoff/Enabled/".
/// "WebRTC-Bwe-AlrLimitedBackoff/Enabled/WebRTC-Bwe-LossBasedBweV2/Enabled:true,CandidateFactors:1.02|1.0|0.95,DelayBasedCandidate:true,HigherBwBiasFactor:0.0002,HigherLogBwBiasFactor:0.02,ObservationDurationLowerBound:250ms,InstantUpperBoundBwBalance:75kbps,BwRampupUpperBoundFactor:1000000.0,InstantUpperBoundTemporalWeightFactor:0.9,TemporalWeightFactor:0.9,MaxIncreaseFactor:1.3,NewtonStepSize:0.75,InherentLossUpperBoundBwBalance:75kbps,LossThresholdOfHighBandwidthPreference:0.15,NotIncreaseIfInherentLossLessThanAverageLoss:true,TrendlineIntegrationEnabled:true,SendingRateSmoothingFactor:0.6/".
#[doc(hidden)]
pub libwebrtc_field_trials: Option<String>,
/// Function that will be called under worker thread before worker starts, can be used for
Expand Down
2 changes: 1 addition & 1 deletion worker/include/Settings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Settings
uint16_t rtcMaxPort{ 59999u };
std::string dtlsCertificateFile;
std::string dtlsPrivateKeyFile;
std::string libwebrtcFieldTrials{ "WebRTC-Bwe-AlrLimitedBackoff/Enabled/" };
std::string libwebrtcFieldTrials{ "WebRTC-Bwe-AlrLimitedBackoff/Enabled/WebRTC-Bwe-LossBasedBweV2/Enabled:true,CandidateFactors:1.02|1.0|0.95,DelayBasedCandidate:true,HigherBwBiasFactor:0.0002,HigherLogBwBiasFactor:0.02,ObservationDurationLowerBound:250ms,InstantUpperBoundBwBalance:75kbps,BwRampupUpperBoundFactor:1000000.0,InstantUpperBoundTemporalWeightFactor:0.9,TemporalWeightFactor:0.9,MaxIncreaseFactor:1.3,NewtonStepSize:0.75,InherentLossUpperBoundBwBalance:75kbps,LossThresholdOfHighBandwidthPreference:0.15,NotIncreaseIfInherentLossLessThanAverageLoss:true,TrendlineIntegrationEnabled:true,SendingRateSmoothingFactor:0.6/" };
};

public:
Expand Down
16 changes: 12 additions & 4 deletions worker/src/DepLibWebRTC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,33 @@

#include "DepLibWebRTC.hpp"
#include "Logger.hpp"
#include "Settings.hpp"
#include "system_wrappers/source/field_trial.h" // webrtc::field_trial
#include <mutex>

/* Static. */

static std::once_flag globalInitOnce;
static constexpr char FieldTrials[] =
"WebRTC-Bwe-AlrLimitedBackoff/Enabled/WebRTC-Bwe-LossBasedBweV2/Enabled:true,CandidateFactors:1.02|1.0|0.95,DelayBasedCandidate:true,HigherBwBiasFactor:0.0002,HigherLogBwBiasFactor:0.02,ObservationDurationLowerBound:250ms,InstantUpperBoundBwBalance:75kbps,BwRampupUpperBoundFactor:1000000.0,InstantUpperBoundTemporalWeightFactor:0.9,TemporalWeightFactor:0.9,MaxIncreaseFactor:1.3,NewtonStepSize:0.75,InherentLossUpperBoundBwBalance:75kbps,LossThresholdOfHighBandwidthPreference:0.15,NotIncreaseIfInherentLossLessThanAverageLoss:true,TrendlineIntegrationEnabled:true,SendingRateSmoothingFactor:0.6/";

/* Static methods. */

void DepLibWebRTC::ClassInit()
{
MS_TRACE();

std::call_once(globalInitOnce, [] { webrtc::field_trial::InitFieldTrialsFromString(FieldTrials); });
MS_DEBUG_TAG(
info, "libwebrtc field trials: \"%s\"", Settings::configuration.libwebrtcFieldTrials.c_str());

std::call_once(
globalInitOnce,
[]
{
webrtc::field_trial::InitFieldTrialsFromString(
Settings::configuration.libwebrtcFieldTrials.c_str());
});
}

void DepLibWebRTC::ClassDestroy()
{
MS_TRACE();
}
}

This comment has been minimized.

Copy link
@ibc

ibc Dec 2, 2022

Member

Please configure your editor to add always a line jump at the end of the file and also remove trailing blank lines at the end of the file.

0 comments on commit e545675

Please sign in to comment.