commit dda8d22fef1fb40e8bc7ccf7d246a2a8508b5833
parent 1cc4d7dd41f73511f6737e2379e7c8287c3bbf4b
Author: Michael Froman <mfroman@mozilla.com>
Date: Wed, 8 Oct 2025 21:44:02 -0500
Bug 1993083 - Vendor libwebrtc from 5320b43d32
Upstream commit: https://webrtc.googlesource.com/src/+/5320b43d326961c636d124fa8c695c762e58a83e
Use FieldTrialsView::IsEnabled/IsDisabled helper
Instead of re-implementing those small helpers.
Bug: None
Change-Id: I31761101283da305b453fbd63332bd521400a5e8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/398781
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45082}
Diffstat:
13 files changed, 43 insertions(+), 77 deletions(-)
diff --git a/third_party/libwebrtc/README.mozilla.last-vendor b/third_party/libwebrtc/README.mozilla.last-vendor
@@ -1,4 +1,4 @@
# ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc
-libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-09T02:42:45.208021+00:00.
+libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-09T02:43:53.116907+00:00.
# base of lastest vendoring
-9688ced75a
+5320b43d32
diff --git a/third_party/libwebrtc/call/rtp_payload_params.cc b/third_party/libwebrtc/call/rtp_payload_params.cc
@@ -18,7 +18,6 @@
#include <optional>
#include "absl/container/inlined_vector.h"
-#include "absl/strings/match.h"
#include "api/field_trials_view.h"
#include "api/transport/rtp/dependency_descriptor.h"
#include "api/video/encoded_image.h"
@@ -186,11 +185,9 @@ RtpPayloadParams::RtpPayloadParams(const uint32_t ssrc,
const FieldTrialsView& trials)
: ssrc_(ssrc),
generic_picture_id_experiment_(
- absl::StartsWith(trials.Lookup("WebRTC-GenericPictureId"),
- "Enabled")),
- simulate_generic_structure_(absl::StartsWith(
- trials.Lookup("WebRTC-GenericCodecDependencyDescriptor"),
- "Enabled")) {
+ trials.IsEnabled("WebRTC-GenericPictureId")),
+ simulate_generic_structure_(
+ trials.IsEnabled("WebRTC-GenericCodecDependencyDescriptor")) {
for (auto& spatial_layer : last_frame_id_)
spatial_layer.fill(-1);
diff --git a/third_party/libwebrtc/call/rtp_video_sender.cc b/third_party/libwebrtc/call/rtp_video_sender.cc
@@ -23,7 +23,6 @@
#include "absl/algorithm/container.h"
#include "absl/base/nullability.h"
-#include "absl/strings/match.h"
#include "absl/strings/string_view.h"
#include "api/array_view.h"
#include "api/call/bitrate_allocation.h"
@@ -103,7 +102,7 @@ bool PayloadTypeSupportsSkippingFecPackets(absl::string_view payload_name,
return true;
}
if (codecType == kVideoCodecGeneric &&
- absl::StartsWith(trials.Lookup("WebRTC-GenericPictureId"), "Enabled")) {
+ trials.IsEnabled("WebRTC-GenericPictureId")) {
return true;
}
return false;
@@ -123,8 +122,7 @@ bool ShouldDisableRedAndUlpfec(bool flexfec_enabled,
bool should_disable_red_and_ulpfec = false;
- if (absl::StartsWith(trials.Lookup("WebRTC-DisableUlpFecExperiment"),
- "Enabled")) {
+ if (trials.IsEnabled("WebRTC-DisableUlpFecExperiment")) {
RTC_LOG(LS_INFO) << "Experiment to disable sending ULPFEC is enabled.";
should_disable_red_and_ulpfec = true;
}
@@ -406,9 +404,8 @@ RtpVideoSender::RtpVideoSender(
const CryptoOptions& crypto_options,
scoped_refptr<FrameTransformerInterface> frame_transformer)
: env_(env),
- use_frame_rate_for_overhead_(absl::StartsWith(
- env.field_trials().Lookup("WebRTC-Video-UseFrameRateForOverhead"),
- "Enabled")),
+ use_frame_rate_for_overhead_(
+ env.field_trials().IsEnabled("WebRTC-Video-UseFrameRateForOverhead")),
has_packet_feedback_(TransportSeqNumExtensionConfigured(rtp_config)),
transport_queue_(*transport_queue),
active_(false),
diff --git a/third_party/libwebrtc/media/engine/webrtc_media_engine.cc b/third_party/libwebrtc/media/engine/webrtc_media_engine.cc
@@ -16,7 +16,6 @@
#include <vector>
#include "absl/algorithm/container.h"
-#include "absl/strings/match.h"
#include "absl/strings/string_view.h"
#include "api/array_view.h"
#include "api/field_trials_view.h"
@@ -144,8 +143,7 @@ std::vector<RtpExtension> FilterRtpExtensions(
result.erase(it, result.end());
// Keep just the highest priority extension of any in the following lists.
- if (absl::StartsWith(trials.Lookup("WebRTC-FilterAbsSendTimeExtension"),
- "Enabled")) {
+ if (trials.IsEnabled("WebRTC-FilterAbsSendTimeExtension")) {
static const char* const kBweExtensionPriorities[] = {
RtpExtension::kTransportSequenceNumberUri,
RtpExtension::kAbsSendTimeUri, RtpExtension::kTimestampOffsetUri};
diff --git a/third_party/libwebrtc/media/engine/webrtc_video_engine.cc b/third_party/libwebrtc/media/engine/webrtc_video_engine.cc
@@ -128,14 +128,6 @@ const char* StreamTypeToString(VideoSendStream::StreamStats::StreamType type) {
return nullptr;
}
-bool IsEnabled(const FieldTrialsView& trials, absl::string_view name) {
- return absl::StartsWith(trials.Lookup(name), "Enabled");
-}
-
-bool IsDisabled(const FieldTrialsView& trials, absl::string_view name) {
- return absl::StartsWith(trials.Lookup(name), "Disabled");
-}
-
void AddDefaultFeedbackParams(Codec* codec, const FieldTrialsView& trials) {
// Don't add any feedback params for RED and ULPFEC.
if (codec->name == kRedCodecName || codec->name == kUlpfecCodecName)
@@ -150,7 +142,7 @@ void AddDefaultFeedbackParams(Codec* codec, const FieldTrialsView& trials) {
codec->AddFeedbackParam(FeedbackParam(kRtcpFbParamNack, kParamValueEmpty));
codec->AddFeedbackParam(FeedbackParam(kRtcpFbParamNack, kRtcpFbNackParamPli));
if (codec->name == kVp8CodecName &&
- IsEnabled(trials, "WebRTC-RtcpLossNotification")) {
+ trials.IsEnabled("WebRTC-RtcpLossNotification")) {
codec->AddFeedbackParam(FeedbackParam(kRtcpFbParamLntf, kParamValueEmpty));
}
}
@@ -182,7 +174,7 @@ std::vector<SdpVideoFormat> GetDefaultSupportedFormats(
supported_formats.push_back(SdpVideoFormat(kUlpfecCodecName));
// flexfec-03 is always supported as receive codec and as send codec
// only if WebRTC-FlexFEC-03-Advertised is enabled
- if (is_decoder_factory || IsEnabled(trials, "WebRTC-FlexFEC-03-Advertised")) {
+ if (is_decoder_factory || trials.IsEnabled("WebRTC-FlexFEC-03-Advertised")) {
SdpVideoFormat flexfec_format(kFlexfecCodecName);
// This value is currently arbitrarily set to 10 seconds. (The unit
// is microseconds.) This parameter MUST be present in the SDP, but
@@ -886,22 +878,21 @@ WebRtcVideoEngine::GetRtpHeaderExtensions() const {
result.emplace_back(uri, id, RtpTransceiverDirection::kStopped);
}
result.emplace_back(RtpExtension::kGenericFrameDescriptorUri00, id,
- IsEnabled(trials_, "WebRTC-GenericDescriptorAdvertised")
+ trials_.IsEnabled("WebRTC-GenericDescriptorAdvertised")
+ ? RtpTransceiverDirection::kSendRecv
+ : RtpTransceiverDirection::kStopped);
+ result.emplace_back(RtpExtension::kDependencyDescriptorUri, id,
+ trials_.IsEnabled("WebRTC-DependencyDescriptorAdvertised")
? RtpTransceiverDirection::kSendRecv
: RtpTransceiverDirection::kStopped);
- result.emplace_back(
- RtpExtension::kDependencyDescriptorUri, id,
- IsEnabled(trials_, "WebRTC-DependencyDescriptorAdvertised")
- ? RtpTransceiverDirection::kSendRecv
- : RtpTransceiverDirection::kStopped);
result.emplace_back(
RtpExtension::kVideoLayersAllocationUri, id,
- IsEnabled(trials_, "WebRTC-VideoLayersAllocationAdvertised")
+ trials_.IsEnabled("WebRTC-VideoLayersAllocationAdvertised")
? RtpTransceiverDirection::kSendRecv
: RtpTransceiverDirection::kStopped);
// VideoFrameTrackingId is a test-only extension.
- if (IsEnabled(trials_, "WebRTC-VideoFrameTrackingIdAdvertised")) {
+ if (trials_.IsEnabled("WebRTC-VideoFrameTrackingIdAdvertised")) {
result.emplace_back(RtpExtension::kVideoFrameTrackingIdUri, id,
RtpTransceiverDirection::kSendRecv);
}
@@ -935,9 +926,8 @@ WebRtcVideoSendChannel::WebRtcVideoSendChannel(
default_send_options_(options),
last_send_stats_log_ms_(-1),
last_receive_stats_log_ms_(-1),
- discard_unknown_ssrc_packets_(
- IsEnabled(call_->trials(),
- "WebRTC-Video-DiscardPacketsWithUnknownSsrc")),
+ discard_unknown_ssrc_packets_(call_->trials().IsEnabled(
+ "WebRTC-Video-DiscardPacketsWithUnknownSsrc")),
crypto_options_(crypto_options) {
RTC_DCHECK_RUN_ON(&thread_checker_);
rtcp_receiver_report_ssrc_ = kDefaultRtcpReceiverReportSsrc;
@@ -1020,7 +1010,7 @@ WebRtcVideoSendChannel::WebRtcVideoSendStream::ConfigureVideoEncoderSettings(
// TODO(webrtc:329396373): Remove after flexible mode is fully deployed.
vp9_settings.flexibleMode =
- !IsDisabled(call_->trials(), "WebRTC-Video-Vp9FlexibleMode");
+ !call_->trials().IsDisabled("WebRTC-Video-Vp9FlexibleMode");
} else {
// Multiple spatial layers vp9 screenshare needs flexible mode.
vp9_settings.flexibleMode = vp9_settings.numberOfSpatialLayers > 1;
@@ -1104,7 +1094,7 @@ bool WebRtcVideoSendChannel::GetChangedSenderParameters(
}
// Never enable sending FlexFEC, unless we are in the experiment.
- if (!IsEnabled(call_->trials(), "WebRTC-FlexFEC-03")) {
+ if (!call_->trials().IsEnabled("WebRTC-FlexFEC-03")) {
for (VideoCodecSettings& codec : negotiated_codecs)
codec.flexfec_payload_type = -1;
}
@@ -1807,7 +1797,7 @@ WebRtcVideoSendChannel::WebRtcVideoSendStream::WebRtcVideoSendStream(
rtp_parameters_(CreateRtpParametersWithEncodings(sp)),
sending_(false),
disable_automatic_resize_(
- IsEnabled(call->trials(), "WebRTC-Video-DisableAutomaticResize")) {
+ call->trials().IsEnabled("WebRTC-Video-DisableAutomaticResize")) {
// Maximum packet size may come in RtpConfig from external transport, for
// example from QuicTransportInterface implementation, so do not exceed
// given max_packet_size.
@@ -1828,7 +1818,7 @@ WebRtcVideoSendChannel::WebRtcVideoSendStream::WebRtcVideoSendStream(
// FlexFEC SSRCs.
// TODO(brandtr): This code needs to be generalized when we add support for
// multistream protection.
- if (IsEnabled(call_->trials(), "WebRTC-FlexFEC-03")) {
+ if (call_->trials().IsEnabled("WebRTC-FlexFEC-03")) {
uint32_t flexfec_ssrc;
bool flexfec_enabled = false;
for (uint32_t primary_ssrc : parameters_.config.rtp.ssrcs) {
@@ -1941,7 +1931,7 @@ WebRtcVideoSendChannel::WebRtcVideoSendStream::GetDegradationPreference()
parameters_.options.content_hint ==
VideoTrackInterface::ContentHint::kText) {
degradation_preference = DegradationPreference::MAINTAIN_RESOLUTION;
- } else if (IsEnabled(call_->trials(), "WebRTC-Video-BalancedDegradation")) {
+ } else if (call_->trials().IsEnabled("WebRTC-Video-BalancedDegradation")) {
// Standard wants balanced by default, but it needs to be tuned first.
degradation_preference = DegradationPreference::BALANCED;
} else {
@@ -2745,9 +2735,8 @@ WebRtcVideoReceiveChannel::WebRtcVideoReceiveChannel(
decoder_factory_(decoder_factory),
default_send_options_(options),
last_receive_stats_log_ms_(-1),
- discard_unknown_ssrc_packets_(
- IsEnabled(call_->trials(),
- "WebRTC-Video-DiscardPacketsWithUnknownSsrc")),
+ discard_unknown_ssrc_packets_(call_->trials().IsEnabled(
+ "WebRTC-Video-DiscardPacketsWithUnknownSsrc")),
crypto_options_(crypto_options),
receive_buffer_size_(ParseReceiveBufferSize(call_->trials())) {
RTC_DCHECK_RUN_ON(&thread_checker_);
@@ -3076,7 +3065,7 @@ void WebRtcVideoReceiveChannel::ConfigureReceiverRtp(
// TODO(brandtr): Generalize when we add support for multistream protection.
flexfec_config->payload_type = recv_flexfec_payload_type_;
- if (!IsDisabled(call_->trials(), "WebRTC-FlexFEC-03-Advertised") &&
+ if (!call_->trials().IsDisabled("WebRTC-FlexFEC-03-Advertised") &&
sp.GetFecFrSsrc(ssrc, &flexfec_config->rtp.remote_ssrc)) {
flexfec_config->protected_media_ssrcs = {ssrc};
flexfec_config->rtp.local_ssrc = config->rtp.local_ssrc;
diff --git a/third_party/libwebrtc/modules/congestion_controller/goog_cc/probe_controller.cc b/third_party/libwebrtc/modules/congestion_controller/goog_cc/probe_controller.cc
@@ -17,7 +17,6 @@
#include <optional>
#include <vector>
-#include "absl/strings/match.h"
#include "api/field_trials_view.h"
#include "api/rtc_event_log/rtc_event_log.h"
#include "api/transport/network_types.h"
@@ -173,9 +172,8 @@ ProbeController::ProbeController(const FieldTrialsView* key_value_config,
RtcEventLog* event_log)
: network_available_(false),
enable_periodic_alr_probing_(false),
- in_rapid_recovery_experiment_(absl::StartsWith(
- key_value_config->Lookup(kBweRapidRecoveryExperiment),
- "Enabled")),
+ in_rapid_recovery_experiment_(
+ key_value_config->IsEnabled(kBweRapidRecoveryExperiment)),
event_log_(event_log),
config_(ProbeControllerConfig(key_value_config)) {
Reset(Timestamp::Zero());
diff --git a/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender_video.cc b/third_party/libwebrtc/modules/rtp_rtcp/source/rtp_sender_video.cc
@@ -22,7 +22,6 @@
#include "absl/algorithm/container.h"
#include "absl/memory/memory.h"
-#include "absl/strings/match.h"
#include "api/array_view.h"
#include "api/crypto/frame_encryptor_interface.h"
#include "api/field_trials_view.h"
@@ -179,9 +178,8 @@ RTPSenderVideo::RTPSenderVideo(const Config& config)
post_encode_overhead_bitrate_(/*max_window_size=*/TimeDelta::Seconds(1)),
frame_encryptor_(config.frame_encryptor),
require_frame_encryption_(config.require_frame_encryption),
- generic_descriptor_auth_experiment_(!absl::StartsWith(
- config.field_trials->Lookup("WebRTC-GenericDescriptorAuth"),
- "Disabled")),
+ generic_descriptor_auth_experiment_(
+ !config.field_trials->IsDisabled("WebRTC-GenericDescriptorAuth")),
absolute_capture_time_sender_(config.clock),
frame_transformer_delegate_(
config.frame_transformer
diff --git a/third_party/libwebrtc/moz-patch-stack/s0072.patch b/third_party/libwebrtc/moz-patch-stack/s0072.patch
@@ -45,10 +45,10 @@ index 80c1c84043..2c900dde28 100644
return flexfec_ssrc_;
}
diff --git a/modules/rtp_rtcp/source/rtp_sender_video.cc b/modules/rtp_rtcp/source/rtp_sender_video.cc
-index 8503b0db75..d19bb9d3ae 100644
+index 6bcd8747f5..fb9fb807ea 100644
--- a/modules/rtp_rtcp/source/rtp_sender_video.cc
+++ b/modules/rtp_rtcp/source/rtp_sender_video.cc
-@@ -189,6 +189,7 @@ RTPSenderVideo::RTPSenderVideo(const Config& config)
+@@ -187,6 +187,7 @@ RTPSenderVideo::RTPSenderVideo(const Config& config)
this,
config.frame_transformer,
rtp_sender_->SSRC(),
diff --git a/third_party/libwebrtc/moz-patch-stack/s0082.patch b/third_party/libwebrtc/moz-patch-stack/s0082.patch
@@ -19,10 +19,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/d92a578327f524ec3
5 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/call/rtp_video_sender.cc b/call/rtp_video_sender.cc
-index 06ce7b36ec..ba2cbec498 100644
+index 282fba85c2..10b145945e 100644
--- a/call/rtp_video_sender.cc
+++ b/call/rtp_video_sender.cc
-@@ -537,6 +537,7 @@ void RtpVideoSender::SetModuleIsActive(bool sending,
+@@ -534,6 +534,7 @@ void RtpVideoSender::SetModuleIsActive(bool sending,
return;
}
diff --git a/third_party/libwebrtc/pc/peer_connection_factory.cc b/third_party/libwebrtc/pc/peer_connection_factory.cc
@@ -18,7 +18,6 @@
#include <utility>
#include <vector>
-#include "absl/strings/match.h"
#include "absl/strings/string_view.h"
#include "api/audio_options.h"
#include "api/environment/environment.h"
@@ -400,7 +399,8 @@ std::unique_ptr<Call> PeerConnectionFactory::CreateCall_w(
RTC_LOG(LS_INFO) << "Using pc injected network controller factory";
call_config.per_call_network_controller_factory =
std::move(per_call_network_controller_factory);
- } else if (IsTrialEnabled("WebRTC-Bwe-InjectedCongestionController")) {
+ } else if (field_trials().IsEnabled(
+ "WebRTC-Bwe-InjectedCongestionController")) {
RTC_LOG(LS_INFO) << "Using pcf injected network controller factory";
call_config.network_controller_factory =
injected_network_controller_factory_.get();
@@ -416,8 +416,4 @@ std::unique_ptr<Call> PeerConnectionFactory::CreateCall_w(
return context_->call_factory()->CreateCall(std::move(call_config));
}
-bool PeerConnectionFactory::IsTrialEnabled(absl::string_view key) const {
- return absl::StartsWith(field_trials().Lookup(key), "Enabled");
-}
-
} // namespace webrtc
diff --git a/third_party/libwebrtc/pc/peer_connection_factory.h b/third_party/libwebrtc/pc/peer_connection_factory.h
@@ -39,7 +39,6 @@
#include "call/call.h"
#include "call/rtp_transport_controller_send_factory_interface.h"
#include "media/base/media_engine.h"
-#include "p2p/base/port_allocator.h"
#include "pc/codec_vendor.h"
#include "pc/connection_context.h"
#include "rtc_base/thread.h"
@@ -126,8 +125,6 @@ class PeerConnectionFactory : public PeerConnectionFactoryInterface {
private:
Thread* network_thread() const { return context_->network_thread(); }
- bool IsTrialEnabled(absl::string_view key) const;
-
std::unique_ptr<Call> CreateCall_w(
const Environment& env,
const PeerConnectionInterface::RTCConfiguration& configuration,
diff --git a/third_party/libwebrtc/rtc_base/experiments/quality_scaling_experiment.cc b/third_party/libwebrtc/rtc_base/experiments/quality_scaling_experiment.cc
@@ -14,7 +14,6 @@
#include <optional>
#include <string>
-#include "absl/strings/match.h"
#include "api/field_trials_view.h"
#include "api/video/video_codec_type.h"
#include "api/video_codecs/video_encoder.h"
@@ -87,9 +86,9 @@ bool QualityScalingExperiment::Enabled(const FieldTrialsView& field_trials) {
WebRTCH265QualityScaling h265_quality_scaling(field_trials);
return
#if defined(WEBRTC_IOS)
- absl::StartsWith(field_trials.Lookup(kFieldTrial), "Enabled") ||
+ field_trials.IsEnabled(kFieldTrial) ||
#else
- !absl::StartsWith(field_trials.Lookup(kFieldTrial), "Disabled") ||
+ !field_trials.IsDisabled(kFieldTrial) ||
#endif
h265_quality_scaling.IsEnabled();
}
diff --git a/third_party/libwebrtc/video/config/simulcast.cc b/third_party/libwebrtc/video/config/simulcast.cc
@@ -18,7 +18,6 @@
#include <string>
#include <vector>
-#include "absl/strings/match.h"
#include "api/array_view.h"
#include "api/field_trials_view.h"
#include "api/units/data_rate.h"
@@ -132,8 +131,7 @@ constexpr DataRate Interpolate(const DataRate& a,
// TODO(webrtc:12415): Flip this to a kill switch when this feature launches.
bool EnableLowresBitrateInterpolation(const FieldTrialsView& trials) {
- return absl::StartsWith(
- trials.Lookup("WebRTC-LowresSimulcastBitrateInterpolation"), "Enabled");
+ return trials.IsEnabled("WebRTC-LowresSimulcastBitrateInterpolation");
}
int GetDefaultSimulcastTemporalLayers(VideoCodecType codec) {
@@ -355,8 +353,7 @@ size_t LimitSimulcastLayerCount(size_t min_num_layers,
int height,
const FieldTrialsView& trials,
VideoCodecType codec) {
- if (!absl::StartsWith(trials.Lookup(kUseLegacySimulcastLayerLimitFieldTrial),
- "Disabled")) {
+ if (!trials.IsDisabled(kUseLegacySimulcastLayerLimitFieldTrial)) {
// Max layers from one higher resolution in kSimulcastFormats will be used
// if the ratio (pixels_up - pixels) / (pixels_up - pixels_down) is less
// than configured `max_ratio`. pixels_down is the selected index in