Merge branch m120

This commit is contained in:
Jim Gustafson 2024-01-17 12:11:58 -08:00
commit 3d44a9e3b5
586 changed files with 14485 additions and 9699 deletions

View file

@ -1,4 +1,2 @@
[style]
based_on_style = pep8
indent_width = 2
column_limit = 80

View file

@ -104,6 +104,7 @@ Raman Budny <budnyjj@gmail.com>
Ramprakash Jelari <ennajelari@gmail.com>
Riku Voipio <riku.voipio@linaro.org>
Robert Bares <robert@bares.me>
Robert Mader <robert.mader@collabora.com>
Robert Mader <robert.mader@posteo.de>
Robert Nagy <robert.nagy@gmail.com>
Ryan Yoakum <ryoakum@skobalt.com>
@ -132,6 +133,7 @@ Xiaohong Xu <freemine@yeah.net>
Xiaolei Yu <dreifachstein@gmail.com>
Xinchao Tian <tianxinchao@360.cn>
Yaowen Guo <albertguo88@gmail.com>
Youfa <vsyfar@gmail.com>
Yura Yaroshevich <yura.yaroshevich@gmail.com>
Yuriy Pavlyshak <yuriy@appear.in>
Yusuke Suzuki <utatane.tea@gmail.com>

View file

@ -30,6 +30,7 @@ if (rtc_enable_protobuf) {
if (is_android) {
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
import("//third_party/jni_zero/jni_zero.gni")
}
if (!build_with_chromium) {
@ -301,6 +302,10 @@ config("common_config") {
defines += [ "RTC_ENABLE_VP9" ]
}
if (rtc_use_h265) {
defines += [ "RTC_ENABLE_H265" ]
}
if (rtc_include_dav1d_in_internal_decoder_factory) {
defines += [ "RTC_DAV1D_IN_INTERNAL_DECODER_FACTORY" ]
}
@ -462,7 +467,7 @@ config("common_config") {
]
}
if (use_fuzzing_engine && optimize_for_fuzzing) {
if (use_fuzzing_engine) {
# Used in Chromium's overrides to disable logging
defines += [ "WEBRTC_UNSAFE_FUZZER_MODE" ]
}
@ -808,8 +813,5 @@ group("poison_default_task_queue") {
group("poison_default_echo_detector") {
}
group("poison_rtc_json") {
}
group("poison_software_video_codecs") {
}

248
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': '6ac79291669656814b2c66e66ea296caac6652fd',
'chromium_revision': 'c89d7a6d7f77a1afc1e3759f0e66a49eca1ee1d7',
# Fetch the prebuilt binaries for llvm-cov and llvm-profdata. Needed to
# process the raw profiles produced by instrumented targets (built with
@ -25,14 +25,14 @@ vars = {
# By default, download the fuchsia sdk from the public sdk directory.
'fuchsia_sdk_cipd_prefix': 'fuchsia/sdk/core/',
'fuchsia_version': 'version:14.20230826.1.1',
'fuchsia_version': 'version:15.20231022.3.1',
# By default, download the fuchsia images from the fuchsia GCS bucket.
'fuchsia_images_bucket': 'fuchsia',
'checkout_fuchsia': False,
# Since the images are hundreds of MB, default to only downloading the image
# most commonly useful for developers. Bots and developers that need to use
# other images can override this with additional images.
'checkout_fuchsia_boot_images': "terminal.qemu-x64",
'checkout_fuchsia_boot_images': "terminal.qemu-x64,terminal.x64",
'checkout_fuchsia_product_bundles': '"{checkout_fuchsia_boot_images}" != ""',
# Fetch configuration files required for the 'use_remoteexec' gn arg
@ -40,7 +40,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.113.0.8b45b89-gomaip',
'reclient_version': 're_client_version:0.117.1.21520c6-gomaip',
# ninja CIPD package version
# https://chrome-infra-packages.appspot.com/p/infra/3pp/tools/ninja
@ -54,30 +54,30 @@ deps = {
# TODO(kjellander): Move this to be Android-only.
'src/base':
'https://chromium.googlesource.com/chromium/src/base@609cafa975c8a29d3b2f686c9a42530a556835fe',
'https://chromium.googlesource.com/chromium/src/base@1546e3adb67bb711ca2fd39c3913cb56bd889748',
'src/build':
'https://chromium.googlesource.com/chromium/src/build@115a7079919c25462a7fd8c1d22900378bbc6585',
'https://chromium.googlesource.com/chromium/src/build@a21fc6065131d0442e8a54c3ca2638e393b69438',
'src/buildtools':
'https://chromium.googlesource.com/chromium/src/buildtools@b2043d4f435131d0a1bdd5342c17753ef9236572',
'https://chromium.googlesource.com/chromium/src/buildtools@6f834e2039daedfc68a2749c217922b26d5e8497',
# 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@17864bdc8fb2f78060ea4109d61a9144f64f4d67',
'url': 'https://chromium.googlesource.com/chromium/src/ios@5139a7efd464e4514a6df1054e44e0e4fac67536',
'condition': 'checkout_ios',
},
'src/testing':
'https://chromium.googlesource.com/chromium/src/testing@ff8dee88bc0b49f8337cee6e82151c245a63b98c',
'https://chromium.googlesource.com/chromium/src/testing@46366a7e4d08bf9fceeb3c1c3b5eab8a6a5024b5',
'src/third_party':
'https://chromium.googlesource.com/chromium/src/third_party@ee6367daea550c5845a6079cec5fd6555f39144f',
'https://chromium.googlesource.com/chromium/src/third_party@64d9ec3158b4629163f88b779a53e16f1cc24f81',
'src/buildtools/linux64': {
'packages': [
{
'package': 'gn/gn/linux-${{arch}}',
'version': 'git_revision:cc56a0f98bb34accd5323316e0292575ff17a5d4',
'version': 'git_revision:e4702d7409069c4f12d45ea7b7f0890717ca3f4b',
}
],
'dep_type': 'cipd',
@ -87,7 +87,7 @@ deps = {
'packages': [
{
'package': 'gn/gn/mac-${{arch}}',
'version': 'git_revision:cc56a0f98bb34accd5323316e0292575ff17a5d4',
'version': 'git_revision:e4702d7409069c4f12d45ea7b7f0890717ca3f4b',
}
],
'dep_type': 'cipd',
@ -97,7 +97,7 @@ deps = {
'packages': [
{
'package': 'gn/gn/windows-amd64',
'version': 'git_revision:cc56a0f98bb34accd5323316e0292575ff17a5d4',
'version': 'git_revision:e4702d7409069c4f12d45ea7b7f0890717ca3f4b',
}
],
'dep_type': 'cipd',
@ -119,11 +119,11 @@ deps = {
'src/third_party/clang-format/script':
'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/clang/tools/clang-format.git@e5337933f2951cacd3aeacd238ce4578163ca0b9',
'src/third_party/libc++/src':
'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxx.git@84fb809dd6dae36d556dc0bb702c6cc2ce9d4b80',
'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxx.git@a429c26ae25c26a569ff12390d5f9be70c5e286b',
'src/third_party/libc++abi/src':
'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git@3d83ca7bd2ab81f042bafe6996da08c9cd57c119',
'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git@2ca9f38714b1465b9f55b5fbd0da5e4342811e2b',
'src/third_party/libunwind/src':
'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git@76e621a89787516da745489245d8b65a48ad60d8',
'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git@7686b5d38c69d14932abfb1c1a66ba56c78791ad',
'src/third_party/ninja': {
'packages': [
@ -159,7 +159,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_build_tools/aapt2',
'version': 'STY0BXlZxsEhudnlXQFed-B5UpwehcoM0sYqor6qRqsC',
'version': 'y1G4s2RWI63L9ZLgzS3RzFdWdeblpCmYyAUzMphcQawC',
},
],
'condition': 'checkout_android',
@ -170,7 +170,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_build_tools/bundletool',
'version': '2RPwohwtc6on0_96oFxokeEvnC1LbLrGuyCAw00k62AC',
'version': 'xOeKyLIaK_RRHU0Qv0EdxTrRlq_22HAwoOr1xn5yoOcC',
},
],
'condition': 'checkout_android',
@ -178,11 +178,11 @@ deps = {
},
'src/third_party/boringssl/src':
'https://boringssl.googlesource.com/boringssl.git@b8e012e1ff736cc794273af4a7db521e6b18bcd5',
'https://boringssl.googlesource.com/boringssl.git@c38dc29860a72540eb2c4fdb8a8bfb27ef94ddf3',
'src/third_party/breakpad/breakpad':
'https://chromium.googlesource.com/breakpad/breakpad.git@8988364bcddd9b194b0bf931c10bc125987330ed',
'src/third_party/catapult':
'https://chromium.googlesource.com/catapult.git@b8c4f2d99ac66fe47cb8cceec0dd1a1da5d1b51e',
'https://chromium.googlesource.com/catapult.git@47efdb4b1428e549c58a6d6c2fa79c4a8ceaf9b4',
'src/third_party/ced/src': {
'url': 'https://chromium.googlesource.com/external/github.com/google/compact_enc_det.git@ba412eaaacd3186085babcd901679a48863c7dd5',
},
@ -195,11 +195,11 @@ deps = {
'src/third_party/crc32c/src':
'https://chromium.googlesource.com/external/github.com/google/crc32c.git@fa5ade41ee480003d9c5af6f43567ba22e4e17e6',
'src/third_party/depot_tools':
'https://chromium.googlesource.com/chromium/tools/depot_tools.git@427f0f43ad0ceb08399561ab9cc60e45931059d3',
'https://chromium.googlesource.com/chromium/tools/depot_tools.git@9f3b33a275e7a5b19d8ce4aba7960d2a38858681',
'src/third_party/ffmpeg':
'https://chromium.googlesource.com/chromium/third_party/ffmpeg.git@0ba37733400593b162e5ae9ff26b384cff49c250',
'https://chromium.googlesource.com/chromium/third_party/ffmpeg.git@e1ca3f06adec15150a171bc38f550058b4bbb23b',
'src/third_party/flatbuffers/src':
'https://chromium.googlesource.com/external/github.com/google/flatbuffers.git@28861d1d7d5ec6ce34d4bbdc10bec4aace341167',
'https://chromium.googlesource.com/external/github.com/google/flatbuffers.git@bcb9ef187628fe07514e57756d05e6a6296f7dc5',
'src/third_party/grpc/src': {
'url': 'https://chromium.googlesource.com/external/github.com/grpc/grpc.git@822dab21d9995c5cf942476b35ca12a1aa9d2737',
},
@ -209,35 +209,29 @@ deps = {
'condition': 'checkout_linux',
},
'src/third_party/freetype/src':
'https://chromium.googlesource.com/chromium/src/third_party/freetype2.git@dd1ced4ee37b375686a1e0fb6e3a6966b195f4ab',
'https://chromium.googlesource.com/chromium/src/third_party/freetype2.git@55d0287cfc31115760cb13caa346b407ef0c0ceb',
'src/third_party/harfbuzz-ng/src':
'https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz.git@db700b5670d9475cc8ed4880cc9447b232c5e432',
'https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz.git@f26fd69d858642d76413b8f4068eaf9b57c40a5f',
'src/third_party/google_benchmark/src': {
'url': 'https://chromium.googlesource.com/external/github.com/google/benchmark.git@b177433f3ee2513b1075140c723d73ab8901790f',
},
# WebRTC-only dependency (not present in Chromium).
'src/third_party/gtest-parallel':
'https://chromium.googlesource.com/external/github.com/google/gtest-parallel@f4d65b555894b301699c7c3c52906f72ea052e83',
'src/third_party/google-truth': {
'packages': [
{
'package': 'chromium/third_party/google-truth',
'version': 'u8oovXxp24lStqX4d54htRovta-75Sy2w7ijg1TL07gC',
},
],
'src/third_party/google-truth/src': {
'url': 'https://chromium.googlesource.com/external/github.com/google/truth.git@33387149b465f82712a817e6744847fe136949b3',
'condition': 'checkout_android',
'dep_type': 'cipd',
},
'src/third_party/googletest/src':
'https://chromium.googlesource.com/external/github.com/google/googletest.git@af29db7ec28d6df1c7f0f745186884091e602e07',
'src/third_party/icu': {
'url': 'https://chromium.googlesource.com/chromium/deps/icu.git@985b9a6f70e13f3db741fed121e4dcc3046ad494',
'url': 'https://chromium.googlesource.com/chromium/deps/icu.git@a622de35ac311c5ad390a7af80724634e5dc61ed',
},
'src/third_party/jdk': {
'packages': [
{
'package': 'chromium/third_party/jdk',
'version': '0yjD6s5XYtcGAQoObIys7xs2ThkudwxJwS-2ZNP0SFEC',
'version': 'tUJrCBvDNDE9jFvgkuOwX8tU6oCWT8CtI2_JxpGlTJIC',
},
],
'condition': 'host_os == "linux" and checkout_android',
@ -259,14 +253,14 @@ deps = {
'src/third_party/jsoncpp/source':
'https://chromium.googlesource.com/external/github.com/open-source-parsers/jsoncpp.git@42e892d96e47b1f6e29844cc705e148ec4856448', # from svn 248
'src/third_party/junit/src': {
'url': 'https://chromium.googlesource.com/external/junit.git@05fe2a64f59127c02135be22f416e91260d6ede6',
'url': 'https://chromium.googlesource.com/external/junit.git@0eb5ce72848d730da5bd6d42902fdd6a8a42055d',
'condition': 'checkout_android',
},
'src/third_party/kotlin_stdlib': {
'packages': [
{
'package': 'chromium/third_party/kotlin_stdlib',
'version': '6cGkpHi3fSRhpRfq2b1mjmzfFmShvtQe6gy4g2nFQd0C',
'version': 'ZwEhbBOU3zJ8iFzea34zthR0d1a1LlfSPjfsblxKbSgC',
},
],
'condition': 'checkout_android',
@ -285,23 +279,23 @@ deps = {
},
# Used for building libFuzzers (only supports Linux).
'src/third_party/libFuzzer/src':
'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/compiler-rt/lib/fuzzer.git@26cc39e59b2bf5cbc20486296248a842c536878d',
'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/compiler-rt/lib/fuzzer.git@758bd21f103a501b362b1ca46fa8fcb692eaa303',
'src/third_party/libjpeg_turbo':
'https://chromium.googlesource.com/chromium/deps/libjpeg_turbo.git@30bdb85e302ecfc52593636b2f44af438e05e784',
'https://chromium.googlesource.com/chromium/deps/libjpeg_turbo.git@9b894306ec3b28cea46e84c32b56773a98c483da',
'src/third_party/libsrtp':
'https://chromium.googlesource.com/chromium/deps/libsrtp.git@5b7c744eb8310250ccc534f3f86a2015b3887a0a',
'src/third_party/dav1d/libdav1d':
'https://chromium.googlesource.com/external/github.com/videolan/dav1d.git@f8ae94eca0f53502a2cddd29a263c1edea4822a0',
'https://chromium.googlesource.com/external/github.com/videolan/dav1d.git@47107e384bd1dc25674acf04d000a8cdc6195234',
'src/third_party/libaom/source/libaom':
'https://aomedia.googlesource.com/aom.git@5f8db64abce68a3698fb732697ae50880bc9cac4',
'https://aomedia.googlesource.com/aom.git@1dbe1c7fae2456f91ccc79fecb919e9ffea0727a',
'src/third_party/libunwindstack': {
'url': 'https://chromium.googlesource.com/chromium/src/third_party/libunwindstack.git@4dbfa0e8c844c8e243b297bc185e54a99ff94f9e',
'condition': 'checkout_android',
},
'src/third_party/perfetto':
'https://android.googlesource.com/platform/external/perfetto.git@00427277dd1728c836d92f78006c60430c04d6bc',
'https://android.googlesource.com/platform/external/perfetto.git@cefa83de08a0851cc0b0edee8801cf860a3bc1ed',
'src/third_party/libvpx/source/libvpx':
'https://chromium.googlesource.com/webm/libvpx.git@38a707faef72eeff89d669c553e7bfe9e08dba8f',
'https://chromium.googlesource.com/webm/libvpx.git@424723dc025ce451dab9568239a46b18d0919b4d',
'src/third_party/libyuv':
'https://chromium.googlesource.com/libyuv/libyuv.git@04821d1e7d60845525e8db55c7bcd41ef5be9406',
'src/third_party/lss': {
@ -324,7 +318,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/r8',
'version': 'TBaeKaSTY2ttKx2JSFuWiQ8Na80KHZwLEgSAvT1DBJ0C',
'version': 'jj098_uPn3EKB7YisD1VAQXkZWNtSa6Qxz3vpMQkPR4C',
},
],
'condition': 'checkout_android',
@ -348,7 +342,7 @@ deps = {
'condition': 'checkout_android',
},
'src/tools':
'https://chromium.googlesource.com/chromium/src/tools@3e78ed797e9e5308cb90f319c7330a6d44dac2c7',
'https://chromium.googlesource.com/chromium/src/tools@d7f60c3fd236aee6695f04187b6c128536a2bc9f',
'src/third_party/accessibility_test_framework': {
'packages': [
@ -409,7 +403,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_toolchain/android_toolchain',
'version': 'R_8suM8m0oHbZ1awdxGXvKEFpAOETscbfZxkkMthyk8C',
'version': 'NSOM616pOQCfRfDAhC72ltgjyUQp9lAWCMzlmgB18dAC',
},
],
'condition': 'checkout_android',
@ -420,7 +414,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/androidx',
'version': '2n47PFweHFzGxPWjh9RANTrGhmSDWowZ-YhkOV4j11MC',
'version': 'F-habe4EUUBiRQmzyGAB5oOUtnTNQkhvpoUe4vVZuegC',
},
],
'condition': 'checkout_android',
@ -431,7 +425,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_build_tools/manifest_merger',
'version': 'kkbYOGsVRXhtxBiXuTufY0puTnG5QAfyxvFTBHFWL08C',
'version': 'V90mMwKNdDvQaZ-2eMjmdkHQdGrDn3w4DxA-fGMA8y0C',
},
],
'condition': 'checkout_android',
@ -503,7 +497,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/robolectric',
'version': 'hzetqh1qFI32FOgQroZvGcGdomrgVBJ6WKRnl1KFw6EC',
'version': 'UmWqaevXYVw3D8VySDJcqj3aU9zMDFwt1RySUuU0vI8C',
},
],
'condition': 'checkout_android',
@ -525,7 +519,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/turbine',
'version': 'ZlMS4BOYyYmbU8BuBDGyW7QrkvZ_-pTkm4lH4jKjTi4C',
'version': 'VRQ9UNP0lvjDXJ4DhORCj66go0TLg5uuGnHWkNN_hgUC',
},
],
'condition': 'checkout_android',
@ -536,11 +530,11 @@ deps = {
'packages': [
{
'package': 'infra/tools/luci/isolate/${{platform}}',
'version': 'git_revision:fe3cfd422b1012c2c8cf00d65cdb11aa2c26cd66',
'version': 'git_revision:924cfd2323a9192361b765f81fffc135026c1fee',
},
{
'package': 'infra/tools/luci/swarming/${{platform}}',
'version': 'git_revision:fe3cfd422b1012c2c8cf00d65cdb11aa2c26cd66',
'version': 'git_revision:924cfd2323a9192361b765f81fffc135026c1fee',
},
],
'dep_type': 'cipd',
@ -597,17 +591,6 @@ deps = {
'dep_type': 'cipd',
},
'src/third_party/android_deps/libs/android_arch_lifecycle_common_java8': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/android_arch_lifecycle_common_java8',
'version': 'version:2@1.1.1.cr1',
},
],
'condition': 'checkout_android',
'dep_type': 'cipd',
},
'src/third_party/android_deps/libs/android_arch_lifecycle_livedata': {
'packages': [
{
@ -652,28 +635,6 @@ deps = {
'dep_type': 'cipd',
},
'src/third_party/android_deps/libs/com_android_support_animated_vector_drawable': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_android_support_animated_vector_drawable',
'version': 'version:2@28.0.0.cr1',
},
],
'condition': 'checkout_android',
'dep_type': 'cipd',
},
'src/third_party/android_deps/libs/com_android_support_appcompat_v7': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_android_support_appcompat_v7',
'version': 'version:2@28.0.0.cr1',
},
],
'condition': 'checkout_android',
'dep_type': 'cipd',
},
'src/third_party/android_deps/libs/com_android_support_asynclayoutinflater': {
'packages': [
{
@ -685,17 +646,6 @@ deps = {
'dep_type': 'cipd',
},
'src/third_party/android_deps/libs/com_android_support_cardview_v7': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_android_support_cardview_v7',
'version': 'version:2@28.0.0.cr1',
},
],
'condition': 'checkout_android',
'dep_type': 'cipd',
},
'src/third_party/android_deps/libs/com_android_support_collections': {
'packages': [
{
@ -740,17 +690,6 @@ deps = {
'dep_type': 'cipd',
},
'src/third_party/android_deps/libs/com_android_support_design': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_android_support_design',
'version': 'version:2@28.0.0.cr1',
},
],
'condition': 'checkout_android',
'dep_type': 'cipd',
},
'src/third_party/android_deps/libs/com_android_support_documentfile': {
'packages': [
{
@ -806,17 +745,6 @@ deps = {
'dep_type': 'cipd',
},
'src/third_party/android_deps/libs/com_android_support_multidex': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_android_support_multidex',
'version': 'version:2@1.0.0.cr1',
},
],
'condition': 'checkout_android',
'dep_type': 'cipd',
},
'src/third_party/android_deps/libs/com_android_support_print': {
'packages': [
{
@ -828,17 +756,6 @@ deps = {
'dep_type': 'cipd',
},
'src/third_party/android_deps/libs/com_android_support_recyclerview_v7': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_android_support_recyclerview_v7',
'version': 'version:2@28.0.0.cr1',
},
],
'condition': 'checkout_android',
'dep_type': 'cipd',
},
'src/third_party/android_deps/libs/com_android_support_slidingpanelayout': {
'packages': [
{
@ -894,50 +811,6 @@ deps = {
'dep_type': 'cipd',
},
'src/third_party/android_deps/libs/com_android_support_support_fragment': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_android_support_support_fragment',
'version': 'version:2@28.0.0.cr1',
},
],
'condition': 'checkout_android',
'dep_type': 'cipd',
},
'src/third_party/android_deps/libs/com_android_support_support_media_compat': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_android_support_support_media_compat',
'version': 'version:2@28.0.0.cr1',
},
],
'condition': 'checkout_android',
'dep_type': 'cipd',
},
'src/third_party/android_deps/libs/com_android_support_support_v4': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_android_support_support_v4',
'version': 'version:2@28.0.0.cr1',
},
],
'condition': 'checkout_android',
'dep_type': 'cipd',
},
'src/third_party/android_deps/libs/com_android_support_support_vector_drawable': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_android_support_support_vector_drawable',
'version': 'version:2@28.0.0.cr1',
},
],
'condition': 'checkout_android',
'dep_type': 'cipd',
},
'src/third_party/android_deps/libs/com_android_support_swiperefreshlayout': {
'packages': [
{
@ -949,17 +822,6 @@ deps = {
'dep_type': 'cipd',
},
'src/third_party/android_deps/libs/com_android_support_transition': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_android_support_transition',
'version': 'version:2@28.0.0.cr1',
},
],
'condition': 'checkout_android',
'dep_type': 'cipd',
},
'src/third_party/android_deps/libs/com_android_support_versionedparcelable': {
'packages': [
{
@ -1448,7 +1310,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/com_google_errorprone_error_prone_annotations',
'version': 'version:2@2.18.0.cr1',
'version': 'version:2@2.23.0.cr1',
},
],
'condition': 'checkout_android',
@ -2346,17 +2208,6 @@ deps = {
'dep_type': 'cipd',
},
'src/third_party/android_deps/libs/org_robolectric_shadows_playservices': {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_robolectric_shadows_playservices',
'version': 'version:2@4.10.3.cr1',
},
],
'condition': 'checkout_android',
'dep_type': 'cipd',
},
'src/third_party/android_deps/libs/org_robolectric_utils': {
'packages': [
{
@ -2703,11 +2554,11 @@ hooks = [
},
# Download remote exec cfg files
{
'name': 'fetch_reclient_cfgs',
'name': 'configure_reclient_cfgs',
'pattern': '.',
'condition': 'download_remoteexec_cfg',
'action': ['python3',
'src/buildtools/reclient_cfgs/fetch_reclient_cfgs.py',
'src/buildtools/reclient_cfgs/configure_reclient_cfgs.py',
'--rbe_instance',
Var('rbe_instance'),
'--reproxy_cfg_template',
@ -2744,6 +2595,7 @@ include_rules = [
"+absl/base/attributes.h",
"+absl/base/config.h",
"+absl/base/const_init.h",
"+absl/base/nullability.h",
"+absl/base/macros.h",
"+absl/cleanup/cleanup.h",
"+absl/container/inlined_vector.h",

View file

@ -10,6 +10,7 @@ per-file .vpython3=mbonadei@webrtc.org,jansson@webrtc.org,jleconte@webrtc.org
per-file AUTHORS=*
per-file DEPS=*
per-file pylintrc=mbonadei@webrtc.org,jansson@webrtc.org,jleconte@webrtc.org
per-file pylintrc_old_style=mbonadei@webrtc.org,jansson@webrtc.org,jleconte@webrtc.org
per-file WATCHLISTS=*
per-file native-api.md=mbonadei@webrtc.org
per-file ....lua=titovartem@webrtc.org

File diff suppressed because it is too large Load diff

View file

@ -162,7 +162,10 @@ rtc_library("candidate") {
"../rtc_base:stringutils",
"../rtc_base/system:rtc_export",
]
absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
absl_deps = [
"//third_party/abseil-cpp/absl/base:core_headers",
"//third_party/abseil-cpp/absl/strings",
]
}
rtc_source_set("turn_customizer") {

View file

@ -13,8 +13,9 @@ Mostly, just follow the regular [style guide](/g3doc/style-guide.md), but:
mountain of technical debt that were trying to shrink.
* `.cc` files in `api/`, on the other hand, are free to `#include` headers
outside `api/`.
* Avoid structs in api, prefer classes.
That is, the preferred way for `api/` code to access non-`api/` code is to call
The preferred way for `api/` code to access non-`api/` code is to call
it from a `.cc` file, so that users of our API headers wont transitively
`#include` non-public headers.
@ -25,3 +26,12 @@ usual [rules](/g3doc/style-guide.md#forward-declarations) still apply, though.
`.cc` files in `api/` should preferably be kept reasonably small. If a
substantial implementation is needed, consider putting it with our non-public
code, and just call it from the `api/` `.cc` file.
Avoid defining api with structs as it makes harder for the api to evolve.
Your struct may gain invariant, or change how it represents data.
Evolving struct from the api is particular challenging as it is designed to be
used in other code bases and thus needs to be updated independetly from its usage.
Class with accessors and setters makes such migration safer.
See [Google C++ style guide](https://google.github.io/styleguide/cppguide.html#Structs_vs._Classes) for more.
If you need to evolve existent struct in api, prefer first to convert it into a class.

View file

@ -19,13 +19,16 @@ namespace webrtc {
// client applications to provide WebRTC with their own mechanism for
// performing DNS resolution.
// TODO(bugs.webrtc.org/12598): Deprecate and remove.
class AsyncResolverFactory {
class [[deprecated("Use AsyncDnsResolverFactory")]] AsyncResolverFactory {
public:
AsyncResolverFactory() = default;
virtual ~AsyncResolverFactory() = default;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
// The caller should call Destroy on the returned object to delete it.
virtual rtc::AsyncResolverInterface* Create() = 0;
#pragma clang diagnostic pop
};
} // namespace webrtc

View file

@ -55,24 +55,6 @@ rtc_library("aec3_config") {
]
}
rtc_library("aec3_config_json") {
visibility = [ "*" ]
allow_poison = [ "rtc_json" ]
sources = [
"echo_canceller3_config_json.cc",
"echo_canceller3_config_json.h",
]
deps = [
":aec3_config",
"../../rtc_base:checks",
"../../rtc_base:logging",
"../../rtc_base:rtc_json",
"../../rtc_base:stringutils",
"../../rtc_base/system:rtc_export",
]
absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
}
rtc_library("aec3_factory") {
visibility = [ "*" ]
configs += [ "../../modules/audio_processing:apm_debug_dump" ]

View file

@ -17,13 +17,12 @@ if (rtc_include_tests) {
testonly = true
sources = [
"audio_frame_unittest.cc",
"echo_canceller3_config_json_unittest.cc",
"echo_canceller3_config_unittest.cc",
]
deps = [
"..:aec3_config",
"..:aec3_config_json",
"..:audio_frame_api",
"../../../modules/audio_processing:aec3_config_json",
"../../../test:test_support",
]
}

View file

@ -10,7 +10,7 @@
#include "api/audio/echo_canceller3_config.h"
#include "api/audio/echo_canceller3_config_json.h"
#include "modules/audio_processing/test/echo_canceller3_config_json.h"
#include "test/gtest.h"
namespace webrtc {

View file

@ -26,9 +26,9 @@ struct CallConfig;
// is constructed with a CallFactoryInterface, which may or may not be null.
class CallFactoryInterface {
public:
virtual ~CallFactoryInterface() {}
virtual ~CallFactoryInterface() = default;
virtual Call* CreateCall(const CallConfig& config) = 0;
virtual std::unique_ptr<Call> CreateCall(const CallConfig& config) = 0;
};
RTC_EXPORT std::unique_ptr<CallFactoryInterface> CreateCallFactory();

View file

@ -45,29 +45,9 @@ struct PacketOptions {
class Transport {
public:
// New style functions. Default implementations are to accomodate
// subclasses that haven't been converted to new style yet.
// TODO(bugs.webrtc.org/14870): Deprecate and remove old functions.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
virtual bool SendRtp(rtc::ArrayView<const uint8_t> packet,
const PacketOptions& options) {
return SendRtp(packet.data(), packet.size(), options);
}
virtual bool SendRtcp(rtc::ArrayView<const uint8_t> packet) {
return SendRtcp(packet.data(), packet.size());
}
#pragma clang diagnostic pop
// Old style functions.
[[deprecated("Use ArrayView version")]] virtual bool
SendRtp(const uint8_t* packet, size_t length, const PacketOptions& options) {
return SendRtp(rtc::MakeArrayView(packet, length), options);
}
[[deprecated("Use ArrayView version")]] virtual bool SendRtcp(
const uint8_t* packet,
size_t length) {
return SendRtcp(rtc::MakeArrayView(packet, length));
}
const PacketOptions& options) = 0;
virtual bool SendRtcp(rtc::ArrayView<const uint8_t> packet) = 0;
protected:
virtual ~Transport() {}

View file

@ -17,6 +17,7 @@
#include <algorithm>
#include <string>
#include "absl/base/attributes.h"
#include "absl/strings/string_view.h"
#include "rtc_base/checks.h"
#include "rtc_base/network_constants.h"
@ -43,7 +44,7 @@ class RTC_EXPORT Candidate {
uint32_t priority,
absl::string_view username,
absl::string_view password,
absl::string_view type,
absl::string_view type ABSL_ATTRIBUTE_LIFETIME_BOUND,
uint32_t generation,
absl::string_view foundation,
uint16_t network_id = 0,
@ -101,7 +102,14 @@ class RTC_EXPORT Candidate {
void set_password(absl::string_view password) { Assign(password_, password); }
const std::string& type() const { return type_; }
void set_type(absl::string_view type) { Assign(type_, type); }
// Setting the type requires a constant string (e.g.
// cricket::LOCAL_PORT_TYPE). The type should really be an enum rather than a
// string, but until we make that change the lifetime attribute helps us lock
// things down. See also the `Port` class.
void set_type(absl::string_view type ABSL_ATTRIBUTE_LIFETIME_BOUND) {
Assign(type_, type);
}
const std::string& network_name() const { return network_name_; }
void set_network_name(absl::string_view network_name) {

View file

@ -42,7 +42,7 @@ struct RTC_EXPORT CryptoOptions {
struct Srtp {
// Enable GCM crypto suites from RFC 7714 for SRTP. GCM will only be used
// if both sides enable it.
bool enable_gcm_crypto_suites = false;
bool enable_gcm_crypto_suites = true;
// If set to true, the (potentially insecure) crypto cipher
// kSrtpAes128CmSha1_32 will be included in the list of supported ciphers

View file

@ -12,6 +12,7 @@
#define API_FRAME_TRANSFORMER_INTERFACE_H_
#include <memory>
#include <string>
#include <vector>
#include "api/scoped_refptr.h"
@ -53,6 +54,11 @@ class TransformableFrameInterface {
// sender frames to allow received frames to be directly re-transmitted on
// other PeerConnectionss.
virtual Direction GetDirection() const { return Direction::kUnknown; }
virtual std::string GetMimeType() const {
// TODO(bugs.webrtc.org/15579): Change this to pure virtual after it
// is implemented everywhere.
return "unknown/unknown";
}
};
class TransformableVideoFrameInterface : public TransformableFrameInterface {
@ -78,11 +84,7 @@ class TransformableAudioFrameInterface : public TransformableFrameInterface {
return absl::nullopt;
}
// TODO(crbug.com/1456628): Change this to pure virtual after it
// is implemented everywhere.
virtual absl::optional<uint64_t> AbsoluteCaptureTimestamp() const {
return absl::nullopt;
}
virtual absl::optional<uint64_t> AbsoluteCaptureTimestamp() const = 0;
enum class FrameType { kEmptyFrame, kAudioFrameSpeech, kAudioFrameCN };

View file

@ -115,8 +115,11 @@ struct IceTransportInit final {
private:
cricket::PortAllocator* port_allocator_ = nullptr;
AsyncDnsResolverFactoryInterface* async_dns_resolver_factory_ = nullptr;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
// For backwards compatibility. Only one resolver factory can be set.
AsyncResolverFactory* async_resolver_factory_ = nullptr;
#pragma clang diagnostic pop
RtcEventLog* event_log_ = nullptr;
cricket::IceControllerFactoryInterface* ice_controller_factory_ = nullptr;
cricket::ActiveIceControllerFactoryInterface* active_ice_controller_factory_ =

View file

@ -76,7 +76,9 @@ class RTC_EXPORT PacketSocketFactory {
// to switch to the AsyncDnsResolverInterface.
// TODO(bugs.webrtc.org/12598): Remove once all downstream users
// are converted.
virtual AsyncResolverInterface* CreateAsyncResolver() {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
[[deprecated]] virtual AsyncResolverInterface* CreateAsyncResolver() {
// Default implementation, so that downstream users can remove this
// immediately after changing to CreateAsyncDnsResolver
RTC_DCHECK_NOTREACHED();
@ -89,6 +91,7 @@ class RTC_EXPORT PacketSocketFactory {
return std::make_unique<webrtc::WrappingAsyncDnsResolver>(
CreateAsyncResolver());
}
#pragma clang diagnostic pop
private:
PacketSocketFactory(const PacketSocketFactory&) = delete;

View file

@ -651,8 +651,7 @@ class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface {
// will also cause PeerConnection to ignore all but the first m= section of
// the same media type (if the PeerConnection is given Unified Plan SDP to
// process).
// RingRTC Change to use "Plan B"
SdpSemantics sdp_semantics = SdpSemantics::kPlanB_DEPRECATED;
SdpSemantics sdp_semantics = SdpSemantics::kUnifiedPlan;
// TODO(bugs.webrtc.org/9891) - Move to crypto_options or remove.
// Actively reset the SRTP parameters whenever the DTLS transports
@ -680,9 +679,6 @@ class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface {
// Added to be able to control rollout of this feature.
bool enable_implicit_rollback = false;
// Whether network condition based codec switching is allowed.
absl::optional<bool> allow_codec_switching;
// The delay before doing a usage histogram report for long-lived
// PeerConnections. Used for testing only.
absl::optional<int> report_usage_pattern_delay_ms;
@ -1453,10 +1449,12 @@ struct RTC_EXPORT PeerConnectionDependencies final {
std::unique_ptr<webrtc::AsyncDnsResolverFactoryInterface>
async_dns_resolver_factory;
// Deprecated - use async_dns_resolver_factory
// Deprecation is in abeyance until Chromium is updated.
// TODO(crbug.com/1475925): Deprecate once Chromium is updated
// [[deprecated("Use async_dns_resolver_factory")]]
std::unique_ptr<webrtc::AsyncResolverFactory> async_resolver_factory;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
[[deprecated("Use async_dns_resolver_factory")]] std::unique_ptr<
webrtc::AsyncResolverFactory>
async_resolver_factory;
#pragma clang diagnostic pop
std::unique_ptr<webrtc::IceTransportFactory> ice_transport_factory;
std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator;
std::unique_ptr<rtc::SSLCertificateVerifier> tls_cert_verifier;
@ -1560,7 +1558,7 @@ class RTC_EXPORT PeerConnectionFactoryInterface
rtc::SSLProtocolVersion ssl_max_version = rtc::SSL_PROTOCOL_DTLS_12;
// Sets crypto related options, e.g. enabled cipher suites.
CryptoOptions crypto_options = CryptoOptions::Default();
CryptoOptions crypto_options = {};
};
// Set the options to be used for subsequently created PeerConnections.

View file

@ -46,8 +46,22 @@ class RTC_LOCKABLE SequenceChecker
public:
enum InitialState : bool { kDetached = false, kAttached = true };
// TODO(tommi): We could maybe join these two ctors and have fewer factory
// functions. At the moment they're separate to minimize code changes when
// we added the second ctor as well as avoiding to have unnecessary code at
// the SequenceChecker which much only run for the SequenceCheckerImpl
// implementation.
// In theory we could have something like:
//
// SequenceChecker(InitialState initial_state = kAttached,
// TaskQueueBase* attached_queue = TaskQueueBase::Current());
//
// But the problem with that is having the call to `Current()` exist for
// `SequenceCheckerDoNothing`.
explicit SequenceChecker(InitialState initial_state = kAttached)
: Impl(initial_state) {}
explicit SequenceChecker(TaskQueueBase* attached_queue)
: Impl(attached_queue) {}
// Returns true if sequence checker is attached to the current sequence.
bool IsCurrent() const { return Impl::IsCurrent(); }

View file

@ -83,6 +83,13 @@ TEST(SequenceCheckerTest, DetachFromThreadAndUseOnTaskQueue) {
queue.SendTask([&] { EXPECT_TRUE(sequence_checker.IsCurrent()); });
}
TEST(SequenceCheckerTest, InitializeForDifferentTaskQueue) {
TaskQueueForTest queue;
SequenceChecker sequence_checker(queue.Get());
EXPECT_EQ(sequence_checker.IsCurrent(), !RTC_DCHECK_IS_ON);
queue.SendTask([&] { EXPECT_TRUE(sequence_checker.IsCurrent()); });
}
TEST(SequenceCheckerTest, DetachFromTaskQueueAndUseOnThread) {
TaskQueueForTest queue;
queue.SendTask([] {

View file

@ -286,6 +286,17 @@ class RTC_EXPORT RTCInboundRtpStreamStats final
RTCStatsMember<double> total_processing_delay;
RTCStatsMember<double> total_assembly_time;
RTCStatsMember<uint32_t> frames_assembled_from_multiple_packets;
// TODO(https://crbug.com/webrtc/15600): Implement framesRendered, which is
// incremented at the same time that totalInterFrameDelay and
// totalSquaredInterFrameDelay is incremented. (Dividing inter-frame delay by
// framesDecoded is slightly wrong.)
// https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats-framesrendered
//
// TODO(https://crbug.com/webrtc/15601): Inter-frame, pause and freeze metrics
// all related to when the frame is rendered, but our implementation measures
// at delivery to sink, not at actual render time. When we have an actual
// frame rendered callback, move the calculating of these metrics to there in
// order to make them more accurate.
RTCStatsMember<double> total_inter_frame_delay;
RTCStatsMember<double> total_squared_inter_frame_delay;
RTCStatsMember<uint32_t> pause_count;

View file

@ -132,7 +132,10 @@ rtc_library("pending_task_safety_flag") {
"../../rtc_base/system:no_unique_address",
"../../rtc_base/system:rtc_export",
]
absl_deps = [ "//third_party/abseil-cpp/absl/functional:any_invocable" ]
absl_deps = [
"//third_party/abseil-cpp/absl/base:nullability",
"//third_party/abseil-cpp/absl/functional:any_invocable",
]
}
if (rtc_include_tests) {

View file

@ -32,6 +32,17 @@ PendingTaskSafetyFlag::CreateDetached() {
return safety_flag;
}
// Creates a flag, but with its SequenceChecker explicitly initialized for
// a given task queue and the `alive()` flag specified.
rtc::scoped_refptr<PendingTaskSafetyFlag>
PendingTaskSafetyFlag::CreateAttachedToTaskQueue(
bool alive,
absl::Nonnull<TaskQueueBase*> attached_queue) {
RTC_DCHECK(attached_queue) << "Null TaskQueue provided";
return rtc::scoped_refptr<PendingTaskSafetyFlag>(
new PendingTaskSafetyFlag(alive, attached_queue));
}
rtc::scoped_refptr<PendingTaskSafetyFlag>
PendingTaskSafetyFlag::CreateDetachedInactive() {
rtc::scoped_refptr<PendingTaskSafetyFlag> safety_flag = CreateInternal(false);

View file

@ -13,6 +13,7 @@
#include <utility>
#include "absl/base/nullability.h"
#include "absl/functional/any_invocable.h"
#include "api/ref_counted_base.h"
#include "api/scoped_refptr.h"
@ -68,6 +69,12 @@ class RTC_EXPORT PendingTaskSafetyFlag final
// may be created on a different thread than the flag will be used on.
static rtc::scoped_refptr<PendingTaskSafetyFlag> CreateDetached();
// Creates a flag, but with its SequenceChecker explicitly initialized for
// a given task queue and the `alive()` flag specified.
static rtc::scoped_refptr<PendingTaskSafetyFlag> CreateAttachedToTaskQueue(
bool alive,
absl::Nonnull<TaskQueueBase*> attached_queue);
// Same as `CreateDetached()` except the initial state of the returned flag
// will be `!alive()`.
static rtc::scoped_refptr<PendingTaskSafetyFlag> CreateDetachedInactive();
@ -95,6 +102,9 @@ class RTC_EXPORT PendingTaskSafetyFlag final
protected:
explicit PendingTaskSafetyFlag(bool alive) : alive_(alive) {}
PendingTaskSafetyFlag(bool alive,
absl::Nonnull<TaskQueueBase*> attached_queue)
: alive_(alive), main_sequence_(attached_queue) {}
private:
static rtc::scoped_refptr<PendingTaskSafetyFlag> CreateInternal(bool alive);

View file

@ -167,6 +167,17 @@ TEST(PendingTaskSafetyFlagTest, PendingTaskNotAliveInitialized) {
EXPECT_TRUE(task_2_ran);
}
TEST(PendingTaskSafetyFlagTest, PendingTaskInitializedForTaskQueue) {
TaskQueueForTest tq("PendingTaskAliveInitializedForTaskQueue");
// Create a new flag that initially `alive`, attached to a specific TQ.
auto flag = PendingTaskSafetyFlag::CreateAttachedToTaskQueue(true, tq.Get());
tq.SendTask([&flag]() { EXPECT_TRUE(flag->alive()); });
// Repeat the same steps but initialize as inactive.
flag = PendingTaskSafetyFlag::CreateAttachedToTaskQueue(false, tq.Get());
tq.SendTask([&flag]() { EXPECT_FALSE(flag->alive()); });
}
TEST(PendingTaskSafetyFlagTest, SafeTask) {
rtc::scoped_refptr<PendingTaskSafetyFlag> flag =
PendingTaskSafetyFlag::Create();

View file

@ -94,8 +94,7 @@ class RTC_LOCKABLE RTC_EXPORT TaskQueueBase {
void PostDelayedTask(absl::AnyInvocable<void() &&> task,
TimeDelta delay,
const Location& location = Location::Current()) {
PostDelayedTaskImpl(std::move(task), delay,
PostDelayedTaskTraits{.high_precision = false},
PostDelayedTaskImpl(std::move(task), delay, PostDelayedTaskTraits{},
location);
}
@ -119,9 +118,9 @@ class RTC_LOCKABLE RTC_EXPORT TaskQueueBase {
absl::AnyInvocable<void() &&> task,
TimeDelta delay,
const Location& location = Location::Current()) {
PostDelayedTaskImpl(std::move(task), delay,
PostDelayedTaskTraits{.high_precision = true},
location);
PostDelayedTaskTraits traits;
traits.high_precision = true;
PostDelayedTaskImpl(std::move(task), delay, traits, location);
}
// As specified by `precision`, calls either PostDelayedTask() or

View file

@ -36,7 +36,7 @@ std::unique_ptr<CallFactoryInterface> CreateTimeControllerBasedCallFactory(
public:
explicit TimeControllerBasedCallFactory(TimeController* time_controller)
: time_controller_(time_controller) {}
Call* CreateCall(const Call::Config& config) override {
std::unique_ptr<Call> CreateCall(const CallConfig& config) override {
RtpTransportConfig transportConfig = config.ExtractTransportConfig();
return Call::Create(config, time_controller_->GetClock(),

View file

@ -11,6 +11,7 @@
#ifndef API_TEST_MOCK_TRANSFORMABLE_VIDEO_FRAME_H_
#define API_TEST_MOCK_TRANSFORMABLE_VIDEO_FRAME_H_
#include <string>
#include <vector>
#include "api/frame_transformer_interface.h"
@ -36,6 +37,7 @@ class MockTransformableVideoFrame
GetDirection,
(),
(const, override));
MOCK_METHOD(std::string, GetMimeType, (), (const, override));
MOCK_METHOD(VideoFrameMetadata, Metadata, (), (const, override));
MOCK_METHOD(absl::optional<Timestamp>,
GetCaptureTimeIdentifier,

View file

@ -66,14 +66,12 @@ rtc_library("media_quality_test_params") {
deps = [
":media_configuration",
"../..:async_dns_resolver",
"../../../api:callfactory_api",
"../../../api:fec_controller_api",
"../../../api:field_trials_view",
"../../../api:libjingle_peerconnection_api",
"../../../api:packet_socket_factory",
"../../../api/audio:audio_mixer_api",
"../../../api/rtc_event_log",
"../../../api/task_queue",
"../../../api/transport:network_control",
"../../../api/video_codecs:video_codecs_api",
"../../../modules/audio_processing:api",
@ -96,21 +94,29 @@ rtc_library("peer_configurer") {
":media_configuration",
":media_quality_test_params",
"../..:async_dns_resolver",
"../../../api:callfactory_api",
"../../../api:create_peer_connection_quality_test_frame_generator",
"../../../api:fec_controller_api",
"../../../api:packet_socket_factory",
"../../../api:field_trials_view",
"../../../api:frame_generator_api",
"../../../api:ice_transport_interface",
"../../../api:libjingle_peerconnection_api",
"../../../api:peer_network_dependencies",
"../../../api:scoped_refptr",
"../../../api/audio:audio_mixer_api",
"../../../api/audio_codecs:audio_codecs_api",
"../../../api/neteq:neteq_api",
"../../../api/rtc_event_log",
"../../../api/task_queue",
"../../../api/transport:bitrate_settings",
"../../../api/transport:network_control",
"../../../api/video_codecs:video_codecs_api",
"../../../modules/audio_processing:api",
"../../../rtc_base:network",
"../../../rtc_base:checks",
"../../../rtc_base:rtc_certificate_generator",
"../../../rtc_base:ssl",
"../../../rtc_base:threading",
]
absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
absl_deps = [
"//third_party/abseil-cpp/absl/strings",
"//third_party/abseil-cpp/absl/types:optional",
"//third_party/abseil-cpp/absl/types:variant",
]
}

View file

@ -17,11 +17,9 @@
#include "api/async_dns_resolver.h"
#include "api/audio/audio_mixer.h"
#include "api/call/call_factory_interface.h"
#include "api/fec_controller.h"
#include "api/field_trials_view.h"
#include "api/rtc_event_log/rtc_event_log_factory_interface.h"
#include "api/task_queue/task_queue_factory.h"
#include "api/test/pclf/media_configuration.h"
#include "api/transport/network_control.h"
#include "api/video_codecs/video_decoder_factory.h"
@ -46,8 +44,6 @@ namespace webrtc_pc_e2e {
// can override only some parts of media engine like video encoder/decoder
// factories.
struct PeerConnectionFactoryComponents {
std::unique_ptr<TaskQueueFactory> task_queue_factory;
std::unique_ptr<CallFactoryInterface> call_factory;
std::unique_ptr<RtcEventLogFactoryInterface> event_log_factory;
std::unique_ptr<FecControllerFactoryInterface> fec_controller_factory;
std::unique_ptr<NetworkControllerFactoryInterface> network_controller_factory;

View file

@ -10,12 +10,38 @@
#include "api/test/pclf/peer_configurer.h"
#include <set>
#include <cstdint>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
#include "api/async_dns_resolver.h"
#include "api/audio/audio_mixer.h"
#include "api/audio_codecs/audio_decoder_factory.h"
#include "api/audio_codecs/audio_encoder_factory.h"
#include "api/fec_controller.h"
#include "api/field_trials_view.h"
#include "api/ice_transport_interface.h"
#include "api/neteq/neteq_factory.h"
#include "api/peer_connection_interface.h"
#include "api/rtc_event_log/rtc_event_log_factory_interface.h"
#include "api/scoped_refptr.h"
#include "api/test/create_peer_connection_quality_test_frame_generator.h"
#include "api/test/frame_generator_interface.h"
#include "api/test/pclf/media_configuration.h"
#include "api/test/pclf/media_quality_test_params.h"
#include "api/test/peer_network_dependencies.h"
#include "api/transport/bitrate_settings.h"
#include "api/transport/network_control.h"
#include "api/video_codecs/video_decoder_factory.h"
#include "api/video_codecs/video_encoder_factory.h"
#include "modules/audio_processing/include/audio_processing.h"
#include "rtc_base/checks.h"
#include "rtc_base/rtc_certificate_generator.h"
#include "rtc_base/ssl_certificate.h"
namespace webrtc {
namespace webrtc_pc_e2e {
@ -34,17 +60,6 @@ PeerConfigurer* PeerConfigurer::SetName(absl::string_view name) {
return this;
}
PeerConfigurer* PeerConfigurer::SetTaskQueueFactory(
std::unique_ptr<TaskQueueFactory> task_queue_factory) {
components_->pcf_dependencies->task_queue_factory =
std::move(task_queue_factory);
return this;
}
PeerConfigurer* PeerConfigurer::SetCallFactory(
std::unique_ptr<CallFactoryInterface> call_factory) {
components_->pcf_dependencies->call_factory = std::move(call_factory);
return this;
}
PeerConfigurer* PeerConfigurer::SetEventLogFactory(
std::unique_ptr<RtcEventLogFactoryInterface> event_log_factory) {
components_->pcf_dependencies->event_log_factory =
@ -212,6 +227,12 @@ PeerConfigurer* PeerConfigurer::SetIceTransportFactory(
return this;
}
PeerConfigurer* PeerConfigurer::SetFieldTrials(
std::unique_ptr<FieldTrialsView> field_trials) {
components_->pcf_dependencies->trials = std::move(field_trials);
return this;
}
PeerConfigurer* PeerConfigurer::SetPortAllocatorExtraFlags(
uint32_t extra_flags) {
params_->port_allocator_extra_flags = extra_flags;

View file

@ -10,30 +10,35 @@
#ifndef API_TEST_PCLF_PEER_CONFIGURER_H_
#define API_TEST_PCLF_PEER_CONFIGURER_H_
#include <cstdint>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "absl/strings/string_view.h"
#include "absl/types/variant.h"
#include "api/async_dns_resolver.h"
#include "api/audio/audio_mixer.h"
#include "api/call/call_factory_interface.h"
#include "api/audio_codecs/audio_decoder_factory.h"
#include "api/audio_codecs/audio_encoder_factory.h"
#include "api/fec_controller.h"
#include "api/field_trials_view.h"
#include "api/ice_transport_interface.h"
#include "api/neteq/neteq_factory.h"
#include "api/peer_connection_interface.h"
#include "api/rtc_event_log/rtc_event_log_factory_interface.h"
#include "api/task_queue/task_queue_factory.h"
#include "api/test/create_peer_connection_quality_test_frame_generator.h"
#include "api/scoped_refptr.h"
#include "api/test/frame_generator_interface.h"
#include "api/test/pclf/media_configuration.h"
#include "api/test/pclf/media_quality_test_params.h"
#include "api/test/peer_network_dependencies.h"
#include "api/transport/bitrate_settings.h"
#include "api/transport/network_control.h"
#include "api/video_codecs/video_decoder_factory.h"
#include "api/video_codecs/video_encoder_factory.h"
#include "modules/audio_processing/include/audio_processing.h"
#include "rtc_base/network.h"
#include "rtc_base/rtc_certificate_generator.h"
#include "rtc_base/ssl_certificate.h"
#include "rtc_base/thread.h"
namespace webrtc {
namespace webrtc_pc_e2e {
@ -52,13 +57,9 @@ class PeerConfigurer {
// unique.
PeerConfigurer* SetName(absl::string_view name);
// The parameters of the following 9 methods will be passed to the
// The parameters of the following 7 methods will be passed to the
// PeerConnectionFactoryInterface implementation that will be created for
// this peer.
PeerConfigurer* SetTaskQueueFactory(
std::unique_ptr<TaskQueueFactory> task_queue_factory);
PeerConfigurer* SetCallFactory(
std::unique_ptr<CallFactoryInterface> call_factory);
PeerConfigurer* SetEventLogFactory(
std::unique_ptr<RtcEventLogFactoryInterface> event_log_factory);
PeerConfigurer* SetFecControllerFactory(
@ -90,7 +91,7 @@ class PeerConfigurer {
// peer.
PeerConfigurer* SetAsyncDnsResolverFactory(
std::unique_ptr<webrtc::AsyncDnsResolverFactoryInterface>
async_resolver_factory);
async_dns_resolver_factory);
PeerConfigurer* SetRTCCertificateGenerator(
std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator);
PeerConfigurer* SetSSLCertificateVerifier(
@ -164,6 +165,8 @@ class PeerConfigurer {
// Set bitrate parameters on PeerConnection. This constraints will be
// applied to all summed RTP streams for this peer.
PeerConfigurer* SetBitrateSettings(BitrateSettings bitrate_settings);
// Set field trials used for this PeerConnection.
PeerConfigurer* SetFieldTrials(std::unique_ptr<FieldTrialsView> field_trials);
// Returns InjectableComponents and transfer ownership to the caller.
// Can be called once.

View file

@ -53,6 +53,7 @@ rtc_library("field_trial_based_config") {
]
deps = [
"../../api:field_trials_registry",
"../../rtc_base/system:rtc_export",
"../../system_wrappers:field_trial",
]
absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]

View file

@ -14,10 +14,11 @@
#include "absl/strings/string_view.h"
#include "api/field_trials_registry.h"
#include "rtc_base/system/rtc_export.h"
namespace webrtc {
// Implementation using the field trial API fo the key value lookup.
class FieldTrialBasedConfig : public FieldTrialsRegistry {
class RTC_EXPORT FieldTrialBasedConfig : public FieldTrialsRegistry {
private:
std::string GetValue(absl::string_view key) const override;
};

View file

@ -97,7 +97,7 @@ PacedPacketInfo::PacedPacketInfo(int probe_cluster_id,
probe_cluster_min_bytes(probe_cluster_min_bytes) {}
bool PacedPacketInfo::operator==(const PacedPacketInfo& rhs) const {
return send_bitrate_bps == rhs.send_bitrate_bps &&
return send_bitrate == rhs.send_bitrate &&
probe_cluster_id == rhs.probe_cluster_id &&
probe_cluster_min_probes == rhs.probe_cluster_min_probes &&
probe_cluster_min_bytes == rhs.probe_cluster_min_bytes;

View file

@ -93,7 +93,7 @@ struct PacedPacketInfo {
// TODO(srte): Move probing info to a separate, optional struct.
static constexpr int kNotAProbe = -1;
int send_bitrate_bps = -1;
DataRate send_bitrate = DataRate::BitsPerSec(0);
int probe_cluster_id = kNotAProbe;
int probe_cluster_min_probes = -1;
int probe_cluster_min_bytes = -1;

View file

@ -56,33 +56,12 @@ class RtpSource {
extensions_(extensions),
rtp_timestamp_(rtp_timestamp) {}
// TODO(bugs.webrtc.org/13757): deprecate when chromium stop using this
// and remove after 2023-09-18
RtpSource(int64_t timestamp_ms,
uint32_t source_id,
RtpSourceType source_type,
uint32_t rtp_timestamp,
const RtpSource::Extensions& extensions)
: timestamp_(Timestamp::Millis(timestamp_ms)),
source_id_(source_id),
source_type_(source_type),
extensions_(extensions),
rtp_timestamp_(rtp_timestamp) {}
RtpSource(const RtpSource&) = default;
RtpSource& operator=(const RtpSource&) = default;
~RtpSource() = default;
Timestamp timestamp() const { return timestamp_; }
// TODO(bugs.webrtc.org/13757): deprecate when chromium stop using this
// and remove after 2023-09-18
int64_t timestamp_ms() const { return timestamp_.ms(); }
[[deprecated]] void update_timestamp_ms(int64_t timestamp_ms) {
RTC_DCHECK_LE(timestamp_.ms(), timestamp_ms);
timestamp_ = Timestamp::Millis(timestamp_ms);
}
// The identifier of the source can be the CSRC or the SSRC.
uint32_t source_id() const { return source_id_; }

View file

@ -10,6 +10,8 @@
#include "api/video/color_space.h"
#include "rtc_base/strings/string_builder.h"
namespace webrtc {
namespace {
// Try to convert `enum_value` into the enum class T. `enum_bitmask` is created
@ -124,6 +126,80 @@ const HdrMetadata* ColorSpace::hdr_metadata() const {
return hdr_metadata_ ? &*hdr_metadata_ : nullptr;
}
#define PRINT_ENUM_CASE(TYPE, NAME) \
case TYPE::NAME: \
ss << #NAME; \
break;
std::string ColorSpace::AsString() const {
char buf[1024];
rtc::SimpleStringBuilder ss(buf);
ss << "{primaries:";
switch (primaries_) {
PRINT_ENUM_CASE(PrimaryID, kBT709)
PRINT_ENUM_CASE(PrimaryID, kUnspecified)
PRINT_ENUM_CASE(PrimaryID, kBT470M)
PRINT_ENUM_CASE(PrimaryID, kBT470BG)
PRINT_ENUM_CASE(PrimaryID, kSMPTE170M)
PRINT_ENUM_CASE(PrimaryID, kSMPTE240M)
PRINT_ENUM_CASE(PrimaryID, kFILM)
PRINT_ENUM_CASE(PrimaryID, kBT2020)
PRINT_ENUM_CASE(PrimaryID, kSMPTEST428)
PRINT_ENUM_CASE(PrimaryID, kSMPTEST431)
PRINT_ENUM_CASE(PrimaryID, kSMPTEST432)
PRINT_ENUM_CASE(PrimaryID, kJEDECP22)
}
ss << ", transfer:";
switch (transfer_) {
PRINT_ENUM_CASE(TransferID, kBT709)
PRINT_ENUM_CASE(TransferID, kUnspecified)
PRINT_ENUM_CASE(TransferID, kGAMMA22)
PRINT_ENUM_CASE(TransferID, kGAMMA28)
PRINT_ENUM_CASE(TransferID, kSMPTE170M)
PRINT_ENUM_CASE(TransferID, kSMPTE240M)
PRINT_ENUM_CASE(TransferID, kLINEAR)
PRINT_ENUM_CASE(TransferID, kLOG)
PRINT_ENUM_CASE(TransferID, kLOG_SQRT)
PRINT_ENUM_CASE(TransferID, kIEC61966_2_4)
PRINT_ENUM_CASE(TransferID, kBT1361_ECG)
PRINT_ENUM_CASE(TransferID, kIEC61966_2_1)
PRINT_ENUM_CASE(TransferID, kBT2020_10)
PRINT_ENUM_CASE(TransferID, kBT2020_12)
PRINT_ENUM_CASE(TransferID, kSMPTEST2084)
PRINT_ENUM_CASE(TransferID, kSMPTEST428)
PRINT_ENUM_CASE(TransferID, kARIB_STD_B67)
}
ss << ", matrix:";
switch (matrix_) {
PRINT_ENUM_CASE(MatrixID, kRGB)
PRINT_ENUM_CASE(MatrixID, kBT709)
PRINT_ENUM_CASE(MatrixID, kUnspecified)
PRINT_ENUM_CASE(MatrixID, kFCC)
PRINT_ENUM_CASE(MatrixID, kBT470BG)
PRINT_ENUM_CASE(MatrixID, kSMPTE170M)
PRINT_ENUM_CASE(MatrixID, kSMPTE240M)
PRINT_ENUM_CASE(MatrixID, kYCOCG)
PRINT_ENUM_CASE(MatrixID, kBT2020_NCL)
PRINT_ENUM_CASE(MatrixID, kBT2020_CL)
PRINT_ENUM_CASE(MatrixID, kSMPTE2085)
PRINT_ENUM_CASE(MatrixID, kCDNCLS)
PRINT_ENUM_CASE(MatrixID, kCDCLS)
PRINT_ENUM_CASE(MatrixID, kBT2100_ICTCP)
}
ss << ", range:";
switch (range_) {
PRINT_ENUM_CASE(RangeID, kInvalid)
PRINT_ENUM_CASE(RangeID, kLimited)
PRINT_ENUM_CASE(RangeID, kFull)
PRINT_ENUM_CASE(RangeID, kDerived)
}
ss << "}";
return ss.str();
}
#undef PRINT_ENUM_CASE
bool ColorSpace::set_primaries_from_uint8(uint8_t enum_value) {
constexpr PrimaryID kPrimaryIds[] = {
PrimaryID::kBT709, PrimaryID::kUnspecified, PrimaryID::kBT470M,

View file

@ -13,6 +13,8 @@
#include <stdint.h>
#include <string>
#include "absl/types/optional.h"
#include "api/video/hdr_metadata.h"
#include "rtc_base/system/rtc_export.h"
@ -155,6 +157,7 @@ class RTC_EXPORT ColorSpace {
ChromaSiting chroma_siting_horizontal() const;
ChromaSiting chroma_siting_vertical() const;
const HdrMetadata* hdr_metadata() const;
std::string AsString() const;
bool set_primaries_from_uint8(uint8_t enum_value);
bool set_transfer_from_uint8(uint8_t enum_value);

View file

@ -79,17 +79,16 @@ class RTC_EXPORT EncodedImage {
EncodedImage& operator=(EncodedImage&&);
EncodedImage& operator=(const EncodedImage&);
// TODO(bugs.webrtc.org/9378): Change style to timestamp(), set_timestamp(),
// for consistency with the VideoFrame class. Set frame timestamp (90kHz).
void SetTimestamp(uint32_t timestamp) { timestamp_rtp_ = timestamp; }
// Get frame timestamp (90kHz).
uint32_t Timestamp() const { return timestamp_rtp_; }
// Frame capture time in RTP timestamp representation (90kHz).
void SetRtpTimestamp(uint32_t timestamp) { timestamp_rtp_ = timestamp; }
uint32_t RtpTimestamp() const { return timestamp_rtp_; }
void SetEncodeTime(int64_t encode_start_ms, int64_t encode_finish_ms);
webrtc::Timestamp CaptureTime() const;
// Frame capture time in local time.
Timestamp CaptureTime() const;
// Frame capture time in ntp epoch time, i.e. time since 1st Jan 1900
int64_t NtpTimeMs() const { return ntp_time_ms_; }
// Every simulcast layer (= encoding) has its own encoder and RTP stream.
@ -101,11 +100,11 @@ class RTC_EXPORT EncodedImage {
simulcast_index_ = simulcast_index;
}
const absl::optional<webrtc::Timestamp>& CaptureTimeIdentifier() const {
const absl::optional<Timestamp>& CaptureTimeIdentifier() const {
return capture_time_identifier_;
}
void SetCaptureTimeIdentifier(
const absl::optional<webrtc::Timestamp>& capture_time_identifier) {
const absl::optional<Timestamp>& capture_time_identifier) {
capture_time_identifier_ = capture_time_identifier;
}
@ -245,7 +244,7 @@ class RTC_EXPORT EncodedImage {
size_t size_ = 0; // Size of encoded frame data.
uint32_t timestamp_rtp_ = 0;
absl::optional<int> simulcast_index_;
absl::optional<webrtc::Timestamp> capture_time_identifier_;
absl::optional<Timestamp> capture_time_identifier_;
absl::optional<int> spatial_index_;
absl::optional<int> temporal_index_;
std::map<int, size_t> spatial_layer_frame_size_bytes_;

View file

@ -50,7 +50,7 @@ int64_t GetFrameId(const FrameIteratorT& it) {
template <typename FrameIteratorT>
uint32_t GetTimestamp(const FrameIteratorT& it) {
return it->second.encoded_frame->Timestamp();
return it->second.encoded_frame->RtpTimestamp();
}
template <typename FrameIteratorT>
@ -76,7 +76,7 @@ bool FrameBuffer::InsertFrame(std::unique_ptr<EncodedFrame> frame) {
if (frame->Id() <= decoded_frame_history_.GetLastDecodedFrameId()) {
if (legacy_frame_id_jump_behavior_ && frame->is_keyframe() &&
AheadOf(frame->Timestamp(),
AheadOf(frame->RtpTimestamp(),
*decoded_frame_history_.GetLastDecodedFrameTimestamp())) {
RTC_DLOG(LS_WARNING)
<< "Keyframe " << frame->Id()

View file

@ -51,6 +51,10 @@ std::unique_ptr<VideoRtpDepacketizer> CreateDepacketizer(
return std::make_unique<VideoRtpDepacketizerAv1>();
case RtpVideoFrameAssembler::kGeneric:
return std::make_unique<VideoRtpDepacketizerGeneric>();
case RtpVideoFrameAssembler::kH265:
// TODO(bugs.webrtc.org/13485): Implement VideoRtpDepacketizerH265
RTC_DCHECK_NOTREACHED();
return nullptr;
}
RTC_DCHECK_NOTREACHED();
return nullptr;

View file

@ -52,7 +52,7 @@ class RtpVideoFrameAssembler {
// FrameVector is just a vector-like type of std::unique_ptr<EncodedFrame>.
// The vector type may change without notice.
using FrameVector = absl::InlinedVector<AssembledFrame, 3>;
enum PayloadFormat { kRaw, kH264, kVp8, kVp9, kAv1, kGeneric };
enum PayloadFormat { kRaw, kH264, kVp8, kVp9, kAv1, kGeneric, kH265 };
explicit RtpVideoFrameAssembler(PayloadFormat payload_format);
RtpVideoFrameAssembler(const RtpVideoFrameAssembler& other) = delete;

View file

@ -89,6 +89,9 @@ class PacketBuilder {
case PayloadFormat::kAv1: {
return kVideoCodecAV1;
}
case PayloadFormat::kH265: {
return kVideoCodecH265;
}
case PayloadFormat::kGeneric: {
return kVideoCodecGeneric;
}

View file

@ -71,4 +71,13 @@ TEST(ColorSpace, TestSettingChromaSitingVerticalFromUint8) {
EXPECT_FALSE(color_space.set_chroma_siting_vertical_from_uint8(3));
}
TEST(ColorSpace, TestAsStringFunction) {
ColorSpace color_space(
ColorSpace::PrimaryID::kBT709, ColorSpace::TransferID::kBT709,
ColorSpace::MatrixID::kBT709, ColorSpace::RangeID::kLimited);
EXPECT_EQ(
color_space.AsString(),
"{primaries:kBT709, transfer:kBT709, matrix:kBT709, range:kLimited}");
}
} // namespace webrtc

View file

@ -22,6 +22,7 @@ enum VideoCodecType {
kVideoCodecAV1,
kVideoCodecH264,
kVideoCodecMultiplex,
kVideoCodecH265,
};
} // namespace webrtc

View file

@ -164,9 +164,9 @@ VideoFrame::Builder::~Builder() = default;
VideoFrame VideoFrame::Builder::build() {
RTC_CHECK(video_frame_buffer_ != nullptr);
return VideoFrame(id_, video_frame_buffer_, timestamp_us_,
capture_time_identifier_, timestamp_rtp_, ntp_time_ms_,
rotation_, color_space_, render_parameters_, update_rect_,
packet_infos_);
capture_time_identifier_, reference_time_, timestamp_rtp_,
ntp_time_ms_, rotation_, color_space_, render_parameters_,
update_rect_, packet_infos_);
}
VideoFrame::Builder& VideoFrame::Builder::set_video_frame_buffer(
@ -193,6 +193,12 @@ VideoFrame::Builder& VideoFrame::Builder::set_capture_time_identifier(
return *this;
}
VideoFrame::Builder& VideoFrame::Builder::set_reference_time(
const absl::optional<Timestamp>& reference_time) {
reference_time_ = reference_time;
return *this;
}
VideoFrame::Builder& VideoFrame::Builder::set_timestamp_rtp(
uint32_t timestamp_rtp) {
timestamp_rtp_ = timestamp_rtp;
@ -264,6 +270,7 @@ VideoFrame::VideoFrame(uint16_t id,
const rtc::scoped_refptr<VideoFrameBuffer>& buffer,
int64_t timestamp_us,
const absl::optional<Timestamp>& capture_time_identifier,
const absl::optional<Timestamp>& reference_time,
uint32_t timestamp_rtp,
int64_t ntp_time_ms,
VideoRotation rotation,
@ -277,6 +284,7 @@ VideoFrame::VideoFrame(uint16_t id,
ntp_time_ms_(ntp_time_ms),
timestamp_us_(timestamp_us),
capture_time_identifier_(capture_time_identifier),
reference_time_(reference_time),
rotation_(rotation),
color_space_(color_space),
render_parameters_(render_parameters),

View file

@ -109,6 +109,8 @@ class RTC_EXPORT VideoFrame {
Builder& set_timestamp_us(int64_t timestamp_us);
Builder& set_capture_time_identifier(
const absl::optional<Timestamp>& capture_time_identifier);
Builder& set_reference_time(
const absl::optional<Timestamp>& reference_time);
Builder& set_timestamp_rtp(uint32_t timestamp_rtp);
Builder& set_ntp_time_ms(int64_t ntp_time_ms);
Builder& set_rotation(VideoRotation rotation);
@ -123,6 +125,7 @@ class RTC_EXPORT VideoFrame {
rtc::scoped_refptr<webrtc::VideoFrameBuffer> video_frame_buffer_;
int64_t timestamp_us_ = 0;
absl::optional<Timestamp> capture_time_identifier_;
absl::optional<Timestamp> reference_time_;
uint32_t timestamp_rtp_ = 0;
int64_t ntp_time_ms_ = 0;
VideoRotation rotation_ = kVideoRotation_0;
@ -177,6 +180,13 @@ class RTC_EXPORT VideoFrame {
capture_time_identifier_ = capture_time_identifier;
}
const absl::optional<Timestamp>& reference_time() const {
return reference_time_;
}
void set_reference_time(const absl::optional<Timestamp>& reference_time) {
reference_time_ = reference_time;
}
// Set frame timestamp (90kHz).
void set_timestamp(uint32_t timestamp) { timestamp_rtp_ = timestamp; }
@ -274,6 +284,7 @@ class RTC_EXPORT VideoFrame {
const rtc::scoped_refptr<VideoFrameBuffer>& buffer,
int64_t timestamp_us,
const absl::optional<Timestamp>& capture_time_identifier,
const absl::optional<Timestamp>& reference_time,
uint32_t timestamp_rtp,
int64_t ntp_time_ms,
VideoRotation rotation,
@ -289,6 +300,11 @@ class RTC_EXPORT VideoFrame {
int64_t ntp_time_ms_;
int64_t timestamp_us_;
absl::optional<Timestamp> capture_time_identifier_;
// Contains a monotonically increasing clock time and represents the time
// when the frame was captured. Not all platforms provide the "true" sample
// capture time in |reference_time| but might instead use a somewhat delayed
// (by the time it took to capture the frame) version of it.
absl::optional<Timestamp> reference_time_;
VideoRotation rotation_;
absl::optional<ColorSpace> color_space_;
// Contains parameters that affect have the frame should be rendered.

View file

@ -31,7 +31,10 @@ rtc_source_set("scalability_mode_helper") {
"scalability_mode_helper.cc",
"scalability_mode_helper.h",
]
deps = [ "../../modules/video_coding/svc:scalability_mode_util" ]
deps = [
":scalability_mode",
"../../modules/video_coding/svc:scalability_mode_util",
]
absl_deps = [
"//third_party/abseil-cpp/absl/strings",
"//third_party/abseil-cpp/absl/types:optional",

View file

@ -34,4 +34,9 @@ absl::optional<int> ScalabilityModeStringToNumTemporalLayers(
return ScalabilityModeToNumTemporalLayers(*scalability_mode);
}
absl::optional<ScalabilityMode> ScalabilityModeStringToEnum(
absl::string_view scalability_mode_string) {
return ScalabilityModeFromString(scalability_mode_string);
}
} // namespace webrtc

View file

@ -13,6 +13,7 @@
#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
#include "api/video_codecs/scalability_mode.h"
namespace webrtc {
@ -26,6 +27,11 @@ absl::optional<int> ScalabilityModeStringToNumSpatialLayers(
absl::optional<int> ScalabilityModeStringToNumTemporalLayers(
absl::string_view scalability_mode_string);
// Convert the `scalability_mode_string` to the scalability mode enum value
// or nullopt if the given mode is unknown.
absl::optional<ScalabilityMode> ScalabilityModeStringToEnum(
absl::string_view scalability_mode_string);
} // namespace webrtc
#endif // API_VIDEO_CODECS_SCALABILITY_MODE_HELPER_H_

View file

@ -15,6 +15,9 @@
#include "api/array_view.h"
#include "api/video_codecs/av1_profile.h"
#include "api/video_codecs/h264_profile_level_id.h"
#ifdef RTC_ENABLE_H265
#include "api/video_codecs/h265_profile_tier_level.h"
#endif
#include "api/video_codecs/video_codec.h"
#include "api/video_codecs/vp9_profile.h"
#include "rtc_base/checks.h"
@ -61,6 +64,10 @@ bool IsSameCodecSpecific(const SdpVideoFormat& format1,
return VP9IsSameProfile(format1.parameters, format2.parameters);
case kVideoCodecAV1:
return AV1IsSameProfile(format1.parameters, format2.parameters);
#ifdef RTC_ENABLE_H265
case kVideoCodecH265:
return H265IsSameProfileTierLevel(format1.parameters, format2.parameters);
#endif
default:
return true;
}

View file

@ -25,12 +25,18 @@ TEST(SdpVideoFormatTest, SameCodecNameNoParameters) {
EXPECT_TRUE(Sdp("VP8").IsSameCodec(Sdp("vp8")));
EXPECT_TRUE(Sdp("VP9").IsSameCodec(Sdp("vp9")));
EXPECT_TRUE(Sdp("AV1").IsSameCodec(Sdp("Av1")));
#ifdef RTC_ENABLE_H265
EXPECT_TRUE(Sdp("H265").IsSameCodec(Sdp("h265")));
#endif
}
TEST(SdpVideoFormatTest, DifferentCodecNameNoParameters) {
EXPECT_FALSE(Sdp("H264").IsSameCodec(Sdp("VP8")));
EXPECT_FALSE(Sdp("VP8").IsSameCodec(Sdp("VP9")));
EXPECT_FALSE(Sdp("AV1").IsSameCodec(Sdp("VP8")));
#ifdef RTC_ENABLE_H265
EXPECT_FALSE(Sdp("H265").IsSameCodec(Sdp("VP8")));
#endif
}
TEST(SdpVideoFormatTest, SameCodecNameSameParameters) {
@ -50,6 +56,17 @@ TEST(SdpVideoFormatTest, SameCodecNameSameParameters) {
.IsSameCodec(Sdp("AV1", Params{{"profile", "0"}})));
EXPECT_TRUE(Sdp("AV1", Params{{"profile", "2"}})
.IsSameCodec(Sdp("AV1", Params{{"profile", "2"}})));
#ifdef RTC_ENABLE_H265
EXPECT_TRUE(Sdp("H265").IsSameCodec(Sdp(
"H265",
Params{{"profile-id", "1"}, {"tier-flag", "0"}, {"level-id", "93"}})));
EXPECT_TRUE(
Sdp("H265",
Params{{"profile-id", "2"}, {"tier-flag", "0"}, {"level-id", "93"}})
.IsSameCodec(Sdp("H265", Params{{"profile-id", "2"},
{"tier-flag", "0"},
{"level-id", "93"}})));
#endif
}
TEST(SdpVideoFormatTest, SameCodecNameDifferentParameters) {
@ -69,6 +86,35 @@ TEST(SdpVideoFormatTest, SameCodecNameDifferentParameters) {
.IsSameCodec(Sdp("AV1", Params{{"profile", "1"}})));
EXPECT_FALSE(Sdp("AV1", Params{{"profile", "1"}})
.IsSameCodec(Sdp("AV1", Params{{"profile", "2"}})));
#ifdef RTC_ENABLE_H265
EXPECT_FALSE(Sdp("H265").IsSameCodec(Sdp(
"H265",
Params{{"profile-id", "0"}, {"tier-flag", "0"}, {"level-id", "93"}})));
EXPECT_FALSE(Sdp("H265").IsSameCodec(Sdp(
"H265",
Params{{"profile-id", "1"}, {"tier-flag", "1"}, {"level-id", "93"}})));
EXPECT_FALSE(Sdp("H265").IsSameCodec(Sdp(
"H265",
Params{{"profile-id", "1"}, {"tier-flag", "0"}, {"level-id", "90"}})));
EXPECT_FALSE(
Sdp("H265",
Params{{"profile-id", "2"}, {"tier-flag", "0"}, {"level-id", "93"}})
.IsSameCodec(Sdp("H265", Params{{"profile-id", "1"},
{"tier-flag", "0"},
{"level-id", "93"}})));
EXPECT_FALSE(
Sdp("H265",
Params{{"profile-id", "1"}, {"tier-flag", "1"}, {"level-id", "120"}})
.IsSameCodec(Sdp("H265", Params{{"profile-id", "1"},
{"tier-flag", "0"},
{"level-id", "120"}})));
EXPECT_FALSE(
Sdp("H265",
Params{{"profile-id", "1"}, {"tier-flag", "0"}, {"level-id", "93"}})
.IsSameCodec(Sdp("H265", Params{{"profile-id", "1"},
{"tier-flag", "0"},
{"level-id", "90"}})));
#endif
}
TEST(SdpVideoFormatTest, DifferentCodecNameSameParameters) {
@ -86,6 +132,12 @@ TEST(SdpVideoFormatTest, DifferentCodecNameSameParameters) {
.IsSameCodec(Sdp("H264", Params{{"profile", "0"}})));
EXPECT_FALSE(Sdp("AV1", Params{{"profile", "2"}})
.IsSameCodec(Sdp("VP9", Params{{"profile", "2"}})));
#ifdef RTC_ENABLE_H265
EXPECT_FALSE(Sdp("H265", Params{{"profile-id", "0"}})
.IsSameCodec(Sdp("H264", Params{{"profile-id", "0"}})));
EXPECT_FALSE(Sdp("H265", Params{{"profile-id", "2"}})
.IsSameCodec(Sdp("VP9", Params{{"profile-id", "2"}})));
#endif
}
TEST(SdpVideoFormatTest, H264PacketizationMode) {

View file

@ -28,6 +28,7 @@ constexpr char kPayloadNameAv1x[] = "AV1X";
constexpr char kPayloadNameH264[] = "H264";
constexpr char kPayloadNameGeneric[] = "Generic";
constexpr char kPayloadNameMultiplex[] = "Multiplex";
constexpr char kPayloadNameH265[] = "H265";
} // namespace
bool VideoCodecVP8::operator==(const VideoCodecVP8& other) const {
@ -102,6 +103,16 @@ const VideoCodecH264& VideoCodec::H264() const {
return codec_specific_.H264;
}
VideoCodecAV1* VideoCodec::AV1() {
RTC_DCHECK_EQ(codecType, kVideoCodecAV1);
return &codec_specific_.AV1;
}
const VideoCodecAV1& VideoCodec::AV1() const {
RTC_DCHECK_EQ(codecType, kVideoCodecAV1);
return codec_specific_.AV1;
}
const char* CodecTypeToPayloadString(VideoCodecType type) {
switch (type) {
case kVideoCodecVP8:
@ -116,6 +127,8 @@ const char* CodecTypeToPayloadString(VideoCodecType type) {
return kPayloadNameMultiplex;
case kVideoCodecGeneric:
return kPayloadNameGeneric;
case kVideoCodecH265:
return kPayloadNameH265;
}
RTC_CHECK_NOTREACHED();
}
@ -132,6 +145,8 @@ VideoCodecType PayloadStringToCodecType(const std::string& name) {
return kVideoCodecH264;
if (absl::EqualsIgnoreCase(name, kPayloadNameMultiplex))
return kVideoCodecMultiplex;
if (absl::EqualsIgnoreCase(name, kPayloadNameH265))
return kVideoCodecH265;
return kVideoCodecGeneric;
}

View file

@ -97,6 +97,16 @@ struct VideoCodecH264 {
uint8_t numberOfTemporalLayers;
};
struct VideoCodecAV1 {
bool operator==(const VideoCodecAV1& other) const {
return automatic_resize_on == other.automatic_resize_on;
}
bool operator!=(const VideoCodecAV1& other) const {
return !(*this == other);
}
bool automatic_resize_on;
};
// Translates from name of codec to codec type and vice versa.
RTC_EXPORT const char* CodecTypeToPayloadString(VideoCodecType type);
RTC_EXPORT VideoCodecType PayloadStringToCodecType(const std::string& name);
@ -105,6 +115,7 @@ union VideoCodecUnion {
VideoCodecVP8 VP8;
VideoCodecVP9 VP9;
VideoCodecH264 H264;
VideoCodecAV1 AV1;
};
enum class VideoCodecMode { kRealtimeVideo, kScreensharing };
@ -193,6 +204,8 @@ class RTC_EXPORT VideoCodec {
const VideoCodecVP9& VP9() const;
VideoCodecH264* H264();
const VideoCodecH264& H264() const;
VideoCodecAV1* AV1();
const VideoCodecAV1& AV1() const;
private:
// TODO(hta): Consider replacing the union with a pointer type.

View file

@ -170,6 +170,10 @@ void VideoDecoderSoftwareFallbackWrapper::UpdateFallbackDecoderHistograms() {
RTC_HISTOGRAM_COUNTS_100000(kFallbackHistogramsUmaPrefix + "Multiplex",
hw_decoded_frames_since_last_fallback_);
break;
case kVideoCodecH265:
RTC_HISTOGRAM_COUNTS_100000(kFallbackHistogramsUmaPrefix + "H265",
hw_decoded_frames_since_last_fallback_);
break;
}
}

View file

@ -33,9 +33,10 @@
namespace webrtc {
class WrappingAsyncDnsResolver;
class [[deprecated("Use AsyncDnsResolver directly")]] WrappingAsyncDnsResolver;
class RTC_EXPORT WrappingAsyncDnsResolverResult
class [[deprecated(
"Use AsyncDnsResolver directly")]] RTC_EXPORT WrappingAsyncDnsResolverResult
: public AsyncDnsResolverResult {
public:
explicit WrappingAsyncDnsResolverResult(WrappingAsyncDnsResolver* owner)
@ -54,6 +55,8 @@ class RTC_EXPORT WrappingAsyncDnsResolverResult
class RTC_EXPORT WrappingAsyncDnsResolver : public AsyncDnsResolverInterface,
public sigslot::has_slots<> {
public:
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
explicit WrappingAsyncDnsResolver(rtc::AsyncResolverInterface* wrapped)
: wrapped_(absl::WrapUnique(wrapped)), result_(this) {}
@ -124,6 +127,7 @@ class RTC_EXPORT WrappingAsyncDnsResolver : public AsyncDnsResolverInterface,
State state_ RTC_GUARDED_BY(sequence_checker_) = State::kNotStarted;
WrappingAsyncDnsResolverResult result_ RTC_GUARDED_BY(sequence_checker_);
bool within_resolve_result_ RTC_GUARDED_BY(sequence_checker_) = false;
#pragma clang diagnostic pop
};
} // namespace webrtc

View file

@ -481,21 +481,15 @@ AudioMixer::Source::AudioFrameInfo ChannelReceive::GetAudioFrameWithInfo(
// Fill in local capture clock offset in `audio_frame->packet_infos_`.
RtpPacketInfos::vector_type packet_infos;
for (auto& packet_info : audio_frame->packet_infos_) {
absl::optional<int64_t> local_capture_clock_offset_q32x32;
RtpPacketInfo new_packet_info(packet_info);
if (packet_info.absolute_capture_time().has_value()) {
MutexLock lock(&ts_stats_lock_);
local_capture_clock_offset_q32x32 =
capture_clock_offset_updater_.AdjustEstimatedCaptureClockOffset(
packet_info.absolute_capture_time()
->estimated_capture_clock_offset);
new_packet_info.set_local_capture_clock_offset(
capture_clock_offset_updater_.ConvertsToTimeDela(
capture_clock_offset_updater_.AdjustEstimatedCaptureClockOffset(
packet_info.absolute_capture_time()
->estimated_capture_clock_offset)));
}
RtpPacketInfo new_packet_info(packet_info);
absl::optional<TimeDelta> local_capture_clock_offset;
if (local_capture_clock_offset_q32x32.has_value()) {
local_capture_clock_offset = TimeDelta::Millis(
UQ32x32ToInt64Ms(*local_capture_clock_offset_q32x32));
}
new_packet_info.set_local_capture_clock_offset(local_capture_clock_offset);
packet_infos.push_back(std::move(new_packet_info));
}
audio_frame->packet_infos_ = RtpPacketInfos(packet_infos);

View file

@ -411,8 +411,10 @@ ChannelSend::ChannelSend(
configuration.event_log = event_log_;
configuration.rtt_stats = rtcp_rtt_stats;
configuration.retransmission_rate_limiter =
retransmission_rate_limiter_.get();
if (field_trials.IsDisabled("WebRTC-DisableRtxRateLimiter")) {
configuration.retransmission_rate_limiter =
retransmission_rate_limiter_.get();
}
configuration.extmap_allow_mixed = extmap_allow_mixed;
configuration.rtcp_report_interval_ms = rtcp_report_interval_ms;
configuration.rtcp_packet_type_counter_observer = this;

View file

@ -48,13 +48,14 @@ AudioFrameType InterfaceFrameTypeToInternalFrameType(
class TransformableOutgoingAudioFrame
: public TransformableAudioFrameInterface {
public:
TransformableOutgoingAudioFrame(AudioFrameType frame_type,
uint8_t payload_type,
uint32_t rtp_timestamp_with_offset,
const uint8_t* payload_data,
size_t payload_size,
int64_t absolute_capture_timestamp_ms,
uint32_t ssrc)
TransformableOutgoingAudioFrame(
AudioFrameType frame_type,
uint8_t payload_type,
uint32_t rtp_timestamp_with_offset,
const uint8_t* payload_data,
size_t payload_size,
absl::optional<uint64_t> absolute_capture_timestamp_ms,
uint32_t ssrc)
: frame_type_(frame_type),
payload_type_(payload_type),
rtp_timestamp_with_offset_(rtp_timestamp_with_offset),
@ -97,7 +98,7 @@ class TransformableOutgoingAudioFrame
uint8_t payload_type_;
uint32_t rtp_timestamp_with_offset_;
rtc::Buffer payload_;
int64_t absolute_capture_timestamp_ms_;
absl::optional<uint64_t> absolute_capture_timestamp_ms_;
uint32_t ssrc_;
};
} // namespace
@ -168,12 +169,11 @@ void ChannelSendFrameTransformerDelegate::SendFrame(
std::unique_ptr<TransformableAudioFrameInterface> CloneSenderAudioFrame(
TransformableAudioFrameInterface* original) {
// TODO(crbug.com/webrtc/14949): Ensure the correct timestamps are passed.
return std::make_unique<TransformableOutgoingAudioFrame>(
InterfaceFrameTypeToInternalFrameType(original->Type()),
original->GetPayloadType(), original->GetTimestamp(),
original->GetData().data(), original->GetData().size(),
original->GetTimestamp(), original->GetSsrc());
original->AbsoluteCaptureTimestamp(), original->GetSsrc());
}
} // namespace webrtc

View file

@ -232,7 +232,7 @@ TEST_F(AudioChannelTest, TestChannelStatistics) {
EXPECT_CALL(transport_, SendRtp).WillRepeatedly(Invoke(loop_rtp));
EXPECT_CALL(transport_, SendRtcp).WillRepeatedly(Invoke(loop_rtcp));
// Simulate microphone giving audio frame (10 ms). This will trigger tranport
// Simulate microphone giving audio frame (10 ms). This will trigger transport
// to send RTP as handled in loop_rtp above.
auto audio_sender = audio_channel_->GetAudioSender();
audio_sender->SendAudioData(GetAudioFrame(0));
@ -245,7 +245,7 @@ TEST_F(AudioChannelTest, TestChannelStatistics) {
audio_mixer_->Mix(/*number_of_channels=*/1, &audio_frame);
// Force sending RTCP SR report in order to have remote_rtcp field available
// in channel statistics. This will trigger tranport to send RTCP as handled
// in channel statistics. This will trigger transport to send RTCP as handled
// in loop_rtcp above.
audio_channel_->SendRTCPReportForTesting(kRtcpSr);

View file

@ -218,7 +218,7 @@ TEST_F(AudioEgressTest, SkipAudioEncodingAfterStopSend) {
// It should be safe to exit the test case while encoder_queue_ has
// outstanding data to process. We are making sure that this doesn't
// result in crahses or sanitizer errors due to remaining data.
// result in crashes or sanitizer errors due to remaining data.
for (size_t i = 0; i < kExpected * 2; i++) {
egress_->SendAudioData(GetAudioFrame(i));
time_controller_.AdvanceTime(TimeDelta::Millis(10));

View file

@ -1 +1,3 @@
jansson@webrtc.org
jleconte@webrtc.org
mbonadei@webrtc.org

View file

@ -345,7 +345,6 @@ rtc_library("call") {
]
absl_deps = [
"//third_party/abseil-cpp/absl/functional:bind_front",
"//third_party/abseil-cpp/absl/memory",
"//third_party/abseil-cpp/absl/strings",
"//third_party/abseil-cpp/absl/types:optional",
]
@ -544,7 +543,6 @@ if (rtc_include_tests) {
absl_deps = [
"//third_party/abseil-cpp/absl/container:inlined_vector",
"//third_party/abseil-cpp/absl/functional:any_invocable",
"//third_party/abseil-cpp/absl/memory",
"//third_party/abseil-cpp/absl/strings",
"//third_party/abseil-cpp/absl/types:optional",
"//third_party/abseil-cpp/absl/types:variant",
@ -606,6 +604,7 @@ if (rtc_include_tests) {
"../test:frame_generator_capturer",
"../test:null_transport",
"../test:test_common",
"../test:test_flags",
"../test:test_support",
"../test:video_test_common",
"../test:video_test_constants",

View file

@ -184,7 +184,7 @@ class Call final : public webrtc::Call,
public BitrateAllocator::LimitObserver {
public:
Call(Clock* clock,
const Call::Config& config,
const CallConfig& config,
std::unique_ptr<RtpTransportControllerSendInterface> transport_send,
TaskQueueFactory* task_queue_factory);
~Call() override;
@ -358,7 +358,7 @@ class Call final : public webrtc::Call,
const int num_cpu_cores_;
const std::unique_ptr<CallStats> call_stats_;
const std::unique_ptr<BitrateAllocator> bitrate_allocator_;
const Call::Config config_ RTC_GUARDED_BY(worker_thread_);
const CallConfig config_ RTC_GUARDED_BY(worker_thread_);
// Maps to config_.trials, can be used from any thread via `trials()`.
const FieldTrialsView& trials_;
@ -391,11 +391,6 @@ class Call final : public webrtc::Call,
RTC_NO_UNIQUE_ADDRESS SequenceChecker receive_11993_checker_;
// TODO(bugs.webrtc.org/11993): Move receive_rtp_config_ over to the
// network thread.
std::map<uint32_t, ReceiveStreamInterface*> receive_rtp_config_
RTC_GUARDED_BY(&receive_11993_checker_);
// Audio and Video send streams are owned by the client that creates them.
// TODO(bugs.webrtc.org/11993): `audio_send_ssrcs_` and `video_send_ssrcs_`
// should be accessed on the network thread.
@ -481,20 +476,22 @@ std::string Call::Stats::ToString(int64_t time_ms) const {
return ss.str();
}
Call* Call::Create(const Call::Config& config) {
std::unique_ptr<Call> Call::Create(const CallConfig& config) {
Clock* clock = Clock::GetRealTimeClock();
return Create(config, clock,
RtpTransportControllerSendFactory().Create(
config.ExtractTransportConfig(), clock));
}
Call* Call::Create(const Call::Config& config,
Clock* clock,
std::unique_ptr<RtpTransportControllerSendInterface>
transportControllerSend) {
std::unique_ptr<Call> Call::Create(
const CallConfig& config,
Clock* clock,
std::unique_ptr<RtpTransportControllerSendInterface>
transportControllerSend) {
RTC_DCHECK(config.task_queue_factory);
return new internal::Call(clock, config, std::move(transportControllerSend),
config.task_queue_factory);
return std::make_unique<internal::Call>(clock, config,
std::move(transportControllerSend),
config.task_queue_factory);
}
// This method here to avoid subclasses has to implement this method.
@ -661,7 +658,7 @@ void Call::SendStats::SetMinAllocatableRate(BitrateAllocationLimits limits) {
}
Call::Call(Clock* clock,
const Call::Config& config,
const CallConfig& config,
std::unique_ptr<RtpTransportControllerSendInterface> transport_send,
TaskQueueFactory* task_queue_factory)
: clock_(clock),
@ -847,11 +844,6 @@ webrtc::AudioReceiveStreamInterface* Call::CreateAudioReceiveStream(
// to live on the network thread.
receive_stream->RegisterWithTransport(&audio_receiver_controller_);
// TODO(bugs.webrtc.org/11993): Update the below on the network thread.
// We could possibly set up the audio_receiver_controller_ association up
// as part of the async setup.
RegisterReceiveStream(config.rtp.remote_ssrc, receive_stream);
ConfigureSync(config.sync_group);
auto it = audio_send_ssrcs_.find(config.rtp.local_ssrc);
@ -886,8 +878,6 @@ void Call::DestroyAudioReceiveStream(
// for this sync_group.
ConfigureSync(audio_receive_stream->sync_group());
UnregisterReceiveStream(ssrc);
UpdateAggregateNetworkState();
// TODO(bugs.webrtc.org/11993): Consider if deleting `audio_receive_stream`
// on the network thread would be better or if we'd need to tear down the
@ -1024,15 +1014,6 @@ webrtc::VideoReceiveStreamInterface* Call::CreateVideoReceiveStream(
// TODO(bugs.webrtc.org/11993): Set this up asynchronously on the network
// thread.
receive_stream->RegisterWithTransport(&video_receiver_controller_);
if (receive_stream->rtx_ssrc()) {
// We record identical config for the rtx stream as for the main
// stream. Since the transport_send_cc negotiation is per payload
// type, we may get an incorrect value for the rtx stream, but
// that is unlikely to matter in practice.
RegisterReceiveStream(receive_stream->rtx_ssrc(), receive_stream);
}
RegisterReceiveStream(receive_stream->remote_ssrc(), receive_stream);
video_receive_streams_.insert(receive_stream);
ConfigureSync(receive_stream->sync_group());
@ -1051,14 +1032,6 @@ void Call::DestroyVideoReceiveStream(
static_cast<VideoReceiveStream2*>(receive_stream);
// TODO(bugs.webrtc.org/11993): Unregister on the network thread.
receive_stream_impl->UnregisterFromTransport();
// Remove all ssrcs pointing to a receive stream. As RTX retransmits on a
// separate SSRC there can be either one or two.
UnregisterReceiveStream(receive_stream_impl->remote_ssrc());
if (receive_stream_impl->rtx_ssrc()) {
UnregisterReceiveStream(receive_stream_impl->rtx_ssrc());
}
video_receive_streams_.erase(receive_stream_impl);
ConfigureSync(receive_stream_impl->sync_group());
@ -1086,8 +1059,6 @@ FlexfecReceiveStream* Call::CreateFlexfecReceiveStream(
// TODO(bugs.webrtc.org/11993): Set this up asynchronously on the network
// thread.
receive_stream->RegisterWithTransport(&video_receiver_controller_);
RegisterReceiveStream(receive_stream->remote_ssrc(), receive_stream);
// TODO(brandtr): Store config in RtcEventLog here.
return receive_stream;
@ -1103,8 +1074,6 @@ void Call::DestroyFlexfecReceiveStream(FlexfecReceiveStream* receive_stream) {
receive_stream_impl->UnregisterFromTransport();
auto ssrc = receive_stream_impl->remote_ssrc();
UnregisterReceiveStream(ssrc);
// Remove all SSRCs pointing to the FlexfecReceiveStreamImpl to be
// destroyed.
receive_side_cc_.RemoveStream(ssrc);
@ -1473,26 +1442,6 @@ void Call::NotifyBweOfReceivedPacket(const RtpPacketReceived& packet,
receive_side_cc_.OnReceivedPacket(packet, media_type);
}
bool Call::RegisterReceiveStream(uint32_t ssrc,
ReceiveStreamInterface* stream) {
RTC_DCHECK_RUN_ON(&receive_11993_checker_);
RTC_DCHECK(stream);
auto inserted = receive_rtp_config_.emplace(ssrc, stream);
if (!inserted.second) {
RTC_DLOG(LS_WARNING) << "ssrc already registered: " << ssrc;
}
return inserted.second;
}
bool Call::UnregisterReceiveStream(uint32_t ssrc) {
RTC_DCHECK_RUN_ON(&receive_11993_checker_);
size_t erased = receive_rtp_config_.erase(ssrc);
if (!erased) {
RTC_DLOG(LS_WARNING) << "ssrc wasn't registered: " << ssrc;
}
return erased != 0u;
}
} // namespace internal
} // namespace webrtc

View file

@ -46,8 +46,6 @@ namespace webrtc {
class Call {
public:
using Config = CallConfig;
struct Stats {
std::string ToString(int64_t time_ms) const;
@ -58,11 +56,12 @@ class Call {
int64_t rtt_ms = -1;
};
static Call* Create(const Call::Config& config);
static Call* Create(const Call::Config& config,
Clock* clock,
std::unique_ptr<RtpTransportControllerSendInterface>
transportControllerSend);
static std::unique_ptr<Call> Create(const CallConfig& config);
static std::unique_ptr<Call> Create(
const CallConfig& config,
Clock* clock,
std::unique_ptr<RtpTransportControllerSendInterface>
transportControllerSend);
virtual AudioSendStream* CreateAudioSendStream(
const AudioSendStream::Config& config) = 0;

View file

@ -17,7 +17,6 @@
#include <utility>
#include <vector>
#include "absl/memory/memory.h"
#include "absl/types/optional.h"
#include "api/test/simulated_network.h"
#include "api/units/time_delta.h"
@ -83,7 +82,7 @@ CallFactory::CallFactory() {
call_thread_.Detach();
}
Call* CallFactory::CreateCall(const Call::Config& config) {
std::unique_ptr<Call> CallFactory::CreateCall(const CallConfig& config) {
RTC_DCHECK_RUN_ON(&call_thread_);
RTC_DCHECK(config.trials);
@ -95,22 +94,22 @@ Call* CallFactory::CreateCall(const Call::Config& config) {
RtpTransportConfig transportConfig = config.ExtractTransportConfig();
Call* call =
std::unique_ptr<Call> call =
Call::Create(config, Clock::GetRealTimeClock(),
config.rtp_transport_controller_send_factory->Create(
transportConfig, Clock::GetRealTimeClock()));
if (!send_degradation_configs.empty() ||
!receive_degradation_configs.empty()) {
return new DegradedCall(absl::WrapUnique(call), send_degradation_configs,
receive_degradation_configs);
return std::make_unique<DegradedCall>(
std::move(call), send_degradation_configs, receive_degradation_configs);
}
return call;
}
std::unique_ptr<CallFactoryInterface> CreateCallFactory() {
return std::unique_ptr<CallFactoryInterface>(new CallFactory());
return std::make_unique<CallFactory>();
}
} // namespace webrtc

View file

@ -11,6 +11,8 @@
#ifndef CALL_CALL_FACTORY_H_
#define CALL_CALL_FACTORY_H_
#include <memory>
#include "api/call/call_factory_interface.h"
#include "api/sequence_checker.h"
#include "call/call.h"
@ -22,11 +24,10 @@ namespace webrtc {
class CallFactory : public CallFactoryInterface {
public:
CallFactory();
~CallFactory() override = default;
private:
~CallFactory() override {}
Call* CreateCall(const CallConfig& config) override;
std::unique_ptr<Call> CreateCall(const CallConfig& config) override;
RTC_NO_UNIQUE_ADDRESS SequenceChecker call_thread_;
};

View file

@ -13,6 +13,7 @@
#include <memory>
#include <string>
#include "absl/flags/flag.h"
#include "absl/strings/string_view.h"
#include "api/audio_codecs/builtin_audio_encoder_factory.h"
#include "api/numerics/samples_stats_counter.h"
@ -52,6 +53,7 @@
#include "test/gtest.h"
#include "test/null_transport.h"
#include "test/rtp_rtcp_observer.h"
#include "test/test_flags.h"
#include "test/testsupport/file_utils.h"
#include "test/video_encoder_proxy_factory.h"
#include "test/video_test_constants.h"
@ -221,12 +223,12 @@ void CallPerfTest::TestAudioVideoSync(FecMode fec,
send_audio_state_config.audio_processing =
AudioProcessingBuilder().Create();
send_audio_state_config.audio_device_module = fake_audio_device;
Call::Config sender_config(send_event_log_.get());
CallConfig sender_config(send_event_log_.get());
auto audio_state = AudioState::Create(send_audio_state_config);
fake_audio_device->RegisterAudioCallback(audio_state->audio_transport());
sender_config.audio_state = audio_state;
Call::Config receiver_config(recv_event_log_.get());
CallConfig receiver_config(recv_event_log_.get());
receiver_config.audio_state = audio_state;
CreateCalls(sender_config, receiver_config);
@ -361,7 +363,7 @@ void CallPerfTest::TestAudioVideoSync(FecMode fec,
observer->PrintResults();
// In quick test synchronization may not be achieved in time.
if (!field_trial::IsEnabled("WebRTC-QuickPerfTest")) {
if (!absl::GetFlag(FLAGS_webrtc_quick_perf_test)) {
// TODO(bugs.webrtc.org/10417): Reenable this for iOS
#if !defined(WEBRTC_IOS)
EXPECT_METRIC_EQ(1, metrics::NumSamples("WebRTC.Video.AVSyncOffsetInMs"));
@ -975,8 +977,8 @@ void CallPerfTest::TestMinAudioVideoBitrate(int test_bitrate_from,
void PerformTest() override {
// Quick test mode, just to exercise all the code paths without actually
// caring about performance measurements.
const bool quick_perf_test =
field_trial::IsEnabled("WebRTC-QuickPerfTest");
const bool quick_perf_test = absl::GetFlag(FLAGS_webrtc_quick_perf_test);
int last_passed_test_bitrate = -1;
for (int test_bitrate = test_bitrate_from_;
test_bitrate_from_ < test_bitrate_to_
@ -1125,8 +1127,7 @@ void CallPerfTest::TestEncodeFramerate(VideoEncoderFactory* encoder_factory,
}
void VerifyStats() const {
const bool quick_perf_test =
field_trial::IsEnabled("WebRTC-QuickPerfTest");
const bool quick_perf_test = absl::GetFlag(FLAGS_webrtc_quick_perf_test);
double input_fps = 0.0;
for (const auto& configured_framerate : configured_framerates_) {
input_fps = std::max(configured_framerate.second, input_fps);

View file

@ -15,7 +15,6 @@
#include <memory>
#include <utility>
#include "absl/memory/memory.h"
#include "absl/strings/string_view.h"
#include "api/audio_codecs/builtin_audio_decoder_factory.h"
#include "api/media_types.h"
@ -40,6 +39,7 @@
#include "test/mock_transport.h"
#include "test/run_loop.h"
namespace webrtc {
namespace {
using ::testing::_;
@ -47,41 +47,38 @@ using ::testing::Contains;
using ::testing::MockFunction;
using ::testing::NiceMock;
using ::testing::StrictMock;
using ::webrtc::test::MockAudioDeviceModule;
using ::webrtc::test::MockAudioMixer;
using ::webrtc::test::MockAudioProcessing;
using ::webrtc::test::RunLoop;
struct CallHelper {
explicit CallHelper(bool use_null_audio_processing) {
task_queue_factory_ = webrtc::CreateDefaultTaskQueueFactory();
webrtc::AudioState::Config audio_state_config;
audio_state_config.audio_mixer =
rtc::make_ref_counted<webrtc::test::MockAudioMixer>();
task_queue_factory_ = CreateDefaultTaskQueueFactory();
AudioState::Config audio_state_config;
audio_state_config.audio_mixer = rtc::make_ref_counted<MockAudioMixer>();
audio_state_config.audio_processing =
use_null_audio_processing
? nullptr
: rtc::make_ref_counted<
NiceMock<webrtc::test::MockAudioProcessing>>();
: rtc::make_ref_counted<NiceMock<MockAudioProcessing>>();
audio_state_config.audio_device_module =
rtc::make_ref_counted<webrtc::test::MockAudioDeviceModule>();
webrtc::Call::Config config(&event_log_);
config.audio_state = webrtc::AudioState::Create(audio_state_config);
rtc::make_ref_counted<MockAudioDeviceModule>();
CallConfig config(&event_log_);
config.audio_state = AudioState::Create(audio_state_config);
config.task_queue_factory = task_queue_factory_.get();
config.trials = &field_trials_;
call_.reset(webrtc::Call::Create(config));
call_ = Call::Create(config);
}
webrtc::Call* operator->() { return call_.get(); }
Call* operator->() { return call_.get(); }
private:
webrtc::test::RunLoop loop_;
webrtc::RtcEventLogNull event_log_;
webrtc::FieldTrialBasedConfig field_trials_;
std::unique_ptr<webrtc::TaskQueueFactory> task_queue_factory_;
std::unique_ptr<webrtc::Call> call_;
RunLoop loop_;
RtcEventLogNull event_log_;
FieldTrialBasedConfig field_trials_;
std::unique_ptr<TaskQueueFactory> task_queue_factory_;
std::unique_ptr<Call> call_;
};
} // namespace
namespace webrtc {
namespace {
rtc::scoped_refptr<Resource> FindResourceWhoseNameContains(
const std::vector<rtc::scoped_refptr<Resource>>& resources,

View file

@ -329,7 +329,7 @@ void RampUpTester::TriggerTestDone() {
RTC_DCHECK_GE(test_start_ms_, 0);
// Stop polling stats.
// Corner case for field_trials=WebRTC-QuickPerfTest/Enabled/
// Corner case for webrtc_quick_perf_test
SendTask(task_queue_, [this] { pending_task_.Stop(); });
// TODO(holmer): Add audio send stats here too when those APIs are available.

View file

@ -100,6 +100,7 @@ void PopulateRtpWithCodecSpecifics(const CodecSpecificInfo& info,
case kVideoCodecGeneric:
rtp->codec = kVideoCodecGeneric;
return;
// TODO(bugs.webrtc.org/13485): Implement H265 codec specific info
default:
return;
}
@ -341,6 +342,9 @@ void RtpPayloadParams::SetGeneric(const CodecSpecificInfo* codec_specific_info,
return;
case VideoCodecType::kVideoCodecMultiplex:
return;
case VideoCodecType::kVideoCodecH265:
// TODO(bugs.webrtc.org/13485): Implement H265 to generic descriptor.
return;
}
RTC_DCHECK_NOTREACHED() << "Unsupported codec.";
}
@ -402,6 +406,7 @@ absl::optional<FrameDependencyStructure> RtpPayloadParams::GenericStructure(
}
case VideoCodecType::kVideoCodecAV1:
case VideoCodecType::kVideoCodecH264:
case VideoCodecType::kVideoCodecH265:
case VideoCodecType::kVideoCodecMultiplex:
return absl::nullopt;
}

View file

@ -343,12 +343,13 @@ void RtpTransportControllerSend::OnNetworkAvailability(bool network_available) {
is_congested_ = false;
pacer_.SetCongested(false);
if (!controller_) {
MaybeCreateControllers();
}
if (controller_) {
control_handler_->SetNetworkAvailability(network_available);
PostUpdates(controller_->OnNetworkAvailability(msg));
UpdateControlState();
} else {
MaybeCreateControllers();
}
for (auto& rtp_sender : video_rtp_senders_) {
rtp_sender->OnNetworkAvailability(network_available);

View file

@ -57,7 +57,6 @@ struct RtpSenderObservers {
BitrateStatisticsObserver* bitrate_observer;
FrameCountObserver* frame_count_observer;
RtcpPacketTypeCounterObserver* rtcp_type_observer;
SendSideDelayObserver* send_delay_observer;
SendPacketObserver* send_packet_observer;
};

View file

@ -224,10 +224,11 @@ std::vector<RtpStreamSender> CreateRtpStreamSenders(
observers.report_block_data_observer;
configuration.paced_sender = transport->packet_sender();
configuration.send_bitrate_observer = observers.bitrate_observer;
configuration.send_side_delay_observer = observers.send_delay_observer;
configuration.send_packet_observer = observers.send_packet_observer;
configuration.event_log = event_log;
configuration.retransmission_rate_limiter = retransmission_rate_limiter;
if (trials.IsDisabled("WebRTC-DisableRtxRateLimiter")) {
configuration.retransmission_rate_limiter = retransmission_rate_limiter;
}
configuration.rtp_stats_callback = observers.rtp_stats;
configuration.frame_encryptor = frame_encryptor;
configuration.require_frame_encryption =
@ -509,7 +510,6 @@ void RtpVideoSender::SetActiveModulesLocked(
const bool was_active = rtp_module.Sending();
const bool should_be_active = active_modules[i];
// Sends a kRtcpByeCode when going from true to false.
rtp_module.SetSendingStatus(active_modules[i]);
if (was_active && !should_be_active) {
@ -577,7 +577,7 @@ EncodedImageCallback::Result RtpVideoSender::OnEncodedImage(
RTC_DCHECK_LT(simulcast_index, rtp_streams_.size());
uint32_t rtp_timestamp =
encoded_image.Timestamp() +
encoded_image.RtpTimestamp() +
rtp_streams_[simulcast_index].rtp_rtcp->StartTimestamp();
// RTCPSender has it's own copy of the timestamp offset, added in
@ -585,7 +585,7 @@ EncodedImageCallback::Result RtpVideoSender::OnEncodedImage(
// TODO(nisse): Delete RTCPSender:timestamp_offset_, and see if we can confine
// knowledge of the offset to a single place.
if (!rtp_streams_[simulcast_index].rtp_rtcp->OnSendingRtpFrame(
encoded_image.Timestamp(), encoded_image.capture_time_ms_,
encoded_image.RtpTimestamp(), encoded_image.capture_time_ms_,
rtp_config_.payload_type,
encoded_image._frameType == VideoFrameType::kVideoFrameKey)) {
// The payload router could be active but this module isn't sending.

View file

@ -32,7 +32,6 @@
#include "test/scenario/scenario.h"
#include "test/scoped_key_value_config.h"
#include "test/time_controller/simulated_time_controller.h"
#include "video/send_delay_stats.h"
#include "video/send_statistics_proxy.h"
namespace webrtc {
@ -62,17 +61,14 @@ class MockRtcpIntraFrameObserver : public RtcpIntraFrameObserver {
};
RtpSenderObservers CreateObservers(
RtcpRttStats* rtcp_rtt_stats,
RtcpIntraFrameObserver* intra_frame_callback,
ReportBlockDataObserver* report_block_data_observer,
StreamDataCountersCallback* rtp_stats,
BitrateStatisticsObserver* bitrate_observer,
FrameCountObserver* frame_count_observer,
RtcpPacketTypeCounterObserver* rtcp_type_observer,
SendSideDelayObserver* send_delay_observer,
SendPacketObserver* send_packet_observer) {
RtcpPacketTypeCounterObserver* rtcp_type_observer) {
RtpSenderObservers observers;
observers.rtcp_rtt_stats = rtcp_rtt_stats;
observers.rtcp_rtt_stats = nullptr;
observers.intra_frame_callback = intra_frame_callback;
observers.rtcp_loss_notification_observer = nullptr;
observers.report_block_data_observer = report_block_data_observer;
@ -80,8 +76,7 @@ RtpSenderObservers CreateObservers(
observers.bitrate_observer = bitrate_observer;
observers.frame_count_observer = frame_count_observer;
observers.rtcp_type_observer = rtcp_type_observer;
observers.send_delay_observer = send_delay_observer;
observers.send_packet_observer = send_packet_observer;
observers.send_packet_observer = nullptr;
return observers;
}
@ -127,7 +122,6 @@ class RtpVideoSenderTestFixture {
ssrcs,
rtx_ssrcs,
payload_type)),
send_delay_stats_(time_controller_.GetClock()),
bitrate_config_(GetBitrateConfig()),
transport_controller_(
time_controller_.GetClock(),
@ -148,9 +142,8 @@ class RtpVideoSenderTestFixture {
router_ = std::make_unique<RtpVideoSender>(
time_controller_.GetClock(), suspended_ssrcs, suspended_payload_states,
config_.rtp, config_.rtcp_report_interval_ms, &transport_,
CreateObservers(nullptr, &encoder_feedback_, &stats_proxy_,
&stats_proxy_, &stats_proxy_, frame_count_observer,
&stats_proxy_, &stats_proxy_, &send_delay_stats_),
CreateObservers(&encoder_feedback_, &stats_proxy_, &stats_proxy_,
&stats_proxy_, frame_count_observer, &stats_proxy_),
&transport_controller_, &event_log_, &retransmission_rate_limiter_,
std::make_unique<FecControllerDefault>(time_controller_.GetClock()),
nullptr, CryptoOptions{}, frame_transformer,
@ -206,7 +199,6 @@ class RtpVideoSenderTestFixture {
GlobalSimulatedTimeController time_controller_;
RtcEventLogNull event_log_;
VideoSendStream::Config config_;
SendDelayStats send_delay_stats_;
BitrateConstraints bitrate_config_;
RtpTransportControllerSend transport_controller_;
SendStatisticsProxy stats_proxy_;
@ -226,7 +218,7 @@ BitrateAllocationUpdate CreateBitrateAllocationUpdate(int target_bitrate_bps) {
TEST(RtpVideoSenderTest, SendOnOneModule) {
constexpr uint8_t kPayload = 'a';
EncodedImage encoded_image;
encoded_image.SetTimestamp(1);
encoded_image.SetRtpTimestamp(1);
encoded_image.capture_time_ms_ = 2;
encoded_image._frameType = VideoFrameType::kVideoFrameKey;
encoded_image.SetEncodedData(EncodedImageBuffer::Create(&kPayload, 1));
@ -251,7 +243,7 @@ TEST(RtpVideoSenderTest, SendOnOneModule) {
TEST(RtpVideoSenderTest, SendSimulcastSetActive) {
constexpr uint8_t kPayload = 'a';
EncodedImage encoded_image_1;
encoded_image_1.SetTimestamp(1);
encoded_image_1.SetRtpTimestamp(1);
encoded_image_1.capture_time_ms_ = 2;
encoded_image_1._frameType = VideoFrameType::kVideoFrameKey;
encoded_image_1.SetEncodedData(EncodedImageBuffer::Create(&kPayload, 1));
@ -286,7 +278,7 @@ TEST(RtpVideoSenderTest, SendSimulcastSetActive) {
TEST(RtpVideoSenderTest, SendSimulcastSetActiveModules) {
constexpr uint8_t kPayload = 'a';
EncodedImage encoded_image_1;
encoded_image_1.SetTimestamp(1);
encoded_image_1.SetRtpTimestamp(1);
encoded_image_1.capture_time_ms_ = 2;
encoded_image_1._frameType = VideoFrameType::kVideoFrameKey;
encoded_image_1.SetEncodedData(EncodedImageBuffer::Create(&kPayload, 1));
@ -322,7 +314,7 @@ TEST(RtpVideoSenderTest,
DiscardsHigherSimulcastFramesAfterLayerDisabledInVideoLayersAllocation) {
constexpr uint8_t kPayload = 'a';
EncodedImage encoded_image_1;
encoded_image_1.SetTimestamp(1);
encoded_image_1.SetRtpTimestamp(1);
encoded_image_1.capture_time_ms_ = 2;
encoded_image_1._frameType = VideoFrameType::kVideoFrameKey;
encoded_image_1.SetEncodedData(EncodedImageBuffer::Create(&kPayload, 1));
@ -407,7 +399,7 @@ TEST(RtpVideoSenderTest, FrameCountCallbacks) {
constexpr uint8_t kPayload = 'a';
EncodedImage encoded_image;
encoded_image.SetTimestamp(1);
encoded_image.SetRtpTimestamp(1);
encoded_image.capture_time_ms_ = 2;
encoded_image._frameType = VideoFrameType::kVideoFrameKey;
encoded_image.SetEncodedData(EncodedImageBuffer::Create(&kPayload, 1));
@ -453,7 +445,7 @@ TEST(RtpVideoSenderTest, DoesNotRetrasmitAckedPackets) {
constexpr uint8_t kPayload = 'a';
EncodedImage encoded_image;
encoded_image.SetTimestamp(1);
encoded_image.SetRtpTimestamp(1);
encoded_image.capture_time_ms_ = 2;
encoded_image._frameType = VideoFrameType::kVideoFrameKey;
encoded_image.SetEncodedData(EncodedImageBuffer::Create(&kPayload, 1));
@ -474,7 +466,7 @@ TEST(RtpVideoSenderTest, DoesNotRetrasmitAckedPackets) {
});
EXPECT_EQ(EncodedImageCallback::Result::OK,
test.router()->OnEncodedImage(encoded_image, nullptr).error);
encoded_image.SetTimestamp(2);
encoded_image.SetRtpTimestamp(2);
encoded_image.capture_time_ms_ = 3;
EXPECT_EQ(EncodedImageCallback::Result::OK,
test.router()->OnEncodedImage(encoded_image, nullptr).error);
@ -618,7 +610,7 @@ TEST(RtpVideoSenderTest, EarlyRetransmits) {
const uint8_t kPayload[1] = {'a'};
EncodedImage encoded_image;
encoded_image.SetTimestamp(1);
encoded_image.SetRtpTimestamp(1);
encoded_image.capture_time_ms_ = 2;
encoded_image._frameType = VideoFrameType::kVideoFrameKey;
encoded_image.SetEncodedData(
@ -725,7 +717,7 @@ TEST(RtpVideoSenderTest, SupportsDependencyDescriptor) {
const uint8_t kPayload[1] = {'a'};
EncodedImage encoded_image;
encoded_image.SetTimestamp(1);
encoded_image.SetRtpTimestamp(1);
encoded_image.capture_time_ms_ = 2;
encoded_image.SetEncodedData(
EncodedImageBuffer::Create(kPayload, sizeof(kPayload)));
@ -831,7 +823,7 @@ TEST(RtpVideoSenderTest, SupportsDependencyDescriptorForVp9) {
const uint8_t kPayload[1] = {'a'};
EncodedImage encoded_image;
encoded_image.SetTimestamp(1);
encoded_image.SetRtpTimestamp(1);
encoded_image.capture_time_ms_ = 2;
encoded_image._frameType = VideoFrameType::kVideoFrameKey;
encoded_image.SetEncodedData(
@ -887,7 +879,7 @@ TEST(RtpVideoSenderTest,
const uint8_t kPayload[1] = {'a'};
EncodedImage encoded_image;
encoded_image.SetTimestamp(1);
encoded_image.SetRtpTimestamp(1);
encoded_image.capture_time_ms_ = 2;
encoded_image._frameType = VideoFrameType::kVideoFrameKey;
encoded_image._encodedWidth = 320;
@ -909,7 +901,7 @@ TEST(RtpVideoSenderTest,
// Send in 2nd picture.
encoded_image._frameType = VideoFrameType::kVideoFrameDelta;
encoded_image.SetTimestamp(3000);
encoded_image.SetRtpTimestamp(3000);
codec_specific.codecSpecific.VP9.inter_pic_predicted = true;
codec_specific.codecSpecific.VP9.num_ref_pics = 1;
codec_specific.codecSpecific.VP9.p_diff[0] = 1;
@ -942,7 +934,7 @@ TEST(RtpVideoSenderTest, GenerateDependecyDescriptorForGenericCodecs) {
const uint8_t kPayload[1] = {'a'};
EncodedImage encoded_image;
encoded_image.SetTimestamp(1);
encoded_image.SetRtpTimestamp(1);
encoded_image.capture_time_ms_ = 2;
encoded_image._frameType = VideoFrameType::kVideoFrameKey;
encoded_image._encodedWidth = 320;
@ -960,7 +952,7 @@ TEST(RtpVideoSenderTest, GenerateDependecyDescriptorForGenericCodecs) {
// Send in 2nd picture.
encoded_image._frameType = VideoFrameType::kVideoFrameDelta;
encoded_image.SetTimestamp(3000);
encoded_image.SetRtpTimestamp(3000);
EXPECT_EQ(test.router()->OnEncodedImage(encoded_image, &codec_specific).error,
EncodedImageCallback::Result::OK);
@ -988,7 +980,7 @@ TEST(RtpVideoSenderTest, SupportsStoppingUsingDependencyDescriptor) {
const uint8_t kPayload[1] = {'a'};
EncodedImage encoded_image;
encoded_image.SetTimestamp(1);
encoded_image.SetRtpTimestamp(1);
encoded_image.capture_time_ms_ = 2;
encoded_image.SetEncodedData(
EncodedImageBuffer::Create(kPayload, sizeof(kPayload)));
@ -1107,7 +1099,7 @@ TEST(RtpVideoSenderTest, ClearsPendingPacketsOnInactivation) {
const size_t kImageSizeBytes = 10000;
constexpr uint8_t kPayload[kImageSizeBytes] = {'a'};
EncodedImage encoded_image;
encoded_image.SetTimestamp(1);
encoded_image.SetRtpTimestamp(1);
encoded_image.capture_time_ms_ = 2;
encoded_image._frameType = VideoFrameType::kVideoFrameKey;
encoded_image.SetEncodedData(
@ -1146,7 +1138,7 @@ TEST(RtpVideoSenderTest, ClearsPendingPacketsOnInactivation) {
EXPECT_TRUE(sent_packets.empty());
// Send a new frame.
encoded_image.SetTimestamp(3);
encoded_image.SetRtpTimestamp(3);
encoded_image.capture_time_ms_ = 4;
EXPECT_EQ(test.router()
->OnEncodedImage(encoded_image, /*codec_specific=*/nullptr)
@ -1169,7 +1161,7 @@ TEST(RtpVideoSenderTest, RetransmitsBaseLayerOnly) {
test.router()->SetRetransmissionMode(kRetransmitBaseLayer);
constexpr uint8_t kPayload = 'a';
EncodedImage encoded_image;
encoded_image.SetTimestamp(1);
encoded_image.SetRtpTimestamp(1);
encoded_image.capture_time_ms_ = 2;
encoded_image._frameType = VideoFrameType::kVideoFrameKey;
encoded_image.SetEncodedData(EncodedImageBuffer::Create(&kPayload, 1));
@ -1195,7 +1187,7 @@ TEST(RtpVideoSenderTest, RetransmitsBaseLayerOnly) {
EXPECT_EQ(EncodedImageCallback::Result::OK,
test.router()->OnEncodedImage(
encoded_image, &key_codec_info).error);
encoded_image.SetTimestamp(2);
encoded_image.SetRtpTimestamp(2);
encoded_image.capture_time_ms_ = 3;
encoded_image._frameType = VideoFrameType::kVideoFrameDelta;
CodecSpecificInfo delta_codec_info;

View file

@ -13,7 +13,7 @@
namespace webrtc {
// The timestamp is always in UTC.
const char* const kSourceTimestamp = "WebRTC source stamp 2023-09-05T04:12:20";
const char* const kSourceTimestamp = "WebRTC source stamp 2023-10-30T04:03:42";
void LoadWebRTCVersionInRegister() {
// Using volatile to instruct the compiler to not optimize `p` away even

View file

@ -84,7 +84,7 @@ std::string VideoReceiveStreamInterface::Stats::ToString(
<< jitter_buffer_target_delay.seconds<double>() << ", ";
ss << "jitterBufferEmittedCount: " << jitter_buffer_emitted_count << ", ";
ss << "jitterBufferMinimumDelay: "
<< jitter_buffer_minimum_delay.seconds<double>();
<< jitter_buffer_minimum_delay.seconds<double>() << ", ";
ss << "totalDecodeTime: " << total_decode_time.seconds<double>() << ", ";
ss << "totalProcessingDelay: " << total_processing_delay.seconds<double>()
<< ", ";

View file

@ -72,9 +72,9 @@ void WebRtcSpl_CrossCorrelationNeon(int32_t* cross_correlation,
size_t dim_cross_correlation,
int right_shifts,
int step_seq2) {
size_t i = 0;
int i = 0;
for (i = 0; i < dim_cross_correlation; i++) {
for (i = 0; i < (int)dim_cross_correlation; i++) {
const int16_t* seq1_ptr = seq1;
const int16_t* seq2_ptr = seq2 + (step_seq2 * i);

View file

@ -8,9 +8,11 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include <arm_neon.h>
#include "common_audio/signal_processing/include/signal_processing_library.h"
#include <arm_neon.h>
#include "rtc_base/checks.h"
// NEON intrinsics version of WebRtcSpl_DownsampleFast()
// for ARM 32-bit/64-bit platforms.
@ -22,19 +24,24 @@ int WebRtcSpl_DownsampleFastNeon(const int16_t* data_in,
size_t coefficients_length,
int factor,
size_t delay) {
size_t i = 0;
size_t j = 0;
// Using signed indexes to be able to compute negative i-j that
// is used to index data_in.
int i = 0;
int j = 0;
int32_t out_s32 = 0;
size_t endpos = delay + factor * (data_out_length - 1) + 1;
int endpos = delay + factor * (data_out_length - 1) + 1;
size_t res = data_out_length & 0x7;
size_t endpos1 = endpos - factor * res;
int endpos1 = endpos - factor * res;
// Return error if any of the running conditions doesn't meet.
if (data_out_length == 0 || coefficients_length == 0
|| data_in_length < endpos) {
|| (int)data_in_length < endpos) {
return -1;
}
RTC_DCHECK_GE(endpos, 0);
RTC_DCHECK_GE(endpos1, 0);
// First part, unroll the loop 8 times, with 3 subcases
// (factor == 2, 4, others).
switch (factor) {
@ -46,7 +53,7 @@ int WebRtcSpl_DownsampleFastNeon(const int16_t* data_in,
#if defined(WEBRTC_ARCH_ARM64)
// Unroll the loop 2 times.
for (j = 0; j < coefficients_length - 1; j += 2) {
for (j = 0; j < (int)coefficients_length - 1; j += 2) {
int32x2_t coeff32 = vld1_dup_s32((int32_t*)&coefficients[j]);
int16x4_t coeff16x4 = vreinterpret_s16_s32(coeff32);
int16x8x2_t in16x8x2 = vld2q_s16(&data_in[i - j - 1]);
@ -68,7 +75,7 @@ int WebRtcSpl_DownsampleFastNeon(const int16_t* data_in,
out32x4_1 = vmlal_lane_s16(out32x4_1, in16x4_3, coeff16x4, 0);
}
for (; j < coefficients_length; j++) {
for (; j < (int)coefficients_length; j++) {
int16x4_t coeff16x4 = vld1_dup_s16(&coefficients[j]);
int16x8x2_t in16x8x2 = vld2q_s16(&data_in[i - j]);
@ -87,7 +94,7 @@ int WebRtcSpl_DownsampleFastNeon(const int16_t* data_in,
#else
// On ARMv7, the loop unrolling 2 times results in performance
// regression.
for (j = 0; j < coefficients_length; j++) {
for (j = 0; j < (int)coefficients_length; j++) {
int16x4_t coeff16x4 = vld1_dup_s16(&coefficients[j]);
int16x8x2_t in16x8x2 = vld2q_s16(&data_in[i - j]);
@ -114,7 +121,7 @@ int WebRtcSpl_DownsampleFastNeon(const int16_t* data_in,
int32x4_t out32x4_1 = vdupq_n_s32(2048);
// Unroll the loop 4 times.
for (j = 0; j < coefficients_length - 3; j += 4) {
for (j = 0; j < (int)coefficients_length - 3; j += 4) {
int16x4_t coeff16x4 = vld1_s16(&coefficients[j]);
int16x8x4_t in16x8x4 = vld4q_s16(&data_in[i - j - 3]);
@ -143,7 +150,7 @@ int WebRtcSpl_DownsampleFastNeon(const int16_t* data_in,
out32x4_1 = vmlal_lane_s16(out32x4_1, in16x4_7, coeff16x4, 0);
}
for (; j < coefficients_length; j++) {
for (; j < (int)coefficients_length; j++) {
int16x4_t coeff16x4 = vld1_dup_s16(&coefficients[j]);
int16x8x4_t in16x8x4 = vld4q_s16(&data_in[i - j]);
@ -174,7 +181,7 @@ int WebRtcSpl_DownsampleFastNeon(const int16_t* data_in,
int32x4_t out32x4_0 = vdupq_n_s32(2048);
int32x4_t out32x4_1 = vdupq_n_s32(2048);
for (j = 0; j < coefficients_length; j++) {
for (j = 0; j < (int)coefficients_length; j++) {
int16x4_t coeff16x4 = vld1_dup_s16(&coefficients[j]);
int16x4_t in16x4_0 = vld1_dup_s16(&data_in[i - j]);
in16x4_0 = vld1_lane_s16(&data_in[i + factor - j], in16x4_0, 1);
@ -204,7 +211,7 @@ int WebRtcSpl_DownsampleFastNeon(const int16_t* data_in,
for (; i < endpos; i += factor) {
out_s32 = 2048; // Round value, 0.5 in Q12.
for (j = 0; j < coefficients_length; j++) {
for (j = 0; j < (int)coefficients_length; j++) {
out_s32 = WebRtc_MulAccumW16(coefficients[j], data_in[i - j], out_s32);
}

View file

@ -138,8 +138,7 @@ H265BitstreamParser::Result H265BitstreamParser::ParseNonParameterSetNalu(
slice_reader.ConsumeBits(1);
}
// slice_type: ue(v)
uint32_t slice_type = 0;
slice_type = slice_reader.ReadExponentialGolomb();
uint32_t slice_type = slice_reader.ReadExponentialGolomb();
IN_RANGE_OR_RETURN(slice_type, 0, 2);
if (pps->output_flag_present_flag) {
// pic_output_flag: u(1)
@ -274,7 +273,7 @@ H265BitstreamParser::Result H265BitstreamParser::ParseNonParameterSetNalu(
}
uint32_t num_pic_total_curr = 0;
uint32_t curr_sps_idx;
uint32_t curr_sps_idx = 0;
if (short_term_ref_pic_set_sps_flag) {
curr_sps_idx = short_term_ref_pic_set_idx;
} else {

View file

@ -64,11 +64,11 @@ enum SliceType : uint8_t { kB = 0, kP = 1, kI = 2 };
struct NaluIndex {
// Start index of NALU, including start sequence.
size_t start_offset;
size_t start_offset = 0;
// Start index of NALU payload, typically type header.
size_t payload_start_offset;
size_t payload_start_offset = 0;
// Length of NALU payload, in bytes, counting from payload_start_offset.
size_t payload_size;
size_t payload_size = 0;
};
// Returns a vector of the NALU indices in the given buffer.

View file

@ -111,7 +111,7 @@ absl::optional<H265SpsParser::SpsState> H265SpsParser::ParseSps(
}
bool H265SpsParser::ParseScalingListData(BitstreamReader& reader) {
int32_t scaling_list_dc_coef_minus8[kMaxNumSizeIds][kMaxNumMatrixIds];
int32_t scaling_list_dc_coef_minus8[kMaxNumSizeIds][kMaxNumMatrixIds] = {};
for (int size_id = 0; size_id < kMaxNumSizeIds; size_id++) {
for (int matrix_id = 0; matrix_id < kMaxNumMatrixIds;
matrix_id += (size_id == 3) ? 3 : 1) {
@ -182,8 +182,8 @@ H265SpsParser::ParseShortTermRefPicSet(
short_term_ref_pic_set[ref_rps_idx].num_delta_pocs;
IN_RANGE_OR_RETURN_NULL(num_delta_pocs, 0, kMaxShortTermRefPicSets);
const ShortTermRefPicSet& ref_set = short_term_ref_pic_set[ref_rps_idx];
bool used_by_curr_pic_flag[kMaxShortTermRefPicSets];
bool use_delta_flag[kMaxShortTermRefPicSets];
bool used_by_curr_pic_flag[kMaxShortTermRefPicSets] = {};
bool use_delta_flag[kMaxShortTermRefPicSets] = {};
// 7.4.8 - use_delta_flag defaults to 1 if not present.
std::fill_n(use_delta_flag, kMaxShortTermRefPicSets, true);
@ -266,7 +266,7 @@ H265SpsParser::ParseShortTermRefPicSet(
for (uint32_t i = 0; i < st_ref_pic_set.num_negative_pics; i++) {
// delta_poc_s0_minus1: ue(v)
int delta_poc_s0_minus1;
int delta_poc_s0_minus1 = 0;
delta_poc_s0_minus1 = reader.ReadExponentialGolomb();
IN_RANGE_OR_RETURN_NULL(delta_poc_s0_minus1, 0, 0x7FFF);
if (i == 0) {
@ -281,7 +281,7 @@ H265SpsParser::ParseShortTermRefPicSet(
for (uint32_t i = 0; i < st_ref_pic_set.num_positive_pics; i++) {
// delta_poc_s1_minus1: ue(v)
int delta_poc_s1_minus1;
int delta_poc_s1_minus1 = 0;
delta_poc_s1_minus1 = reader.ReadExponentialGolomb();
IN_RANGE_OR_RETURN_NULL(delta_poc_s1_minus1, 0, 0x7FFF);
if (i == 0) {
@ -319,10 +319,8 @@ H265SpsParser::ParseProfileTierLevel(bool profile_present,
reader.ConsumeBits(1);
pf_tier_level.general_profile_idc = reader.ReadBits(5);
IN_RANGE_OR_RETURN_NULL(pf_tier_level.general_profile_idc, 0, 11);
uint16_t general_profile_compatibility_flag_high16;
uint16_t general_profile_compatibility_flag_low16;
general_profile_compatibility_flag_high16 = reader.ReadBits(16);
general_profile_compatibility_flag_low16 = reader.ReadBits(16);
uint16_t general_profile_compatibility_flag_high16 = reader.ReadBits(16);
uint16_t general_profile_compatibility_flag_low16 = reader.ReadBits(16);
pf_tier_level.general_profile_compatibility_flags =
(general_profile_compatibility_flag_high16 << 16) +
general_profile_compatibility_flag_low16;
@ -344,8 +342,8 @@ H265SpsParser::ParseProfileTierLevel(bool profile_present,
reader.ConsumeBits(1);
}
pf_tier_level.general_level_idc = reader.ReadBits(8);
bool sub_layer_profile_present_flag[8];
bool sub_layer_level_present_flag[8];
bool sub_layer_profile_present_flag[8] = {};
bool sub_layer_level_present_flag[8] = {};
for (int i = 0; i < max_num_sub_layers_minus1; ++i) {
sub_layer_profile_present_flag[i] = reader.ReadBits(1);
sub_layer_level_present_flag[i] = reader.ReadBits(1);
@ -443,7 +441,7 @@ absl::optional<H265SpsParser::SpsState> H265SpsParser::ParseSpsInternal(
// Equation A-2: Calculate max_dpb_size.
uint32_t max_luma_ps = GetMaxLumaPs(profile_tier_level->general_level_idc);
uint32_t max_dpb_size;
uint32_t max_dpb_size = 0;
uint32_t pic_size_in_samples_y = pic_height_in_luma_samples;
pic_size_in_samples_y *= pic_width_in_luma_samples;
size_t max_dpb_pic_buf =
@ -503,7 +501,7 @@ absl::optional<H265SpsParser::SpsState> H265SpsParser::ParseSpsInternal(
uint32_t sps_sub_layer_ordering_info_present_flag = 0;
// sps_sub_layer_ordering_info_present_flag: u(1)
sps_sub_layer_ordering_info_present_flag = reader.Read<bool>();
uint32_t sps_max_num_reorder_pics[kMaxSubLayers];
uint32_t sps_max_num_reorder_pics[kMaxSubLayers] = {};
for (uint32_t i = (sps_sub_layer_ordering_info_present_flag != 0)
? 0
: sps_max_sub_layers_minus1;
@ -552,8 +550,8 @@ absl::optional<H265SpsParser::SpsState> H265SpsParser::ParseSpsInternal(
// log2_min_luma_transform_block_size_minus2: ue(v)
int log2_min_luma_transform_block_size_minus2 =
reader.ReadExponentialGolomb();
TRUE_OR_RETURN(log2_min_luma_transform_block_size_minus2 <
min_cb_log2_size_y - 2);
IN_RANGE_OR_RETURN_NULL(log2_min_luma_transform_block_size_minus2, 0,
min_cb_log2_size_y - 3);
int min_tb_log2_size_y = log2_min_luma_transform_block_size_minus2 + 2;
// log2_diff_max_min_luma_transform_block_size: ue(v)
int log2_diff_max_min_luma_transform_block_size =

View file

@ -47,29 +47,29 @@ class H265SpsParser {
struct ProfileTierLevel {
ProfileTierLevel();
// Syntax elements.
int general_profile_idc;
int general_level_idc; // 30x the actual level.
uint32_t general_profile_compatibility_flags;
bool general_progressive_source_flag;
bool general_interlaced_source_flag;
bool general_non_packed_constraint_flag;
bool general_frame_only_constraint_flag;
bool general_one_picture_only_constraint_flag;
int general_profile_idc = 0;
int general_level_idc = 0; // 30x the actual level.
uint32_t general_profile_compatibility_flags = 0;
bool general_progressive_source_flag = false;
bool general_interlaced_source_flag = false;
bool general_non_packed_constraint_flag = false;
bool general_frame_only_constraint_flag = false;
bool general_one_picture_only_constraint_flag = false;
};
struct ShortTermRefPicSet {
ShortTermRefPicSet();
// Syntax elements.
uint32_t num_negative_pics;
uint32_t num_positive_pics;
uint32_t delta_poc_s0[kMaxShortTermRefPicSets];
uint32_t used_by_curr_pic_s0[kMaxShortTermRefPicSets];
uint32_t delta_poc_s1[kMaxShortTermRefPicSets];
uint32_t used_by_curr_pic_s1[kMaxShortTermRefPicSets];
uint32_t num_negative_pics = 0;
uint32_t num_positive_pics = 0;
uint32_t delta_poc_s0[kMaxShortTermRefPicSets] = {};
uint32_t used_by_curr_pic_s0[kMaxShortTermRefPicSets] = {};
uint32_t delta_poc_s1[kMaxShortTermRefPicSets] = {};
uint32_t used_by_curr_pic_s1[kMaxShortTermRefPicSets] = {};
// Calculated fields.
uint32_t num_delta_pocs;
uint32_t num_delta_pocs = 0;
};
// The parsed state of the SPS. Only some select values are stored.

View file

@ -22,6 +22,10 @@ rtp stream (SVC), or independent spatial layers sent on multiple rtp streams
## RTP header extension format
Note: when including the optional width, height and maximum framerate
fields, the total data length of the extension can exceed 16 bytes
and is sent as a two-byte header extension [1]
### Data layout
```
@ -68,7 +72,7 @@ alignment.
layers. Values are stored in ascending order of spatial id. Zero-padded to byte
alignment.
Target bitrate in kbps. Values are stored using leb128 encoding [1]. One value per
Target bitrate in kbps. Values are stored using leb128 encoding [2]. One value per
temporal layer. Values are stored in (RTP stream id, spatial id, temporal id)
ascending order. All bitrates are total required bitrate to receive the
corresponding layer, i.e. in simulcast mode they include only corresponding
@ -78,9 +82,11 @@ temporal layers are also included.
Resolution and framerate. Optional. Presence is inferred from the rtp header
extension size. Encoded (width - 1), 16-bit, (height - 1), 16-bit, max frame
rate 8-bit per spatial layer per RTP stream. Values are stored in (RTP stream
id, spatial id) ascending order.
id, spatial id) ascending order. Only sent when the resolution differs from the
last values, the framerate changed by more than 5fps and on key frames.
An empty layer allocation (i.e nothing sent on ssrc) is encoded as
special case with a single 0 byte.
[1] https://aomediacodec.github.io/av1-spec/#leb128
[1] https://www.rfc-editor.org/rfc/rfc8285#section-4.3
[2] https://aomediacodec.github.io/av1-spec/#leb128

View file

@ -11,6 +11,7 @@ import("../webrtc.gni")
if (is_android) {
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
import("//third_party/jni_zero/jni_zero.gni")
} else if (is_mac) {
import("//build/config/mac/rules.gni")
} else if (is_ios) {
@ -685,6 +686,7 @@ if (is_linux || is_chromeos || is_win) {
]
deps = [
"../api:async_dns_resolver",
"../api:audio_options_api",
"../api:create_peerconnection_factory",
"../api:libjingle_peerconnection_api",
@ -702,6 +704,7 @@ if (is_linux || is_chromeos || is_win) {
"../media:rtc_media_base",
"../p2p:rtc_p2p",
"../pc:video_track_source",
"../rtc_base:async_dns_resolver",
"../rtc_base:checks",
"../rtc_base:logging",
"../rtc_base:macromagic",

View file

@ -1,6 +1,7 @@
import("//webrtc.gni")
if (is_android) {
import("//third_party/jni_zero/jni_zero.gni")
rtc_android_apk("androidnativeapi") {
testonly = true
apk_name = "androidnativeapi"

View file

@ -9,6 +9,7 @@
import("//webrtc.gni")
if (is_android) {
import("//third_party/jni_zero/jni_zero.gni")
rtc_android_apk("androidvoip") {
testonly = true
apk_name = "androidvoip"

View file

@ -427,10 +427,9 @@ void AndroidVoipClient::SendRtpPacket(const std::vector<uint8_t>& packet_copy) {
}
}
bool AndroidVoipClient::SendRtp(const uint8_t* packet,
size_t length,
bool AndroidVoipClient::SendRtp(rtc::ArrayView<const uint8_t> packet,
const webrtc::PacketOptions& options) {
std::vector<uint8_t> packet_copy(packet, packet + length);
std::vector<uint8_t> packet_copy(packet.begin(), packet.end());
voip_thread_->PostTask([this, packet_copy = std::move(packet_copy)] {
SendRtpPacket(packet_copy);
});
@ -447,8 +446,8 @@ void AndroidVoipClient::SendRtcpPacket(
}
}
bool AndroidVoipClient::SendRtcp(const uint8_t* packet, size_t length) {
std::vector<uint8_t> packet_copy(packet, packet + length);
bool AndroidVoipClient::SendRtcp(rtc::ArrayView<const uint8_t> packet) {
std::vector<uint8_t> packet_copy(packet.begin(), packet.end());
voip_thread_->PostTask([this, packet_copy = std::move(packet_copy)] {
SendRtcpPacket(packet_copy);
});

View file

@ -118,10 +118,9 @@ class AndroidVoipClient : public webrtc::Transport,
void Delete(JNIEnv* env);
// Implementation for Transport.
bool SendRtp(const uint8_t* packet,
size_t length,
bool SendRtp(rtc::ArrayView<const uint8_t> packet,
const webrtc::PacketOptions& options) override;
bool SendRtcp(const uint8_t* packet, size_t length) override;
bool SendRtcp(rtc::ArrayView<const uint8_t> packet) override;
// Slots for sockets to connect to.
void OnSignalReadRTPPacket(rtc::AsyncPacketSocket* socket,

View file

@ -12,6 +12,7 @@
#include "api/units/time_delta.h"
#include "examples/peerconnection/client/defaults.h"
#include "rtc_base/async_dns_resolver.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include "rtc_base/net_helpers.h"
@ -32,7 +33,7 @@ rtc::Socket* CreateClientSocket(int family) {
} // namespace
PeerConnectionClient::PeerConnectionClient()
: callback_(NULL), resolver_(NULL), state_(NOT_CONNECTED), my_id_(-1) {}
: callback_(NULL), resolver_(nullptr), state_(NOT_CONNECTED), my_id_(-1) {}
PeerConnectionClient::~PeerConnectionClient() = default;
@ -95,26 +96,32 @@ void PeerConnectionClient::Connect(const std::string& server,
client_name_ = client_name;
if (server_address_.IsUnresolvedIP()) {
RTC_DCHECK_NE(state_, RESOLVING);
RTC_DCHECK(!resolver_);
state_ = RESOLVING;
resolver_ = new rtc::AsyncResolver();
resolver_->SignalDone.connect(this, &PeerConnectionClient::OnResolveResult);
resolver_->Start(server_address_);
resolver_ = std::make_unique<webrtc::AsyncDnsResolver>();
resolver_->Start(server_address_,
[this] { OnResolveResult(resolver_->result()); });
} else {
DoConnect();
}
}
void PeerConnectionClient::OnResolveResult(
rtc::AsyncResolverInterface* resolver) {
if (resolver_->GetError() != 0) {
const webrtc::AsyncDnsResolverResult& result) {
if (result.GetError() != 0) {
callback_->OnServerConnectionFailure();
resolver_->Destroy(false);
resolver_ = NULL;
resolver_.reset();
state_ = NOT_CONNECTED;
} else {
server_address_ = resolver_->address();
DoConnect();
return;
}
if (!result.GetResolvedAddress(AF_INET, &server_address_)) {
callback_->OnServerConnectionFailure();
resolver_.reset();
state_ = NOT_CONNECTED;
return;
}
DoConnect();
}
void PeerConnectionClient::DoConnect() {
@ -196,10 +203,7 @@ void PeerConnectionClient::Close() {
hanging_get_->Close();
onconnect_data_.clear();
peers_.clear();
if (resolver_ != NULL) {
resolver_->Destroy(false);
resolver_ = NULL;
}
resolver_.reset();
my_id_ = -1;
state_ = NOT_CONNECTED;
}

View file

@ -15,6 +15,7 @@
#include <memory>
#include <string>
#include "api/async_dns_resolver.h"
#include "api/task_queue/pending_task_safety_flag.h"
#include "rtc_base/net_helpers.h"
#include "rtc_base/physical_socket_server.h"
@ -109,11 +110,11 @@ class PeerConnectionClient : public sigslot::has_slots<> {
void OnClose(rtc::Socket* socket, int err);
void OnResolveResult(rtc::AsyncResolverInterface* resolver);
void OnResolveResult(const webrtc::AsyncDnsResolverResult& result);
PeerConnectionClientObserver* callback_;
rtc::SocketAddress server_address_;
rtc::AsyncResolver* resolver_;
std::unique_ptr<webrtc::AsyncDnsResolverInterface> resolver_;
std::unique_ptr<rtc::Socket> control_socket_;
std::unique_ptr<rtc::Socket> hanging_get_;
std::string onconnect_data_;

2
experiments/OWNERS Normal file
View file

@ -0,0 +1,2 @@
# Allow anyone to update the field trial experiment list.
per-file field_trials.py=*

File diff suppressed because it is too large Load diff

View file

@ -29,6 +29,7 @@ will generate a shared library.
* `absl::bind_front`
* `absl::Cleanup`
* `absl::InlinedVector`
* `absl::Nonnull` and `absl::Nullable`
* `absl::WrapUnique`
* `absl::optional` and related stuff from `absl/types/optional.h`.
* `absl::string_view`

View file

@ -39,7 +39,32 @@ The policy for field trials is:
- The field trial must have an end date. The end date may be pushed back if
necessary, but should not be pushed back indefinitely.
- A field trial must be associated with a bug that
- reserves the field trial key,
- is open,
- is assigned to an owner, and
- has the end date specified.
- reserves the field trial key, and
- is assigned to an owner.
## Creating a field trial
Before creating a new field trial, make sure to read the [policy](#policy).
Either create a new or reuse an existing bug and make sure it is assigned to the
correct owner. Take note of the bug ID. Next, decide how long you need the field
trial to last. It should be rare to have field trials lasting more than 12
months. You can use the `NextAction` field in the bug to help you remember the
end date.
Using this information, add a new entry to `ACTIVE_FIELD_TRIALS` in
`experiments/field_trials.py`. You may not add new items to
`POLICY_EXEMPT_FIELD_TRIALS` since it is reserved for field trials that were
created before the policy was in place.
## Removing a field trial
Any field trial that has expired or otherwise is not needed anymore may be
removed by following these steps:
- Remove all references from the code base. You can find these by, e.g.
grepping for the field trial key.
- Clean up potential glue code that might have been added.
- Remove the field trial from `ACTIVE_FIELD_TRIALS` in
`experiments/field_trials.py`.
- If all work is finished, also close the associated bug.

View file

@ -127,6 +127,19 @@ For example,
See the [source code for `rtc::ArrayView`](api/array_view.h) for more detailed
docs.
### Strings
WebRTC uses std::string, with content assumed to be UTF-8. Note that this
has to be verified whenever accepting external input.
For concatenation of strings, use rtc::SimpleStringBuilder.
The following string building tools are NOT recommended:
* The + operator. See https://abseil.io/tips/3 for why not.
* absl::StrCat, absl::StrAppend, absl::StrJoin. These are optimized for
speed, not code size, and have significant code size overhead.
* strcat. It is too easy to create buffer overflows.
### sigslot
SIGSLOT IS DEPRECATED.

View file

@ -2,7 +2,7 @@
# Do not modify manually.
#
# For the schema of this file, see Config message:
# https://luci-config.appspot.com/schemas/projects:commit-queue.cfg
# https://config.luci.app/schemas/projects:commit-queue.cfg
cq_status_host: "chromium-cq-status.appspot.com"
submit_options {

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