Merge branch '6998-testing'

This commit is contained in:
Jim Gustafson 2025-04-07 15:48:35 -07:00
commit 69f1105f47
1216 changed files with 39204 additions and 27885 deletions

View file

@ -9,7 +9,7 @@ Language: ObjC
BasedOnStyle: Google
BinPackParameters: false
BinPackArguments: false
ColumnLimit: 100
ColumnLimit: 80
ObjCBlockIndentWidth: 2
AllowAllParametersOfDeclarationOnNextLine: true
AlignOperands: false

View file

@ -22,6 +22,7 @@ Andrey Efremov <yoklmnprst@ya.ru>
Andrew Johnson <ajohnson@draster.com>
Andy Tamilo <andytamilo@gmail.com>
Anil Kumar <an1kumar@gmail.com>
Anna Lemehova <Anna.Lemehova@gmail.com>
Anton Barkov <anton.barkov@macpaw.com>
Ben Strong <bstrong@gmail.com>
Berthold Herrmann <bertholdherrmann08@googlemail.com>
@ -56,6 +57,7 @@ Frederik Riedel, Frogg GmbH <frederik.riedel@frogg.io>
Gao Chun <gaochun.dev@gmail.com>
Giji Gangadharan <giji.g@samsung.com>
Graham Yoakum <gyoakum@skobalt.com>
Guillaume Petit <guillaume.petit@shadow.tech>
Gustavo Garcia <gustavogb@gmail.com>
Hans Knoechel <hans@hans-knoechel.de>
Helmut Januschka <helmut@januschka.com>
@ -72,6 +74,7 @@ Jie Mao <maojie0924@gmail.com>
Jiwon Kim <jwkim0000@gmail.com>
Johnny Wong <hellojinqiang@gmail.com>
Jose Antonio Olivera Ortega <josea.olivera@gmail.com>
Kacper Waśniowski <kacp.was@gmail.com>
Karim Hammache <karim@karhm.com>
Keiichi Enomoto <enm10k@gmail.com>
Kiran Thind <kiran.thind@gmail.com>
@ -105,6 +108,7 @@ Olivier Crête <olivier.crete@ocrete.ca>
Pali Rohar
Paul Kapustin <pkapustin@gmail.com>
Peng Yu <yupeng323@gmail.com>
Pete Makeev <guuud.morning@gmail.com>
Philipp Hancke <philipp.hancke@googlemail.com>
Piasy Xu <xz4215@gmail.com>
Rafael Lopez Diez <rafalopezdiez@gmail.com>
@ -112,6 +116,7 @@ Ralph Giles <giles@ghostscript.com>
Raman Budny <budnyjj@gmail.com>
Ramprakash Jelari <ennajelari@gmail.com>
Riku Voipio <riku.voipio@linaro.org>
Rishit Bansal <rishitbansal0@gmail.com>
Robert Bares <robert@bares.me>
Robert Mader <robert.mader@collabora.com>
Robert Mader <robert.mader@posteo.de>
@ -125,6 +130,7 @@ Sergio Garcia Murillo <sergio.garcia.murillo@gmail.com>
Shaofan Qi <vshaqi@gmail.com>
Shigemasa Watanabe <shigemasa7watanabe@gmail.com>
Shuhai Peng <shuhai.peng@intel.com>
Shunbo Li <lishunbo@agora.io>
Shunbo Li <lishunbo@shengwang.cn>
Seija <doremylover123@gmail.com>
Silviu Caragea <silviu.cpp@gmail.com>
@ -153,6 +159,7 @@ Yusuke Suzuki <utatane.tea@gmail.com>
Pengfei Han <hanpfei@gmail.com>
Yingying Ma <yingying.ma@intel.com>
Hailin Zhao <lynnworld7@gmail.com>
Fizz Fang <fangkb555@gmail.com>
# END individuals section.
# BEGIN organizations section.

View file

@ -354,10 +354,6 @@ config("common_config") {
defines += [ "WEBRTC_ABSL_MUTEX" ]
}
if (rtc_enable_libevent) {
defines += [ "WEBRTC_ENABLE_LIBEVENT" ]
}
if (rtc_disable_logging) {
defines += [ "RTC_DISABLE_LOGGING" ]
}
@ -566,7 +562,6 @@ if (!build_with_chromium) {
"media",
"modules",
"modules/video_capture:video_capture_internal_impl",
"p2p:rtc_p2p",
"pc:libjingle_peerconnection",
"pc:rtc_pc",
"ringrtc",
@ -654,6 +649,7 @@ if (rtc_include_tests && !build_with_chromium) {
"api/task_queue:pending_task_safety_flag_unittests",
"api/test/metrics:metrics_unittests",
"api/transport:stun_unittest",
"api/transport/rtp:corruption_detection_message_unittest",
"api/video/test:rtc_api_video_unittests",
"api/video_codecs:libaom_av1_encoder_factory_test",
"api/video_codecs:simple_encoder_wrapper_unittests",
@ -706,7 +702,6 @@ if (rtc_include_tests && !build_with_chromium) {
deps += [
"sdk/android:native_unittests",
"sdk/android:native_unittests_java",
"//testing/android/native_test:native_test_support",
]
shard_timeout = 900
}
@ -755,11 +750,7 @@ if (rtc_include_tests && !build_with_chromium) {
data = video_engine_tests_resources
if (is_android) {
use_default_launcher = false
deps += [
"//build/android/gtest_apk:native_test_instrumentation_test_runner_java",
"//testing/android/native_test:native_test_java",
"//testing/android/native_test:native_test_support",
]
deps += [ "//build/android/gtest_apk:native_test_instrumentation_test_runner_java" ]
shard_timeout = 900
}
if (is_ios) {
@ -804,11 +795,7 @@ if (rtc_include_tests && !build_with_chromium) {
data = webrtc_perf_tests_resources
if (is_android) {
use_default_launcher = false
deps += [
"//build/android/gtest_apk:native_test_instrumentation_test_runner_java",
"//testing/android/native_test:native_test_java",
"//testing/android/native_test:native_test_support",
]
deps += [ "//build/android/gtest_apk:native_test_instrumentation_test_runner_java" ]
shard_timeout = 4500
}
if (is_ios) {
@ -820,7 +807,6 @@ if (rtc_include_tests && !build_with_chromium) {
testonly = true
deps = [ "rtc_base:rtc_base_nonparallel_tests" ]
if (is_android) {
deps += [ "//testing/android/native_test:native_test_support" ]
shard_timeout = 900
}
}

393
DEPS
View file

@ -10,7 +10,7 @@ vars = {
# chromium waterfalls. More info at: crbug.com/570091.
'checkout_configuration': 'default',
'checkout_instrumented_libraries': 'checkout_linux and checkout_configuration == "default"',
'chromium_revision': '030af8fbf08f2bb06397304628f15b2d3bdb90d0',
'chromium_revision': '3462a5bab8ba8c0989f448c56ff055cd4a0a5c89',
# Fetch the prebuilt binaries for llvm-cov and llvm-profdata. Needed to
# process the raw profiles produced by instrumented targets (built with
@ -33,7 +33,7 @@ vars = {
# By default, download the fuchsia sdk from the public sdk directory.
'fuchsia_sdk_cipd_prefix': 'fuchsia/sdk/core/',
'fuchsia_version': 'version:24.20241014.3.1',
'fuchsia_version': 'version:26.20250117.5.1',
# By default, download the fuchsia images from the fuchsia GCS bucket.
'fuchsia_images_bucket': 'fuchsia',
'checkout_fuchsia': False,
@ -48,7 +48,7 @@ vars = {
# RBE instance to use for running remote builds
'rbe_instance': 'projects/rbe-webrtc-developer/instances/default_instance',
# reclient CIPD package version
'reclient_version': 're_client_version:0.168.0.c46e68bc-gomaip',
'reclient_version': 're_client_version:0.174.0.d516e7c7-gomaip',
# ninja CIPD package.
'ninja_package': 'infra/3pp/tools/ninja/',
@ -74,30 +74,30 @@ deps = {
# TODO(kjellander): Move this to be Android-only.
'src/base':
'https://chromium.googlesource.com/chromium/src/base@69f3676cdbd05660c136a6cc3b23383cbabe53d8',
'https://chromium.googlesource.com/chromium/src/base@e0914b7606a151a3a12e994c400519f2e291c53f',
'src/build':
'https://chromium.googlesource.com/chromium/src/build@05874e6c9429039f1747034af61de1fe2ea1ed06',
'https://chromium.googlesource.com/chromium/src/build@64e296c42a93fbd27acc9a94713e4289273409b2',
'src/buildtools':
'https://chromium.googlesource.com/chromium/src/buildtools@db0eae9640184fb132061f248f6108771a6ea2d4',
'https://chromium.googlesource.com/chromium/src/buildtools@a660247d3c14a172b74b8e832ba1066b30183c97',
# Gradle 6.6.1. Used for testing Android Studio project generation for WebRTC.
'src/examples/androidtests/third_party/gradle': {
'url': 'https://chromium.googlesource.com/external/github.com/gradle/gradle.git@f2d1fb54a951d8b11d25748e4711bec8d128d7e3',
'condition': 'checkout_android',
},
'src/ios': {
'url': 'https://chromium.googlesource.com/chromium/src/ios@452c8ab2166e50fe43484dd3da5e19ce14a68e6b',
'url': 'https://chromium.googlesource.com/chromium/src/ios@f83303423aeb21536cf8f913540b0ece28bc778a',
'condition': 'checkout_ios',
},
'src/testing':
'https://chromium.googlesource.com/chromium/src/testing@eac4c18f749488d7232af275405e0e1b67d84cb3',
'https://chromium.googlesource.com/chromium/src/testing@63412fdcdfe281e6b9531a5e1086a59c0b9e6909',
'src/third_party':
'https://chromium.googlesource.com/chromium/src/third_party@9d80a193fbfe8e2f2a29be2efeee93de9a826dcb',
'https://chromium.googlesource.com/chromium/src/third_party@d212a71416ad7c6ceca04d6d27dfdd84fd00c04c',
'src/buildtools/linux64': {
'packages': [
{
'package': 'gn/gn/linux-${{arch}}',
'version': 'git_revision:feafd1012a32c05ec6095f69ddc3850afb621f3a',
'version': 'git_revision:ed1abc107815210dc66ec439542bee2f6cbabc00',
}
],
'dep_type': 'cipd',
@ -107,7 +107,7 @@ deps = {
'packages': [
{
'package': 'gn/gn/mac-${{arch}}',
'version': 'git_revision:feafd1012a32c05ec6095f69ddc3850afb621f3a',
'version': 'git_revision:ed1abc107815210dc66ec439542bee2f6cbabc00',
}
],
'dep_type': 'cipd',
@ -117,7 +117,7 @@ deps = {
'packages': [
{
'package': 'gn/gn/windows-amd64',
'version': 'git_revision:feafd1012a32c05ec6095f69ddc3850afb621f3a',
'version': 'git_revision:ed1abc107815210dc66ec439542bee2f6cbabc00',
}
],
'dep_type': 'cipd',
@ -136,12 +136,7 @@ deps = {
'condition': 'not (host_os == "linux" and host_cpu == "arm64")',
},
'third_party/rust': {
'url': Var('chromium_git') + '/chromium/src/third_party/rust@0e0ef14876a32128574eaf80bc7fc1c7cde92006',
'condition': 'checkout_android or checkout_fuzzer',
},
'third_party/rust-toolchain': {
'src/third_party/rust-toolchain': {
'dep_type': 'gcs',
'bucket': 'chromium-browser-clang',
'objects': [
@ -177,15 +172,15 @@ deps = {
},
'src/third_party/clang-format/script':
'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/clang/tools/clang-format.git@3c0acd2d4e73dd911309d9e970ba09d58bf23a62',
'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/clang/tools/clang-format.git@37f6e68a107df43b7d7e044fd36a13cbae3413f2',
'src/third_party/libc++/src':
'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxx.git@6a68fd412b9aecd515a20a7cf84d11b598bfaf96',
'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxx.git@2e25154d49c29fa9aa42c30ad4a027bd30123434',
'src/third_party/libc++abi/src':
'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git@9a1d90c3b412d5ebeb97a6e33d98e1d0dd923221',
'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git@8205ccf0f23545ebcd8846363ea1d29e77917a22',
'src/third_party/llvm-libc/src':
'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libc.git@98ed09318387deb45282ca1c92a384499860b76a',
'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libc.git@12809bfa855813dcef51871e2ee3155e53ed35ea',
'src/third_party/libunwind/src':
'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git@efc3baa2d1ece3630fcfa72bef93ed831bcaec4c',
'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git@e55d8cf51c6db1fdd4bb56c158945ec59772c8ee',
'src/third_party/test_fonts/test_fonts': {
'dep_type': 'gcs',
@ -237,7 +232,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_build_tools/aapt2',
'version': 'cfGQ9GV4juNnGZIPzTmaL3ehiZM1hs6UsB5HUA8fT6oC',
'version': '_lNsOL_GGlXLOIMGtrbMOqNd7TQHabaP1q8SlvUpFbMC',
},
],
'condition': 'checkout_android',
@ -248,7 +243,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_build_tools/bundletool',
'version': 'sZ24OFOduSafn8fvR3ajsGS6KP_oS_Tq0Cw3SA8XiD0C',
'version': 'tal0sHGlqsDFNFQ5lV1zRomrRs0Ppq6ngUOYbACAAUwC',
},
],
'condition': 'checkout_android',
@ -259,7 +254,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_build_tools/error_prone',
'version': 'hUxlP8GvC1xhmZ6r9xjYau2laPlzHbs_P2emx4ZL4jgC',
'version': 'Q3oiuVxuq1jkWhjfnfCSviXK8BbbB9n6_4jz3x_Mo3kC',
},
],
'condition': 'checkout_android',
@ -277,6 +272,18 @@ deps = {
'dep_type': 'cipd',
},
# TODO(webrtc:42223878): This is only needed for //base.
'src/third_party/android_build_tools/nullaway/cipd': {
'packages': [
{
'package': 'chromium/third_party/android_build_tools/nullaway',
'version': '65WJkoinJEXvtu9xwdDNDb3QCbqBAl8FKDpgnXr3iiEC',
},
],
'condition': 'checkout_android and non_git_source',
'dep_type': 'cipd',
},
'src/third_party/aosp_dalvik/cipd': {
'packages': [
{
@ -289,11 +296,11 @@ deps = {
},
'src/third_party/boringssl/src':
'https://boringssl.googlesource.com/boringssl.git@0fa9014d861f024e28fb491ed7b1cfd44103dee7',
'https://boringssl.googlesource.com/boringssl.git@d4b6eb542d4fd109baacd550935efd00c521e674',
'src/third_party/breakpad/breakpad':
'https://chromium.googlesource.com/breakpad/breakpad.git@6b0c5b7ee1988a14a4af94564e8ae8bba8a94374',
'https://chromium.googlesource.com/breakpad/breakpad.git@0dfd77492fdb0dcd06027c5842095e2e908adc90',
'src/third_party/catapult':
'https://chromium.googlesource.com/catapult.git@44791916611acec1cd74c492c7453e46d9b0dbd2',
'https://chromium.googlesource.com/catapult.git@b15611f18b506cf9dbc03e9bf87dbc8df549ccce',
'src/third_party/ced/src': {
'url': 'https://chromium.googlesource.com/external/github.com/google/compact_enc_det.git@ba412eaaacd3186085babcd901679a48863c7dd5',
},
@ -306,13 +313,13 @@ deps = {
'src/third_party/crc32c/src':
'https://chromium.googlesource.com/external/github.com/google/crc32c.git@d3d60ac6e0f16780bcfcc825385e1d338801a558',
'src/third_party/depot_tools':
'https://chromium.googlesource.com/chromium/tools/depot_tools.git@20b9bdcace7ed561d6a75728c85373503473cb6b',
'https://chromium.googlesource.com/chromium/tools/depot_tools.git@80d1969422e75e8e9eecafa46074074b289e2568',
'src/third_party/ffmpeg':
'https://chromium.googlesource.com/chromium/third_party/ffmpeg.git@686d6944501a6ee9c849581e3fe343273d4af3f6',
'https://chromium.googlesource.com/chromium/third_party/ffmpeg.git@d10a0f8bf5ddcce572df95105152bc74041cae0c',
'src/third_party/flatbuffers/src':
'https://chromium.googlesource.com/external/github.com/google/flatbuffers.git@8db59321d9f02cdffa30126654059c7d02f70c32',
'src/third_party/grpc/src': {
'url': 'https://chromium.googlesource.com/external/github.com/grpc/grpc.git@822dab21d9995c5cf942476b35ca12a1aa9d2737',
'url': 'https://chromium.googlesource.com/external/github.com/grpc/grpc.git@a363b6c001139b9c8ffb7cd63f60a72f15349c3b',
},
# Used for embedded builds. CrOS & Linux use the system version.
'src/third_party/fontconfig/src': {
@ -320,11 +327,11 @@ deps = {
'condition': 'checkout_linux',
},
'src/third_party/freetype/src':
'https://chromium.googlesource.com/chromium/src/third_party/freetype2.git@f02bffad0fd57f3acfa835c3f2899c5b71ff8be0',
'https://chromium.googlesource.com/chromium/src/third_party/freetype2.git@a059b237bb01eb3e4f9f8b1618dda8c117498bab',
'src/third_party/harfbuzz-ng/src':
'https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz.git@1da053e87f0487382404656edca98b85fe51f2fd',
'https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz.git@1c249be96e27eafd15eb86d832b67fbc3751634b',
'src/third_party/google_benchmark/src': {
'url': 'https://chromium.googlesource.com/external/github.com/google/benchmark.git@344117638c8ff7e239044fd0fa7085839fc03021',
'url': 'https://chromium.googlesource.com/external/github.com/google/benchmark.git@761305ec3b33abf30e08d50eb829e19a802581cc',
},
# WebRTC-only dependency (not present in Chromium).
'src/third_party/gtest-parallel':
@ -334,15 +341,15 @@ deps = {
'condition': 'checkout_android',
},
'src/third_party/googletest/src':
'https://chromium.googlesource.com/external/github.com/google/googletest.git@62df7bdbc10887e094661e07ec2595b7920376fd',
'https://chromium.googlesource.com/external/github.com/google/googletest.git@2b6b042a77446ff322cd7522ca068d9f2a21c1d1',
'src/third_party/icu': {
'url': 'https://chromium.googlesource.com/chromium/deps/icu.git@4239b1559d11d4fa66c100543eda4161e060311e',
'url': 'https://chromium.googlesource.com/chromium/deps/icu.git@bbccc2f6efc1b825de5f2c903c48be685cd0cf22',
},
'src/third_party/jdk/current': {
'packages': [
{
'package': 'chromium/third_party/jdk',
'version': 'BXZwbslDFpYhPRuG8hBh2z7ApP36ZG-ZfkBWrkpnPl4C',
'version': 'G-WIGWdFIBTPPhv2xPK_lTfI5N7WmfCBh0oTKqX-c5sC',
},
],
'condition': 'host_os == "linux" and checkout_android',
@ -371,7 +378,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/kotlin_stdlib',
'version': 'XJ7_doI-Qt7GFaSQ9BNo-3qF7Gv2--9Sa8GEUdjxMTUC',
'version': 'z7NenFzvjmGieRhzC5IhUKe-nO3U6xA5VwUilO3GZLgC',
},
],
'condition': 'checkout_android',
@ -382,39 +389,36 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/kotlinc',
'version': 'FNZSCjJ6yKsi6oRcgQrt-lX0MDlaWoxT7gPTz0CjLhMC',
'version': 'VgYl1YO2AM2qu-RYvdko61h4YtNnJeZlGWWppX7vJq8C',
},
],
'condition': 'checkout_android',
'dep_type': 'cipd',
},
# Used for building libFuzzers (only supports Linux).
'src/third_party/libFuzzer/src': {
'url': 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/compiler-rt/lib/fuzzer.git@487e79376394754705984c5de7c4ce7f82f2bd7c',
'condition': 'checkout_fuzzer',
},
'src/third_party/libFuzzer/src':
'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/compiler-rt/lib/fuzzer.git@e31b99917861f891308269c36a32363b120126bb',
'src/third_party/fuzztest/src':
'https://chromium.googlesource.com/external/github.com/google/fuzztest.git@0021f30508bc7f73fa5270962d022acb480d242f',
'https://chromium.googlesource.com/external/github.com/google/fuzztest.git@00edfa0dd94d7e00a89684e950015c30d3b7ae07',
'src/third_party/libjpeg_turbo':
'https://chromium.googlesource.com/chromium/deps/libjpeg_turbo.git@927aabfcd26897abb9776ecf2a6c38ea5bb52ab6',
'src/third_party/libsrtp':
'https://chromium.googlesource.com/chromium/deps/libsrtp.git@000edd791434c8738455f10e0dd6b268a4852c0b',
'https://chromium.googlesource.com/chromium/deps/libsrtp.git@a52756acb1c5e133089c798736dd171567df11f5',
'src/third_party/dav1d/libdav1d':
'https://chromium.googlesource.com/external/github.com/videolan/dav1d.git@389450f61ea0b2057fc9ea393d3065859c4ba7f2',
'https://chromium.googlesource.com/external/github.com/videolan/dav1d.git@edb16889d16f5e13161b6e8f7a839cd82d7d655d',
'src/third_party/libaom/source/libaom':
'https://aomedia.googlesource.com/aom.git@840f8797871cc587f7113ea9d2483a1156d57c0e',
'https://aomedia.googlesource.com/aom.git@d737ca3ebe92feec465876a8fc98950cecd08fd8',
'src/third_party/libunwindstack': {
'url': 'https://chromium.googlesource.com/chromium/src/third_party/libunwindstack.git@a3bb4cd02e0e984a235069f812cbef2b37c389e5',
'url': 'https://chromium.googlesource.com/chromium/src/third_party/libunwindstack.git@e5061bbda4c2ba6438020669ed06b122032433dd',
'condition': 'checkout_android',
},
'src/third_party/perfetto':
'https://android.googlesource.com/platform/external/perfetto.git@e57316a6ae4e85e9bc8ba82a6c6a93eb5d9a72aa',
'https://android.googlesource.com/platform/external/perfetto.git@a0c2bc7919f7467cf4a8287c8389c3f96a3fcbac',
'src/third_party/protobuf-javascript/src':
Var('chromium_git') + '/external/github.com/protocolbuffers/protobuf-javascript' + '@' + 'e34549db516f8712f678fcd4bc411613b5cc5295',
'src/third_party/libvpx/source/libvpx':
'https://chromium.googlesource.com/webm/libvpx.git@906334ac1de2b0afa666472dce5545b82c1251fb',
'https://chromium.googlesource.com/webm/libvpx.git@7a65480684b1b28bb9defae164bf0dc78b32653e',
'src/third_party/libyuv':
'https://chromium.googlesource.com/libyuv/libyuv.git@a8e59d207483f75b87dd5fc670e937672cdf5776',
'https://chromium.googlesource.com/libyuv/libyuv.git@10592b60c0b2c33210b7752454253dc2625b4305',
'src/third_party/lss': {
'url': 'https://chromium.googlesource.com/linux-syscall-support.git@ce877209e11aa69dcfffbd53ef90ea1d07136521',
'condition': 'checkout_android or checkout_linux',
@ -424,7 +428,7 @@ deps = {
'condition': 'checkout_android',
},
'src/third_party/instrumented_libs': {
'url': Var('chromium_git') + '/chromium/third_party/instrumented_libraries.git' + '@' + 'bb6dbcf2df7a9beb34c3773ef4df161800e3aed9',
'url': Var('chromium_git') + '/chromium/third_party/instrumented_libraries.git' + '@' + '3cc43119a29158bcde39d288a8def4b8ec49baf8',
'condition': 'checkout_instrumented_libraries',
},
@ -443,7 +447,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/r8',
'version': '-i5fwP_NzM6Ylg5AsSGEotYN7hQgV852gXCslvXIrRwC',
'version': 'DJU_YH-xmuJ4kRnli6eXC-q9Q21-GPFj4YVZyAqKSWoC',
},
],
'condition': 'checkout_android',
@ -456,7 +460,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/r8',
'version': '3KCj5eRYCvGGYs5i90pRaeihkzsqgUGc4OkICT8AOlIC',
'version': 'U3Jf_ewWOZyxa6vyO3wjNIgm8XIz1yFk-4k3-wqDL44C',
},
],
'condition': 'checkout_android',
@ -467,7 +471,7 @@ deps = {
'condition': 'checkout_android',
},
'src/tools':
'https://chromium.googlesource.com/chromium/src/tools@c809c4133185094fbd75508202221ff14fc92f7c',
'https://chromium.googlesource.com/chromium/src/tools@6820cc03cc8a4b1fb99747f30e8249d138a70981',
'src/third_party/espresso': {
'packages': [
@ -506,7 +510,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/androidx',
'version': 'k1wif7sS51pJGSFGN7FAeGWDorxgPart9E1f383TQL4C',
'version': 'VWuP17o8bAsMqJ5b_3fu60qkAIWd905hpPI83flbNrMC',
},
],
'condition': 'checkout_android and non_git_source',
@ -517,7 +521,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_build_tools/manifest_merger',
'version': 'rnIeJMlGw7adxOKZofLsm7tdYaOy1nHivJn9ck7ocVkC',
'version': 'yd6w2zQr48NAkrzrzEj2OmMzI-kANsmD6lvKhfXluAsC',
},
],
'condition': 'checkout_android',
@ -544,7 +548,7 @@ deps = {
},
{
'package': 'chromium/third_party/android_sdk/public/cmdline-tools',
'version': 'B4p95sDPpm34K8Cf4JcfTM-iYSglWko9qjWgbT9dxWQC',
'version': 'OCGHZKTdjXjIELVI6FMAgcDkfnd_1ybB0_MtljPtz-8C',
},
],
'condition': 'checkout_android',
@ -566,7 +570,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/robolectric',
'version': 'Y1B0M_fCpPZ058xErMX6GQOJEVRBWR342juuxNLpVnkC',
'version': 'G3VkWqTv1YWDvC6zCrL34iQREzrzdBmSL4GMboAIiAEC',
},
],
'condition': 'checkout_android',
@ -588,26 +592,36 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/turbine',
'version': 'vSia3h9tzpwpP_goLj4HMdl7_FEB5iVCv9nU5ZXOfIMC',
'version': 'qNNUfaj7w4cSHTjVawVaZpq0pABVec9LcFebN19wm4EC',
},
],
'condition': 'checkout_android',
'dep_type': 'cipd',
},
'src/third_party/zstd/src': {
'url': Var('chromium_git') + '/external/github.com/facebook/zstd.git' + '@' + '80af41e08a630946a75a5cda9e4cdf192247f20a',
'condition': 'checkout_android',
},
'src/tools/luci-go': {
'packages': [
{
'package': 'infra/tools/luci/cas/${{platform}}',
'version': 'git_revision:e3703a4d1c29e8355653c19b59b0aa793a850956',
},
{
'package': 'infra/tools/luci/isolate/${{platform}}',
'version': 'git_revision:7dd39503276dfa4a920102ca77a2f409f2f67655',
'version': 'git_revision:e3703a4d1c29e8355653c19b59b0aa793a850956',
},
{
'package': 'infra/tools/luci/swarming/${{platform}}',
'version': 'git_revision:7dd39503276dfa4a920102ca77a2f409f2f67655',
},
'version': 'git_revision:e3703a4d1c29e8355653c19b59b0aa793a850956',
}
],
'dep_type': 'cipd',
},
'src/third_party/pipewire/linux-amd64': {
'packages': [
{
@ -671,22 +685,11 @@ deps = {
'dep_type': 'cipd',
},
'src/third_party/android_deps/cipd/libs/com_google_android_annotations': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_google_android_annotations',
'version': 'version:2@4.1.1.4.cr1',
},
],
'condition': 'checkout_android and non_git_source',
'dep_type': 'cipd',
},
'src/third_party/android_deps/cipd/libs/com_google_android_apps_common_testing_accessibility_framework_accessibility_test_framework': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_google_android_apps_common_testing_accessibility_framework_accessibility_test_framework',
'version': 'version:2@4.0.0.cr1',
'version': 'version:2@4.1.1.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -708,7 +711,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_auth',
'version': 'version:2@20.1.0.cr1',
'version': 'version:2@21.1.1.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -719,7 +722,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_auth_api_phone',
'version': 'version:2@18.0.1.cr1',
'version': 'version:2@18.0.2.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -730,7 +733,18 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_auth_base',
'version': 'version:2@18.0.2.cr1',
'version': 'version:2@18.0.10.cr1',
},
],
'condition': 'checkout_android and non_git_source',
'dep_type': 'cipd',
},
'src/third_party/android_deps/cipd/libs/com_google_android_gms_play_services_auth_blockstore': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_auth_blockstore',
'version': 'version:2@16.4.0.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -752,7 +766,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_basement',
'version': 'version:2@18.4.0.cr1',
'version': 'version:2@18.5.0.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -803,6 +817,17 @@ deps = {
'dep_type': 'cipd',
},
'src/third_party/android_deps/cipd/libs/com_google_android_gms_play_services_fido': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_fido',
'version': 'version:2@21.1.0.cr1',
},
],
'condition': 'checkout_android and non_git_source',
'dep_type': 'cipd',
},
'src/third_party/android_deps/cipd/libs/com_google_android_gms_play_services_flags': {
'packages': [
{
@ -829,7 +854,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_identity_credentials',
'version': 'version:2@16.0.0-alpha02.cr1',
'version': 'version:2@16.0.0-alpha04.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -924,6 +949,17 @@ deps = {
'dep_type': 'cipd',
},
'src/third_party/android_deps/cipd/libs/com_google_android_libraries_identity_googleid_googleid': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_google_android_libraries_identity_googleid_googleid',
'version': 'version:2@1.1.1.cr1',
},
],
'condition': 'checkout_android and non_git_source',
'dep_type': 'cipd',
},
'src/third_party/android_deps/cipd/libs/com_google_android_material_material': {
'packages': [
{
@ -972,7 +1008,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_google_auto_value_auto_value_annotations',
'version': 'version:2@1.10.4.cr1',
'version': 'version:2@1.11.0.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -994,7 +1030,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_google_code_gson_gson',
'version': 'version:2@2.9.0.cr1',
'version': 'version:2@2.8.0.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -1012,17 +1048,6 @@ deps = {
'dep_type': 'cipd',
},
'src/third_party/android_deps/cipd/libs/com_google_dagger_hilt_core': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_google_dagger_hilt_core',
'version': 'version:2@2.52.cr1',
},
],
'condition': 'checkout_android and non_git_source',
'dep_type': 'cipd',
},
'src/third_party/android_deps/cipd/libs/com_google_errorprone_error_prone_annotations': {
'packages': [
{
@ -1159,7 +1184,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_google_guava_failureaccess',
'version': 'version:2@1.0.1.cr1',
'version': 'version:2@1.0.2.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -1170,7 +1195,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_google_guava_guava',
'version': 'version:2@32.1.3-jre.cr1',
'version': 'version:2@33.3.1-jre.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -1181,7 +1206,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_google_guava_guava_android',
'version': 'version:2@32.1.3-android.cr1',
'version': 'version:2@33.3.1-android.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -1192,7 +1217,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_google_j2objc_j2objc_annotations',
'version': 'version:2@2.8.cr1',
'version': 'version:2@3.0.0.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -1210,6 +1235,17 @@ deps = {
'dep_type': 'cipd',
},
'src/third_party/android_deps/cipd/libs/com_google_testparameterinjector_test_parameter_injector': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_google_testparameterinjector_test_parameter_injector',
'version': 'version:2@1.18.cr1',
},
],
'condition': 'checkout_android and non_git_source',
'dep_type': 'cipd',
},
'src/third_party/android_deps/cipd/libs/com_googlecode_java_diff_utils_diffutils': {
'packages': [
{
@ -1269,7 +1305,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_squareup_okio_okio_jvm',
'version': 'version:2@3.9.0.cr1',
'version': 'version:2@3.9.1.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -1287,83 +1323,6 @@ deps = {
'dep_type': 'cipd',
},
'src/third_party/android_deps/cipd/libs/io_grpc_grpc_api': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/io_grpc_grpc_api',
'version': 'version:2@1.49.0.cr1',
},
],
'condition': 'checkout_android and non_git_source',
'dep_type': 'cipd',
},
'src/third_party/android_deps/cipd/libs/io_grpc_grpc_binder': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/io_grpc_grpc_binder',
'version': 'version:2@1.49.0.cr1',
},
],
'condition': 'checkout_android and non_git_source',
'dep_type': 'cipd',
},
'src/third_party/android_deps/cipd/libs/io_grpc_grpc_context': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/io_grpc_grpc_context',
'version': 'version:2@1.49.0.cr1',
},
],
'condition': 'checkout_android and non_git_source',
'dep_type': 'cipd',
},
'src/third_party/android_deps/cipd/libs/io_grpc_grpc_core': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/io_grpc_grpc_core',
'version': 'version:2@1.49.0.cr1',
},
],
'condition': 'checkout_android and non_git_source',
'dep_type': 'cipd',
},
'src/third_party/android_deps/cipd/libs/io_grpc_grpc_protobuf_lite': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/io_grpc_grpc_protobuf_lite',
'version': 'version:2@1.49.0.cr1',
},
],
'condition': 'checkout_android and non_git_source',
'dep_type': 'cipd',
},
'src/third_party/android_deps/cipd/libs/io_grpc_grpc_stub': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/io_grpc_grpc_stub',
'version': 'version:2@1.49.0.cr1',
},
],
'condition': 'checkout_android and non_git_source',
'dep_type': 'cipd',
},
'src/third_party/android_deps/cipd/libs/io_perfmark_perfmark_api': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/io_perfmark_perfmark_api',
'version': 'version:2@0.25.0.cr1',
},
],
'condition': 'checkout_android and non_git_source',
'dep_type': 'cipd',
},
'src/third_party/android_deps/cipd/libs/jakarta_inject_jakarta_inject_api': {
'packages': [
{
@ -1434,7 +1393,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_bouncycastle_bcprov_jdk18on',
'version': 'version:2@1.77.cr1',
'version': 'version:2@1.78.1.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -1467,7 +1426,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_checkerframework_checker_qual',
'version': 'version:2@3.37.0.cr1',
'version': 'version:2@3.43.0.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -1489,7 +1448,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_codehaus_mojo_animal_sniffer_annotations',
'version': 'version:2@1.21.cr1',
'version': 'version:2@1.17.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -1584,6 +1543,17 @@ deps = {
'dep_type': 'cipd',
},
'src/third_party/android_deps/cipd/libs/org_jetbrains_kotlinx_kotlinx_coroutines_test_jvm': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_jetbrains_kotlinx_kotlinx_coroutines_test_jvm',
'version': 'version:2@1.7.3.cr1',
},
],
'condition': 'checkout_android and non_git_source',
'dep_type': 'cipd',
},
'src/third_party/android_deps/cipd/libs/org_jetbrains_kotlinx_kotlinx_serialization_core_jvm': {
'packages': [
{
@ -1665,7 +1635,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_ow2_asm_asm',
'version': 'version:2@9.7.cr1',
'version': 'version:2@9.7.1.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -1676,7 +1646,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_ow2_asm_asm_analysis',
'version': 'version:2@9.7.cr1',
'version': 'version:2@9.7.1.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -1687,7 +1657,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_ow2_asm_asm_commons',
'version': 'version:2@9.7.cr1',
'version': 'version:2@9.7.1.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -1698,7 +1668,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_ow2_asm_asm_tree',
'version': 'version:2@9.7.cr1',
'version': 'version:2@9.7.1.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -1709,7 +1679,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_ow2_asm_asm_util',
'version': 'version:2@9.7.cr1',
'version': 'version:2@9.7.1.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -1720,7 +1690,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_robolectric_annotations',
'version': 'version:2@4.12.1.cr1',
'version': 'version:2@4.14.1.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -1731,7 +1701,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_robolectric_junit',
'version': 'version:2@4.12.1.cr1',
'version': 'version:2@4.14.1.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -1742,7 +1712,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_robolectric_nativeruntime',
'version': 'version:2@4.12.1.cr1',
'version': 'version:2@4.14.1.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -1753,7 +1723,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_robolectric_nativeruntime_dist_compat',
'version': 'version:2@1.0.9.cr1',
'version': 'version:2@1.0.16.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -1764,7 +1734,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_robolectric_pluginapi',
'version': 'version:2@4.12.1.cr1',
'version': 'version:2@4.14.1.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -1775,7 +1745,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_robolectric_plugins_maven_dependency_resolver',
'version': 'version:2@4.12.1.cr1',
'version': 'version:2@4.14.1.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -1786,7 +1756,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_robolectric_resources',
'version': 'version:2@4.12.1.cr1',
'version': 'version:2@4.14.1.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -1797,7 +1767,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_robolectric_robolectric',
'version': 'version:2@4.12.1.cr1',
'version': 'version:2@4.14.1.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -1808,7 +1778,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_robolectric_sandbox',
'version': 'version:2@4.12.1.cr1',
'version': 'version:2@4.14.1.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -1819,7 +1789,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_robolectric_shadowapi',
'version': 'version:2@4.12.1.cr1',
'version': 'version:2@4.14.1.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -1830,18 +1800,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_robolectric_shadows_framework',
'version': 'version:2@4.12.1.cr1',
},
],
'condition': 'checkout_android and non_git_source',
'dep_type': 'cipd',
},
'src/third_party/android_deps/cipd/libs/org_robolectric_shadows_versioning': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_robolectric_shadows_versioning',
'version': 'version:2@4.12.1.cr1',
'version': 'version:2@4.14.1.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -1852,7 +1811,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_robolectric_utils',
'version': 'version:2@4.12.1.cr1',
'version': 'version:2@4.14.1.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -1863,7 +1822,18 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_robolectric_utils_reflector',
'version': 'version:2@4.12.1.cr1',
'version': 'version:2@4.14.1.cr1',
},
],
'condition': 'checkout_android and non_git_source',
'dep_type': 'cipd',
},
'src/third_party/android_deps/cipd/libs/org_yaml_snakeyaml': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_yaml_snakeyaml',
'version': 'version:2@2.3.cr1',
},
],
'condition': 'checkout_android and non_git_source',
@ -2013,7 +1983,7 @@ hooks = [
{
'name': 'rust',
'pattern': '.',
'condition': 'checkout_android or checkout_fuzzer',
'condition': 'checkout_fuzzer',
'action': ['python3', 'src/tools/rust/update_rust.py'],
},
{
@ -2179,7 +2149,8 @@ include_rules = [
"+absl/base/nullability.h",
"+absl/base/macros.h",
"+absl/cleanup/cleanup.h",
"+absl/container/inlined_vector.h",
"+absl/container",
"-absl/container/fixed_array.h",
"+absl/functional/any_invocable.h",
"+absl/functional/bind_front.h",
"+absl/memory/memory.h",

View file

@ -282,7 +282,7 @@ rtc_library("libjingle_peerconnection_api") {
"crypto_params.h",
"data_channel_interface.cc",
"data_channel_interface.h",
# RingRTC change to add ICE forking
# RingRTC change to support ICE forking
"ice_gatherer_interface.h",
"jsep.cc",
"jsep.h",
@ -343,8 +343,8 @@ rtc_library("libjingle_peerconnection_api") {
"../call:rtp_interfaces",
"../media:media_engine",
"../p2p:connection",
"../p2p:port",
"../p2p:port_allocator",
"../p2p:rtc_p2p",
"../pc:media_factory",
"../rtc_base:copy_on_write_buffer",
"../rtc_base:logging",
@ -431,10 +431,23 @@ rtc_library("rtc_error") {
"../rtc_base:logging",
"../rtc_base:macromagic",
"../rtc_base/system:rtc_export",
"//third_party/abseil-cpp/absl/meta:type_traits",
"//third_party/abseil-cpp/absl/strings",
"//third_party/abseil-cpp/absl/strings:str_format",
"//third_party/abseil-cpp/absl/strings:string_view",
]
}
rtc_source_set("rtc_error_matchers") {
testonly = true
sources = [ "test/rtc_error_matchers.h" ]
deps = [
":rtc_error",
"../test:test_support",
"//third_party/abseil-cpp/absl/strings",
]
}
rtc_source_set("packet_socket_factory") {
visibility = [ "*" ]
sources = [ "packet_socket_factory.h" ]
@ -537,6 +550,7 @@ rtc_library("rtp_parameters") {
"video:resolution",
"video_codecs:scalability_mode",
"//third_party/abseil-cpp/absl/container:inlined_vector",
"//third_party/abseil-cpp/absl/strings:str_format",
"//third_party/abseil-cpp/absl/strings:string_view",
]
}
@ -861,6 +875,7 @@ rtc_source_set("simulated_network_api") {
deps = [
"../rtc_base:macromagic",
"../rtc_base:random",
"transport:ecn_marking",
"units:data_rate",
"//third_party/abseil-cpp/absl/functional:any_invocable",
]
@ -971,7 +986,6 @@ rtc_library("ice_transport_factory") {
"../p2p:p2p_constants",
"../p2p:p2p_transport_channel",
"../p2p:port_allocator",
"../p2p:rtc_p2p",
"../rtc_base:macromagic",
"../rtc_base:threading",
"../rtc_base/system:rtc_export",
@ -1326,7 +1340,7 @@ if (rtc_include_tests) {
":rtc_error",
":rtp_parameters",
":scoped_refptr",
"../p2p:rtc_p2p",
"../p2p:port_allocator",
"../rtc_base:refcount",
"../rtc_base:rtc_certificate_generator",
"../test:test_support",
@ -1551,7 +1565,6 @@ if (rtc_include_tests) {
"rtp_parameters_unittest.cc",
"scoped_refptr_unittest.cc",
"sequence_checker_unittest.cc",
"test/create_time_controller_unittest.cc",
"test/peerconnection_quality_test_fixture_unittest.cc",
]
@ -1573,7 +1586,7 @@ if (rtc_include_tests) {
":scoped_refptr",
":sequence_checker",
":time_controller",
"../p2p:rtc_p2p",
"../p2p:p2p_constants",
"../rtc_base:buffer",
"../rtc_base:checks",
"../rtc_base:gunit_helpers",
@ -1593,6 +1606,7 @@ if (rtc_include_tests) {
"../test:fileutils",
"../test:rtc_expect_death",
"../test:test_support",
"audio_codecs/opus:unittests",
"environment:environment_unittests",
"task_queue:task_queue_default_factory_unittests",
"test/pclf:media_configuration",

View file

@ -135,6 +135,8 @@ specific_include_rules = {
"rtc_error\.h": [
"+rtc_base/logging.h",
"+absl/strings/has_absl_stringify.h",
"+absl/strings/str_format.h",
],
"rtc_event_log_output_file.h": [
# For private member and constructor.
@ -199,6 +201,10 @@ specific_include_rules = {
"+modules/video_coding/include/video_codec_interface.h"
],
"rtp_parameters\.h": [
"+absl/strings/str_format.h",
],
"sequence_checker\.h": [
"+rtc_base/synchronization/sequence_checker_internal.h",
"+rtc_base/thread_annotations.h",

View file

@ -140,13 +140,19 @@ rtc_library("aec3_factory") {
":echo_control",
"../../modules/audio_processing/aec3",
"../../rtc_base/system:rtc_export",
"../environment",
"//third_party/abseil-cpp/absl/base:nullability",
]
}
rtc_source_set("echo_control") {
visibility = [ "*" ]
sources = [ "echo_control.h" ]
deps = [ "../../rtc_base:checks" ]
deps = [
"../../rtc_base:checks",
"../environment",
"//third_party/abseil-cpp/absl/base:nullability",
]
}
rtc_source_set("echo_detector_creator") {

View file

@ -61,13 +61,11 @@ class AudioDeviceModule : public webrtc::RefCountInterface {
public:
// Creates a default ADM for usage in production code.
static rtc::scoped_refptr<AudioDeviceModule> Create(
AudioLayer audio_layer,
TaskQueueFactory* task_queue_factory);
AudioLayer audio_layer, TaskQueueFactory* task_queue_factory);
// Creates an ADM with support for extra test methods. Don't use this factory
// in production code.
static rtc::scoped_refptr<AudioDeviceModuleForTest> CreateForTest(
AudioLayer audio_layer,
TaskQueueFactory* task_queue_factory);
AudioLayer audio_layer, TaskQueueFactory* task_queue_factory);
// Retrieve the currently utilized audio layer
virtual int32_t ActiveAudioLayer(AudioLayer* audioLayer) const = 0;

View file

@ -790,70 +790,6 @@ class CustomProcessing {
virtual ~CustomProcessing() {}
};
// Use BuiltinAudioProcessingBuilder instead, see bugs.webrtc.org/369904700
class RTC_EXPORT [[deprecated]] AudioProcessingBuilder {
public:
AudioProcessingBuilder();
AudioProcessingBuilder(const AudioProcessingBuilder&) = delete;
AudioProcessingBuilder& operator=(const AudioProcessingBuilder&) = delete;
~AudioProcessingBuilder();
// Sets the APM configuration.
AudioProcessingBuilder& SetConfig(const AudioProcessing::Config& config) {
config_ = config;
return *this;
}
// Sets the echo controller factory to inject when APM is created.
AudioProcessingBuilder& SetEchoControlFactory(
std::unique_ptr<EchoControlFactory> echo_control_factory) {
echo_control_factory_ = std::move(echo_control_factory);
return *this;
}
// Sets the capture post-processing sub-module to inject when APM is created.
AudioProcessingBuilder& SetCapturePostProcessing(
std::unique_ptr<CustomProcessing> capture_post_processing) {
capture_post_processing_ = std::move(capture_post_processing);
return *this;
}
// Sets the render pre-processing sub-module to inject when APM is created.
AudioProcessingBuilder& SetRenderPreProcessing(
std::unique_ptr<CustomProcessing> render_pre_processing) {
render_pre_processing_ = std::move(render_pre_processing);
return *this;
}
// Sets the echo detector to inject when APM is created.
AudioProcessingBuilder& SetEchoDetector(
rtc::scoped_refptr<EchoDetector> echo_detector) {
echo_detector_ = std::move(echo_detector);
return *this;
}
// Sets the capture analyzer sub-module to inject when APM is created.
AudioProcessingBuilder& SetCaptureAnalyzer(
std::unique_ptr<CustomAudioAnalyzer> capture_analyzer) {
capture_analyzer_ = std::move(capture_analyzer);
return *this;
}
// Creates an APM instance with the specified config or the default one if
// unspecified. Injects the specified components transferring the ownership
// to the newly created APM instance - i.e., except for the config, the
// builder is reset to its initial state.
rtc::scoped_refptr<AudioProcessing> Create();
private:
AudioProcessing::Config config_;
std::unique_ptr<EchoControlFactory> echo_control_factory_;
std::unique_ptr<CustomProcessing> capture_post_processing_;
std::unique_ptr<CustomProcessing> render_pre_processing_;
rtc::scoped_refptr<EchoDetector> echo_detector_;
std::unique_ptr<CustomAudioAnalyzer> capture_analyzer_;
};
class StreamConfig {
public:
// sample_rate_hz: The sampling rate of the stream.

View file

@ -22,11 +22,9 @@
namespace webrtc {
absl::Nullable<scoped_refptr<AudioProcessing>>
BuiltinAudioProcessingBuilder::Build(const Environment& /*env*/) {
// TODO: bugs.webrtc.org/369904700 - Pass `env` when AudioProcessingImpl gets
// constructor that accepts it.
BuiltinAudioProcessingBuilder::Build(const Environment& env) {
return make_ref_counted<AudioProcessingImpl>(
config_, std::move(capture_post_processing_),
env, config_, std::move(capture_post_processing_),
std::move(render_pre_processing_), std::move(echo_control_factory_),
std::move(echo_detector_), std::move(capture_analyzer_));
}

View file

@ -12,8 +12,10 @@
#include <memory>
#include <optional>
#include "absl/base/nullability.h"
#include "api/audio/echo_canceller3_config.h"
#include "api/audio/echo_control.h"
#include "api/environment/environment.h"
#include "modules/audio_processing/aec3/echo_canceller3.h"
namespace webrtc {
@ -23,12 +25,13 @@ EchoCanceller3Factory::EchoCanceller3Factory() {}
EchoCanceller3Factory::EchoCanceller3Factory(const EchoCanceller3Config& config)
: config_(config) {}
std::unique_ptr<EchoControl> EchoCanceller3Factory::Create(
absl::Nonnull<std::unique_ptr<EchoControl>> EchoCanceller3Factory::Create(
const Environment& env,
int sample_rate_hz,
int num_render_channels,
int num_capture_channels) {
return std::make_unique<EchoCanceller3>(
config_, /*multichannel_config=*/std::nullopt, sample_rate_hz,
env, config_, /*multichannel_config=*/std::nullopt, sample_rate_hz,
num_render_channels, num_capture_channels);
}

View file

@ -13,8 +13,10 @@
#include <memory>
#include "absl/base/nullability.h"
#include "api/audio/echo_canceller3_config.h"
#include "api/audio/echo_control.h"
#include "api/environment/environment.h"
#include "rtc_base/system/rtc_export.h"
namespace webrtc {
@ -29,9 +31,11 @@ class RTC_EXPORT EchoCanceller3Factory : public EchoControlFactory {
explicit EchoCanceller3Factory(const EchoCanceller3Config& config);
// Creates an EchoCanceller3 with a specified channel count and sampling rate.
std::unique_ptr<EchoControl> Create(int sample_rate_hz,
int num_render_channels,
int num_capture_channels) override;
absl::Nonnull<std::unique_ptr<EchoControl>> Create(
const Environment& env,
int sample_rate_hz,
int num_render_channels,
int num_capture_channels) override;
private:
const EchoCanceller3Config config_;

View file

@ -13,7 +13,8 @@
#include <memory>
#include "rtc_base/checks.h"
#include "absl/base/nullability.h"
#include "api/environment/environment.h"
namespace webrtc {
@ -64,11 +65,13 @@ class EchoControl {
// Interface for a factory that creates EchoControllers.
class EchoControlFactory {
public:
virtual std::unique_ptr<EchoControl> Create(int sample_rate_hz,
int num_render_channels,
int num_capture_channels) = 0;
virtual ~EchoControlFactory() = default;
virtual absl::Nonnull<std::unique_ptr<EchoControl>> Create(
const Environment& env,
int sample_rate_hz,
int num_render_channels,
int num_capture_channels) = 0;
};
} // namespace webrtc

View file

@ -300,7 +300,7 @@ class AudioEncoder {
// The maximum number of audio channels supported by WebRTC encoders.
static constexpr int kMaxNumberOfChannels = 24;
// RingRTC Change to configure OPUS
// RingRTC Change to configure opus
virtual bool Configure(const Config& config) {
RTC_LOG(LS_WARNING) << "Default AudioEncoder::Configure(...) does nothing!";
return false;

View file

@ -59,8 +59,7 @@ rtc::scoped_refptr<AudioDecoderFactory> CreateBuiltinAudioDecoderFactory() {
AudioDecoderOpus, NotAdvertised<AudioDecoderMultiChannelOpus>,
#endif
AudioDecoderG722,
AudioDecoderG711, NotAdvertised<AudioDecoderL16>>();
AudioDecoderG722, AudioDecoderG711, NotAdvertised<AudioDecoderL16>>();
}
} // namespace webrtc

View file

@ -66,8 +66,7 @@ rtc::scoped_refptr<AudioEncoderFactory> CreateBuiltinAudioEncoderFactory() {
AudioEncoderOpus, NotAdvertised<AudioEncoderMultiChannelOpus>,
#endif
AudioEncoderG722,
AudioEncoderG711, NotAdvertised<AudioEncoderL16>>();
AudioEncoderG722, AudioEncoderG711, NotAdvertised<AudioEncoderL16>>();
}
} // namespace webrtc

View file

@ -98,3 +98,16 @@ rtc_library("audio_decoder_multiopus") {
"//third_party/abseil-cpp/absl/strings",
]
}
rtc_library("unittests") {
visibility = [ "*" ]
testonly = true
sources = [ "audio_decoder_opus_unittest.cc" ]
deps = [
":audio_decoder_opus",
"../../../api/environment",
"../../../api/environment:environment_factory",
"../../../test:explicit_key_value_config",
"../../../test:test_support",
]
}

View file

@ -25,6 +25,14 @@
#include "rtc_base/checks.h"
namespace webrtc {
namespace {
int GetDefaultNumChannels(const FieldTrialsView& field_trials) {
return field_trials.IsEnabled("WebRTC-Audio-OpusDecodeStereoByDefault") ? 2
: 1;
}
} // namespace
bool AudioDecoderOpus::Config::IsOk() const {
if (sample_rate_hz != 16000 && sample_rate_hz != 48000) {
@ -32,40 +40,37 @@ bool AudioDecoderOpus::Config::IsOk() const {
// well; we can add support for them when needed.)
return false;
}
if (num_channels != 1 && num_channels != 2) {
return false;
}
return true;
return !num_channels.has_value() || *num_channels == 1 || *num_channels == 2;
}
std::optional<AudioDecoderOpus::Config> AudioDecoderOpus::SdpToConfig(
const SdpAudioFormat& format) {
const auto num_channels = [&]() -> std::optional<int> {
auto stereo = format.parameters.find("stereo");
if (stereo != format.parameters.end()) {
if (stereo->second == "0") {
return 1;
} else if (stereo->second == "1") {
return 2;
} else {
return std::nullopt; // Bad stereo parameter.
}
}
return 1; // Default to mono.
}();
if (absl::EqualsIgnoreCase(format.name, "opus") &&
format.clockrate_hz == 48000 && format.num_channels == 2 &&
num_channels) {
Config config;
config.num_channels = *num_channels;
if (!config.IsOk()) {
RTC_DCHECK_NOTREACHED();
return std::nullopt;
}
return config;
} else {
if (!absl::EqualsIgnoreCase(format.name, "opus") ||
format.clockrate_hz != 48000 || format.num_channels != 2) {
return std::nullopt;
}
Config config;
// Parse the "stereo" codec parameter. If set, it overrides the default number
// of channels.
const auto stereo_param = format.parameters.find("stereo");
if (stereo_param != format.parameters.end()) {
if (stereo_param->second == "0") {
config.num_channels = 1;
} else if (stereo_param->second == "1") {
config.num_channels = 2;
} else {
// Malformed stereo parameter.
return std::nullopt;
}
}
if (!config.IsOk()) {
RTC_DCHECK_NOTREACHED();
return std::nullopt;
}
return config;
}
void AudioDecoderOpus::AppendSupportedDecoders(
@ -86,7 +91,9 @@ std::unique_ptr<AudioDecoder> AudioDecoderOpus::MakeAudioDecoder(
return nullptr;
}
return std::make_unique<AudioDecoderOpusImpl>(
env.field_trials(), config.num_channels, config.sample_rate_hz);
env.field_trials(),
config.num_channels.value_or(GetDefaultNumChannels(env.field_trials())),
config.sample_rate_hz);
}
} // namespace webrtc

View file

@ -29,7 +29,7 @@ struct RTC_EXPORT AudioDecoderOpus {
struct Config {
bool IsOk() const; // Checks if the values are currently OK.
int sample_rate_hz = 48000;
int num_channels = 1;
std::optional<int> num_channels;
};
static std::optional<Config> SdpToConfig(const SdpAudioFormat& audio_format);
static void AppendSupportedDecoders(std::vector<AudioCodecSpec>* specs);

View file

@ -0,0 +1,109 @@
/*
* Copyright (c) 2024 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "api/audio_codecs/opus/audio_decoder_opus.h"
#include <string>
#include "api/environment/environment.h"
#include "api/environment/environment_factory.h"
#include "test/explicit_key_value_config.h"
#include "test/gmock.h"
#include "test/gtest.h"
namespace webrtc {
namespace {
using test::ExplicitKeyValueConfig;
using ::testing::Field;
using ::testing::Optional;
using Config = AudioDecoderOpus::Config;
enum class StereoParam { kUnset, kMono, kStereo };
SdpAudioFormat GetSdpAudioFormat(StereoParam param) {
SdpAudioFormat format("opus", 48000, 2);
switch (param) {
case StereoParam::kUnset:
// Do nothing.
break;
case StereoParam::kMono:
format.parameters.emplace("stereo", "0");
break;
case StereoParam::kStereo:
format.parameters.emplace("stereo", "1");
break;
}
return format;
}
constexpr int kDefaultNumChannels = 1;
constexpr int kAlternativeNumChannels = 2;
TEST(AudioDecoderOpusTest, SdpToConfigDoesNotSetNumChannels) {
const std::optional<Config> config =
AudioDecoderOpus::SdpToConfig(GetSdpAudioFormat(StereoParam::kUnset));
EXPECT_THAT(config, Optional(Field(&Config::num_channels, std::nullopt)));
}
TEST(AudioDecoderOpusTest, SdpToConfigForcesMono) {
const std::optional<Config> config =
AudioDecoderOpus::SdpToConfig(GetSdpAudioFormat(StereoParam::kMono));
EXPECT_THAT(config, Optional(Field(&Config::num_channels, 1)));
}
TEST(AudioDecoderOpusTest, SdpToConfigForcesStereo) {
const std::optional<Config> config =
AudioDecoderOpus::SdpToConfig(GetSdpAudioFormat(StereoParam::kStereo));
EXPECT_THAT(config, Optional(Field(&Config::num_channels, 2)));
}
TEST(AudioDecoderOpusTest, MakeAudioDecoderForcesDefaultNumChannels) {
const Environment env = CreateEnvironment();
auto decoder = AudioDecoderOpus::MakeAudioDecoder(
env, /*config=*/{.num_channels = std::nullopt});
EXPECT_EQ(decoder->Channels(), static_cast<size_t>(kDefaultNumChannels));
}
TEST(AudioDecoderOpusTest, MakeAudioDecoderCannotForceDefaultNumChannels) {
const Environment env = CreateEnvironment();
auto decoder = AudioDecoderOpus::MakeAudioDecoder(
env, /*config=*/{.num_channels = kAlternativeNumChannels});
EXPECT_EQ(decoder->Channels(), static_cast<size_t>(kAlternativeNumChannels));
}
TEST(AudioDecoderOpusTest, MakeAudioDecoderForcesStereo) {
const Environment env =
CreateEnvironment(std::make_unique<ExplicitKeyValueConfig>(
"WebRTC-Audio-OpusDecodeStereoByDefault/Enabled/"));
auto decoder = AudioDecoderOpus::MakeAudioDecoder(
env,
/*config=*/{.num_channels = std::nullopt});
EXPECT_EQ(decoder->Channels(), 2u);
}
TEST(AudioDecoderOpusTest, MakeAudioDecoderCannotForceStereo) {
const Environment env =
CreateEnvironment(std::make_unique<ExplicitKeyValueConfig>(
"WebRTC-Audio-OpusDecodeStereoByDefault/Enabled/"));
auto decoder =
AudioDecoderOpus::MakeAudioDecoder(env, /*config=*/{.num_channels = 1});
EXPECT_EQ(decoder->Channels(), 1u);
}
} // namespace
} // namespace webrtc

View file

@ -12,6 +12,7 @@
#define API_AUDIO_CODECS_OPUS_AUDIO_ENCODER_MULTI_CHANNEL_OPUS_CONFIG_H_
#include <stddef.h>
#include <vector>
#include "rtc_base/system/rtc_export.h"

View file

@ -31,6 +31,7 @@ struct PacketOptions {
bool is_media = true;
bool included_in_feedback = false;
bool included_in_allocation = false;
bool send_as_ect1 = false;
// Whether this packet can be part of a packet batch at lower levels.
bool batchable = false;
// Whether this packet is the last of a batch.

View file

@ -54,9 +54,10 @@ struct RTC_EXPORT CryptoOptions {
// RingRTC change to use GCM by default
bool enable_aes128_sha1_80_crypto_cipher = false;
// If set to true, encrypted RTP header extensions as defined in RFC 6904
// will be negotiated. They will only be used if both peers support them.
bool enable_encrypted_rtp_header_extensions = false;
// This feature enables encrypting RTP header extensions using RFC 6904, if
// requested. For this to work the Chromium field trial
// `kWebRtcEncryptedRtpHeaderExtensions` must be enabled.
bool enable_encrypted_rtp_header_extensions = true;
} srtp;
// Options to be used when the FrameEncryptor / FrameDecryptor APIs are used.

View file

@ -161,8 +161,10 @@ class RTC_EXPORT DataChannelInterface : public RefCountInterface {
// DataChannel was created with.
virtual bool ordered() const;
// TODO(hta): Deprecate and remove the following two functions.
virtual uint16_t maxRetransmitTime() const;
virtual uint16_t maxRetransmits() const;
[[deprecated("Use maxPacketLifeTime")]] virtual uint16_t maxRetransmitTime()
const;
[[deprecated("Use maxRetransmitsOpt")]] virtual uint16_t maxRetransmits()
const;
virtual std::optional<int> maxRetransmitsOpt() const;
virtual std::optional<int> maxPacketLifeTime() const;
virtual std::string protocol() const;

View file

@ -49,7 +49,10 @@ class MediaFactoryImpl : public MediaFactory {
absl::Nullable<scoped_refptr<AudioProcessing>> audio_processing =
deps.audio_processing_builder != nullptr
? std::move(deps.audio_processing_builder)->Build(env)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
: std::move(deps.audio_processing);
#pragma clang diagnostic pop
auto audio_engine = std::make_unique<WebRtcVoiceEngine>(
&env.task_queue_factory(), deps.adm.get(),

View file

@ -34,7 +34,10 @@ void EnableMediaWithDefaults(PeerConnectionFactoryDependencies& deps) {
if (deps.audio_decoder_factory == nullptr) {
deps.audio_decoder_factory = CreateBuiltinAudioDecoderFactory();
}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
if (deps.audio_processing == nullptr &&
#pragma clang diagnostic pop
deps.audio_processing_builder == nullptr) {
deps.audio_processing_builder =
std::make_unique<BuiltinAudioProcessingBuilder>();

View file

@ -37,6 +37,7 @@ class VCMProtectionCallback {
// 'retransmission_mode' is either a value of enum RetransmissionMode, or
// computed with bitwise operators on values of enum RetransmissionMode.
virtual void SetRetransmissionMode(int retransmission_mode) = 0;
protected:
virtual ~VCMProtectionCallback() {}
};

View file

@ -22,38 +22,30 @@
namespace {
// This part is copied from system_wrappers/field_trial.cc.
webrtc::flat_map<std::string, std::string> InsertIntoMap(const std::string& s) {
std::string::size_type field_start = 0;
webrtc::flat_map<std::string, std::string> InsertIntoMap(absl::string_view s) {
webrtc::flat_map<std::string, std::string> key_value_map;
while (field_start < s.size()) {
std::string::size_type separator_pos = s.find('/', field_start);
RTC_CHECK_NE(separator_pos, std::string::npos)
while (!s.empty()) {
absl::string_view::size_type separator_pos = s.find('/');
RTC_CHECK_NE(separator_pos, absl::string_view::npos)
<< "Missing separator '/' after field trial key.";
RTC_CHECK_GT(separator_pos, field_start)
<< "Field trial key cannot be empty.";
std::string key = s.substr(field_start, separator_pos - field_start);
field_start = separator_pos + 1;
RTC_CHECK_GT(separator_pos, 0) << "Field trial key cannot be empty.";
absl::string_view key = s.substr(0, separator_pos);
s.remove_prefix(separator_pos + 1);
RTC_CHECK_LT(field_start, s.size())
RTC_CHECK(!s.empty())
<< "Missing value after field trial key. String ended.";
separator_pos = s.find('/', field_start);
RTC_CHECK_NE(separator_pos, std::string::npos)
separator_pos = s.find('/');
RTC_CHECK_NE(separator_pos, absl::string_view::npos)
<< "Missing terminating '/' in field trial string.";
RTC_CHECK_GT(separator_pos, field_start)
<< "Field trial value cannot be empty.";
std::string value = s.substr(field_start, separator_pos - field_start);
field_start = separator_pos + 1;
RTC_CHECK_GT(separator_pos, 0) << "Field trial value cannot be empty.";
absl::string_view value = s.substr(0, separator_pos);
s.remove_prefix(separator_pos + 1);
// If a key is specified multiple times, only the value linked to the first
// key is stored. note: This will crash in debug build when calling
// InitFieldTrialsFromString().
key_value_map.emplace(key, value);
}
// This check is technically redundant due to earlier checks.
// We nevertheless keep the check to make it clear that the entire
// string has been processed, and without indexing past the end.
RTC_CHECK_EQ(field_start, s.size());
return key_value_map;
}
@ -67,7 +59,7 @@ std::atomic<bool> instance_created_{false};
namespace webrtc {
FieldTrials::FieldTrials(const std::string& s)
FieldTrials::FieldTrials(absl::string_view s)
: uses_global_(true),
field_trial_string_(s),
previous_field_trial_string_(webrtc::field_trial::GetFieldTrialString()),
@ -78,11 +70,11 @@ FieldTrials::FieldTrials(const std::string& s)
<< "Only one instance may be instanciated at any given time!";
}
std::unique_ptr<FieldTrials> FieldTrials::CreateNoGlobal(const std::string& s) {
std::unique_ptr<FieldTrials> FieldTrials::CreateNoGlobal(absl::string_view s) {
return std::unique_ptr<FieldTrials>(new FieldTrials(s, true));
}
FieldTrials::FieldTrials(const std::string& s, bool)
FieldTrials::FieldTrials(absl::string_view s, bool)
: uses_global_(false),
previous_field_trial_string_(nullptr),
key_value_map_(InsertIntoMap(s)) {}
@ -96,7 +88,7 @@ FieldTrials::~FieldTrials() {
}
std::string FieldTrials::GetValue(absl::string_view key) const {
auto it = key_value_map_.find(std::string(key));
auto it = key_value_map_.find(key);
if (it != key_value_map_.end())
return it->second;
@ -104,7 +96,7 @@ std::string FieldTrials::GetValue(absl::string_view key) const {
// a mix between FieldTrials and the global string continue to work
// TODO(bugs.webrtc.org/10335): Remove the global string!
if (uses_global_) {
return field_trial::FindFullName(std::string(key));
return field_trial::FindFullName(key);
}
return "";
}

View file

@ -36,15 +36,15 @@ namespace webrtc {
// (unless using CreateNoGlobal):
class FieldTrials : public FieldTrialsRegistry {
public:
explicit FieldTrials(const std::string& s);
explicit FieldTrials(absl::string_view s);
~FieldTrials();
// Create a FieldTrials object that is not reading/writing from
// global variable (i.e can not be used for all parts of webrtc).
static std::unique_ptr<FieldTrials> CreateNoGlobal(const std::string& s);
static std::unique_ptr<FieldTrials> CreateNoGlobal(absl::string_view s);
private:
explicit FieldTrials(const std::string& s, bool);
explicit FieldTrials(absl::string_view s, bool);
std::string GetValue(absl::string_view key) const override;

View file

@ -23,6 +23,7 @@
#include "api/audio_codecs/audio_codec_pair_id.h"
#include "api/audio_codecs/audio_format.h"
#include "api/rtp_headers.h"
#include "api/rtp_packet_info.h"
#include "api/units/timestamp.h"
namespace webrtc {
@ -186,16 +187,24 @@ class NetEq {
virtual int InsertPacket(const RTPHeader& rtp_header,
rtc::ArrayView<const uint8_t> payload) {
// TODO: webrtc:343501093 - removed unused method.
return InsertPacket(rtp_header, payload,
/*receive_time=*/Timestamp::MinusInfinity());
}
// Inserts a new packet into NetEq.
// Returns 0 on success, -1 on failure.
// TODO: webrtc:343501093 - removed unused method.
virtual int InsertPacket(const RTPHeader& rtp_header,
rtc::ArrayView<const uint8_t> payload,
Timestamp /* receive_time */) {
// TODO: webrtc:343501093 - Make this method pure virtual.
Timestamp receive_time) {
return InsertPacket(rtp_header, payload,
RtpPacketInfo(rtp_header, receive_time));
}
// Inserts a new packet into NetEq.
// Returns 0 on success, -1 on failure.
// TODO: webrtc:343501093 - Make this method pure virtual.
virtual int InsertPacket(const RTPHeader& rtp_header,
rtc::ArrayView<const uint8_t> payload,
const RtpPacketInfo& /* rtp_packet_info */) {
return InsertPacket(rtp_header, payload);
}

View file

@ -50,14 +50,14 @@ PeerConnectionInterface::RTCConfiguration::RTCConfiguration(
PeerConnectionInterface::RTCConfiguration::~RTCConfiguration() = default;
// RingRTC change to add ICE forking
// RingRTC change to support ICE forking
rtc::scoped_refptr<webrtc::IceGathererInterface>
PeerConnectionInterface::CreateSharedIceGatherer() {
RTC_LOG(LS_ERROR) << "No shared ICE gatherer in dummy implementation";
return nullptr;
}
// RingRTC change to add ICE forking
// RingRTC change to support ICE forking
bool PeerConnectionInterface::UseSharedIceGatherer(
rtc::scoped_refptr<webrtc::IceGathererInterface> shared_ice_gatherer) {
RTC_LOG(LS_ERROR) << "No shared ICE gatherer in dummy implementation";
@ -110,8 +110,13 @@ PeerConnectionDependencies::~PeerConnectionDependencies() = default;
PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies() =
default;
// TODO: bugs.webrtc.org/369904700 - remove pragma once `audio_processing`
// is removed from PeerConnectionFactoryDependencies.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
PeerConnectionFactoryDependencies::PeerConnectionFactoryDependencies(
PeerConnectionFactoryDependencies&&) = default;
#pragma clang diagnostic pop
PeerConnectionFactoryDependencies::~PeerConnectionFactoryDependencies() =
default;
@ -152,14 +157,4 @@ PeerConnectionFactoryInterface::CreatePeerConnectionOrError(
return RTCError(RTCErrorType::INTERNAL_ERROR);
}
RtpCapabilities PeerConnectionFactoryInterface::GetRtpSenderCapabilities(
cricket::MediaType /* kind */) const {
return {};
}
RtpCapabilities PeerConnectionFactoryInterface::GetRtpReceiverCapabilities(
cricket::MediaType /* kind */) const {
return {};
}
} // namespace webrtc

View file

@ -1160,12 +1160,12 @@ class RTC_EXPORT PeerConnectionInterface : public webrtc::RefCountInterface {
virtual bool RemoveIceCandidates(
const std::vector<cricket::Candidate>& candidates) = 0;
// RingRTC change to add ICE forking
// RingRTC change to support ICE forking
// Creates an IceGatherer that can be shared/used with UseSharedIceGatherer
virtual rtc::scoped_refptr<webrtc::IceGathererInterface>
CreateSharedIceGatherer();
// RingRTC change to add ICE forking
// RingRTC change to support ICE forking
// SetGatherer with the same IceGatherer on many ICE transports to get
// ICE forking behavior. For example, like so:
// auto gatherer = pc1->CreateSharedIceGatherer();
@ -1537,9 +1537,9 @@ struct RTC_EXPORT PeerConnectionFactoryDependencies final {
rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory;
rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory;
rtc::scoped_refptr<AudioMixer> audio_mixer;
// TODO: bugs.webrtc.org/369904700 - Deprecate `audio_processing` in favor
// TODO: bugs.webrtc.org/369904700 - Delete `audio_processing` in favor
// of `audio_processing_builder`.
rtc::scoped_refptr<AudioProcessing> audio_processing;
[[deprecated]] scoped_refptr<AudioProcessing> audio_processing;
std::unique_ptr<AudioProcessingBuilderInterface> audio_processing_builder;
std::unique_ptr<AudioFrameProcessor> audio_frame_processor;
std::unique_ptr<VideoEncoderFactory> video_encoder_factory;
@ -1635,15 +1635,13 @@ class RTC_EXPORT PeerConnectionFactoryInterface
// Returns the capabilities of an RTP sender of type `kind`.
// If for some reason you pass in MEDIA_TYPE_DATA, returns an empty structure.
// TODO(orphis): Make pure virtual when all subclasses implement it.
virtual RtpCapabilities GetRtpSenderCapabilities(
cricket::MediaType kind) const;
cricket::MediaType kind) const = 0;
// Returns the capabilities of an RTP receiver of type `kind`.
// If for some reason you pass in MEDIA_TYPE_DATA, returns an empty structure.
// TODO(orphis): Make pure virtual when all subclasses implement it.
virtual RtpCapabilities GetRtpReceiverCapabilities(
cricket::MediaType kind) const;
cricket::MediaType kind) const = 0;
virtual rtc::scoped_refptr<MediaStreamInterface> CreateLocalMediaStream(
const std::string& stream_id) = 0;

View file

@ -15,8 +15,10 @@
#include <optional>
#include <string>
#include <type_traits>
#include <utility> // For std::move.
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
@ -95,6 +97,24 @@ enum class RTCErrorDetailType {
HARDWARE_ENCODER_ERROR,
};
// Outputs the error as a friendly string. Update this method when adding a new
// error type.
//
// Only intended to be used for logging/diagnostics. The returned char* points
// to literal strings that live for the whole duration of the program.
RTC_EXPORT absl::string_view ToString(RTCErrorType error);
RTC_EXPORT absl::string_view ToString(RTCErrorDetailType error);
template <typename Sink>
void AbslStringify(Sink& sink, RTCErrorType error) {
sink.Append(ToString(error));
}
template <typename Sink>
void AbslStringify(Sink& sink, RTCErrorDetailType error_detail) {
sink.Append(ToString(error_detail));
}
// Roughly corresponds to RTCError in the web api. Holds an error type, a
// message, and possibly additional information specific to that error.
//
@ -146,6 +166,16 @@ class RTC_EXPORT RTCError {
// error occurred.
bool ok() const { return type_ == RTCErrorType::NONE; }
template <typename Sink>
friend void AbslStringify(Sink& sink, const RTCError& error) {
sink.Append(ToString(error.type_));
if (!error.message_.empty()) {
sink.Append(" with message: \"");
sink.Append(error.message_);
sink.Append("\"");
}
}
private:
RTCErrorType type_ = RTCErrorType::NONE;
std::string message_;
@ -153,14 +183,6 @@ class RTC_EXPORT RTCError {
std::optional<uint16_t> sctp_cause_code_;
};
// Outputs the error as a friendly string. Update this method when adding a new
// error type.
//
// Only intended to be used for logging/diagnostics. The returned char* points
// to literal string that lives for the whole duration of the program.
RTC_EXPORT absl::string_view ToString(RTCErrorType error);
RTC_EXPORT absl::string_view ToString(RTCErrorDetailType error);
// Helper macro that can be used by implementations to create an error with a
// message and log it. `message` should be a string literal or movable
// std::string.
@ -307,6 +329,19 @@ class RTCErrorOr {
return std::move(*value_);
}
template <typename Sink>
friend void AbslStringify(Sink& sink, const RTCErrorOr<T>& error_or) {
if (error_or.ok()) {
sink.Append("OK");
if constexpr (std::is_convertible_v<T, absl::AlphaNum>) {
sink.Append(" with value: ");
sink.Append(absl::StrCat(error_or.value()));
}
} else {
sink.Append(absl::StrCat(error_or.error()));
}
}
private:
RTCError error_;
std::optional<T> value_;

View file

@ -13,6 +13,7 @@
#include <string>
#include <utility>
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "rtc_base/checks.h"
#include "test/gtest.h"
@ -147,6 +148,11 @@ TEST(RTCErrorTest, SetMessage) {
EXPECT_STREQ(e.message(), "string");
}
TEST(RTCErrorTest, Stringify) {
RTCError e(RTCErrorType::INVALID_PARAMETER, "foo");
EXPECT_EQ(absl::StrCat(e), "INVALID_PARAMETER with message: \"foo\"");
}
// Test that the default constructor creates an "INTERNAL_ERROR".
TEST(RTCErrorOrTest, DefaultConstructor) {
RTCErrorOr<MoveOnlyInt> e;
@ -212,6 +218,26 @@ TEST(RTCErrorOrTest, MoveValue) {
EXPECT_EQ(value.value, 88);
}
TEST(RTCErrorOrTest, StringifyWithUnprintableValue) {
RTCErrorOr<MoveOnlyInt> e(MoveOnlyInt(1337));
EXPECT_EQ(absl::StrCat(e), "OK");
}
TEST(RTCErrorOrTest, StringifyWithStringValue) {
RTCErrorOr<absl::string_view> e("foo");
EXPECT_EQ(absl::StrCat(e), "OK with value: foo");
}
TEST(RTCErrorOrTest, StringifyWithPrintableValue) {
RTCErrorOr<int> e(1337);
EXPECT_EQ(absl::StrCat(e), "OK with value: 1337");
}
TEST(RTCErrorOrTest, StringifyWithError) {
RTCErrorOr<int> e({RTCErrorType::SYNTAX_ERROR, "message"});
EXPECT_EQ(absl::StrCat(e), "SYNTAX_ERROR with message: \"message\"");
}
// Death tests.
// Disabled on Android because death tests misbehave on Android, see
// base/test/gtest_util.h.

View file

@ -11,7 +11,6 @@
#ifndef API_RTC_EVENT_LOG_OUTPUT_H_
#define API_RTC_EVENT_LOG_OUTPUT_H_
#include "absl/strings/string_view.h"
namespace webrtc {

View file

@ -19,6 +19,7 @@
#include <vector>
#include "absl/container/inlined_vector.h"
#include "absl/strings/str_format.h"
#include "absl/strings/string_view.h"
#include "api/media_types.h"
#include "api/priority.h"
@ -395,6 +396,15 @@ struct RTC_EXPORT RtpExtension {
std::string uri;
int id = 0;
bool encrypt = false;
template <typename Sink>
friend void AbslStringify(Sink& sink, const RtpExtension& extension) {
if (extension.encrypt) {
absl::Format(&sink, "[%d %s (encrypted)]", extension.id, extension.uri);
} else {
absl::Format(&sink, "[%d %s]", extension.id, extension.uri);
}
}
};
struct RTC_EXPORT RtpFecParameters {

View file

@ -73,7 +73,6 @@ namespace webrtc {
template <class T>
class ABSL_NULLABILITY_COMPATIBLE scoped_refptr {
public:
using absl_nullability_compatible = void;
using element_type = T;
scoped_refptr() : ptr_(nullptr) {}

View file

@ -14,18 +14,15 @@
#include <stddef.h>
#include <stdint.h>
#include <map>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include "api/stats/attribute.h"
#include "api/units/timestamp.h"
#include "rtc_base/checks.h"
#include "rtc_base/system/rtc_export.h"
#include "rtc_base/system/rtc_export_template.h"
namespace webrtc {
@ -66,6 +63,7 @@ class RTC_EXPORT RTCStats {
const std::string& id() const { return id_; }
// Time relative to the UNIX epoch (Jan 1, 1970, UTC), in microseconds.
Timestamp timestamp() const { return timestamp_; }
void set_timestamp(Timestamp timestamp) { timestamp_ = timestamp; }
// Returns the static member variable `kType` of the implementing class.
virtual const char* type() const = 0;
@ -106,7 +104,7 @@ class RTC_EXPORT RTCStats {
virtual std::vector<Attribute> AttributesImpl(
size_t additional_capacity) const;
std::string const id_;
std::string id_;
Timestamp timestamp_;
};
@ -150,7 +148,7 @@ class RTC_EXPORT RTCStats {
// bar("bar") {
// }
//
#define WEBRTC_RTCSTATS_DECL() \
#define WEBRTC_RTCSTATS_DECL(SelfT) \
protected: \
std::vector<webrtc::Attribute> AttributesImpl(size_t additional_capacity) \
const override; \
@ -158,6 +156,11 @@ class RTC_EXPORT RTCStats {
public: \
static const char kType[]; \
\
template <typename Sink> \
friend void AbslStringify(Sink& sink, const SelfT& stats) { \
sink.Append(stats.ToJson()); \
} \
\
std::unique_ptr<webrtc::RTCStats> copy() const override; \
const char* type() const override

View file

@ -17,9 +17,9 @@
#include <memory>
#include <optional>
#include <string>
#include <vector>
#include "api/stats/rtc_stats.h"
#include "api/units/timestamp.h"
#include "rtc_base/system/rtc_export.h"
namespace webrtc {
@ -27,7 +27,7 @@ namespace webrtc {
// https://w3c.github.io/webrtc-stats/#certificatestats-dict*
class RTC_EXPORT RTCCertificateStats final : public RTCStats {
public:
WEBRTC_RTCSTATS_DECL();
WEBRTC_RTCSTATS_DECL(RTCCertificateStats);
RTCCertificateStats(std::string id, Timestamp timestamp);
~RTCCertificateStats() override;
@ -40,7 +40,7 @@ class RTC_EXPORT RTCCertificateStats final : public RTCStats {
// https://w3c.github.io/webrtc-stats/#codec-dict*
class RTC_EXPORT RTCCodecStats final : public RTCStats {
public:
WEBRTC_RTCSTATS_DECL();
WEBRTC_RTCSTATS_DECL(RTCCodecStats);
RTCCodecStats(std::string id, Timestamp timestamp);
~RTCCodecStats() override;
@ -55,7 +55,7 @@ class RTC_EXPORT RTCCodecStats final : public RTCStats {
// https://w3c.github.io/webrtc-stats/#dcstats-dict*
class RTC_EXPORT RTCDataChannelStats final : public RTCStats {
public:
WEBRTC_RTCSTATS_DECL();
WEBRTC_RTCSTATS_DECL(RTCDataChannelStats);
RTCDataChannelStats(std::string id, Timestamp timestamp);
~RTCDataChannelStats() override;
@ -72,7 +72,7 @@ class RTC_EXPORT RTCDataChannelStats final : public RTCStats {
// https://w3c.github.io/webrtc-stats/#candidatepair-dict*
class RTC_EXPORT RTCIceCandidatePairStats final : public RTCStats {
public:
WEBRTC_RTCSTATS_DECL();
WEBRTC_RTCSTATS_DECL(RTCIceCandidatePairStats);
RTCIceCandidatePairStats(std::string id, Timestamp timestamp);
~RTCIceCandidatePairStats() override;
@ -110,7 +110,7 @@ class RTC_EXPORT RTCIceCandidatePairStats final : public RTCStats {
// https://w3c.github.io/webrtc-stats/#icecandidate-dict*
class RTC_EXPORT RTCIceCandidateStats : public RTCStats {
public:
WEBRTC_RTCSTATS_DECL();
WEBRTC_RTCSTATS_DECL(RTCIceCandidateStats);
~RTCIceCandidateStats() override;
std::optional<std::string> transport_id;
@ -165,7 +165,7 @@ class RTC_EXPORT RTCRemoteIceCandidateStats final
// https://w3c.github.io/webrtc-stats/#pcstats-dict*
class RTC_EXPORT RTCPeerConnectionStats final : public RTCStats {
public:
WEBRTC_RTCSTATS_DECL();
WEBRTC_RTCSTATS_DECL(RTCPeerConnectionStats);
RTCPeerConnectionStats(std::string id, Timestamp timestamp);
~RTCPeerConnectionStats() override;
@ -176,7 +176,7 @@ class RTC_EXPORT RTCPeerConnectionStats final : public RTCStats {
// https://w3c.github.io/webrtc-stats/#streamstats-dict*
class RTC_EXPORT RTCRtpStreamStats : public RTCStats {
public:
WEBRTC_RTCSTATS_DECL();
WEBRTC_RTCSTATS_DECL(RTCRtpStreamStats);
~RTCRtpStreamStats() override;
std::optional<uint32_t> ssrc;
@ -191,7 +191,7 @@ class RTC_EXPORT RTCRtpStreamStats : public RTCStats {
// https://www.w3.org/TR/webrtc-stats/#receivedrtpstats-dict*
class RTC_EXPORT RTCReceivedRtpStreamStats : public RTCRtpStreamStats {
public:
WEBRTC_RTCSTATS_DECL();
WEBRTC_RTCSTATS_DECL(RTCReceivedRtpStreamStats);
~RTCReceivedRtpStreamStats() override;
std::optional<double> jitter;
@ -204,7 +204,7 @@ class RTC_EXPORT RTCReceivedRtpStreamStats : public RTCRtpStreamStats {
// https://www.w3.org/TR/webrtc-stats/#sentrtpstats-dict*
class RTC_EXPORT RTCSentRtpStreamStats : public RTCRtpStreamStats {
public:
WEBRTC_RTCSTATS_DECL();
WEBRTC_RTCSTATS_DECL(RTCSentRtpStreamStats);
~RTCSentRtpStreamStats() override;
std::optional<uint64_t> packets_sent;
@ -218,7 +218,7 @@ class RTC_EXPORT RTCSentRtpStreamStats : public RTCRtpStreamStats {
class RTC_EXPORT RTCInboundRtpStreamStats final
: public RTCReceivedRtpStreamStats {
public:
WEBRTC_RTCSTATS_DECL();
WEBRTC_RTCSTATS_DECL(RTCInboundRtpStreamStats);
RTCInboundRtpStreamStats(std::string id, Timestamp timestamp);
~RTCInboundRtpStreamStats() override;
@ -324,7 +324,7 @@ class RTC_EXPORT RTCInboundRtpStreamStats final
class RTC_EXPORT RTCOutboundRtpStreamStats final
: public RTCSentRtpStreamStats {
public:
WEBRTC_RTCSTATS_DECL();
WEBRTC_RTCSTATS_DECL(RTCOutboundRtpStreamStats);
RTCOutboundRtpStreamStats(std::string id, Timestamp timestamp);
~RTCOutboundRtpStreamStats() override;
@ -374,7 +374,7 @@ class RTC_EXPORT RTCOutboundRtpStreamStats final
class RTC_EXPORT RTCRemoteInboundRtpStreamStats final
: public RTCReceivedRtpStreamStats {
public:
WEBRTC_RTCSTATS_DECL();
WEBRTC_RTCSTATS_DECL(RTCRemoteInboundRtpStreamStats);
RTCRemoteInboundRtpStreamStats(std::string id, Timestamp timestamp);
~RTCRemoteInboundRtpStreamStats() override;
@ -389,7 +389,7 @@ class RTC_EXPORT RTCRemoteInboundRtpStreamStats final
class RTC_EXPORT RTCRemoteOutboundRtpStreamStats final
: public RTCSentRtpStreamStats {
public:
WEBRTC_RTCSTATS_DECL();
WEBRTC_RTCSTATS_DECL(RTCRemoteOutboundRtpStreamStats);
RTCRemoteOutboundRtpStreamStats(std::string id, Timestamp timestamp);
~RTCRemoteOutboundRtpStreamStats() override;
@ -404,7 +404,7 @@ class RTC_EXPORT RTCRemoteOutboundRtpStreamStats final
// https://w3c.github.io/webrtc-stats/#dom-rtcmediasourcestats
class RTC_EXPORT RTCMediaSourceStats : public RTCStats {
public:
WEBRTC_RTCSTATS_DECL();
WEBRTC_RTCSTATS_DECL(RTCMediaSourceStats);
~RTCMediaSourceStats() override;
std::optional<std::string> track_identifier;
@ -417,7 +417,7 @@ class RTC_EXPORT RTCMediaSourceStats : public RTCStats {
// https://w3c.github.io/webrtc-stats/#dom-rtcaudiosourcestats
class RTC_EXPORT RTCAudioSourceStats final : public RTCMediaSourceStats {
public:
WEBRTC_RTCSTATS_DECL();
WEBRTC_RTCSTATS_DECL(RTCAudioSourceStats);
RTCAudioSourceStats(std::string id, Timestamp timestamp);
~RTCAudioSourceStats() override;
@ -431,7 +431,7 @@ class RTC_EXPORT RTCAudioSourceStats final : public RTCMediaSourceStats {
// https://w3c.github.io/webrtc-stats/#dom-rtcvideosourcestats
class RTC_EXPORT RTCVideoSourceStats final : public RTCMediaSourceStats {
public:
WEBRTC_RTCSTATS_DECL();
WEBRTC_RTCSTATS_DECL(RTCVideoSourceStats);
RTCVideoSourceStats(std::string id, Timestamp timestamp);
~RTCVideoSourceStats() override;
@ -444,7 +444,7 @@ class RTC_EXPORT RTCVideoSourceStats final : public RTCMediaSourceStats {
// https://w3c.github.io/webrtc-stats/#transportstats-dict*
class RTC_EXPORT RTCTransportStats final : public RTCStats {
public:
WEBRTC_RTCSTATS_DECL();
WEBRTC_RTCSTATS_DECL(RTCTransportStats);
RTCTransportStats(std::string id, Timestamp timestamp);
~RTCTransportStats() override;
@ -470,7 +470,7 @@ class RTC_EXPORT RTCTransportStats final : public RTCStats {
// https://w3c.github.io/webrtc-stats/#playoutstats-dict*
class RTC_EXPORT RTCAudioPlayoutStats final : public RTCStats {
public:
WEBRTC_RTCSTATS_DECL();
WEBRTC_RTCSTATS_DECL(RTCAudioPlayoutStats);
RTCAudioPlayoutStats(const std::string& id, Timestamp timestamp);
~RTCAudioPlayoutStats() override;

View file

@ -90,21 +90,7 @@ rtc_library("default_task_queue_factory") {
"../../rtc_base/memory:always_valid_pointer",
]
if (rtc_enable_libevent) {
if (is_android) {
sources +=
[ "default_task_queue_factory_stdlib_or_libevent_experiment.cc" ]
deps += [
"../../api/transport:field_trial_based_config",
"../../rtc_base:logging",
"../../rtc_base:rtc_task_queue_libevent",
"../../rtc_base:rtc_task_queue_stdlib",
]
} else {
sources += [ "default_task_queue_factory_libevent.cc" ]
deps += [ "../../rtc_base:rtc_task_queue_libevent" ]
}
} else if (is_mac || is_ios) {
if (is_mac || is_ios) {
sources += [ "default_task_queue_factory_gcd.cc" ]
deps += [ "../../rtc_base:rtc_task_queue_gcd" ]
} else if (is_win && current_os != "winuwp" && !build_with_chromium) {

View file

@ -1,26 +0,0 @@
/*
* Copyright 2022 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <memory>
#include "api/field_trials_view.h"
#include "api/task_queue/task_queue_factory.h"
#include "api/transport/field_trial_based_config.h"
#include "rtc_base/memory/always_valid_pointer.h"
#include "rtc_base/task_queue_stdlib.h"
namespace webrtc {
std::unique_ptr<TaskQueueFactory> CreateDefaultTaskQueueFactory(
const FieldTrialsView* field_trials_view) {
return CreateTaskQueueStdlibFactory();
}
} // namespace webrtc

View file

@ -56,4 +56,7 @@ specific_include_rules = {
"videocodec_test_fixture\.h": [
"+modules/video_coding/codecs/h264/include/h264_globals.h",
],
"rtc_error_matchers\.h": [
"+test/gmock.h",
],
}

View file

@ -73,15 +73,11 @@ std::unique_ptr<FrameGeneratorInterface> CreateFromNV12FileFrameGenerator(
frame_repeat_count);
}
std::unique_ptr<FrameGeneratorInterface> CreateFromIvfFileFrameGenerator(
std::string filename) {
return CreateFromIvfFileFrameGenerator(CreateEnvironment(), filename);
}
absl::Nonnull<std::unique_ptr<FrameGeneratorInterface>>
CreateFromIvfFileFrameGenerator(const Environment& env,
absl::string_view filename) {
return std::make_unique<IvfVideoFrameGenerator>(env, filename);
absl::string_view filename,
std::optional<int> fps_hint) {
return std::make_unique<IvfVideoFrameGenerator>(env, filename, fps_hint);
}
std::unique_ptr<FrameGeneratorInterface>

View file

@ -55,13 +55,10 @@ std::unique_ptr<FrameGeneratorInterface> CreateFromNV12FileFrameGenerator(
size_t height,
int frame_repeat_count = 1);
// Creates a frame generator that repeatedly plays an ivf file.
[[deprecated]] std::unique_ptr<FrameGeneratorInterface>
CreateFromIvfFileFrameGenerator(std::string filename);
absl::Nonnull<std::unique_ptr<FrameGeneratorInterface>>
CreateFromIvfFileFrameGenerator(const Environment& env,
absl::string_view filename);
absl::string_view filename,
std::optional<int> fps_hint = std::nullopt);
// Creates a frame generator which takes a set of yuv files (wrapping a
// frame generator created by CreateFromYuvFile() above), but outputs frames

View file

@ -22,7 +22,7 @@ namespace webrtc {
std::unique_ptr<NetworkEmulationManager> CreateNetworkEmulationManager(
NetworkEmulationManagerConfig config = NetworkEmulationManagerConfig());
[[deprecated("Use version with NetworkEmulationManagerConfig)")]]
[[deprecated("Use version with NetworkEmulationManagerConfig)")]] //
std::unique_ptr<NetworkEmulationManager>
CreateNetworkEmulationManager(
TimeMode time_mode,

View file

@ -26,16 +26,10 @@
#include "pc/media_factory.h"
#include "rtc_base/checks.h"
#include "system_wrappers/include/clock.h"
#include "test/time_controller/external_time_controller.h"
#include "test/time_controller/simulated_time_controller.h"
namespace webrtc {
std::unique_ptr<TimeController> CreateTimeController(
ControlledAlarmClock* alarm) {
return std::make_unique<ExternalTimeController>(alarm);
}
std::unique_ptr<TimeController> CreateSimulatedTimeController() {
return std::make_unique<GlobalSimulatedTimeController>(
Timestamp::Seconds(10000));

View file

@ -17,10 +17,6 @@
namespace webrtc {
// Creates a time coltroller that wraps `alarm`.
std::unique_ptr<TimeController> CreateTimeController(
ControlledAlarmClock* alarm);
// Creates a time controller that runs in simulated time.
std::unique_ptr<TimeController> CreateSimulatedTimeController();

View file

@ -1,78 +0,0 @@
/*
* Copyright 2019 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "api/test/create_time_controller.h"
#include <functional>
#include "api/test/time_controller.h"
#include "api/units/time_delta.h"
#include "api/units/timestamp.h"
#include "system_wrappers/include/clock.h"
#include "test/gtest.h"
namespace webrtc {
namespace {
class FakeAlarm : public ControlledAlarmClock {
public:
explicit FakeAlarm(Timestamp start_time);
Clock* GetClock() override;
bool ScheduleAlarmAt(Timestamp deadline) override;
void SetCallback(std::function<void()> callback) override;
void Sleep(TimeDelta duration) override;
private:
SimulatedClock clock_;
Timestamp deadline_;
std::function<void()> callback_;
};
FakeAlarm::FakeAlarm(Timestamp start_time)
: clock_(start_time),
deadline_(Timestamp::PlusInfinity()),
callback_([] {}) {}
Clock* FakeAlarm::GetClock() {
return &clock_;
}
bool FakeAlarm::ScheduleAlarmAt(Timestamp deadline) {
if (deadline < deadline_) {
deadline_ = deadline;
return true;
}
return false;
}
void FakeAlarm::SetCallback(std::function<void()> callback) {
callback_ = callback;
}
void FakeAlarm::Sleep(TimeDelta duration) {
Timestamp end_time = clock_.CurrentTime() + duration;
while (deadline_ <= end_time) {
clock_.AdvanceTime(deadline_ - clock_.CurrentTime());
deadline_ = Timestamp::PlusInfinity();
callback_();
}
clock_.AdvanceTime(end_time - clock_.CurrentTime());
}
TEST(CreateTimeControllerTest, CreatesNonNullController) {
FakeAlarm alarm(Timestamp::Millis(100));
EXPECT_NE(CreateTimeController(&alarm), nullptr);
}
} // namespace
} // namespace webrtc

View file

@ -45,7 +45,9 @@ class MockRtpSender : public RtpSenderInterface {
track,
(),
(const, override));
MOCK_METHOD(rtc::scoped_refptr<DtlsTransportInterface>, dtls_transport, (),
MOCK_METHOD(rtc::scoped_refptr<DtlsTransportInterface>,
dtls_transport,
(),
(const, override));
MOCK_METHOD(uint32_t, ssrc, (), (const, override));
MOCK_METHOD(cricket::MediaType, media_type, (), (const, override));

View file

@ -33,7 +33,9 @@ class MockTransformableAudioFrame : public TransformableAudioFrameInterface {
MOCK_METHOD(uint32_t, GetSsrc, (), (const, override));
MOCK_METHOD(uint32_t, GetTimestamp, (), (const, override));
MOCK_METHOD(std::string, GetMimeType, (), (const, override));
MOCK_METHOD(rtc::ArrayView<const uint32_t>, GetContributingSources, (),
MOCK_METHOD(rtc::ArrayView<const uint32_t>,
GetContributingSources,
(),
(const, override));
MOCK_METHOD(const std::optional<uint16_t>,
SequenceNumber,

View file

@ -64,8 +64,7 @@ class MockVideoDecoder : public VideoDecoder {
MOCK_METHOD(bool, Configure, (const Settings& settings), (override));
MOCK_METHOD(int32_t,
Decode,
(const EncodedImage& input_image,
int64_t render_time_ms),
(const EncodedImage& input_image, int64_t render_time_ms),
(override));
MOCK_METHOD(int32_t,
Decode,

View file

@ -38,6 +38,8 @@ rtc_library("network_emulation") {
sources = [
"cross_traffic.h",
"ecn_marking_counter.cc",
"ecn_marking_counter.h",
"network_emulation_interfaces.cc",
"network_emulation_interfaces.h",
]
@ -52,6 +54,7 @@ rtc_library("network_emulation") {
"../../../rtc_base:socket_address",
"../../numerics",
"../../task_queue",
"../../transport:ecn_marking",
"../../units:data_rate",
"../../units:data_size",
"../../units:time_delta",

View file

@ -0,0 +1,40 @@
/*
* Copyright 2024 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "api/test/network_emulation/ecn_marking_counter.h"
namespace webrtc {
void EcnMarkingCounter::Add(EcnMarking ecn) {
switch (ecn) {
case EcnMarking::kNotEct:
++not_ect_;
break;
case EcnMarking::kEct0:
++ect_0_;
break;
case EcnMarking::kEct1:
++ect_1_;
break;
case EcnMarking::kCe:
++ce_;
break;
}
}
EcnMarkingCounter& EcnMarkingCounter::operator+=(
const EcnMarkingCounter& counter) {
not_ect_ += counter.not_ect();
ect_0_ += counter.ect_0();
ect_1_ += counter.ect_1();
ce_ += counter.ce();
return *this;
}
} // namespace webrtc

View file

@ -0,0 +1,41 @@
/*
* Copyright 2024 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef API_TEST_NETWORK_EMULATION_ECN_MARKING_COUNTER_H_
#define API_TEST_NETWORK_EMULATION_ECN_MARKING_COUNTER_H_
#include "api/transport/ecn_marking.h"
namespace webrtc {
// Counts Explicit Congestion Notifaction marks in IP packets.
// https://www.rfc-editor.org/rfc/rfc9331.html
class EcnMarkingCounter {
public:
// Number of packets without ECT explicitly set sent through the network.
int not_ect() const { return not_ect_; }
// Number of packets with ECT(1) sent through the network.
int ect_0() const { return ect_0_; }
// Number of packets with ECT(1) sent through the network.
int ect_1() const { return ect_1_; }
// Number of packets the network has marked as CE (congestion experienced).
int ce() const { return ce_; }
void Add(EcnMarking ecn);
EcnMarkingCounter& operator+=(const EcnMarkingCounter& counter);
private:
int not_ect_ = 0;
int ect_0_ = 0; // Not used by WebRTC or L4S.
int ect_1_ = 0;
int ce_ = 0;
};
} // namespace webrtc
#endif // API_TEST_NETWORK_EMULATION_ECN_MARKING_COUNTER_H_

View file

@ -25,13 +25,15 @@ EmulatedIpPacket::EmulatedIpPacket(const rtc::SocketAddress& from,
const rtc::SocketAddress& to,
rtc::CopyOnWriteBuffer data,
Timestamp arrival_time,
uint16_t application_overhead)
uint16_t application_overhead,
EcnMarking ecn)
: from(from),
to(to),
data(data),
headers_size(to.ipaddr().overhead() + application_overhead +
cricket::kUdpHeaderSize),
arrival_time(arrival_time) {
arrival_time(arrival_time),
ecn(ecn) {
RTC_DCHECK(to.family() == AF_INET || to.family() == AF_INET6);
}

View file

@ -18,6 +18,8 @@
#include <vector>
#include "api/numerics/samples_stats_counter.h"
#include "api/test/network_emulation/ecn_marking_counter.h"
#include "api/transport/ecn_marking.h"
#include "api/units/data_rate.h"
#include "api/units/data_size.h"
#include "api/units/timestamp.h"
@ -33,7 +35,8 @@ struct EmulatedIpPacket {
const rtc::SocketAddress& to,
rtc::CopyOnWriteBuffer data,
Timestamp arrival_time,
uint16_t application_overhead = 0);
uint16_t application_overhead = 0,
EcnMarking ecn = EcnMarking::kNotEct);
~EmulatedIpPacket() = default;
// This object is not copyable or assignable.
EmulatedIpPacket(const EmulatedIpPacket&) = delete;
@ -52,6 +55,7 @@ struct EmulatedIpPacket {
rtc::CopyOnWriteBuffer data;
uint16_t headers_size;
Timestamp arrival_time;
EcnMarking ecn;
};
// Interface for handling IP packets from an emulated network. This is used with
@ -80,6 +84,8 @@ struct EmulatedNetworkOutgoingStats {
// Time of the last packet sent or infinite value if no packets were sent.
Timestamp last_packet_sent_time = Timestamp::MinusInfinity();
EcnMarkingCounter ecn_count;
// Returns average send rate. Requires that at least 2 packets were sent.
DataRate AverageSendRate() const;
};
@ -115,6 +121,8 @@ struct EmulatedNetworkIncomingStats {
// received.
Timestamp last_packet_received_time = Timestamp::MinusInfinity();
EcnMarkingCounter ecn_count;
DataRate AverageReceiveRate() const;
};
@ -254,7 +262,8 @@ class EmulatedEndpoint : public EmulatedNetworkReceiverInterface {
virtual void SendPacket(const rtc::SocketAddress& from,
const rtc::SocketAddress& to,
rtc::CopyOnWriteBuffer packet_data,
uint16_t application_overhead = 0) = 0;
uint16_t application_overhead = 0,
EcnMarking ecn = EcnMarking::kNotEct) = 0;
// Binds receiver to this endpoint to send and receive data.
// `desired_port` is a port that should be used. If it is equal to 0,

View file

@ -92,6 +92,7 @@ struct EmulatedEndpointConfig {
struct EmulatedTURNServerConfig {
EmulatedEndpointConfig client_config;
EmulatedEndpointConfig peer_config;
bool enable_permission_checks = true;
};
// EmulatedTURNServer is an abstraction for a TURN server.

View file

@ -74,7 +74,6 @@ rtc_library("media_quality_test_params") {
"../../../api/video_codecs:video_codecs_api",
"../../../p2p:connection",
"../../../p2p:port_allocator",
"../../../p2p:rtc_p2p",
"../../../rtc_base:checks",
"../../../rtc_base:network",
"../../../rtc_base:rtc_certificate_generator",

View file

@ -220,9 +220,6 @@ VideoConfig::VideoConfig(absl::string_view stream_label,
int32_t fps)
: width(width), height(height), fps(fps), stream_label(stream_label) {}
AudioConfig::AudioConfig(absl::string_view stream_label)
: stream_label(stream_label) {}
VideoCodecConfig::VideoCodecConfig(absl::string_view name)
: name(name), required_params() {}

View file

@ -348,9 +348,6 @@ struct VideoConfig {
// Contains properties for audio in the call.
struct AudioConfig {
AudioConfig() = default;
explicit AudioConfig(absl::string_view stream_label);
// Have to be unique among all specified configs for all peers in the call.
// Will be auto generated if omitted.
std::optional<std::string> stream_label;

View file

@ -0,0 +1,94 @@
/*
* Copyright 2024 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef API_TEST_RTC_ERROR_MATCHERS_H_
#define API_TEST_RTC_ERROR_MATCHERS_H_
#include <string>
#include "absl/strings/str_cat.h"
#include "api/rtc_error.h"
#include "test/gmock.h"
namespace webrtc {
MATCHER(IsRtcOk, "") {
if (!arg.ok()) {
*result_listener << "Expected OK, got " << absl::StrCat(arg);
return false;
}
return true;
}
MATCHER_P(IsRtcOkAndHolds,
matcher,
"RtcErrorOr that is holding an OK status and ") {
if (!arg.ok()) {
*result_listener << "Expected OK, got " << absl::StrCat(arg);
return false;
}
return testing::ExplainMatchResult(matcher, arg.value(), result_listener);
}
MATCHER_P(IsRtcErrorWithType, error_type, ToString(error_type)) {
if (arg.ok()) {
*result_listener << "Expected " << ToString(error_type) << ", got OK.";
return false;
}
if (arg.type() != error_type) {
*result_listener << "Expected " << ToString(error_type) << ", got "
<< ToString(arg.type());
return false;
}
return true;
}
MATCHER_P2(IsRtcErrorWithTypeAndMessage,
error_type,
message,
ToString(error_type)) {
if (arg.ok()) {
*result_listener << "Expected " << ToString(error_type) << ", got OK.";
return false;
}
if (arg.type() != error_type) {
*result_listener << "Expected " << ToString(error_type) << ", got "
<< ToString(arg.type());
return false;
}
if (std::string(arg.message()) != message) {
*result_listener << "Expected message \"" << message << "\", got \""
<< arg.message() << "\"";
return false;
}
return true;
}
MATCHER_P2(IsRtcErrorOrWithMessage,
error_matcher,
message_matcher,
"RtcErrorOr that is holding an error that " +
testing::DescribeMatcher<RTCError>(error_matcher, negation) +
(negation ? " or " : " and ") + " with a message that " +
testing::DescribeMatcher<std::string>(message_matcher,
negation)) {
if (arg.ok()) {
*result_listener << "Expected error, got " << absl::StrCat(arg);
return false;
}
return testing::ExplainMatchResult(error_matcher, arg.error(),
result_listener) &&
testing::ExplainMatchResult(message_matcher, arg.error().message(),
result_listener);
}
} // namespace webrtc
#endif // API_TEST_RTC_ERROR_MATCHERS_H_

View file

@ -19,24 +19,40 @@
#include <vector>
#include "absl/functional/any_invocable.h"
#include "api/transport/ecn_marking.h"
#include "api/units/data_rate.h"
namespace webrtc {
struct PacketInFlightInfo {
PacketInFlightInfo(size_t size,
int64_t send_time_us,
uint64_t packet_id,
webrtc::EcnMarking ecn)
: size(size),
send_time_us(send_time_us),
packet_id(packet_id),
ecn(ecn) {}
PacketInFlightInfo(size_t size, int64_t send_time_us, uint64_t packet_id)
: size(size), send_time_us(send_time_us), packet_id(packet_id) {}
: PacketInFlightInfo(size,
send_time_us,
packet_id,
webrtc::EcnMarking::kNotEct) {}
size_t size;
int64_t send_time_us;
// Unique identifier for the packet in relation to other packets in flight.
uint64_t packet_id;
webrtc::EcnMarking ecn;
};
struct PacketDeliveryInfo {
static constexpr int kNotReceived = -1;
PacketDeliveryInfo(PacketInFlightInfo source, int64_t receive_time_us)
: receive_time_us(receive_time_us), packet_id(source.packet_id) {}
: receive_time_us(receive_time_us),
packet_id(source.packet_id),
ecn(source.ecn) {}
bool operator==(const PacketDeliveryInfo& other) const {
return receive_time_us == other.receive_time_us &&
@ -45,6 +61,7 @@ struct PacketDeliveryInfo {
int64_t receive_time_us;
uint64_t packet_id;
webrtc::EcnMarking ecn;
};
// BuiltInNetworkBehaviorConfig is a built-in network behavior configuration

View file

@ -62,28 +62,5 @@ class TimeController {
TimeDelta max_duration = TimeDelta::Seconds(5));
};
// Interface for telling time, scheduling an event to fire at a particular time,
// and waiting for time to pass.
class ControlledAlarmClock {
public:
virtual ~ControlledAlarmClock() = default;
// Gets a clock that tells the alarm clock's notion of time.
virtual Clock* GetClock() = 0;
// Schedules the alarm to fire at `deadline`.
// An alarm clock only supports one deadline. Calls to `ScheduleAlarmAt` with
// an earlier deadline will reset the alarm to fire earlier.Calls to
// `ScheduleAlarmAt` with a later deadline are ignored. Returns true if the
// deadline changed, false otherwise.
virtual bool ScheduleAlarmAt(Timestamp deadline) = 0;
// Sets the callback that should be run when the alarm fires.
virtual void SetCallback(std::function<void()> callback) = 0;
// Waits for `duration` to pass, according to the alarm clock.
virtual void Sleep(TimeDelta duration) = 0;
};
} // namespace webrtc
#endif // API_TEST_TIME_CONTROLLER_H_

View file

@ -179,6 +179,7 @@ struct RTC_EXPORT TransportPacketsFeedback {
Timestamp feedback_time = Timestamp::PlusInfinity();
DataSize data_in_flight = DataSize::Zero();
bool transport_supports_ecn = false;
std::vector<PacketResult> packet_feedbacks;
// Arrival times for messages without send time information.

View file

@ -32,3 +32,23 @@ rtc_source_set("dependency_descriptor") {
"//third_party/abseil-cpp/absl/strings:string_view",
]
}
rtc_source_set("corruption_detection_message") {
visibility = [ "*" ]
sources = [ "corruption_detection_message.h" ]
deps = [
"../../../api:array_view",
"//third_party/abseil-cpp/absl/container:inlined_vector",
]
}
if (rtc_include_tests && !build_with_chromium) {
rtc_library("corruption_detection_message_unittest") {
testonly = true
sources = [ "corruption_detection_message_unittest.cc" ]
deps = [
":corruption_detection_message",
"../../../test:test_support",
]
}
}

View file

@ -8,8 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef COMMON_VIDEO_CORRUPTION_DETECTION_MESSAGE_H_
#define COMMON_VIDEO_CORRUPTION_DETECTION_MESSAGE_H_
#ifndef API_TRANSPORT_RTP_CORRUPTION_DETECTION_MESSAGE_H_
#define API_TRANSPORT_RTP_CORRUPTION_DETECTION_MESSAGE_H_
#include <cstddef>
#include <optional>
@ -150,4 +150,4 @@ class CorruptionDetectionMessage::Builder {
} // namespace webrtc
#endif // COMMON_VIDEO_CORRUPTION_DETECTION_MESSAGE_H_
#endif // API_TRANSPORT_RTP_CORRUPTION_DETECTION_MESSAGE_H_

View file

@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "common_video/corruption_detection_message.h"
#include "api/transport/rtp/corruption_detection_message.h"
#include <optional>
#include <vector>

View file

@ -18,12 +18,9 @@
// These classes are not part of the API, and are treated as opaque pointers.
namespace cricket {
class SctpTransportInternal;
class DtlsTransportInternal;
} // namespace cricket
namespace rtc {
class PacketTransportInternal;
} // namespace rtc
namespace webrtc {
// Factory class which can be used to allow fake SctpTransports to be injected
@ -37,7 +34,7 @@ class SctpTransportFactoryInterface {
// Create an SCTP transport using `channel` for the underlying transport.
virtual std::unique_ptr<cricket::SctpTransportInternal> CreateSctpTransport(
const Environment& env,
rtc::PacketTransportInternal* channel) = 0;
cricket::DtlsTransportInternal* channel) = 0;
};
} // namespace webrtc

View file

@ -722,6 +722,9 @@ enum IceAttributeType {
STUN_ATTR_GOOG_DELTA_SYNC_REQ = 0xC05E, // Not yet implemented.
// MESSAGE-INTEGRITY truncated to 32-bit.
STUN_ATTR_GOOG_MESSAGE_INTEGRITY_32 = 0xC060,
// Experimental: piggybacking the DTLS handshake in STUN.
STUN_ATTR_META_DTLS_IN_STUN = 0xC070,
STUN_ATTR_META_DTLS_IN_STUN_ACK = 0xC071,
};
// When adding new attributes to STUN_ATTR_GOOG_MISC_INFO

View file

@ -175,6 +175,44 @@ enum RtcpMuxPolicyUsage {
kRtcpMuxPolicyUsageMax
};
// Metrics for SDP munging.
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused. Keep in sync with SdpMungingType from
// tools/metrics/histograms/metadata/web_rtc/enums.xml
enum SdpMungingType {
kNoModification = 0,
kUnknownModification = 1,
kWithoutCreateAnswer = 2,
kWithoutCreateOffer = 3,
kNumberOfContents = 4,
// Transport-related munging.
kIceOptions = 20,
kIcePwd = 21,
kIceUfrag = 22,
kIceMode = 23,
kDtlsSetup = 24,
kMid = 25,
kSsrcs = 27,
// RTP header extension munging.
kRtpHeaderExtensionRemoved = 40,
kRtpHeaderExtensionAdded = 41,
kRtpHeaderExtensionModified = 42,
// Audio-related munging.
kAudioCodecsRemoved = 60,
kAudioCodecsAdded = 61,
kAudioCodecsReordered = 62,
kAudioCodecsAddedMultiOpus = 63,
kAudioCodecsAddedL16 = 64,
kAudioCodecsFmtpOpusStereo = 68,
// Video-related munging.
kVideoCodecsRemoved = 80,
kVideoCodecsAdded = 81,
kVideoCodecsReordered = 82,
kVideoCodecsLegacySimulcast = 83,
kVideoCodecsFmtpH264SpsPpsIdrInKeyframe = 84,
kMaxValue,
};
// When adding new metrics please consider using the style described in
// https://chromium.googlesource.com/chromium/src.git/+/HEAD/tools/metrics/histograms/README.md#usage
// instead of the legacy enums used above.

View file

@ -46,7 +46,7 @@ class DataRate final : public rtc_units_impl::RelativeUnit<DataRate> {
}
static constexpr DataRate Infinity() { return PlusInfinity(); }
DataRate() = delete;
constexpr DataRate() = default;
template <typename Sink>
friend void AbslStringify(Sink& sink, DataRate value);

View file

@ -34,6 +34,7 @@ TEST(DataRateTest, ConstExpr) {
constexpr int64_t kValue = 12345;
constexpr DataRate kDataRateZero = DataRate::Zero();
constexpr DataRate kDataRateInf = DataRate::Infinity();
static_assert(DataRate() == kDataRateZero);
static_assert(kDataRateZero.IsZero(), "");
static_assert(kDataRateInf.IsInfinite(), "");
static_assert(kDataRateInf.bps_or(-1) == -1, "");

View file

@ -29,7 +29,7 @@ class DataSize final : public rtc_units_impl::RelativeUnit<DataSize> {
}
static constexpr DataSize Infinity() { return PlusInfinity(); }
DataSize() = delete;
constexpr DataSize() = default;
template <typename Sink>
friend void AbslStringify(Sink& sink, DataSize value);

View file

@ -22,6 +22,7 @@ TEST(DataSizeTest, ConstExpr) {
constexpr int64_t kValue = 12345;
constexpr DataSize kDataSizeZero = DataSize::Zero();
constexpr DataSize kDataSizeInf = DataSize::Infinity();
static_assert(DataSize() == kDataSizeZero);
static_assert(kDataSizeZero.IsZero(), "");
static_assert(kDataSizeInf.IsInfinite(), "");
static_assert(kDataSizeInf.bytes_or(-1) == -1, "");

View file

@ -41,7 +41,7 @@ class Frequency final : public rtc_units_impl::RelativeUnit<Frequency> {
return FromFraction(1'000'000, value);
}
Frequency() = delete;
constexpr Frequency() = default;
template <typename Sink>
friend void AbslStringify(Sink& sink, Frequency value);

View file

@ -20,6 +20,7 @@ TEST(FrequencyTest, ConstExpr) {
constexpr Frequency kFrequencyZero = Frequency::Zero();
constexpr Frequency kFrequencyPlusInf = Frequency::PlusInfinity();
constexpr Frequency kFrequencyMinusInf = Frequency::MinusInfinity();
static_assert(Frequency() == kFrequencyZero);
static_assert(kFrequencyZero.IsZero(), "");
static_assert(kFrequencyPlusInf.IsPlusInfinity(), "");
static_assert(kFrequencyMinusInf.IsMinusInfinity(), "");

View file

@ -51,7 +51,7 @@ class TimeDelta final : public rtc_units_impl::RelativeUnit<TimeDelta> {
return FromValue(value);
}
TimeDelta() = delete;
constexpr TimeDelta() = default;
template <typename Sink>
friend void AbslStringify(Sink& sink, TimeDelta value);

View file

@ -23,6 +23,7 @@ TEST(TimeDeltaTest, ConstExpr) {
constexpr TimeDelta kTimeDeltaZero = TimeDelta::Zero();
constexpr TimeDelta kTimeDeltaPlusInf = TimeDelta::PlusInfinity();
constexpr TimeDelta kTimeDeltaMinusInf = TimeDelta::MinusInfinity();
static_assert(TimeDelta() == kTimeDeltaZero);
static_assert(kTimeDeltaZero.IsZero(), "");
static_assert(kTimeDeltaPlusInf.IsPlusInfinity(), "");
static_assert(kTimeDeltaMinusInf.IsMinusInfinity(), "");

View file

@ -69,6 +69,7 @@ rtc_library("video_frame") {
"..:video_track_source_constraints",
"../../rtc_base:checks",
"../../rtc_base:refcount",
"../../rtc_base:safe_conversions",
"../../rtc_base:timeutils",
"../../rtc_base/memory:aligned_malloc",
"../../rtc_base/system:rtc_export",
@ -101,6 +102,7 @@ rtc_library("video_frame_i010") {
"..:scoped_refptr",
"../../rtc_base:checks",
"../../rtc_base:refcount",
"../../rtc_base:safe_conversions",
"../../rtc_base/memory:aligned_malloc",
"../../rtc_base/system:rtc_export",
"//third_party/libyuv",
@ -142,6 +144,11 @@ rtc_source_set("resolution") {
deps = [ "../../rtc_base/system:rtc_export" ]
}
rtc_source_set("corruption_detection_filter_settings") {
visibility = [ "*" ]
public = [ "corruption_detection_filter_settings.h" ]
}
rtc_library("encoded_image") {
visibility = [ "*" ]
sources = [
@ -149,6 +156,7 @@ rtc_library("encoded_image") {
"encoded_image.h",
]
deps = [
":corruption_detection_filter_settings",
":video_codec_constants",
":video_frame",
":video_frame_type",

View file

@ -0,0 +1,27 @@
/*
* Copyright (c) 2024 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef API_VIDEO_CORRUPTION_DETECTION_FILTER_SETTINGS_H_
#define API_VIDEO_CORRUPTION_DETECTION_FILTER_SETTINGS_H_
#include <stdint.h>
// Filter settings for automatic corruption detection. See
// http://www.webrtc.org/experiments/rtp-hdrext/corruption-detection for more
// information.
struct CorruptionDetectionFilterSettings {
// Size of the blur kernel used.
double std_dev = 0.0;
// Allowed error thresholds (maps to `Y err` and `UV err` respectively).
int luma_error_threshold = 0;
int chroma_error_threshold = 0;
};
#endif // API_VIDEO_CORRUPTION_DETECTION_FILTER_SETTINGS_H_

View file

@ -23,6 +23,7 @@
#include "api/scoped_refptr.h"
#include "api/units/timestamp.h"
#include "api/video/color_space.h"
#include "api/video/corruption_detection_filter_settings.h"
#include "api/video/video_codec_constants.h"
#include "api/video/video_content_type.h"
#include "api/video/video_frame_type.h"
@ -228,6 +229,15 @@ class RTC_EXPORT EncodedImage {
VideoContentType contentType() const { return content_type_; }
VideoRotation rotation() const { return rotation_; }
std::optional<CorruptionDetectionFilterSettings>
corruption_detection_filter_settings() const {
return corruption_detection_filter_settings_;
}
void set_corruption_detection_filter_settings(
const CorruptionDetectionFilterSettings& settings) {
corruption_detection_filter_settings_ = settings;
}
uint32_t _encodedWidth = 0;
uint32_t _encodedHeight = 0;
// NTP time of the capture time in local timebase in milliseconds.
@ -283,6 +293,12 @@ class RTC_EXPORT EncodedImage {
// True if the frame that was encoded is a steady-state refresh frame intended
// to improve the visual quality.
bool is_steady_state_refresh_frame_ = false;
// Filter settings for corruption detection suggested by the encoder
// implementation, if any. Otherwise generic per-codec-type settings will be
// used.
std::optional<CorruptionDetectionFilterSettings>
corruption_detection_filter_settings_;
};
} // namespace webrtc

View file

@ -19,6 +19,7 @@
#include "api/video/video_rotation.h"
#include "rtc_base/checks.h"
#include "rtc_base/memory/aligned_malloc.h"
#include "rtc_base/numerics/safe_conversions.h"
#include "third_party/libyuv/include/libyuv/convert.h"
#include "third_party/libyuv/include/libyuv/convert_from.h"
#include "third_party/libyuv/include/libyuv/rotate.h"
@ -32,9 +33,15 @@ namespace webrtc {
namespace {
int I010DataSize(int height, int stride_y, int stride_u, int stride_v) {
return kBytesPerPixel *
(stride_y * height + (stride_u + stride_v) * ((height + 1) / 2));
int I010DataSize(int width,
int height,
int stride_y,
int stride_u,
int stride_v) {
CheckValidDimensions(width, height, stride_y, stride_u, stride_v);
int64_t h = height, y = stride_y, u = stride_u, v = stride_v;
return rtc::checked_cast<int>(kBytesPerPixel *
(y * h + (u + v) * ((h + 1) / 2)));
}
} // namespace
@ -49,12 +56,9 @@ I010Buffer::I010Buffer(int width,
stride_y_(stride_y),
stride_u_(stride_u),
stride_v_(stride_v),
data_(static_cast<uint16_t*>(
AlignedMalloc(I010DataSize(height, stride_y, stride_u, stride_v),
kBufferAlignment))) {
RTC_DCHECK_GT(width, 0);
RTC_DCHECK_GT(height, 0);
RTC_DCHECK_GE(stride_y, width);
data_(static_cast<uint16_t*>(AlignedMalloc(
I010DataSize(width, height, stride_y, stride_u, stride_v),
kBufferAlignment))) {
RTC_DCHECK_GE(stride_u, (width + 1) / 2);
RTC_DCHECK_GE(stride_v, (width + 1) / 2);
}

View file

@ -20,6 +20,7 @@
#include "api/video/video_rotation.h"
#include "rtc_base/checks.h"
#include "rtc_base/memory/aligned_malloc.h"
#include "rtc_base/numerics/safe_conversions.h"
#include "third_party/libyuv/include/libyuv/convert.h"
#include "third_party/libyuv/include/libyuv/planar_functions.h"
#include "third_party/libyuv/include/libyuv/rotate.h"
@ -33,9 +34,14 @@ namespace webrtc {
namespace {
int I210DataSize(int height, int stride_y, int stride_u, int stride_v) {
return kBytesPerPixel *
(stride_y * height + stride_u * height + stride_v * height);
int I210DataSize(int width,
int height,
int stride_y,
int stride_u,
int stride_v) {
CheckValidDimensions(width, height, stride_y, stride_u, stride_v);
int64_t h = height, y = stride_y, u = stride_u, v = stride_v;
return rtc::checked_cast<int>(kBytesPerPixel * (y * h + u * h + v * h));
}
} // namespace
@ -50,12 +56,9 @@ I210Buffer::I210Buffer(int width,
stride_y_(stride_y),
stride_u_(stride_u),
stride_v_(stride_v),
data_(static_cast<uint16_t*>(
AlignedMalloc(I210DataSize(height, stride_y, stride_u, stride_v),
kBufferAlignment))) {
RTC_DCHECK_GT(width, 0);
RTC_DCHECK_GT(height, 0);
RTC_DCHECK_GE(stride_y, width);
data_(static_cast<uint16_t*>(AlignedMalloc(
I210DataSize(width, height, stride_y, stride_u, stride_v),
kBufferAlignment))) {
RTC_DCHECK_GE(stride_u, (width + 1) / 2);
RTC_DCHECK_GE(stride_v, (width + 1) / 2);
}

View file

@ -22,6 +22,7 @@
#include "api/video/video_rotation.h"
#include "rtc_base/checks.h"
#include "rtc_base/memory/aligned_malloc.h"
#include "rtc_base/numerics/safe_conversions.h"
#include "third_party/libyuv/include/libyuv/convert.h"
#include "third_party/libyuv/include/libyuv/planar_functions.h"
#include "third_party/libyuv/include/libyuv/rotate.h"
@ -35,9 +36,14 @@ namespace webrtc {
namespace {
int I410DataSize(int height, int stride_y, int stride_u, int stride_v) {
return kBytesPerPixel *
(stride_y * height + stride_u * height + stride_v * height);
int I410DataSize(int width,
int height,
int stride_y,
int stride_u,
int stride_v) {
CheckValidDimensions(width, height, stride_y, stride_u, stride_v);
int64_t h = height, y = stride_y, u = stride_u, v = stride_v;
return rtc::checked_cast<int>(kBytesPerPixel * (y * h + u * h + v * h));
}
} // namespace
@ -55,12 +61,9 @@ I410Buffer::I410Buffer(int width,
stride_y_(stride_y),
stride_u_(stride_u),
stride_v_(stride_v),
data_(static_cast<uint16_t*>(
AlignedMalloc(I410DataSize(height, stride_y, stride_u, stride_v),
kBufferAlignment))) {
RTC_DCHECK_GT(width, 0);
RTC_DCHECK_GT(height, 0);
RTC_DCHECK_GE(stride_y, width);
data_(static_cast<uint16_t*>(AlignedMalloc(
I410DataSize(width, height, stride_y, stride_u, stride_v),
kBufferAlignment))) {
RTC_DCHECK_GE(stride_u, width);
RTC_DCHECK_GE(stride_v, width);
}
@ -155,7 +158,7 @@ rtc::scoped_refptr<I420BufferInterface> I410Buffer::ToI420() {
void I410Buffer::InitializeData() {
memset(data_.get(), 0,
I410DataSize(height_, stride_y_, stride_u_, stride_v_));
I410DataSize(width_, height_, stride_y_, stride_u_, stride_v_));
}
int I410Buffer::width() const {

View file

@ -13,6 +13,7 @@
#include <algorithm>
#include <cstdint>
#include <limits>
#include <utility>
#include "api/make_ref_counted.h"
@ -21,6 +22,7 @@
#include "api/video/video_rotation.h"
#include "rtc_base/checks.h"
#include "rtc_base/memory/aligned_malloc.h"
#include "rtc_base/numerics/safe_conversions.h"
#include "third_party/libyuv/include/libyuv/convert.h"
#include "third_party/libyuv/include/libyuv/planar_functions.h"
#include "third_party/libyuv/include/libyuv/rotate.h"
@ -33,8 +35,16 @@ namespace webrtc {
namespace {
int I420DataSize(int height, int stride_y, int stride_u, int stride_v) {
return stride_y * height + (stride_u + stride_v) * ((height + 1) / 2);
int I420DataSize(int width,
int height,
int stride_y,
int stride_u,
int stride_v) {
CheckValidDimensions(width, height, stride_y, stride_u, stride_v);
// Do the size calculation using 64bit integers and use checked_cast to catch
// overflow.
int64_t h = height, y = stride_y, u = stride_u, v = stride_v;
return rtc::checked_cast<int>(y * h + (u + v) * ((h + 1) / 2));
}
} // namespace
@ -52,12 +62,9 @@ I420Buffer::I420Buffer(int width,
stride_y_(stride_y),
stride_u_(stride_u),
stride_v_(stride_v),
data_(static_cast<uint8_t*>(
AlignedMalloc(I420DataSize(height, stride_y, stride_u, stride_v),
kBufferAlignment))) {
RTC_DCHECK_GT(width, 0);
RTC_DCHECK_GT(height, 0);
RTC_DCHECK_GE(stride_y, width);
data_(static_cast<uint8_t*>(AlignedMalloc(
I420DataSize(width, height, stride_y, stride_u, stride_v),
kBufferAlignment))) {
RTC_DCHECK_GE(stride_u, (width + 1) / 2);
RTC_DCHECK_GE(stride_v, (width + 1) / 2);
}
@ -137,7 +144,7 @@ rtc::scoped_refptr<I420Buffer> I420Buffer::Rotate(
void I420Buffer::InitializeData() {
memset(data_.get(), 0,
I420DataSize(height_, stride_y_, stride_u_, stride_v_));
I420DataSize(width_, height_, stride_y_, stride_u_, stride_v_));
}
int I420Buffer::width() const {

View file

@ -22,6 +22,7 @@
#include "api/video/video_rotation.h"
#include "rtc_base/checks.h"
#include "rtc_base/memory/aligned_malloc.h"
#include "rtc_base/numerics/safe_conversions.h"
#include "third_party/libyuv/include/libyuv/convert.h"
#include "third_party/libyuv/include/libyuv/convert_from.h"
#include "third_party/libyuv/include/libyuv/planar_functions.h"
@ -35,8 +36,14 @@ namespace webrtc {
namespace {
int I422DataSize(int height, int stride_y, int stride_u, int stride_v) {
return stride_y * height + stride_u * height + stride_v * height;
int I422DataSize(int width,
int height,
int stride_y,
int stride_u,
int stride_v) {
CheckValidDimensions(width, height, stride_y, stride_u, stride_v);
int64_t h = height, y = stride_y, u = stride_u, v = stride_v;
return rtc::checked_cast<int>(y * h + u * h + v * h);
}
} // namespace
@ -53,12 +60,9 @@ I422Buffer::I422Buffer(int width,
stride_y_(stride_y),
stride_u_(stride_u),
stride_v_(stride_v),
data_(static_cast<uint8_t*>(
AlignedMalloc(I422DataSize(height, stride_y, stride_u, stride_v),
kBufferAlignment))) {
RTC_DCHECK_GT(width, 0);
RTC_DCHECK_GT(height, 0);
RTC_DCHECK_GE(stride_y, width);
data_(static_cast<uint8_t*>(AlignedMalloc(
I422DataSize(width, height, stride_y, stride_u, stride_v),
kBufferAlignment))) {
RTC_DCHECK_GE(stride_u, (width + 1) / 2);
RTC_DCHECK_GE(stride_v, (width + 1) / 2);
}
@ -169,7 +173,7 @@ rtc::scoped_refptr<I420BufferInterface> I422Buffer::ToI420() {
void I422Buffer::InitializeData() {
memset(data_.get(), 0,
I422DataSize(height_, stride_y_, stride_u_, stride_v_));
I422DataSize(width_, height_, stride_y_, stride_u_, stride_v_));
}
int I422Buffer::width() const {

View file

@ -22,6 +22,7 @@
#include "api/video/video_rotation.h"
#include "rtc_base/checks.h"
#include "rtc_base/memory/aligned_malloc.h"
#include "rtc_base/numerics/safe_conversions.h"
#include "third_party/libyuv/include/libyuv/convert.h"
#include "third_party/libyuv/include/libyuv/planar_functions.h"
#include "third_party/libyuv/include/libyuv/rotate.h"
@ -34,8 +35,14 @@ namespace webrtc {
namespace {
int I444DataSize(int height, int stride_y, int stride_u, int stride_v) {
return stride_y * height + stride_u * height + stride_v * height;
int I444DataSize(int width,
int height,
int stride_y,
int stride_u,
int stride_v) {
CheckValidDimensions(width, height, stride_y, stride_u, stride_v);
int64_t h = height, y = stride_y, u = stride_u, v = stride_v;
return rtc::checked_cast<int>(y * h + u * h + v * h);
}
} // namespace
@ -53,14 +60,11 @@ I444Buffer::I444Buffer(int width,
stride_y_(stride_y),
stride_u_(stride_u),
stride_v_(stride_v),
data_(static_cast<uint8_t*>(
AlignedMalloc(I444DataSize(height, stride_y, stride_u, stride_v),
kBufferAlignment))) {
RTC_DCHECK_GT(width, 0);
RTC_DCHECK_GT(height, 0);
RTC_DCHECK_GE(stride_y, width);
RTC_DCHECK_GE(stride_u, (width));
RTC_DCHECK_GE(stride_v, (width));
data_(static_cast<uint8_t*>(AlignedMalloc(
I444DataSize(width, height, stride_y, stride_u, stride_v),
kBufferAlignment))) {
RTC_DCHECK_GE(stride_u, width);
RTC_DCHECK_GE(stride_v, width);
}
I444Buffer::~I444Buffer() {}
@ -149,7 +153,7 @@ rtc::scoped_refptr<I420BufferInterface> I444Buffer::ToI420() {
void I444Buffer::InitializeData() {
memset(data_.get(), 0,
I444DataSize(height_, stride_y_, stride_u_, stride_v_));
I444DataSize(width_, height_, stride_y_, stride_u_, stride_v_));
}
int I444Buffer::width() const {

View file

@ -20,6 +20,7 @@
#include "api/video/video_frame_buffer.h"
#include "rtc_base/checks.h"
#include "rtc_base/memory/aligned_malloc.h"
#include "rtc_base/numerics/safe_conversions.h"
#include "third_party/libyuv/include/libyuv/convert.h"
#include "third_party/libyuv/include/libyuv/scale.h"
@ -29,8 +30,10 @@ namespace {
static const int kBufferAlignment = 64;
int NV12DataSize(int height, int stride_y, int stride_uv) {
return stride_y * height + stride_uv * ((height + 1) / 2);
int NV12DataSize(int width, int height, int stride_y, int stride_uv) {
CheckValidDimensions(width, height, stride_y, stride_uv, stride_uv);
int64_t h = height, y = stride_y, uv = stride_uv;
return rtc::checked_cast<int>(y * h + uv * ((h + 1) / 2));
}
} // namespace
@ -44,12 +47,9 @@ NV12Buffer::NV12Buffer(int width, int height, int stride_y, int stride_uv)
stride_y_(stride_y),
stride_uv_(stride_uv),
data_(static_cast<uint8_t*>(
AlignedMalloc(NV12DataSize(height_, stride_y_, stride_uv),
AlignedMalloc(NV12DataSize(width, height, stride_y, stride_uv),
kBufferAlignment))) {
RTC_DCHECK_GT(width, 0);
RTC_DCHECK_GT(height, 0);
RTC_DCHECK_GE(stride_y, width);
RTC_DCHECK_GE(stride_uv, (width + width % 2));
RTC_DCHECK_GE(stride_uv, width + width % 2);
}
NV12Buffer::~NV12Buffer() = default;
@ -126,7 +126,7 @@ size_t NV12Buffer::UVOffset() const {
}
void NV12Buffer::InitializeData() {
memset(data_.get(), 0, NV12DataSize(height_, stride_y_, stride_uv_));
memset(data_.get(), 0, NV12DataSize(width_, height_, stride_y_, stride_uv_));
}
void NV12Buffer::CropAndScaleFrom(const NV12BufferInterface& src,

View file

@ -247,4 +247,16 @@ rtc::scoped_refptr<VideoFrameBuffer> NV12BufferInterface::CropAndScale(
return result;
}
void CheckValidDimensions(int width,
int height,
int stride_y,
int stride_u,
int stride_v) {
RTC_CHECK_GT(width, 0);
RTC_CHECK_GT(height, 0);
RTC_CHECK_GE(stride_y, width);
RTC_CHECK_GT(stride_u, 0);
RTC_CHECK_GT(stride_v, 0);
}
} // namespace webrtc

View file

@ -324,6 +324,17 @@ class RTC_EXPORT NV12BufferInterface : public BiplanarYuv8Buffer {
~NV12BufferInterface() override {}
};
// RTC_CHECKs that common values used to calculate buffer sizes are within the
// range of [1..std::numeric_limits<int>::max()].
// `width` and `height` must be > 0, `stride_y` must be >= `width` whereas
// `stride_u` and `stride_v` must be `> 0` as this is where the various yuv
// formats differ.
void CheckValidDimensions(int width,
int height,
int stride_y,
int stride_u,
int stride_v);
} // namespace webrtc
#endif // API_VIDEO_VIDEO_FRAME_BUFFER_H_

View file

@ -11,7 +11,6 @@
#ifndef API_VIDEO_VIDEO_STREAM_ENCODER_SETTINGS_H_
#define API_VIDEO_VIDEO_STREAM_ENCODER_SETTINGS_H_
#include "api/video/video_bitrate_allocator_factory.h"
#include "api/video_codecs/sdp_video_format.h"
#include "api/video_codecs/video_encoder.h"

View file

@ -257,4 +257,16 @@ bool H264IsSameProfile(const CodecParameterMap& params1,
profile_level_id->profile == other_profile_level_id->profile;
}
bool H264IsSameProfileAndLevel(const CodecParameterMap& params1,
const CodecParameterMap& params2) {
const std::optional<H264ProfileLevelId> profile_level_id =
ParseSdpForH264ProfileLevelId(params1);
const std::optional<H264ProfileLevelId> other_profile_level_id =
ParseSdpForH264ProfileLevelId(params2);
// Compare H264 profiles, but not levels.
return profile_level_id && other_profile_level_id &&
profile_level_id->profile == other_profile_level_id->profile &&
profile_level_id->level == other_profile_level_id->level;
}
} // namespace webrtc

View file

@ -86,6 +86,10 @@ RTC_EXPORT std::optional<std::string> H264ProfileLevelIdToString(
// etc).
RTC_EXPORT bool H264IsSameProfile(const CodecParameterMap& params1,
const CodecParameterMap& params2);
// Returns true if the parameters have the same H264 profile (Baseline, High,
// etc) and same level.
RTC_EXPORT bool H264IsSameProfileAndLevel(const CodecParameterMap& params1,
const CodecParameterMap& params2);
} // namespace webrtc

View file

@ -47,9 +47,8 @@ std::string VideoDecoder::DecoderInfo::ToString() const {
rtc::SimpleStringBuilder oss(string_buf);
oss << "DecoderInfo { "
<< "prefers_late_decoding = "
<< "implementation_name = '" << implementation_name << "', "
<< "is_hardware_accelerated = "
<< "prefers_late_decoding = " << "implementation_name = '"
<< implementation_name << "', " << "is_hardware_accelerated = "
<< (is_hardware_accelerated ? "true" : "false") << " }";
return oss.str();
}

View file

@ -120,9 +120,7 @@ VideoEncoder::EncoderInfo::EncoderInfo(const EncoderInfo&) = default;
VideoEncoder::EncoderInfo::~EncoderInfo() = default;
std::string VideoEncoder::EncoderInfo::ToString() const {
char string_buf[2048];
rtc::SimpleStringBuilder oss(string_buf);
rtc::StringBuilder oss;
oss << "EncoderInfo { "
"ScalingSettings { ";
if (scaling_settings.thresholds) {

View file

@ -10,4 +10,3 @@
// This file verifies that all include files in this directory can be
// compiled without errors or other required includes.

View file

@ -39,11 +39,14 @@ rtc_library("audio") {
deps = [
"../api:array_view",
"../api:bitrate_allocation",
"../api:call_api",
"../api:field_trials_view",
"../api:frame_transformer_interface",
"../api:function_view",
"../api:make_ref_counted",
"../api:rtp_headers",
"../api:rtp_packet_info",
"../api:rtp_parameters",
"../api:scoped_refptr",
"../api:sequence_checker",
@ -65,6 +68,8 @@ rtc_library("audio") {
"../api/task_queue",
"../api/task_queue:pending_task_safety_flag",
"../api/transport/rtp:rtp_source",
"../api/units:data_rate",
"../api/units:data_size",
"../api/units:time_delta",
"../api/units:timestamp",
"../call:audio_sender_interface",
@ -164,8 +169,10 @@ if (rtc_include_tests) {
":channel_receive_unittest",
"../api:array_view",
"../api:bitrate_allocation",
"../api:call_api",
"../api:frame_transformer_factory",
"../api:frame_transformer_interface",
"../api:function_view",
"../api:libjingle_peerconnection_api",
"../api:make_ref_counted",
"../api:mock_audio_mixer",
@ -173,25 +180,36 @@ if (rtc_include_tests) {
"../api:mock_frame_encryptor",
"../api:mock_frame_transformer",
"../api:mock_transformable_audio_frame",
"../api:rtc_error_matchers",
"../api:rtp_headers",
"../api:rtp_parameters",
"../api:scoped_refptr",
"../api:simulated_network_api",
"../api:transport_api",
"../api/audio:audio_frame_api",
"../api/audio:audio_mixer_api",
"../api/audio:audio_processing_statistics",
"../api/audio_codecs:audio_codecs_api",
"../api/audio_codecs:builtin_audio_encoder_factory",
"../api/audio_codecs/opus:audio_decoder_opus",
"../api/audio_codecs/opus:audio_encoder_opus",
"../api/crypto:frame_decryptor_interface",
"../api/crypto:frame_encryptor_interface",
"../api/crypto:options",
"../api/environment",
"../api/environment:environment_factory",
"../api/task_queue",
"../api/task_queue:default_task_queue_factory",
"../api/task_queue/test:mock_task_queue_base",
"../api/transport:bitrate_settings",
"../api/transport:network_control",
"../api/transport/rtp:rtp_source",
"../api/units:data_rate",
"../api/units:data_size",
"../api/units:time_delta",
"../api/units:timestamp",
"../call:bitrate_allocator",
"../call:call_interfaces",
"../call:mock_bitrate_allocator",
"../call:mock_call_interfaces",
"../call:mock_rtp_interfaces",
@ -207,6 +225,7 @@ if (rtc_include_tests) {
"../modules/audio_processing:mocks",
"../modules/pacing",
"../modules/rtp_rtcp:mock_rtp_rtcp",
"../modules/rtp_rtcp:rtp_rtcp",
"../modules/rtp_rtcp:rtp_rtcp_format",
"../rtc_base:checks",
"../rtc_base:gunit_helpers",
@ -227,10 +246,13 @@ if (rtc_include_tests) {
"../test:test_common",
"../test:test_support",
"../test:video_test_constants",
"../test:wait_until",
"../test/time_controller:time_controller",
"utility:utility_tests",
"//testing/gmock",
"//testing/gtest",
"//third_party/abseil-cpp/absl/memory",
"//third_party/abseil-cpp/absl/strings:string_view",
]
}

View file

@ -10,22 +10,36 @@
#include "audio/audio_receive_stream.h"
#include <cstddef>
#include <cstdint>
#include <map>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/strings/string_view.h"
#include "api/array_view.h"
#include "api/audio/audio_frame.h"
#include "api/audio/audio_mixer.h"
#include "api/audio_codecs/audio_format.h"
#include "api/call/audio_sink.h"
#include "api/rtp_parameters.h"
#include "api/environment/environment.h"
#include "api/frame_transformer_interface.h"
#include "api/neteq/neteq_factory.h"
#include "api/rtp_headers.h"
#include "api/scoped_refptr.h"
#include "api/sequence_checker.h"
#include "api/transport/rtp/rtp_source.h"
#include "audio/audio_send_stream.h"
#include "audio/audio_state.h"
#include "audio/channel_receive.h"
#include "audio/conversion.h"
#include "call/audio_state.h"
#include "call/rtp_config.h"
#include "call/rtp_stream_receiver_controller_interface.h"
#include "modules/rtp_rtcp/source/rtp_packet_received.h"
#include "call/syncable.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include "rtc_base/strings/string_builder.h"
@ -133,7 +147,6 @@ AudioReceiveStreamImpl::~AudioReceiveStreamImpl() {
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
RTC_LOG(LS_INFO) << "~AudioReceiveStreamImpl: " << remote_ssrc();
Stop();
channel_receive_->SetAssociatedSendChannel(nullptr);
channel_receive_->ResetReceiverCongestionControlObjects();
}
@ -265,25 +278,35 @@ webrtc::AudioReceiveStreamInterface::Stats AudioReceiveStreamImpl::GetStats(
webrtc::AudioReceiveStreamInterface::Stats stats;
stats.remote_ssrc = remote_ssrc();
webrtc::CallReceiveStatistics call_stats =
channel_receive_->GetRTCPStatistics();
auto receive_codec = channel_receive_->GetReceiveCodec();
if (receive_codec) {
stats.codec_name = receive_codec->second.name;
stats.codec_payload_type = receive_codec->first;
int clockrate_khz = receive_codec->second.clockrate_hz / 1000;
if (clockrate_khz > 0) {
stats.jitter_ms = call_stats.jitterSamples / clockrate_khz;
}
}
webrtc::CallReceiveStatistics call_stats =
channel_receive_->GetRTCPStatistics();
stats.payload_bytes_received = call_stats.payload_bytes_received;
stats.header_and_padding_bytes_received =
call_stats.header_and_padding_bytes_received;
stats.packets_received = call_stats.packetsReceived;
stats.packets_lost = call_stats.cumulativeLost;
stats.packets_received = call_stats.packets_received;
stats.packets_lost = call_stats.packets_lost;
stats.jitter_ms = call_stats.jitter_ms;
stats.nacks_sent = call_stats.nacks_sent;
stats.capture_start_ntp_time_ms = call_stats.capture_start_ntp_time_ms_;
stats.capture_start_ntp_time_ms = call_stats.capture_start_ntp_time_ms;
stats.last_packet_received = call_stats.last_packet_received;
stats.last_sender_report_timestamp = call_stats.last_sender_report_timestamp;
stats.last_sender_report_utc_timestamp =
call_stats.last_sender_report_utc_timestamp;
stats.last_sender_report_remote_utc_timestamp =
call_stats.last_sender_report_remote_utc_timestamp;
stats.sender_reports_packets_sent = call_stats.sender_reports_packets_sent;
stats.sender_reports_bytes_sent = call_stats.sender_reports_bytes_sent;
stats.sender_reports_reports_count = call_stats.sender_reports_reports_count;
stats.round_trip_time = call_stats.round_trip_time;
stats.round_trip_time_measurements = call_stats.round_trip_time_measurements;
stats.total_round_trip_time = call_stats.total_round_trip_time;
stats.delay_estimate_ms = channel_receive_->GetDelayEstimate();
stats.audio_level = channel_receive_->GetSpeechOutputLevelFullRange();
stats.total_output_energy = channel_receive_->GetTotalOutputEnergy();
@ -342,18 +365,6 @@ webrtc::AudioReceiveStreamInterface::Stats AudioReceiveStreamImpl::GetStats(
stats.decoding_plc_cng = ds.decoded_plc_cng;
stats.decoding_muted_output = ds.decoded_muted_output;
stats.last_sender_report_timestamp = call_stats.last_sender_report_timestamp;
stats.last_sender_report_utc_timestamp =
call_stats.last_sender_report_utc_timestamp;
stats.last_sender_report_remote_utc_timestamp =
call_stats.last_sender_report_remote_utc_timestamp;
stats.sender_reports_packets_sent = call_stats.sender_reports_packets_sent;
stats.sender_reports_bytes_sent = call_stats.sender_reports_bytes_sent;
stats.sender_reports_reports_count = call_stats.sender_reports_reports_count;
stats.round_trip_time = call_stats.round_trip_time;
stats.round_trip_time_measurements = call_stats.round_trip_time_measurements;
stats.total_round_trip_time = call_stats.total_round_trip_time;
return stats;
}
@ -429,14 +440,6 @@ bool AudioReceiveStreamImpl::SetMinimumPlayoutDelay(int delay_ms) {
return channel_receive_->SetMinimumPlayoutDelay(delay_ms);
}
void AudioReceiveStreamImpl::AssociateSendStream(
internal::AudioSendStream* send_stream) {
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
channel_receive_->SetAssociatedSendChannel(
send_stream ? send_stream->GetChannel() : nullptr);
associated_send_stream_ = send_stream;
}
void AudioReceiveStreamImpl::DeliverRtcp(const uint8_t* packet, size_t length) {
// TODO(solenberg): Tests call this function on a network thread, libjingle
// calls on the worker thread. We should move towards always using a network
@ -468,12 +471,6 @@ const std::string& AudioReceiveStreamImpl::sync_group() const {
return config_.sync_group;
}
const AudioSendStream*
AudioReceiveStreamImpl::GetAssociatedSendStreamForTesting() const {
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
return associated_send_stream_;
}
internal::AudioState* AudioReceiveStreamImpl::audio_state() const {
auto* audio_state = static_cast<internal::AudioState*>(audio_state_.get());
RTC_DCHECK(audio_state);

View file

@ -11,21 +11,32 @@
#ifndef AUDIO_AUDIO_RECEIVE_STREAM_H_
#define AUDIO_AUDIO_RECEIVE_STREAM_H_
#include <cstddef>
#include <cstdint>
#include <map>
#include <memory>
#include <optional>
#include <string>
#include <vector>
#include "absl/strings/string_view.h"
#include "api/audio/audio_frame.h"
#include "api/audio/audio_mixer.h"
#include "api/audio_codecs/audio_format.h"
#include "api/crypto/frame_decryptor_interface.h"
#include "api/environment/environment.h"
#include "api/frame_transformer_interface.h"
#include "api/neteq/neteq_factory.h"
#include "api/rtp_headers.h"
#include "api/scoped_refptr.h"
#include "api/sequence_checker.h"
#include "api/transport/rtp/rtp_source.h"
#include "audio/audio_state.h"
#include "call/audio_receive_stream.h"
#include "call/audio_state.h"
#include "call/syncable.h"
#include "rtc_base/system/no_unique_address.h"
#include "rtc_base/thread_annotations.h"
namespace webrtc {
class PacketRouter;
@ -36,10 +47,6 @@ namespace voe {
class ChannelReceiveInterface;
} // namespace voe
namespace internal {
class AudioSendStream;
} // namespace internal
class AudioReceiveStreamImpl final : public webrtc::AudioReceiveStreamInterface,
public AudioMixer::Source,
public Syncable {
@ -115,7 +122,6 @@ class AudioReceiveStreamImpl final : public webrtc::AudioReceiveStreamInterface,
int64_t time_ms) override;
bool SetMinimumPlayoutDelay(int delay_ms) override;
void AssociateSendStream(internal::AudioSendStream* send_stream);
void DeliverRtcp(const uint8_t* packet, size_t length);
void SetSyncGroup(absl::string_view sync_group);
@ -134,8 +140,6 @@ class AudioReceiveStreamImpl final : public webrtc::AudioReceiveStreamInterface,
// Must be called on the packet delivery thread.
const std::string& sync_group() const;
const AudioSendStream* GetAssociatedSendStreamForTesting() const;
// TODO(tommi): Remove this method.
void ReconfigureForTesting(
const webrtc::AudioReceiveStreamInterface::Config& config);
@ -159,8 +163,6 @@ class AudioReceiveStreamImpl final : public webrtc::AudioReceiveStreamInterface,
webrtc::AudioReceiveStreamInterface::Config config_;
rtc::scoped_refptr<webrtc::AudioState> audio_state_;
const std::unique_ptr<voe::ChannelReceiveInterface> channel_receive_;
AudioSendStream* associated_send_stream_
RTC_GUARDED_BY(packet_sequence_checker_) = nullptr;
bool playing_ RTC_GUARDED_BY(worker_thread_checker_) = false;

View file

@ -10,17 +10,28 @@
#include "audio/audio_receive_stream.h"
#include <cstddef>
#include <cstdint>
#include <map>
#include <string>
#include <memory>
#include <utility>
#include <vector>
#include "api/audio_codecs/audio_format.h"
#include "api/crypto/frame_decryptor_interface.h"
#include "api/environment/environment_factory.h"
#include "api/make_ref_counted.h"
#include "api/rtp_headers.h"
#include "api/scoped_refptr.h"
#include "api/test/mock_audio_mixer.h"
#include "api/test/mock_frame_decryptor.h"
#include "audio/channel_receive.h"
#include "audio/conversion.h"
#include "audio/mock_voe_channel_proxy.h"
#include "call/audio_receive_stream.h"
#include "call/audio_state.h"
#include "call/rtp_stream_receiver_controller.h"
#include "modules/audio_coding/include/audio_coding_module_typedefs.h"
#include "modules/audio_device/include/mock_audio_device.h"
#include "modules/audio_processing/include/mock_audio_processing.h"
#include "modules/pacing/packet_router.h"
@ -127,7 +138,6 @@ struct ConfigHelper {
.Times(1);
EXPECT_CALL(*channel_receive_, ResetReceiverCongestionControlObjects())
.Times(1);
EXPECT_CALL(*channel_receive_, SetAssociatedSendChannel(nullptr)).Times(1);
EXPECT_CALL(*channel_receive_, SetReceiveCodecs(_))
.WillRepeatedly(Invoke([](const std::map<int, SdpAudioFormat>& codecs) {
EXPECT_THAT(codecs, ::testing::IsEmpty());
@ -190,7 +200,7 @@ struct ConfigHelper {
MockTransport rtcp_send_transport_;
};
const std::vector<uint8_t> CreateRtcpSenderReport() {
std::vector<uint8_t> CreateRtcpSenderReport() {
std::vector<uint8_t> packet;
const size_t kRtcpSrLength = 28; // In bytes.
packet.resize(kRtcpSrLength);
@ -250,13 +260,11 @@ TEST(AudioReceiveStreamTest, GetStats) {
EXPECT_EQ(kCallStats.payload_bytes_received, stats.payload_bytes_received);
EXPECT_EQ(kCallStats.header_and_padding_bytes_received,
stats.header_and_padding_bytes_received);
EXPECT_EQ(static_cast<uint32_t>(kCallStats.packetsReceived),
EXPECT_EQ(static_cast<uint32_t>(kCallStats.packets_received),
stats.packets_received);
EXPECT_EQ(kCallStats.cumulativeLost, stats.packets_lost);
EXPECT_EQ(kCallStats.packets_lost, stats.packets_lost);
EXPECT_EQ(kReceiveCodec.second.name, stats.codec_name);
EXPECT_EQ(
kCallStats.jitterSamples / (kReceiveCodec.second.clockrate_hz / 1000),
stats.jitter_ms);
EXPECT_EQ(kCallStats.jitter_ms, stats.jitter_ms);
EXPECT_EQ(kNetworkStats.currentBufferSize, stats.jitter_buffer_ms);
EXPECT_EQ(kNetworkStats.preferredBufferSize,
stats.jitter_buffer_preferred_ms);
@ -320,7 +328,7 @@ TEST(AudioReceiveStreamTest, GetStats) {
EXPECT_EQ(kAudioDecodeStats.decoded_plc_cng, stats.decoding_plc_cng);
EXPECT_EQ(kAudioDecodeStats.decoded_muted_output,
stats.decoding_muted_output);
EXPECT_EQ(kCallStats.capture_start_ntp_time_ms_,
EXPECT_EQ(kCallStats.capture_start_ntp_time_ms,
stats.capture_start_ntp_time_ms);
EXPECT_EQ(kPlayoutNtpTimestampMs, stats.estimated_playout_ntp_timestamp_ms);
recv_stream->UnregisterFromTransport();

Some files were not shown because too many files have changed in this diff Show more