commit d5e02992bc2d09359be764a53e268ce48fcbc369
parent 6127877771c6e445156863396d0d3dcc9f340b77
Author: Michael Froman <mfroman@mozilla.com>
Date: Wed, 8 Oct 2025 16:46:27 -0500
Bug 1993083 - Vendor libwebrtc from 521d252c93
Upstream commit: https://webrtc.googlesource.com/src/+/521d252c93b6be7fa459c30375803e4dd347f83c
av1: (partially) follow spec fmtp parameter comparisons
as stated in
https://aomediacodec.github.io/av1-rtp-spec/#723-usage-with-the-sdp-offeranswer-model
for SDP negotiation purposes, level-idx, profile and tier are
asymmetrical and the answerer MAY declare its own media configuration if
the answerer receiving capabilities are different from the offerer.
For backward-compat reasons we continue to compare the profile.
BUG=webrtc:396434695
Change-Id: Icf0cf150ce10a0aa83000a8ec68d191dd6e717a7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/377221
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45018}
Diffstat:
3 files changed, 27 insertions(+), 16 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-08T21:45:14.473477+00:00.
+libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-08T21:46:17.488341+00:00.
# base of lastest vendoring
-0f4c92a534
+521d252c93
diff --git a/third_party/libwebrtc/media/base/codec_comparators.cc b/third_party/libwebrtc/media/base/codec_comparators.cc
@@ -71,22 +71,12 @@ std::string AV1GetTierOrDefault(const CodecParameterMap& params) {
return GetFmtpParameterOrDefault(params, kAv1FmtpTier, "0");
}
-bool AV1IsSameTier(const CodecParameterMap& left,
- const CodecParameterMap& right) {
- return AV1GetTierOrDefault(left) == AV1GetTierOrDefault(right);
-}
-
std::string AV1GetLevelIdxOrDefault(const CodecParameterMap& params) {
// If the parameter is not present, it MUST be inferred to be 5 (level 3.1).
// https://aomediacodec.github.io/av1-rtp-spec/#72-sdp-parameters
return GetFmtpParameterOrDefault(params, kAv1FmtpLevelIdx, "5");
}
-bool AV1IsSameLevelIdx(const CodecParameterMap& left,
- const CodecParameterMap& right) {
- return AV1GetLevelIdxOrDefault(left) == AV1GetLevelIdxOrDefault(right);
-}
-
#ifdef RTC_ENABLE_H265
std::string GetH265TxModeOrDefault(const CodecParameterMap& params) {
// If TxMode is not present, a value of "SRST" must be inferred.
@@ -117,10 +107,13 @@ bool IsSameCodecSpecific(const std::string& name1,
H264IsSamePacketizationMode(params1, params2);
if (either_name_matches(kVp9CodecName))
return VP9IsSameProfile(params1, params2);
+ // https://aomediacodec.github.io/av1-rtp-spec/#723-usage-with-the-sdp-offeranswer-model
+ // These media configuration parameters are asymmetrical and the answerer
+ // MAY declare its own media configuration
+ // TODO(bugs.webrtc.org/396434695): for backward compability we currently
+ // compare profile.
if (either_name_matches(kAv1CodecName))
- return AV1IsSameProfile(params1, params2) &&
- AV1IsSameTier(params1, params2) &&
- AV1IsSameLevelIdx(params1, params2);
+ return AV1IsSameProfile(params1, params2);
#ifdef RTC_ENABLE_H265
if (either_name_matches(kH265CodecName)) {
return H265IsSameProfile(params1, params2) &&
diff --git a/third_party/libwebrtc/media/base/codec_comparators_unittest.cc b/third_party/libwebrtc/media/base/codec_comparators_unittest.cc
@@ -425,7 +425,7 @@ TEST(CodecTest, TestVideoCodecMatchesWithDifferentPacketization) {
EXPECT_TRUE(c1.Matches(c0));
}
-// AV1 codecs compare profile information.
+// AV1 codecs do not compare profile information.
TEST(CodecTest, TestAV1CodecMatches) {
const char kProfile0[] = "0";
const char kProfile1[] = "1";
@@ -469,6 +469,24 @@ TEST(CodecTest, TestAV1CodecMatches) {
// AV1 entries with different profiles (0 and 2) are seen as distinct.
EXPECT_FALSE(c_profile0.Matches(c_profile2));
EXPECT_FALSE(c_no_profile.Matches(c_profile2));
+
+ // AV1 entries with same profile and different tier are seen as equal.
+ Codec c_tier0 = CreateVideoCodec(95, kAv1CodecName);
+ c_tier0.params[kAv1FmtpProfile] = kProfile0;
+ c_tier0.params[kAv1FmtpTier] = "0";
+ Codec c_tier1 = CreateVideoCodec(95, kAv1CodecName);
+ c_tier1.params[kAv1FmtpProfile] = kProfile0;
+ c_tier1.params[kAv1FmtpTier] = "1";
+ EXPECT_TRUE(c_tier0.Matches(c_tier1));
+
+ // AV1 entries with profile and different level are seen as equal.
+ Codec c_level0 = CreateVideoCodec(95, kAv1CodecName);
+ c_level0.params[kAv1FmtpProfile] = kProfile0;
+ c_level0.params[kAv1FmtpLevelIdx] = "0";
+ Codec c_level1 = CreateVideoCodec(95, kAv1CodecName);
+ c_level1.params[kAv1FmtpProfile] = kProfile0;
+ c_level1.params[kAv1FmtpLevelIdx] = "1";
+ EXPECT_TRUE(c_level0.Matches(c_level1));
}
// VP9 codecs compare profile information.