tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit d102a59505da22c1a9798fb455bee935cd4a1275
parent a272cc062662fa08aba1f3195c067798cb538d9e
Author: Dan Baker <dbaker@mozilla.com>
Date:   Mon, 27 Oct 2025 12:58:21 -0600

Bug 1995393 - Vendor libwebrtc from cb9c945c06

Upstream commit: https://webrtc.googlesource.com/src/+/cb9c945c0656e44cfd2baa55e8b87f2e885da379
    clang-tidy: apply modernize-use-designated-initializer to common_video media modules/video_coding video/

    split from
      https://webrtc-review.googlesource.com/c/src/+/404061
    see there for full history and manual changes

    Bug: webrtc:424706384
    Change-Id: I40409779e40eb3a744d754f6b691c39301d3ac81
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/405063
    Reviewed-by: Harald Alvestrand <hta@webrtc.org>
    Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
    Commit-Queue: Philipp Hancke <phancke@meta.com>
    Cr-Commit-Position: refs/heads/main@{#45441}

Diffstat:
Mthird_party/libwebrtc/README.mozilla.last-vendor | 4++--
Mthird_party/libwebrtc/common_video/h264/h264_common.cc | 4+++-
Mthird_party/libwebrtc/common_video/h264/sps_vui_rewriter_unittest.cc | 137+++++++++++++++++++++++++++----------------------------------------------------
Mthird_party/libwebrtc/common_video/video_frame_unittest.cc | 84+++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------
Mthird_party/libwebrtc/media/base/adapted_video_track_source.cc | 2+-
Mthird_party/libwebrtc/media/base/video_adapter.cc | 10+++++-----
Mthird_party/libwebrtc/media/base/video_broadcaster_unittest.cc | 16+++++++---------
Mthird_party/libwebrtc/media/base/video_common.cc | 29+++++++++++++++--------------
Mthird_party/libwebrtc/media/engine/internal_decoder_factory.cc | 2+-
Mthird_party/libwebrtc/media/engine/internal_decoder_factory_unittest.cc | 6++++--
Mthird_party/libwebrtc/media/engine/internal_encoder_factory_unittest.cc | 6++++--
Mthird_party/libwebrtc/media/engine/simulcast_encoder_adapter.cc | 6++++--
Mthird_party/libwebrtc/media/engine/simulcast_encoder_adapter_unittest.cc | 4++--
Mthird_party/libwebrtc/media/engine/webrtc_voice_engine.cc | 3++-
Mthird_party/libwebrtc/media/engine/webrtc_voice_engine_unittest.cc | 33+++++++++++++++++----------------
Mthird_party/libwebrtc/modules/video_coding/codecs/av1/libaom_av1_unittest.cc | 3++-
Mthird_party/libwebrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc | 2+-
Mthird_party/libwebrtc/modules/video_coding/generic_decoder.cc | 3++-
Mthird_party/libwebrtc/modules/video_coding/h264_sps_pps_tracker.cc | 14+++++++-------
Mthird_party/libwebrtc/modules/video_coding/svc/create_scalability_structure.cc | 399++++++++++++++++++++++++++++++++++++++++++++++---------------------------------
Mthird_party/libwebrtc/modules/video_coding/utility/simulcast_test_fixture_impl.cc | 5+++--
Mthird_party/libwebrtc/modules/video_coding/video_codec_initializer.cc | 7++++---
Mthird_party/libwebrtc/moz-patch-stack/s0028.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0037.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0042.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0057.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0068.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0093.patch | 4++--
Mthird_party/libwebrtc/moz-patch-stack/s0110.patch | 2+-
Mthird_party/libwebrtc/video/config/encoder_stream_factory_unittest.cc | 20++++++++++----------
Mthird_party/libwebrtc/video/config/simulcast.cc | 127+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------
Mthird_party/libwebrtc/video/end_to_end_tests/multi_stream_tester.cc | 6+++---
Mthird_party/libwebrtc/video/end_to_end_tests/resolution_bitrate_limits_tests.cc | 280+++++++++++++++++++++++++++++++++++++++++--------------------------------------
Mthird_party/libwebrtc/video/frame_cadence_adapter_unittest.cc | 67+++++++++++++++++++++++++++++++++++++++++++------------------------
Mthird_party/libwebrtc/video/frame_encode_metadata_writer.cc | 3++-
Mthird_party/libwebrtc/video/frame_encode_metadata_writer_unittest.cc | 5+++--
Mthird_party/libwebrtc/video/full_stack_tests.cc | 1470++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------
Mthird_party/libwebrtc/video/rtp_video_stream_receiver2_unittest.cc | 12++++++------
Mthird_party/libwebrtc/video/send_statistics_proxy.cc | 7++++---
Mthird_party/libwebrtc/video/video_analyzer.cc | 3++-
Mthird_party/libwebrtc/video/video_receive_stream2.cc | 8++++----
Mthird_party/libwebrtc/video/video_receive_stream_timeout_tracker_unittest.cc | 3++-
Mthird_party/libwebrtc/video/video_send_stream_impl.cc | 20+++++++++++---------
Mthird_party/libwebrtc/video/video_send_stream_tests.cc | 14+++++++++++---
Mthird_party/libwebrtc/video/video_stream_encoder.cc | 27++++++++++++++++++++-------
Mthird_party/libwebrtc/video/video_stream_encoder_unittest.cc | 10++++++----
46 files changed, 1874 insertions(+), 1003 deletions(-)

diff --git a/third_party/libwebrtc/README.mozilla.last-vendor b/third_party/libwebrtc/README.mozilla.last-vendor @@ -1,4 +1,4 @@ # ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc -libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-27T18:55:44.349728+00:00. +libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-27T18:58:04.884837+00:00. # base of lastest vendoring -3950d10647 +cb9c945c06 diff --git a/third_party/libwebrtc/common_video/h264/h264_common.cc b/third_party/libwebrtc/common_video/h264/h264_common.cc @@ -40,7 +40,9 @@ std::vector<NaluIndex> FindNaluIndices(ArrayView<const uint8_t> buffer) { } else if (buffer[i + 2] == 1) { if (buffer[i + 1] == 0 && buffer[i] == 0) { // We found a start sequence, now check if it was a 3 of 4 byte one. - NaluIndex index = {i, i + 3, 0}; + NaluIndex index = {.start_offset = i, + .payload_start_offset = i + 3, + .payload_size = 0}; if (index.start_offset > 0 && buffer[index.start_offset - 1] == 0) --index.start_offset; diff --git a/third_party/libwebrtc/common_video/h264/sps_vui_rewriter_unittest.cc b/third_party/libwebrtc/common_video/h264/sps_vui_rewriter_unittest.cc @@ -46,113 +46,68 @@ constexpr uint8_t kIdr1[] = {H264::NaluType::kIdr, 0xFF, 0x00, 0x00, 0x04}; constexpr uint8_t kIdr2[] = {H264::NaluType::kIdr, 0xFF, 0x00, 0x11}; struct VuiHeader { - uint32_t vui_parameters_present_flag; - uint32_t bitstream_restriction_flag; - uint32_t max_num_reorder_frames; - uint32_t max_dec_frame_buffering; - uint32_t video_signal_type_present_flag; - uint32_t video_full_range_flag; - uint32_t colour_description_present_flag; - uint8_t colour_primaries; - uint8_t transfer_characteristics; - uint8_t matrix_coefficients; + uint32_t vui_parameters_present_flag = 0; + uint32_t bitstream_restriction_flag = 0; + uint32_t max_num_reorder_frames = 0; + uint32_t max_dec_frame_buffering = 0; + uint32_t video_signal_type_present_flag = 0; + uint32_t video_full_range_flag = 0; + uint32_t colour_description_present_flag = 0; + uint8_t colour_primaries = 0; + uint8_t transfer_characteristics = 0; + uint8_t matrix_coefficients = 0; }; -const VuiHeader kVuiNotPresent = { - /* vui_parameters_present_flag= */ 0, - /* bitstream_restriction_flag= */ 0, - /* max_num_reorder_frames= */ 0, - /* max_dec_frame_buffering= */ 0, - /* video_signal_type_present_flag= */ 0, - /* video_full_range_flag= */ 0, - /* colour_description_present_flag= */ 0, - /* colour_primaries= */ 0, - /* transfer_characteristics= */ 0, - /* matrix_coefficients= */ 0}; +const VuiHeader kVuiNotPresent; const VuiHeader kVuiNoBitstreamRestriction = { - /* vui_parameters_present_flag= */ 1, - /* bitstream_restriction_flag= */ 0, - /* max_num_reorder_frames= */ 0, - /* max_dec_frame_buffering= */ 0, - /* video_signal_type_present_flag= */ 0, - /* video_full_range_flag= */ 0, - /* colour_description_present_flag= */ 0, - /* colour_primaries= */ 0, - /* transfer_characteristics= */ 0, - /* matrix_coefficients= */ 0}; + .vui_parameters_present_flag = 1, +}; const VuiHeader kVuiNoFrameBuffering = { - /* vui_parameters_present_flag= */ 1, - /* bitstream_restriction_flag= */ 1, - /* max_num_reorder_frames= */ 0, - /* max_dec_frame_buffering= */ 1, - /* video_signal_type_present_flag= */ 0, - /* video_full_range_flag= */ 0, - /* colour_description_present_flag= */ 0, - /* colour_primaries= */ 0, - /* transfer_characteristics= */ 0, - /* matrix_coefficients= */ 0}; + .vui_parameters_present_flag = 1, + .bitstream_restriction_flag = 1, + .max_dec_frame_buffering = 1, +}; const VuiHeader kVuiFrameBuffering = { - /* vui_parameters_present_flag= */ 1, - /* bitstream_restriction_flag= */ 1, - /* max_num_reorder_frames= */ 3, - /* max_dec_frame_buffering= */ 3, - /* video_signal_type_present_flag= */ 0, - /* video_full_range_flag= */ 0, - /* colour_description_present_flag= */ 0, - /* colour_primaries= */ 0, - /* transfer_characteristics= */ 0, - /* matrix_coefficients= */ 0}; + .vui_parameters_present_flag = 1, + .bitstream_restriction_flag = 1, + .max_num_reorder_frames = 3, + .max_dec_frame_buffering = 3, +}; const VuiHeader kVuiNoVideoSignalType = { - /* vui_parameters_present_flag= */ 1, - /* bitstream_restriction_flag= */ 1, - /* max_num_reorder_frames= */ 0, - /* max_dec_frame_buffering= */ 1, - /* video_signal_type_present_flag= */ 0, - /* video_full_range_flag= */ 0, - /* colour_description_present_flag= */ 0, - /* colour_primaries= */ 0, - /* transfer_characteristics= */ 0, - /* matrix_coefficients= */ 0}; + .vui_parameters_present_flag = 1, + .bitstream_restriction_flag = 1, + .max_dec_frame_buffering = 1, +}; const VuiHeader kVuiLimitedRangeNoColourDescription = { - /* vui_parameters_present_flag= */ 1, - /* bitstream_restriction_flag= */ 1, - /* max_num_reorder_frames= */ 0, - /* max_dec_frame_buffering= */ 1, - /* video_signal_type_present_flag= */ 1, - /* video_full_range_flag= */ 0, - /* colour_description_present_flag= */ 0, - /* colour_primaries= */ 0, - /* transfer_characteristics= */ 0, - /* matrix_coefficients= */ 0}; + .vui_parameters_present_flag = 1, + .bitstream_restriction_flag = 1, + .max_dec_frame_buffering = 1, + .video_signal_type_present_flag = 1, +}; const VuiHeader kVuiFullRangeNoColourDescription = { - /* vui_parameters_present_flag= */ 1, - /* bitstream_restriction_flag= */ 1, - /* max_num_reorder_frames= */ 0, - /* max_dec_frame_buffering= */ 1, - /* video_signal_type_present_flag= */ 1, - /* video_full_range_flag= */ 1, - /* colour_description_present_flag= */ 0, - /* colour_primaries= */ 0, - /* transfer_characteristics= */ 0, - /* matrix_coefficients= */ 0}; + .vui_parameters_present_flag = 1, + .bitstream_restriction_flag = 1, + .max_dec_frame_buffering = 1, + .video_signal_type_present_flag = 1, + .video_full_range_flag = 1, +}; const VuiHeader kVuiLimitedRangeBt709Color = { - /* vui_parameters_present_flag= */ 1, - /* bitstream_restriction_flag= */ 1, - /* max_num_reorder_frames= */ 0, - /* max_dec_frame_buffering= */ 1, - /* video_signal_type_present_flag= */ 1, - /* video_full_range_flag= */ 0, - /* colour_description_present_flag= */ 1, - /* colour_primaries= */ 1, - /* transfer_characteristics= */ 1, - /* matrix_coefficients= */ 1}; + .vui_parameters_present_flag = 1, + .bitstream_restriction_flag = 1, + .max_dec_frame_buffering = 1, + .video_signal_type_present_flag = 1, + .colour_description_present_flag = 1, + .colour_primaries = 1, + .transfer_characteristics = 1, + .matrix_coefficients = 1, +}; const ColorSpace kColorSpaceH264Default(ColorSpace::PrimaryID::kUnspecified, ColorSpace::TransferID::kUnspecified, diff --git a/third_party/libwebrtc/common_video/video_frame_unittest.cc b/third_party/libwebrtc/common_video/video_frame_unittest.cc @@ -474,20 +474,28 @@ TEST(TestNV12Buffer, CropAndScale) { } TEST(TestUpdateRect, CanCompare) { - VideoFrame::UpdateRect a = {0, 0, 100, 200}; - VideoFrame::UpdateRect b = {0, 0, 100, 200}; - VideoFrame::UpdateRect c = {1, 0, 100, 200}; - VideoFrame::UpdateRect d = {0, 1, 100, 200}; + VideoFrame::UpdateRect a = { + .offset_x = 0, .offset_y = 0, .width = 100, .height = 200}; + VideoFrame::UpdateRect b = { + .offset_x = 0, .offset_y = 0, .width = 100, .height = 200}; + VideoFrame::UpdateRect c = { + .offset_x = 1, .offset_y = 0, .width = 100, .height = 200}; + VideoFrame::UpdateRect d = { + .offset_x = 0, .offset_y = 1, .width = 100, .height = 200}; EXPECT_TRUE(a == b); EXPECT_FALSE(a == c); EXPECT_FALSE(a == d); } TEST(TestUpdateRect, ComputesIsEmpty) { - VideoFrame::UpdateRect a = {0, 0, 0, 0}; - VideoFrame::UpdateRect b = {0, 0, 100, 200}; - VideoFrame::UpdateRect c = {1, 100, 0, 0}; - VideoFrame::UpdateRect d = {1, 100, 100, 200}; + VideoFrame::UpdateRect a = { + .offset_x = 0, .offset_y = 0, .width = 0, .height = 0}; + VideoFrame::UpdateRect b = { + .offset_x = 0, .offset_y = 0, .width = 100, .height = 200}; + VideoFrame::UpdateRect c = { + .offset_x = 1, .offset_y = 100, .width = 0, .height = 0}; + VideoFrame::UpdateRect d = { + .offset_x = 1, .offset_y = 100, .width = 100, .height = 200}; EXPECT_TRUE(a.IsEmpty()); EXPECT_FALSE(b.IsEmpty()); EXPECT_TRUE(c.IsEmpty()); @@ -495,43 +503,55 @@ TEST(TestUpdateRect, ComputesIsEmpty) { } TEST(TestUpdateRectUnion, NonIntersecting) { - VideoFrame::UpdateRect a = {0, 0, 10, 20}; - VideoFrame::UpdateRect b = {100, 200, 10, 20}; + VideoFrame::UpdateRect a = { + .offset_x = 0, .offset_y = 0, .width = 10, .height = 20}; + VideoFrame::UpdateRect b = { + .offset_x = 100, .offset_y = 200, .width = 10, .height = 20}; a.Union(b); EXPECT_EQ(a, VideoFrame::UpdateRect({0, 0, 110, 220})); } TEST(TestUpdateRectUnion, Intersecting) { - VideoFrame::UpdateRect a = {0, 0, 10, 10}; - VideoFrame::UpdateRect b = {5, 5, 30, 20}; + VideoFrame::UpdateRect a = { + .offset_x = 0, .offset_y = 0, .width = 10, .height = 10}; + VideoFrame::UpdateRect b = { + .offset_x = 5, .offset_y = 5, .width = 30, .height = 20}; a.Union(b); EXPECT_EQ(a, VideoFrame::UpdateRect({0, 0, 35, 25})); } TEST(TestUpdateRectUnion, OneInsideAnother) { - VideoFrame::UpdateRect a = {0, 0, 100, 100}; - VideoFrame::UpdateRect b = {5, 5, 30, 20}; + VideoFrame::UpdateRect a = { + .offset_x = 0, .offset_y = 0, .width = 100, .height = 100}; + VideoFrame::UpdateRect b = { + .offset_x = 5, .offset_y = 5, .width = 30, .height = 20}; a.Union(b); EXPECT_EQ(a, VideoFrame::UpdateRect({0, 0, 100, 100})); } TEST(TestUpdateRectIntersect, NonIntersecting) { - VideoFrame::UpdateRect a = {0, 0, 10, 20}; - VideoFrame::UpdateRect b = {100, 200, 10, 20}; + VideoFrame::UpdateRect a = { + .offset_x = 0, .offset_y = 0, .width = 10, .height = 20}; + VideoFrame::UpdateRect b = { + .offset_x = 100, .offset_y = 200, .width = 10, .height = 20}; a.Intersect(b); EXPECT_EQ(a, VideoFrame::UpdateRect({0, 0, 0, 0})); } TEST(TestUpdateRectIntersect, Intersecting) { - VideoFrame::UpdateRect a = {0, 0, 10, 10}; - VideoFrame::UpdateRect b = {5, 5, 30, 20}; + VideoFrame::UpdateRect a = { + .offset_x = 0, .offset_y = 0, .width = 10, .height = 10}; + VideoFrame::UpdateRect b = { + .offset_x = 5, .offset_y = 5, .width = 30, .height = 20}; a.Intersect(b); EXPECT_EQ(a, VideoFrame::UpdateRect({5, 5, 5, 5})); } TEST(TestUpdateRectIntersect, OneInsideAnother) { - VideoFrame::UpdateRect a = {0, 0, 100, 100}; - VideoFrame::UpdateRect b = {5, 5, 30, 20}; + VideoFrame::UpdateRect a = { + .offset_x = 0, .offset_y = 0, .width = 100, .height = 100}; + VideoFrame::UpdateRect b = { + .offset_x = 5, .offset_y = 5, .width = 30, .height = 20}; a.Intersect(b); EXPECT_EQ(a, VideoFrame::UpdateRect({5, 5, 30, 20})); } @@ -539,7 +559,8 @@ TEST(TestUpdateRectIntersect, OneInsideAnother) { TEST(TestUpdateRectScale, NoScale) { const int width = 640; const int height = 480; - VideoFrame::UpdateRect a = {100, 50, 100, 200}; + VideoFrame::UpdateRect a = { + .offset_x = 100, .offset_y = 50, .width = 100, .height = 200}; VideoFrame::UpdateRect scaled = a.ScaleWithFrame(width, height, 0, 0, width, height, width, height); EXPECT_EQ(scaled, VideoFrame::UpdateRect({100, 50, 100, 200})); @@ -548,7 +569,8 @@ TEST(TestUpdateRectScale, NoScale) { TEST(TestUpdateRectScale, CropOnly) { const int width = 640; const int height = 480; - VideoFrame::UpdateRect a = {100, 50, 100, 200}; + VideoFrame::UpdateRect a = { + .offset_x = 100, .offset_y = 50, .width = 100, .height = 200}; VideoFrame::UpdateRect scaled = a.ScaleWithFrame( width, height, 10, 10, width - 20, height - 20, width - 20, height - 20); EXPECT_EQ(scaled, VideoFrame::UpdateRect({90, 40, 100, 200})); @@ -557,7 +579,8 @@ TEST(TestUpdateRectScale, CropOnly) { TEST(TestUpdateRectScale, CropOnlyToOddOffset) { const int width = 640; const int height = 480; - VideoFrame::UpdateRect a = {100, 50, 100, 200}; + VideoFrame::UpdateRect a = { + .offset_x = 100, .offset_y = 50, .width = 100, .height = 200}; VideoFrame::UpdateRect scaled = a.ScaleWithFrame( width, height, 5, 5, width - 10, height - 10, width - 10, height - 10); EXPECT_EQ(scaled, VideoFrame::UpdateRect({94, 44, 102, 202})); @@ -566,7 +589,8 @@ TEST(TestUpdateRectScale, CropOnlyToOddOffset) { TEST(TestUpdateRectScale, ScaleByHalf) { const int width = 640; const int height = 480; - VideoFrame::UpdateRect a = {100, 60, 100, 200}; + VideoFrame::UpdateRect a = { + .offset_x = 100, .offset_y = 60, .width = 100, .height = 200}; VideoFrame::UpdateRect scaled = a.ScaleWithFrame( width, height, 0, 0, width, height, width / 2, height / 2); // Scaled by half and +2 pixels in all directions. @@ -576,7 +600,8 @@ TEST(TestUpdateRectScale, ScaleByHalf) { TEST(TestUpdateRectScale, CropToUnchangedRegionBelowUpdateRect) { const int width = 640; const int height = 480; - VideoFrame::UpdateRect a = {100, 60, 100, 200}; + VideoFrame::UpdateRect a = { + .offset_x = 100, .offset_y = 60, .width = 100, .height = 200}; VideoFrame::UpdateRect scaled = a.ScaleWithFrame( width, height, (width - 10) / 2, (height - 10) / 2, 10, 10, 10, 10); // Update is out of the cropped frame. @@ -586,7 +611,8 @@ TEST(TestUpdateRectScale, CropToUnchangedRegionBelowUpdateRect) { TEST(TestUpdateRectScale, CropToUnchangedRegionAboveUpdateRect) { const int width = 640; const int height = 480; - VideoFrame::UpdateRect a = {600, 400, 10, 10}; + VideoFrame::UpdateRect a = { + .offset_x = 600, .offset_y = 400, .width = 10, .height = 10}; VideoFrame::UpdateRect scaled = a.ScaleWithFrame( width, height, (width - 10) / 2, (height - 10) / 2, 10, 10, 10, 10); // Update is out of the cropped frame. @@ -596,7 +622,8 @@ TEST(TestUpdateRectScale, CropToUnchangedRegionAboveUpdateRect) { TEST(TestUpdateRectScale, CropInsideUpdate) { const int width = 640; const int height = 480; - VideoFrame::UpdateRect a = {300, 200, 100, 100}; + VideoFrame::UpdateRect a = { + .offset_x = 300, .offset_y = 200, .width = 100, .height = 100}; VideoFrame::UpdateRect scaled = a.ScaleWithFrame( width, height, (width - 10) / 2, (height - 10) / 2, 10, 10, 10, 10); // Cropped frame is inside the update rect. @@ -606,7 +633,8 @@ TEST(TestUpdateRectScale, CropInsideUpdate) { TEST(TestUpdateRectScale, CropAndScaleByHalf) { const int width = 640; const int height = 480; - VideoFrame::UpdateRect a = {100, 60, 100, 200}; + VideoFrame::UpdateRect a = { + .offset_x = 100, .offset_y = 60, .width = 100, .height = 200}; VideoFrame::UpdateRect scaled = a.ScaleWithFrame(width, height, 10, 10, width - 20, height - 20, (width - 20) / 2, (height - 20) / 2); diff --git a/third_party/libwebrtc/media/base/adapted_video_track_source.cc b/third_party/libwebrtc/media/base/adapted_video_track_source.cc @@ -101,7 +101,7 @@ bool AdaptedVideoTrackSource::AdaptFrame(int width, int* crop_y) { { MutexLock lock(&stats_mutex_); - stats_ = Stats{width, height}; + stats_ = Stats{.input_width = width, .input_height = height}; } if (!broadcaster_.frame_wanted()) { diff --git a/third_party/libwebrtc/media/base/video_adapter.cc b/third_party/libwebrtc/media/base/video_adapter.cc @@ -73,19 +73,19 @@ Fraction FindScale(int input_width, // Don't scale up original. if (target_pixels >= input_pixels) - return Fraction{1, 1}; + return {.numerator = 1, .denominator = 1}; - Fraction current_scale = Fraction{1, 1}; - Fraction best_scale = Fraction{1, 1}; + Fraction current_scale = {.numerator = 1, .denominator = 1}; + Fraction best_scale = {.numerator = 1, .denominator = 1}; // Start scaling down by 2/3 depending on `input_width` and `input_height`. if (input_width % 3 == 0 && input_height % 3 == 0) { // 2/3 (then alternates 3/4, 2/3, 3/4,...). - current_scale = Fraction{6, 6}; + current_scale = {.numerator = 6, .denominator = 6}; } if (input_width % 9 == 0 && input_height % 9 == 0) { // 2/3, 2/3 (then alternates 3/4, 2/3, 3/4,...). - current_scale = Fraction{36, 36}; + current_scale = {.numerator = 36, .denominator = 36}; } // The minimum (absolute) difference between the number of output pixels and diff --git a/third_party/libwebrtc/media/base/video_broadcaster_unittest.cc b/third_party/libwebrtc/media/base/video_broadcaster_unittest.cc @@ -265,8 +265,8 @@ TEST(VideoBroadcasterTest, ConstraintsChangedNotCalledOnSinkAddition) { TEST(VideoBroadcasterTest, ForwardsLastConstraintsOnAdd) { MockSink sink; VideoBroadcaster broadcaster; - broadcaster.ProcessConstraints(webrtc::VideoTrackSourceConstraints{2, 3}); - broadcaster.ProcessConstraints(webrtc::VideoTrackSourceConstraints{1, 4}); + broadcaster.ProcessConstraints({.min_fps = 2, .max_fps = 3}); + broadcaster.ProcessConstraints({.min_fps = 1, .max_fps = 4}); EXPECT_CALL( sink, OnConstraintsChanged(AllOf( @@ -279,7 +279,7 @@ TEST(VideoBroadcasterTest, UpdatesOnlyNewSinksWithConstraints) { MockSink sink1; VideoBroadcaster broadcaster; broadcaster.AddOrUpdateSink(&sink1, VideoSinkWants()); - broadcaster.ProcessConstraints(webrtc::VideoTrackSourceConstraints{1, 4}); + broadcaster.ProcessConstraints({.min_fps = 1, .max_fps = 4}); Mock::VerifyAndClearExpectations(&sink1); EXPECT_CALL(sink1, OnConstraintsChanged).Times(0); MockSink sink2; @@ -304,7 +304,7 @@ TEST(VideoBroadcasterTest, ForwardsConstraintsToSink) { Field(&webrtc::VideoTrackSourceConstraints::max_fps, Eq(std::nullopt))))); broadcaster.ProcessConstraints( - webrtc::VideoTrackSourceConstraints{std::nullopt, std::nullopt}); + {.min_fps = std::nullopt, .max_fps = std::nullopt}); Mock::VerifyAndClearExpectations(&sink); EXPECT_CALL( @@ -313,8 +313,7 @@ TEST(VideoBroadcasterTest, ForwardsConstraintsToSink) { Field(&webrtc::VideoTrackSourceConstraints::min_fps, Eq(std::nullopt)), Field(&webrtc::VideoTrackSourceConstraints::max_fps, Optional(3))))); - broadcaster.ProcessConstraints( - webrtc::VideoTrackSourceConstraints{std::nullopt, 3}); + broadcaster.ProcessConstraints({.min_fps = std::nullopt, .max_fps = 3}); Mock::VerifyAndClearExpectations(&sink); EXPECT_CALL( @@ -323,8 +322,7 @@ TEST(VideoBroadcasterTest, ForwardsConstraintsToSink) { Field(&webrtc::VideoTrackSourceConstraints::min_fps, Optional(2)), Field(&webrtc::VideoTrackSourceConstraints::max_fps, Eq(std::nullopt))))); - broadcaster.ProcessConstraints( - webrtc::VideoTrackSourceConstraints{2, std::nullopt}); + broadcaster.ProcessConstraints({.min_fps = 2, .max_fps = std::nullopt}); Mock::VerifyAndClearExpectations(&sink); EXPECT_CALL( @@ -332,7 +330,7 @@ TEST(VideoBroadcasterTest, ForwardsConstraintsToSink) { OnConstraintsChanged(AllOf( Field(&webrtc::VideoTrackSourceConstraints::min_fps, Optional(2)), Field(&webrtc::VideoTrackSourceConstraints::max_fps, Optional(3))))); - broadcaster.ProcessConstraints(webrtc::VideoTrackSourceConstraints{2, 3}); + broadcaster.ProcessConstraints({.min_fps = 2, .max_fps = 3}); } TEST(VideoBroadcasterTest, AppliesMaxOfSinkWantsScaleResolutionDownTo) { diff --git a/third_party/libwebrtc/media/base/video_common.cc b/third_party/libwebrtc/media/base/video_common.cc @@ -26,20 +26,21 @@ struct FourCCAliasEntry { }; static const FourCCAliasEntry kFourCCAliases[] = { - {FOURCC_IYUV, FOURCC_I420}, - {FOURCC_YU16, FOURCC_I422}, - {FOURCC_YU24, FOURCC_I444}, - {FOURCC_YUYV, FOURCC_YUY2}, - {FOURCC_YUVS, FOURCC_YUY2}, - {FOURCC_HDYC, FOURCC_UYVY}, - {FOURCC_2VUY, FOURCC_UYVY}, - {FOURCC_JPEG, FOURCC_MJPG}, // Note: JPEG has DHT while MJPG does not. - {FOURCC_DMB1, FOURCC_MJPG}, - {FOURCC_BA81, FOURCC_BGGR}, - {FOURCC_RGB3, FOURCC_RAW}, - {FOURCC_BGR3, FOURCC_24BG}, - {FOURCC_CM32, FOURCC_BGRA}, - {FOURCC_CM24, FOURCC_RAW}, + {.alias = FOURCC_IYUV, .canonical = FOURCC_I420}, + {.alias = FOURCC_YU16, .canonical = FOURCC_I422}, + {.alias = FOURCC_YU24, .canonical = FOURCC_I444}, + {.alias = FOURCC_YUYV, .canonical = FOURCC_YUY2}, + {.alias = FOURCC_YUVS, .canonical = FOURCC_YUY2}, + {.alias = FOURCC_HDYC, .canonical = FOURCC_UYVY}, + {.alias = FOURCC_2VUY, .canonical = FOURCC_UYVY}, + {.alias = FOURCC_JPEG, + .canonical = FOURCC_MJPG}, // Note: JPEG has DHT while MJPG does not. + {.alias = FOURCC_DMB1, .canonical = FOURCC_MJPG}, + {.alias = FOURCC_BA81, .canonical = FOURCC_BGGR}, + {.alias = FOURCC_RGB3, .canonical = FOURCC_RAW}, + {.alias = FOURCC_BGR3, .canonical = FOURCC_24BG}, + {.alias = FOURCC_CM32, .canonical = FOURCC_BGRA}, + {.alias = FOURCC_CM24, .canonical = FOURCC_RAW}, }; uint32_t CanonicalFourCC(uint32_t fourcc) { diff --git a/third_party/libwebrtc/media/engine/internal_decoder_factory.cc b/third_party/libwebrtc/media/engine/internal_decoder_factory.cc @@ -72,7 +72,7 @@ VideoDecoderFactory::CodecSupport InternalDecoderFactory::QueryCodecSupport( if (reference_scaling) { VideoCodecType codec = PayloadStringToCodecType(format.name); if (codec != kVideoCodecVP9 && codec != kVideoCodecAV1) { - return {/*is_supported=*/false, /*is_power_efficient=*/false}; + return {.is_supported = false, .is_power_efficient = false}; } } diff --git a/third_party/libwebrtc/media/engine/internal_decoder_factory_unittest.cc b/third_party/libwebrtc/media/engine/internal_decoder_factory_unittest.cc @@ -45,9 +45,11 @@ constexpr bool kDav1dIsIncluded = false; constexpr bool kH265Enabled = false; constexpr VideoDecoderFactory::CodecSupport kSupported = { - /*is_supported=*/true, /*is_power_efficient=*/false}; + .is_supported = true, + .is_power_efficient = false}; constexpr VideoDecoderFactory::CodecSupport kUnsupported = { - /*is_supported=*/false, /*is_power_efficient=*/false}; + .is_supported = false, + .is_power_efficient = false}; MATCHER_P(Support, expected, "") { return arg.is_supported == expected.is_supported && diff --git a/third_party/libwebrtc/media/engine/internal_encoder_factory_unittest.cc b/third_party/libwebrtc/media/engine/internal_encoder_factory_unittest.cc @@ -40,9 +40,11 @@ constexpr bool kH264Enabled = false; constexpr bool kH265Enabled = false; constexpr VideoEncoderFactory::CodecSupport kSupported = { - /*is_supported=*/true, /*is_power_efficient=*/false}; + .is_supported = true, + .is_power_efficient = false}; constexpr VideoEncoderFactory::CodecSupport kUnsupported = { - /*is_supported=*/false, /*is_power_efficient=*/false}; + .is_supported = false, + .is_power_efficient = false}; MATCHER_P(Support, expected, "") { return arg.is_supported == expected.is_supported && diff --git a/third_party/libwebrtc/media/engine/simulcast_encoder_adapter.cc b/third_party/libwebrtc/media/engine/simulcast_encoder_adapter.cc @@ -591,8 +591,10 @@ int SimulcastEncoderAdapter::Encode( VideoFrame frame(input_image); frame.set_video_frame_buffer(dst_buffer); frame.set_rotation(kVideoRotation_0); - frame.set_update_rect( - VideoFrame::UpdateRect{0, 0, frame.width(), frame.height()}); + frame.set_update_rect(VideoFrame::UpdateRect{.offset_x = 0, + .offset_y = 0, + .width = frame.width(), + .height = frame.height()}); int ret = layer.encoder().Encode(frame, &stream_frame_types); if (ret != WEBRTC_VIDEO_CODEC_OK) { return ret; diff --git a/third_party/libwebrtc/media/engine/simulcast_encoder_adapter_unittest.cc b/third_party/libwebrtc/media/engine/simulcast_encoder_adapter_unittest.cc @@ -538,7 +538,7 @@ class TestSimulcastEncoderAdapterFake : public ::testing::Test, ++stream_idx) { if (stream_idx >= codec_.numberOfSimulcastStreams) { // Reset parameters of unspecified stream. - codec_.simulcastStream[stream_idx] = {0}; + codec_.simulcastStream[stream_idx] = {}; } else { codec_.simulcastStream[stream_idx].active = active_streams[stream_idx]; } @@ -559,7 +559,7 @@ class TestSimulcastEncoderAdapterFake : public ::testing::Test, ++stream_idx) { if (stream_idx >= codec_.numberOfSimulcastStreams) { // Reset parameters of unspecified stream. - codec_.simulcastStream[stream_idx] = {0}; + codec_.simulcastStream[stream_idx] = {}; } else { codec_.simulcastStream[stream_idx].active = active_streams[stream_idx]; } diff --git a/third_party/libwebrtc/media/engine/webrtc_voice_engine.cc b/third_party/libwebrtc/media/engine/webrtc_voice_engine.cc @@ -1199,7 +1199,8 @@ class WebRtcVoiceSendChannel::WebRtcAudioSendStream : public AudioSource::Sink { std::min(info->max_bitrate_bps, *send_codec_spec.target_bitrate_bps)); } - audio_codec_spec_.emplace(AudioCodecSpec{send_codec_spec.format, *info}); + audio_codec_spec_.emplace( + AudioCodecSpec{.format = send_codec_spec.format, .info = *info}); config_.send_codec_spec->target_bitrate_bps = ComputeSendBitrate( max_send_bitrate_bps_, rtp_parameters_.encodings[0].max_bitrate_bps, diff --git a/third_party/libwebrtc/media/engine/webrtc_voice_engine_unittest.cc b/third_party/libwebrtc/media/engine/webrtc_voice_engine_unittest.cc @@ -4035,20 +4035,21 @@ TEST(WebRtcVoiceEngineTest, CollectRecvCodecs) { Environment env = CreateEnvironment(); for (bool use_null_apm : {false, true}) { std::vector<webrtc::AudioCodecSpec> specs; - webrtc::AudioCodecSpec spec1{{"codec1", 48000, 2, {{"param1", "value1"}}}, - {48000, 2, 16000, 10000, 20000}}; + webrtc::AudioCodecSpec spec1 = { + .format = {"codec1", 48000, 2, {{"param1", "value1"}}}, + .info = {48000, 2, 16000, 10000, 20000}, + }; spec1.info.allow_comfort_noise = false; spec1.info.supports_network_adaption = true; specs.push_back(spec1); - webrtc::AudioCodecSpec spec2{{"codec2", 48000, 2, {{"param1", "value1"}}}, - {48000, 2, 16000, 10000, 20000}}; + webrtc::AudioCodecSpec spec2 = { + .format = {"codec2", 48000, 2, {{"param1", "value1"}}}, + .info = {48000, 2, 16000, 10000, 20000}}; // We do not support 48khz CN. spec2.info.allow_comfort_noise = true; specs.push_back(spec2); - specs.push_back( - webrtc::AudioCodecSpec{{"codec3", 8000, 1}, {8000, 1, 64000}}); - specs.push_back( - webrtc::AudioCodecSpec{{"codec4", 8000, 2}, {8000, 1, 64000}}); + specs.push_back({.format = {"codec3", 8000, 1}, .info = {8000, 1, 64000}}); + specs.push_back({.format = {"codec4", 8000, 2}, .info = {8000, 1, 64000}}); webrtc::scoped_refptr<webrtc::MockAudioEncoderFactory> unused_encoder_factory = @@ -4124,20 +4125,20 @@ TEST(WebRtcVoiceEngineTest, CollectRecvCodecsWithLatePtAssignment) { for (bool use_null_apm : {false, true}) { std::vector<webrtc::AudioCodecSpec> specs; - webrtc::AudioCodecSpec spec1{{"codec1", 48000, 2, {{"param1", "value1"}}}, - {48000, 2, 16000, 10000, 20000}}; + webrtc::AudioCodecSpec spec1 = { + .format = {"codec1", 48000, 2, {{"param1", "value1"}}}, + .info = {48000, 2, 16000, 10000, 20000}}; spec1.info.allow_comfort_noise = false; spec1.info.supports_network_adaption = true; specs.push_back(spec1); - webrtc::AudioCodecSpec spec2{{"codec2", 48000, 2, {{"param1", "value1"}}}, - {48000, 2, 16000, 10000, 20000}}; + webrtc::AudioCodecSpec spec2 = { + .format = {"codec2", 48000, 2, {{"param1", "value1"}}}, + .info = {48000, 2, 16000, 10000, 20000}}; // We do not support 48khz CN. spec2.info.allow_comfort_noise = true; specs.push_back(spec2); - specs.push_back( - webrtc::AudioCodecSpec{{"codec3", 8000, 1}, {8000, 1, 64000}}); - specs.push_back( - webrtc::AudioCodecSpec{{"codec4", 8000, 2}, {8000, 1, 64000}}); + specs.push_back({.format = {"codec3", 8000, 1}, .info = {8000, 1, 64000}}); + specs.push_back({.format = {"codec4", 8000, 2}, .info = {8000, 1, 64000}}); webrtc::scoped_refptr<webrtc::MockAudioEncoderFactory> unused_encoder_factory = diff --git a/third_party/libwebrtc/modules/video_coding/codecs/av1/libaom_av1_unittest.cc b/third_party/libwebrtc/modules/video_coding/codecs/av1/libaom_av1_unittest.cc @@ -324,7 +324,8 @@ TEST_P(LibaomAv1SvcTest, SetRatesMatchMeasuredBitrate) { for (const auto& frame : encoded_frames) { ASSERT_TRUE(frame.codec_specific_info.generic_frame_info); const auto& layer = *frame.codec_specific_info.generic_frame_info; - LayerId layer_id = {layer.spatial_id, layer.temporal_id}; + LayerId layer_id = {.spatial_id = layer.spatial_id, + .temporal_id = layer.temporal_id}; // This is almost same as // layer_size[layer_id] += DataSize::Bytes(frame.encoded_image.size()); // but avoids calling deleted default constructor for DataSize. diff --git a/third_party/libwebrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc b/third_party/libwebrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc @@ -474,7 +474,7 @@ int32_t H264EncoderImpl::Encode( // Encode image for each layer. for (size_t i = 0; i < encoders_.size(); ++i) { // EncodeFrame input. - pictures_[i] = {0}; + pictures_[i] = {}; pictures_[i].iPicWidth = configurations_[i].width; pictures_[i].iPicHeight = configurations_[i].height; pictures_[i].iColorFormat = EVideoFormatType::videoFormatI420; diff --git a/third_party/libwebrtc/modules/video_coding/generic_decoder.cc b/third_party/libwebrtc/modules/video_coding/generic_decoder.cc @@ -165,7 +165,8 @@ void VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage, : now - *frame_info->decode_start; _timing->StopDecodeTimer(decode_time, now); decodedImage.set_processing_time( - {*frame_info->decode_start, *frame_info->decode_start + decode_time}); + {.start = *frame_info->decode_start, + .finish = *frame_info->decode_start + decode_time}); // Report timing information. TimingFrameInfo timing_frame_info; diff --git a/third_party/libwebrtc/modules/video_coding/h264_sps_pps_tracker.cc b/third_party/libwebrtc/modules/video_coding/h264_sps_pps_tracker.cc @@ -67,21 +67,21 @@ H264SpsPpsTracker::FixedBitstream H264SpsPpsTracker::CopyAndFixBitstream( if (video_header->is_first_packet_in_frame) { if (nalu.pps_id == -1) { RTC_LOG(LS_WARNING) << "No PPS id in IDR nalu."; - return {kRequestKeyframe}; + return {.action = kRequestKeyframe}; } pps = pps_data_.find(nalu.pps_id); if (pps == pps_data_.end()) { RTC_LOG(LS_WARNING) << "No PPS with id << " << nalu.pps_id << " received"; - return {kRequestKeyframe}; + return {.action = kRequestKeyframe}; } sps = sps_data_.find(pps->second.sps_id); if (sps == sps_data_.end()) { RTC_LOG(LS_WARNING) << "No SPS with id << " << pps->second.sps_id << " received"; - return {kRequestKeyframe}; + return {.action = kRequestKeyframe}; } // Since the first packet of every keyframe should have its width and @@ -122,9 +122,9 @@ H264SpsPpsTracker::FixedBitstream H264SpsPpsTracker::CopyAndFixBitstream( // The first two bytes describe the length of a segment. uint16_t segment_length; if (!nalu.ReadUInt16(&segment_length)) - return {kDrop}; + return {.action = kDrop}; if (segment_length == 0 || segment_length > nalu.Length()) { - return {kDrop}; + return {.action = kDrop}; } required_size += segment_length; nalu.Consume(segment_length); @@ -166,9 +166,9 @@ H264SpsPpsTracker::FixedBitstream H264SpsPpsTracker::CopyAndFixBitstream( // The first two bytes describe the length of a segment. uint16_t segment_length; if (!nalu.ReadUInt16(&segment_length)) - return {kDrop}; + return {.action = kDrop}; if (segment_length == 0 || segment_length > nalu.Length()) { - return {kDrop}; + return {.action = kDrop}; } fixed.bitstream.AppendData(nalu.Data(), segment_length); nalu.Consume(segment_length); diff --git a/third_party/libwebrtc/modules/video_coding/svc/create_scalability_structure.cc b/third_party/libwebrtc/modules/video_coding/svc/create_scalability_structure.cc @@ -46,228 +46,291 @@ std::unique_ptr<ScalableVideoController> CreateH() { } constexpr ScalableVideoController::StreamLayersConfig kConfigL1T1 = { - /*num_spatial_layers=*/1, /*num_temporal_layers=*/1, - /*uses_reference_scaling=*/false}; + .num_spatial_layers = 1, + .num_temporal_layers = 1, + .uses_reference_scaling = false}; constexpr ScalableVideoController::StreamLayersConfig kConfigL1T2 = { - /*num_spatial_layers=*/1, /*num_temporal_layers=*/2, - /*uses_reference_scaling=*/false}; + .num_spatial_layers = 1, + .num_temporal_layers = 2, + .uses_reference_scaling = false}; constexpr ScalableVideoController::StreamLayersConfig kConfigL1T3 = { - /*num_spatial_layers=*/1, /*num_temporal_layers=*/3, - /*uses_reference_scaling=*/false}; + .num_spatial_layers = 1, + .num_temporal_layers = 3, + .uses_reference_scaling = false}; constexpr ScalableVideoController::StreamLayersConfig kConfigL2T1 = { - /*num_spatial_layers=*/2, - /*num_temporal_layers=*/1, - /*uses_reference_scaling=*/true, - {1, 1}, - {2, 1}}; + .num_spatial_layers = 2, + .num_temporal_layers = 1, + .uses_reference_scaling = true, + .scaling_factor_num = {1, 1}, + .scaling_factor_den = {2, 1}}; constexpr ScalableVideoController::StreamLayersConfig kConfigL2T1h = { - /*num_spatial_layers=*/2, - /*num_temporal_layers=*/1, - /*uses_reference_scaling=*/true, - {2, 1}, - {3, 1}}; + .num_spatial_layers = 2, + .num_temporal_layers = 1, + .uses_reference_scaling = true, + .scaling_factor_num = {2, 1}, + .scaling_factor_den = {3, 1}}; constexpr ScalableVideoController::StreamLayersConfig kConfigL2T2 = { - /*num_spatial_layers=*/2, - /*num_temporal_layers=*/2, - /*uses_reference_scaling=*/true, - {1, 1}, - {2, 1}}; + .num_spatial_layers = 2, + .num_temporal_layers = 2, + .uses_reference_scaling = true, + .scaling_factor_num = {1, 1}, + .scaling_factor_den = {2, 1}}; constexpr ScalableVideoController::StreamLayersConfig kConfigL2T2h = { - /*num_spatial_layers=*/2, - /*num_temporal_layers=*/2, - /*uses_reference_scaling=*/true, - {2, 1}, - {3, 1}}; + .num_spatial_layers = 2, + .num_temporal_layers = 2, + .uses_reference_scaling = true, + .scaling_factor_num = {2, 1}, + .scaling_factor_den = {3, 1}}; constexpr ScalableVideoController::StreamLayersConfig kConfigL2T3 = { - /*num_spatial_layers=*/2, - /*num_temporal_layers=*/3, - /*uses_reference_scaling=*/true, - {1, 1}, - {2, 1}}; + .num_spatial_layers = 2, + .num_temporal_layers = 3, + .uses_reference_scaling = true, + .scaling_factor_num = {1, 1}, + .scaling_factor_den = {2, 1}}; constexpr ScalableVideoController::StreamLayersConfig kConfigL2T3h = { - /*num_spatial_layers=*/2, - /*num_temporal_layers=*/3, - /*uses_reference_scaling=*/true, - {2, 1}, - {3, 1}}; + .num_spatial_layers = 2, + .num_temporal_layers = 3, + .uses_reference_scaling = true, + .scaling_factor_num = {2, 1}, + .scaling_factor_den = {3, 1}}; constexpr ScalableVideoController::StreamLayersConfig kConfigL3T1 = { - /*num_spatial_layers=*/3, - /*num_temporal_layers=*/1, - /*uses_reference_scaling=*/true, - {1, 1, 1}, - {4, 2, 1}}; + .num_spatial_layers = 3, + .num_temporal_layers = 1, + .uses_reference_scaling = true, + .scaling_factor_num = {1, 1, 1}, + .scaling_factor_den = {4, 2, 1}}; constexpr ScalableVideoController::StreamLayersConfig kConfigL3T1h = { - /*num_spatial_layers=*/3, - /*num_temporal_layers=*/1, - /*uses_reference_scaling=*/true, - {4, 2, 1}, - {9, 3, 1}}; + .num_spatial_layers = 3, + .num_temporal_layers = 1, + .uses_reference_scaling = true, + .scaling_factor_num = {4, 2, 1}, + .scaling_factor_den = {9, 3, 1}}; constexpr ScalableVideoController::StreamLayersConfig kConfigL3T2 = { - /*num_spatial_layers=*/3, - /*num_temporal_layers=*/2, - /*uses_reference_scaling=*/true, - {1, 1, 1}, - {4, 2, 1}}; + .num_spatial_layers = 3, + .num_temporal_layers = 2, + .uses_reference_scaling = true, + .scaling_factor_num = {1, 1, 1}, + .scaling_factor_den = {4, 2, 1}}; constexpr ScalableVideoController::StreamLayersConfig kConfigL3T2h = { - /*num_spatial_layers=*/3, - /*num_temporal_layers=*/2, - /*uses_reference_scaling=*/true, - {4, 2, 1}, - {9, 3, 1}}; + .num_spatial_layers = 3, + .num_temporal_layers = 2, + .uses_reference_scaling = true, + .scaling_factor_num = {4, 2, 1}, + .scaling_factor_den = {9, 3, 1}}; constexpr ScalableVideoController::StreamLayersConfig kConfigL3T3 = { - /*num_spatial_layers=*/3, - /*num_temporal_layers=*/3, - /*uses_reference_scaling=*/true, - {1, 1, 1}, - {4, 2, 1}}; + .num_spatial_layers = 3, + .num_temporal_layers = 3, + .uses_reference_scaling = true, + .scaling_factor_num = {1, 1, 1}, + .scaling_factor_den = {4, 2, 1}}; constexpr ScalableVideoController::StreamLayersConfig kConfigL3T3h = { - /*num_spatial_layers=*/3, - /*num_temporal_layers=*/3, - /*uses_reference_scaling=*/true, - {4, 2, 1}, - {9, 3, 1}}; + .num_spatial_layers = 3, + .num_temporal_layers = 3, + .uses_reference_scaling = true, + .scaling_factor_num = {4, 2, 1}, + .scaling_factor_den = {9, 3, 1}}; constexpr ScalableVideoController::StreamLayersConfig kConfigS2T1 = { - /*num_spatial_layers=*/2, - /*num_temporal_layers=*/1, - /*uses_reference_scaling=*/false, - {1, 1}, - {2, 1}}; + .num_spatial_layers = 2, + .num_temporal_layers = 1, + .uses_reference_scaling = false, + .scaling_factor_num = {1, 1}, + .scaling_factor_den = {2, 1}}; constexpr ScalableVideoController::StreamLayersConfig kConfigS2T1h = { - /*num_spatial_layers=*/2, - /*num_temporal_layers=*/1, - /*uses_reference_scaling=*/false, - {2, 1}, - {3, 1}}; + .num_spatial_layers = 2, + .num_temporal_layers = 1, + .uses_reference_scaling = false, + .scaling_factor_num = {2, 1}, + .scaling_factor_den = {3, 1}}; constexpr ScalableVideoController::StreamLayersConfig kConfigS2T2 = { - /*num_spatial_layers=*/2, - /*num_temporal_layers=*/2, - /*uses_reference_scaling=*/false, - {1, 1}, - {2, 1}}; + .num_spatial_layers = 2, + .num_temporal_layers = 2, + .uses_reference_scaling = false, + .scaling_factor_num = {1, 1}, + .scaling_factor_den = {2, 1}}; constexpr ScalableVideoController::StreamLayersConfig kConfigS2T2h = { - /*num_spatial_layers=*/2, - /*num_temporal_layers=*/2, - /*uses_reference_scaling=*/false, - {2, 1}, - {3, 1}}; + .num_spatial_layers = 2, + .num_temporal_layers = 2, + .uses_reference_scaling = false, + .scaling_factor_num = {2, 1}, + .scaling_factor_den = {3, 1}}; constexpr ScalableVideoController::StreamLayersConfig kConfigS2T3 = { - /*num_spatial_layers=*/2, - /*num_temporal_layers=*/3, - /*uses_reference_scaling=*/false, - {1, 1}, - {2, 1}}; + .num_spatial_layers = 2, + .num_temporal_layers = 3, + .uses_reference_scaling = false, + .scaling_factor_num = {1, 1}, + .scaling_factor_den = {2, 1}}; constexpr ScalableVideoController::StreamLayersConfig kConfigS2T3h = { - /*num_spatial_layers=*/2, - /*num_temporal_layers=*/3, - /*uses_reference_scaling=*/false, - {2, 1}, - {3, 1}}; + .num_spatial_layers = 2, + .num_temporal_layers = 3, + .uses_reference_scaling = false, + .scaling_factor_num = {2, 1}, + .scaling_factor_den = {3, 1}}; constexpr ScalableVideoController::StreamLayersConfig kConfigS3T1 = { - /*num_spatial_layers=*/3, - /*num_temporal_layers=*/1, - /*uses_reference_scaling=*/false, - {1, 1, 1}, - {4, 2, 1}}; + .num_spatial_layers = 3, + .num_temporal_layers = 1, + .uses_reference_scaling = false, + .scaling_factor_num = {1, 1, 1}, + .scaling_factor_den = {4, 2, 1}}; constexpr ScalableVideoController::StreamLayersConfig kConfigS3T1h = { - /*num_spatial_layers=*/3, - /*num_temporal_layers=*/1, - /*uses_reference_scaling=*/false, - {4, 2, 1}, - {9, 3, 1}}; + .num_spatial_layers = 3, + .num_temporal_layers = 1, + .uses_reference_scaling = false, + .scaling_factor_num = {4, 2, 1}, + .scaling_factor_den = {9, 3, 1}}; constexpr ScalableVideoController::StreamLayersConfig kConfigS3T2 = { - /*num_spatial_layers=*/3, - /*num_temporal_layers=*/2, - /*uses_reference_scaling=*/false, - {1, 1, 1}, - {4, 2, 1}}; + .num_spatial_layers = 3, + .num_temporal_layers = 2, + .uses_reference_scaling = false, + .scaling_factor_num = {1, 1, 1}, + .scaling_factor_den = {4, 2, 1}}; constexpr ScalableVideoController::StreamLayersConfig kConfigS3T2h = { - /*num_spatial_layers=*/3, - /*num_temporal_layers=*/2, - /*uses_reference_scaling=*/false, - {4, 2, 1}, - {9, 3, 1}}; + .num_spatial_layers = 3, + .num_temporal_layers = 2, + .uses_reference_scaling = false, + .scaling_factor_num = {4, 2, 1}, + .scaling_factor_den = {9, 3, 1}}; constexpr ScalableVideoController::StreamLayersConfig kConfigS3T3 = { - /*num_spatial_layers=*/3, - /*num_temporal_layers=*/3, - /*uses_reference_scaling=*/false, - {1, 1, 1}, - {4, 2, 1}}; + .num_spatial_layers = 3, + .num_temporal_layers = 3, + .uses_reference_scaling = false, + .scaling_factor_num = {1, 1, 1}, + .scaling_factor_den = {4, 2, 1}}; constexpr ScalableVideoController::StreamLayersConfig kConfigS3T3h = { - /*num_spatial_layers=*/3, - /*num_temporal_layers=*/3, - /*uses_reference_scaling=*/false, - {4, 2, 1}, - {9, 3, 1}}; + .num_spatial_layers = 3, + .num_temporal_layers = 3, + .uses_reference_scaling = false, + .scaling_factor_num = {4, 2, 1}, + .scaling_factor_den = {9, 3, 1}}; constexpr NamedStructureFactory kFactories[] = { - {ScalabilityMode::kL1T1, Create<ScalableVideoControllerNoLayering>, - kConfigL1T1}, - {ScalabilityMode::kL1T2, Create<ScalabilityStructureL1T2>, kConfigL1T2}, - {ScalabilityMode::kL1T3, Create<ScalabilityStructureL1T3>, kConfigL1T3}, - {ScalabilityMode::kL2T1, Create<ScalabilityStructureL2T1>, kConfigL2T1}, - {ScalabilityMode::kL2T1h, CreateH<ScalabilityStructureL2T1>, kConfigL2T1h}, - {ScalabilityMode::kL2T1_KEY, Create<ScalabilityStructureL2T1Key>, - kConfigL2T1}, - {ScalabilityMode::kL2T2, Create<ScalabilityStructureL2T2>, kConfigL2T2}, - {ScalabilityMode::kL2T2h, CreateH<ScalabilityStructureL2T2>, kConfigL2T2h}, - {ScalabilityMode::kL2T2_KEY, Create<ScalabilityStructureL2T2Key>, - kConfigL2T2}, - {ScalabilityMode::kL2T2_KEY_SHIFT, Create<ScalabilityStructureL2T2KeyShift>, - kConfigL2T2}, - {ScalabilityMode::kL2T3, Create<ScalabilityStructureL2T3>, kConfigL2T3}, - {ScalabilityMode::kL2T3h, CreateH<ScalabilityStructureL2T3>, kConfigL2T3h}, - {ScalabilityMode::kL2T3_KEY, Create<ScalabilityStructureL2T3Key>, - kConfigL2T3}, - {ScalabilityMode::kL3T1, Create<ScalabilityStructureL3T1>, kConfigL3T1}, - {ScalabilityMode::kL3T1h, CreateH<ScalabilityStructureL3T1>, kConfigL3T1h}, - {ScalabilityMode::kL3T1_KEY, Create<ScalabilityStructureL3T1Key>, - kConfigL3T1}, - {ScalabilityMode::kL3T2, Create<ScalabilityStructureL3T2>, kConfigL3T2}, - {ScalabilityMode::kL3T2h, CreateH<ScalabilityStructureL3T2>, kConfigL3T2h}, - {ScalabilityMode::kL3T2_KEY, Create<ScalabilityStructureL3T2Key>, - kConfigL3T2}, - {ScalabilityMode::kL3T3, Create<ScalabilityStructureL3T3>, kConfigL3T3}, - {ScalabilityMode::kL3T3h, CreateH<ScalabilityStructureL3T3>, kConfigL3T3h}, - {ScalabilityMode::kL3T3_KEY, Create<ScalabilityStructureL3T3Key>, - kConfigL3T3}, - {ScalabilityMode::kS2T1, Create<ScalabilityStructureS2T1>, kConfigS2T1}, - {ScalabilityMode::kS2T1h, CreateH<ScalabilityStructureS2T1>, kConfigS2T1h}, - {ScalabilityMode::kS2T2, Create<ScalabilityStructureS2T2>, kConfigS2T2}, - {ScalabilityMode::kS2T2h, CreateH<ScalabilityStructureS2T2>, kConfigS2T2h}, - {ScalabilityMode::kS2T3, Create<ScalabilityStructureS2T3>, kConfigS2T3}, - {ScalabilityMode::kS2T3h, CreateH<ScalabilityStructureS2T3>, kConfigS2T3h}, - {ScalabilityMode::kS3T1, Create<ScalabilityStructureS3T1>, kConfigS3T1}, - {ScalabilityMode::kS3T1h, CreateH<ScalabilityStructureS3T1>, kConfigS3T1h}, - {ScalabilityMode::kS3T2, Create<ScalabilityStructureS3T2>, kConfigS3T2}, - {ScalabilityMode::kS3T2h, CreateH<ScalabilityStructureS3T2>, kConfigS3T2h}, - {ScalabilityMode::kS3T3, Create<ScalabilityStructureS3T3>, kConfigS3T3}, - {ScalabilityMode::kS3T3h, CreateH<ScalabilityStructureS3T3>, kConfigS3T3h}, + {.name = ScalabilityMode::kL1T1, + .factory = Create<ScalableVideoControllerNoLayering>, + .config = kConfigL1T1}, + {.name = ScalabilityMode::kL1T2, + .factory = Create<ScalabilityStructureL1T2>, + .config = kConfigL1T2}, + {.name = ScalabilityMode::kL1T3, + .factory = Create<ScalabilityStructureL1T3>, + .config = kConfigL1T3}, + {.name = ScalabilityMode::kL2T1, + .factory = Create<ScalabilityStructureL2T1>, + .config = kConfigL2T1}, + {.name = ScalabilityMode::kL2T1h, + .factory = CreateH<ScalabilityStructureL2T1>, + .config = kConfigL2T1h}, + {.name = ScalabilityMode::kL2T1_KEY, + .factory = Create<ScalabilityStructureL2T1Key>, + .config = kConfigL2T1}, + {.name = ScalabilityMode::kL2T2, + .factory = Create<ScalabilityStructureL2T2>, + .config = kConfigL2T2}, + {.name = ScalabilityMode::kL2T2h, + .factory = CreateH<ScalabilityStructureL2T2>, + .config = kConfigL2T2h}, + {.name = ScalabilityMode::kL2T2_KEY, + .factory = Create<ScalabilityStructureL2T2Key>, + .config = kConfigL2T2}, + {.name = ScalabilityMode::kL2T2_KEY_SHIFT, + .factory = Create<ScalabilityStructureL2T2KeyShift>, + .config = kConfigL2T2}, + {.name = ScalabilityMode::kL2T3, + .factory = Create<ScalabilityStructureL2T3>, + .config = kConfigL2T3}, + {.name = ScalabilityMode::kL2T3h, + .factory = CreateH<ScalabilityStructureL2T3>, + .config = kConfigL2T3h}, + {.name = ScalabilityMode::kL2T3_KEY, + .factory = Create<ScalabilityStructureL2T3Key>, + .config = kConfigL2T3}, + {.name = ScalabilityMode::kL3T1, + .factory = Create<ScalabilityStructureL3T1>, + .config = kConfigL3T1}, + {.name = ScalabilityMode::kL3T1h, + .factory = CreateH<ScalabilityStructureL3T1>, + .config = kConfigL3T1h}, + {.name = ScalabilityMode::kL3T1_KEY, + .factory = Create<ScalabilityStructureL3T1Key>, + .config = kConfigL3T1}, + {.name = ScalabilityMode::kL3T2, + .factory = Create<ScalabilityStructureL3T2>, + .config = kConfigL3T2}, + {.name = ScalabilityMode::kL3T2h, + .factory = CreateH<ScalabilityStructureL3T2>, + .config = kConfigL3T2h}, + {.name = ScalabilityMode::kL3T2_KEY, + .factory = Create<ScalabilityStructureL3T2Key>, + .config = kConfigL3T2}, + {.name = ScalabilityMode::kL3T3, + .factory = Create<ScalabilityStructureL3T3>, + .config = kConfigL3T3}, + {.name = ScalabilityMode::kL3T3h, + .factory = CreateH<ScalabilityStructureL3T3>, + .config = kConfigL3T3h}, + {.name = ScalabilityMode::kL3T3_KEY, + .factory = Create<ScalabilityStructureL3T3Key>, + .config = kConfigL3T3}, + {.name = ScalabilityMode::kS2T1, + .factory = Create<ScalabilityStructureS2T1>, + .config = kConfigS2T1}, + {.name = ScalabilityMode::kS2T1h, + .factory = CreateH<ScalabilityStructureS2T1>, + .config = kConfigS2T1h}, + {.name = ScalabilityMode::kS2T2, + .factory = Create<ScalabilityStructureS2T2>, + .config = kConfigS2T2}, + {.name = ScalabilityMode::kS2T2h, + .factory = CreateH<ScalabilityStructureS2T2>, + .config = kConfigS2T2h}, + {.name = ScalabilityMode::kS2T3, + .factory = Create<ScalabilityStructureS2T3>, + .config = kConfigS2T3}, + {.name = ScalabilityMode::kS2T3h, + .factory = CreateH<ScalabilityStructureS2T3>, + .config = kConfigS2T3h}, + {.name = ScalabilityMode::kS3T1, + .factory = Create<ScalabilityStructureS3T1>, + .config = kConfigS3T1}, + {.name = ScalabilityMode::kS3T1h, + .factory = CreateH<ScalabilityStructureS3T1>, + .config = kConfigS3T1h}, + {.name = ScalabilityMode::kS3T2, + .factory = Create<ScalabilityStructureS3T2>, + .config = kConfigS3T2}, + {.name = ScalabilityMode::kS3T2h, + .factory = CreateH<ScalabilityStructureS3T2>, + .config = kConfigS3T2h}, + {.name = ScalabilityMode::kS3T3, + .factory = Create<ScalabilityStructureS3T3>, + .config = kConfigS3T3}, + {.name = ScalabilityMode::kS3T3h, + .factory = CreateH<ScalabilityStructureS3T3>, + .config = kConfigS3T3h}, }; } // namespace diff --git a/third_party/libwebrtc/modules/video_coding/utility/simulcast_test_fixture_impl.cc b/third_party/libwebrtc/modules/video_coding/utility/simulcast_test_fixture_impl.cc @@ -250,8 +250,9 @@ void SimulcastTestFixtureImpl::DefaultSettings( layer_order[0] = 2; layer_order[2] = 0; } - settings->timing_frame_thresholds = {kDefaultTimingFramesDelayMs, - kDefaultOutlierFrameSizePercent}; + settings->timing_frame_thresholds = { + .delay_ms = kDefaultTimingFramesDelayMs, + .outlier_ratio_percent = kDefaultOutlierFrameSizePercent}; ConfigureStream(kDefaultWidth / 4, kDefaultHeight / 4, kMaxBitrates[0], kMinBitrates[0], kTargetBitrates[0], kMaxFramerates[0], &settings->simulcastStream[layer_order[0]], diff --git a/third_party/libwebrtc/modules/video_coding/video_codec_initializer.cc b/third_party/libwebrtc/modules/video_coding/video_codec_initializer.cc @@ -96,8 +96,9 @@ VideoCodec VideoCodecInitializer::SetupCodec( video_codec.active = codec_active; if (video_codec.minBitrate < kEncoderMinBitrateKbps) video_codec.minBitrate = kEncoderMinBitrateKbps; - video_codec.timing_frame_thresholds = {kDefaultTimingFramesDelayMs, - kDefaultOutlierFrameSizePercent}; + video_codec.timing_frame_thresholds = { + .delay_ms = kDefaultTimingFramesDelayMs, + .outlier_ratio_percent = kDefaultOutlierFrameSizePercent}; RTC_DCHECK_LE(streams.size(), kMaxSimulcastStreams); int max_framerate = 0; @@ -170,7 +171,7 @@ VideoCodec VideoCodecInitializer::SetupCodec( video_codec.maxBitrate = kEncoderMinBitrateKbps; video_codec.maxFramerate = max_framerate; - video_codec.spatialLayers[0] = {0}; + video_codec.spatialLayers[0] = {}; video_codec.spatialLayers[0].width = video_codec.width; video_codec.spatialLayers[0].height = video_codec.height; video_codec.spatialLayers[0].maxFramerate = max_framerate; diff --git a/third_party/libwebrtc/moz-patch-stack/s0028.patch b/third_party/libwebrtc/moz-patch-stack/s0028.patch @@ -9,7 +9,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/ef548d7758c7de6e7 1 file changed, 2 insertions(+) diff --git a/media/engine/internal_decoder_factory.cc b/media/engine/internal_decoder_factory.cc -index b87fe2f2c3..6e07b2f0f5 100644 +index f81c0f57bb..d9ddf2ebeb 100644 --- a/media/engine/internal_decoder_factory.cc +++ b/media/engine/internal_decoder_factory.cc @@ -53,10 +53,12 @@ std::vector<SdpVideoFormat> InternalDecoderFactory::GetSupportedFormats() diff --git a/third_party/libwebrtc/moz-patch-stack/s0037.patch b/third_party/libwebrtc/moz-patch-stack/s0037.patch @@ -53,7 +53,7 @@ index 2ca52615a7..52f998ddc2 100644 // Implements RtpVideoFrameReceiver. void ManageFrame(std::unique_ptr<RtpFrameObject> frame) override; diff --git a/video/video_receive_stream2.cc b/video/video_receive_stream2.cc -index 5238e8d3a6..4877b8421b 100644 +index ea4b474a09..f6482e09d3 100644 --- a/video/video_receive_stream2.cc +++ b/video/video_receive_stream2.cc @@ -626,6 +626,14 @@ VideoReceiveStreamInterface::Stats VideoReceiveStream2::GetStats() const { diff --git a/third_party/libwebrtc/moz-patch-stack/s0042.patch b/third_party/libwebrtc/moz-patch-stack/s0042.patch @@ -153,7 +153,7 @@ index 52f998ddc2..1acb0ac70e 100644 private: // Implements RtpVideoFrameReceiver. diff --git a/video/video_receive_stream2.cc b/video/video_receive_stream2.cc -index 4877b8421b..bc997550df 100644 +index f6482e09d3..517ef80f2f 100644 --- a/video/video_receive_stream2.cc +++ b/video/video_receive_stream2.cc @@ -632,7 +632,8 @@ VideoReceiveStreamInterface::Stats VideoReceiveStream2::GetStats() const { diff --git a/third_party/libwebrtc/moz-patch-stack/s0057.patch b/third_party/libwebrtc/moz-patch-stack/s0057.patch @@ -272,7 +272,7 @@ index 1acb0ac70e..272f83ccba 100644 RTC_GUARDED_BY(packet_sequence_checker_); // h26x_packet_buffer_ is applicable to H.264 and H.265. For H.265 it is diff --git a/video/video_receive_stream2.cc b/video/video_receive_stream2.cc -index bc997550df..59b5282229 100644 +index 517ef80f2f..4705d95d0a 100644 --- a/video/video_receive_stream2.cc +++ b/video/video_receive_stream2.cc @@ -256,6 +256,7 @@ VideoReceiveStream2::VideoReceiveStream2( diff --git a/third_party/libwebrtc/moz-patch-stack/s0068.patch b/third_party/libwebrtc/moz-patch-stack/s0068.patch @@ -10,7 +10,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/a7179d8d75313b6c9 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/video/video_stream_encoder.cc b/video/video_stream_encoder.cc -index 2e402e0896..0b5ec1050f 100644 +index 4ae969421a..84670c4822 100644 --- a/video/video_stream_encoder.cc +++ b/video/video_stream_encoder.cc @@ -1442,7 +1442,7 @@ void VideoStreamEncoder::ReconfigureEncoder() { diff --git a/third_party/libwebrtc/moz-patch-stack/s0093.patch b/third_party/libwebrtc/moz-patch-stack/s0093.patch @@ -30,7 +30,7 @@ index 82aede5e28..b602b8d2ce 100644 if (rtc_use_perfetto) { rtc_library("webrtc_libperfetto") { diff --git a/modules/video_coding/generic_decoder.cc b/modules/video_coding/generic_decoder.cc -index 7dc827a0d2..8ab283fa95 100644 +index 2cb8db695f..2db0a4d381 100644 --- a/modules/video_coding/generic_decoder.cc +++ b/modules/video_coding/generic_decoder.cc @@ -120,9 +120,9 @@ void VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage, @@ -46,7 +46,7 @@ index 7dc827a0d2..8ab283fa95 100644 // TODO(holmer): We should improve this so that we can handle multiple // callbacks from one call to Decode(). std::optional<FrameInfo> frame_info; -@@ -324,8 +324,8 @@ int32_t VCMGenericDecoder::Decode( +@@ -325,8 +325,8 @@ int32_t VCMGenericDecoder::Decode( Timestamp now, int64_t render_time_ms, const std::optional<FrameInstrumentationData>& frame_instrumentation_data) { diff --git a/third_party/libwebrtc/moz-patch-stack/s0110.patch b/third_party/libwebrtc/moz-patch-stack/s0110.patch @@ -36,7 +36,7 @@ index 7fda03ffa8..8ca8462dd0 100644 ~VideoStreamFactoryInterface() override {} }; diff --git a/video/video_stream_encoder.cc b/video/video_stream_encoder.cc -index 0b5ec1050f..8d1cf10e65 100644 +index 84670c4822..bbea307fb7 100644 --- a/video/video_stream_encoder.cc +++ b/video/video_stream_encoder.cc @@ -1054,6 +1054,7 @@ void VideoStreamEncoder::ReconfigureEncoder() { diff --git a/third_party/libwebrtc/video/config/encoder_stream_factory_unittest.cc b/third_party/libwebrtc/video/config/encoder_stream_factory_unittest.cc @@ -496,8 +496,8 @@ TEST(EncoderStreamFactory, VP9TemporalLayerCountTransferToStreamSettings) { encoder_config.number_of_streams = 1; encoder_config.simulcast_layers.resize(1); encoder_config.simulcast_layers[0].num_temporal_layers = 3; - auto streams = CreateEncoderStreams(CreateTestFieldTrials(), {1280, 720}, - encoder_config); + auto streams = CreateEncoderStreams( + CreateTestFieldTrials(), {.width = 1280, .height = 720}, encoder_config); ASSERT_THAT(streams, SizeIs(1)); EXPECT_EQ(streams[0].num_temporal_layers, 3); } @@ -508,8 +508,8 @@ TEST(EncoderStreamFactory, AV1TemporalLayerCountTransferToStreamSettings) { encoder_config.number_of_streams = 1; encoder_config.simulcast_layers.resize(1); encoder_config.simulcast_layers[0].num_temporal_layers = 3; - auto streams = CreateEncoderStreams(CreateTestFieldTrials(), {1280, 720}, - encoder_config); + auto streams = CreateEncoderStreams( + CreateTestFieldTrials(), {.width = 1280, .height = 720}, encoder_config); ASSERT_THAT(streams, SizeIs(1)); EXPECT_EQ(streams[0].num_temporal_layers, 3); } @@ -520,8 +520,8 @@ TEST(EncoderStreamFactory, H264TemporalLayerCountTransferToStreamSettings) { encoder_config.number_of_streams = 1; encoder_config.simulcast_layers.resize(1); encoder_config.simulcast_layers[0].num_temporal_layers = 3; - auto streams = CreateEncoderStreams(CreateTestFieldTrials(), {1280, 720}, - encoder_config); + auto streams = CreateEncoderStreams( + CreateTestFieldTrials(), {.width = 1280, .height = 720}, encoder_config); ASSERT_THAT(streams, SizeIs(1)); EXPECT_EQ(streams[0].num_temporal_layers, std::nullopt); } @@ -533,8 +533,8 @@ TEST(EncoderStreamFactory, H265TemporalLayerCountTransferToStreamSettings) { encoder_config.number_of_streams = 1; encoder_config.simulcast_layers.resize(1); encoder_config.simulcast_layers[0].num_temporal_layers = 3; - auto streams = CreateEncoderStreams(CreateTestFieldTrials(), {1280, 720}, - encoder_config); + auto streams = CreateEncoderStreams( + CreateTestFieldTrials(), {.width = 1280, .height = 720}, encoder_config); ASSERT_THAT(streams, SizeIs(1)); EXPECT_EQ(streams[0].num_temporal_layers, 3); } @@ -550,8 +550,8 @@ TEST(EncoderStreamFactory, VP9SetsMaxBitrateToConfiguredEncodingValue) { encoder_config.number_of_streams = 1; encoder_config.simulcast_layers.resize(3); encoder_config.simulcast_layers[0].max_bitrate_bps = 5000000; - auto streams = CreateEncoderStreams(CreateTestFieldTrials(), {1280, 720}, - encoder_config); + auto streams = CreateEncoderStreams( + CreateTestFieldTrials(), {.width = 1280, .height = 720}, encoder_config); ASSERT_THAT(streams, SizeIs(1)); EXPECT_EQ(streams[0].max_bitrate_bps, 5000000); } diff --git a/third_party/libwebrtc/video/config/simulcast.cc b/third_party/libwebrtc/video/config/simulcast.cc @@ -80,47 +80,107 @@ struct SimulcastFormat { // simulcast layers at what bitrates (maximum, target, and minimum). // Important!! Keep this table from high resolution to low resolution. constexpr const SimulcastFormat kSimulcastFormatsVP8[] = { - {1920, 1080, 3, DataRate::KilobitsPerSec(5000), - DataRate::KilobitsPerSec(4000), DataRate::KilobitsPerSec(800)}, - {1280, 720, 3, DataRate::KilobitsPerSec(2500), - DataRate::KilobitsPerSec(2500), DataRate::KilobitsPerSec(600)}, - {960, 540, 3, DataRate::KilobitsPerSec(1200), - DataRate::KilobitsPerSec(1200), DataRate::KilobitsPerSec(350)}, - {640, 360, 2, DataRate::KilobitsPerSec(700), DataRate::KilobitsPerSec(500), - DataRate::KilobitsPerSec(150)}, - {480, 270, 2, DataRate::KilobitsPerSec(450), DataRate::KilobitsPerSec(350), - DataRate::KilobitsPerSec(150)}, - {320, 180, 1, DataRate::KilobitsPerSec(200), DataRate::KilobitsPerSec(150), - DataRate::KilobitsPerSec(30)}, + {.width = 1920, + .height = 1080, + .max_layers = 3, + .max_bitrate = DataRate::KilobitsPerSec(5000), + .target_bitrate = DataRate::KilobitsPerSec(4000), + .min_bitrate = DataRate::KilobitsPerSec(800)}, + {.width = 1280, + .height = 720, + .max_layers = 3, + .max_bitrate = DataRate::KilobitsPerSec(2500), + .target_bitrate = DataRate::KilobitsPerSec(2500), + .min_bitrate = DataRate::KilobitsPerSec(600)}, + {.width = 960, + .height = 540, + .max_layers = 3, + .max_bitrate = DataRate::KilobitsPerSec(1200), + .target_bitrate = DataRate::KilobitsPerSec(1200), + .min_bitrate = DataRate::KilobitsPerSec(350)}, + {.width = 640, + .height = 360, + .max_layers = 2, + .max_bitrate = DataRate::KilobitsPerSec(700), + .target_bitrate = DataRate::KilobitsPerSec(500), + .min_bitrate = DataRate::KilobitsPerSec(150)}, + {.width = 480, + .height = 270, + .max_layers = 2, + .max_bitrate = DataRate::KilobitsPerSec(450), + .target_bitrate = DataRate::KilobitsPerSec(350), + .min_bitrate = DataRate::KilobitsPerSec(150)}, + {.width = 320, + .height = 180, + .max_layers = 1, + .max_bitrate = DataRate::KilobitsPerSec(200), + .target_bitrate = DataRate::KilobitsPerSec(150), + .min_bitrate = DataRate::KilobitsPerSec(30)}, // As the resolution goes down, interpolate the target and max bitrates down // towards zero. The min bitrate is still limited at 30 kbps and the target // and the max will be capped from below accordingly. - {0, 0, 1, DataRate::KilobitsPerSec(0), DataRate::KilobitsPerSec(0), - DataRate::KilobitsPerSec(30)}}; + {.width = 0, + .height = 0, + .max_layers = 1, + .max_bitrate = DataRate::KilobitsPerSec(0), + .target_bitrate = DataRate::KilobitsPerSec(0), + .min_bitrate = DataRate::KilobitsPerSec(30)}}; // These tables describe from which resolution we can use how many // simulcast layers at what bitrates (maximum, target, and minimum). // Important!! Keep this table from high resolution to low resolution. constexpr const SimulcastFormat kSimulcastFormatsVP9[] = { - {1920, 1080, 3, DataRate::KilobitsPerSec(3367), - DataRate::KilobitsPerSec(3367), DataRate::KilobitsPerSec(769)}, - {1280, 720, 3, DataRate::KilobitsPerSec(1524), - DataRate::KilobitsPerSec(1524), DataRate::KilobitsPerSec(481)}, - {960, 540, 3, DataRate::KilobitsPerSec(879), DataRate::KilobitsPerSec(879), - DataRate::KilobitsPerSec(337)}, - {640, 360, 2, DataRate::KilobitsPerSec(420), DataRate::KilobitsPerSec(420), - DataRate::KilobitsPerSec(193)}, - {480, 270, 2, DataRate::KilobitsPerSec(257), DataRate::KilobitsPerSec(257), - DataRate::KilobitsPerSec(121)}, - {320, 180, 1, DataRate::KilobitsPerSec(142), DataRate::KilobitsPerSec(142), - DataRate::KilobitsPerSec(30)}, - {240, 135, 1, DataRate::KilobitsPerSec(101), DataRate::KilobitsPerSec(101), - DataRate::KilobitsPerSec(30)}, + {.width = 1920, + .height = 1080, + .max_layers = 3, + .max_bitrate = DataRate::KilobitsPerSec(3367), + .target_bitrate = DataRate::KilobitsPerSec(3367), + .min_bitrate = DataRate::KilobitsPerSec(769)}, + {.width = 1280, + .height = 720, + .max_layers = 3, + .max_bitrate = DataRate::KilobitsPerSec(1524), + .target_bitrate = DataRate::KilobitsPerSec(1524), + .min_bitrate = DataRate::KilobitsPerSec(481)}, + {.width = 960, + .height = 540, + .max_layers = 3, + .max_bitrate = DataRate::KilobitsPerSec(879), + .target_bitrate = DataRate::KilobitsPerSec(879), + .min_bitrate = DataRate::KilobitsPerSec(337)}, + {.width = 640, + .height = 360, + .max_layers = 2, + .max_bitrate = DataRate::KilobitsPerSec(420), + .target_bitrate = DataRate::KilobitsPerSec(420), + .min_bitrate = DataRate::KilobitsPerSec(193)}, + {.width = 480, + .height = 270, + .max_layers = 2, + .max_bitrate = DataRate::KilobitsPerSec(257), + .target_bitrate = DataRate::KilobitsPerSec(257), + .min_bitrate = DataRate::KilobitsPerSec(121)}, + {.width = 320, + .height = 180, + .max_layers = 1, + .max_bitrate = DataRate::KilobitsPerSec(142), + .target_bitrate = DataRate::KilobitsPerSec(142), + .min_bitrate = DataRate::KilobitsPerSec(30)}, + {.width = 240, + .height = 135, + .max_layers = 1, + .max_bitrate = DataRate::KilobitsPerSec(101), + .target_bitrate = DataRate::KilobitsPerSec(101), + .min_bitrate = DataRate::KilobitsPerSec(30)}, // As the resolution goes down, interpolate the target and max bitrates down // towards zero. The min bitrate is still limited at 30 kbps and the target // and the max will be capped from below accordingly. - {0, 0, 1, DataRate::KilobitsPerSec(0), DataRate::KilobitsPerSec(0), - DataRate::KilobitsPerSec(30)}}; + {.width = 0, + .height = 0, + .max_layers = 1, + .max_bitrate = DataRate::KilobitsPerSec(0), + .target_bitrate = DataRate::KilobitsPerSec(0), + .min_bitrate = DataRate::KilobitsPerSec(30)}}; constexpr DataRate Interpolate(const DataRate& a, const DataRate& b, @@ -227,7 +287,12 @@ SimulcastFormat InterpolateSimulcastFormat( DataRate min_bitrate = Interpolate(formats[index - 1].min_bitrate, formats[index].min_bitrate, rate); - return {width, height, max_layers, max_bitrate, target_bitrate, min_bitrate}; + return {.width = width, + .height = height, + .max_layers = max_layers, + .max_bitrate = max_bitrate, + .target_bitrate = target_bitrate, + .min_bitrate = min_bitrate}; } std::vector<VideoStream> GetNormalSimulcastLayers( diff --git a/third_party/libwebrtc/video/end_to_end_tests/multi_stream_tester.cc b/third_party/libwebrtc/video/end_to_end_tests/multi_stream_tester.cc @@ -48,9 +48,9 @@ namespace webrtc { MultiStreamTester::MultiStreamTester() { // TODO(sprang): Cleanup when msvc supports explicit initializers for array. - codec_settings[0] = {1, 640, 480}; - codec_settings[1] = {2, 320, 240}; - codec_settings[2] = {3, 240, 160}; + codec_settings[0] = {.ssrc = 1, .width = 640, .height = 480}; + codec_settings[1] = {.ssrc = 2, .width = 320, .height = 240}; + codec_settings[2] = {.ssrc = 3, .width = 240, .height = 160}; } MultiStreamTester::~MultiStreamTester() = default; diff --git a/third_party/libwebrtc/video/end_to_end_tests/resolution_bitrate_limits_tests.cc b/third_party/libwebrtc/video/end_to_end_tests/resolution_bitrate_limits_tests.cc @@ -63,23 +63,28 @@ BitrateLimits GetLayerBitrateLimits(int pixels, const VideoCodec& codec) { ++i) { if (codec.spatialLayers[i].width * codec.spatialLayers[i].height == pixels) { - return {DataRate::KilobitsPerSec(codec.spatialLayers[i].minBitrate), - DataRate::KilobitsPerSec(codec.spatialLayers[i].maxBitrate)}; + return { + .min = DataRate::KilobitsPerSec(codec.spatialLayers[i].minBitrate), + .max = DataRate::KilobitsPerSec(codec.spatialLayers[i].maxBitrate)}; } } } else if (codec.codecType == VideoCodecType::kVideoCodecVP9) { for (size_t i = 0; i < codec.VP9().numberOfSpatialLayers; ++i) { if (codec.spatialLayers[i].width * codec.spatialLayers[i].height == pixels) { - return {DataRate::KilobitsPerSec(codec.spatialLayers[i].minBitrate), - DataRate::KilobitsPerSec(codec.spatialLayers[i].maxBitrate)}; + return { + .min = DataRate::KilobitsPerSec(codec.spatialLayers[i].minBitrate), + .max = DataRate::KilobitsPerSec(codec.spatialLayers[i].maxBitrate)}; } } } else { for (int i = 0; i < codec.numberOfSimulcastStreams; ++i) { if (codec.simulcastStream[i].width * codec.simulcastStream[i].height == pixels) { - return {DataRate::KilobitsPerSec(codec.simulcastStream[i].minBitrate), + return { + .min = + DataRate::KilobitsPerSec(codec.simulcastStream[i].minBitrate), + .max = DataRate::KilobitsPerSec(codec.simulcastStream[i].maxBitrate)}; } } @@ -233,25 +238,27 @@ TEST_P(ResolutionBitrateLimitsTest, LimitsApplied) { "min_bitrate_bps:32000," "max_bitrate_bps:3333000"); - InitEncodeTest test(env(), payload_name_, {{.active = true}}, - // Expectations: - {{.pixels = 1280 * 720, - .eq_bitrate = {DataRate::KilobitsPerSec(32), - DataRate::KilobitsPerSec(3333)}}}); + InitEncodeTest test( + env(), payload_name_, {{.active = true}}, + // Expectations: + {{.pixels = 1280 * 720, + .eq_bitrate = {.min = DataRate::KilobitsPerSec(32), + .max = DataRate::KilobitsPerSec(3333)}}}); RunBaseTest(&test); } TEST_F(ResolutionBitrateLimitsWithScalabilityModeTest, OneStreamDefaultMaxBitrateAppliedForOneSpatialLayer) { - InitEncodeTest test(env(), "VP9", - {{.active = true, - .bitrate = {DataRate::KilobitsPerSec(30), - DataRate::KilobitsPerSec(3000)}, - .scalability_mode = ScalabilityMode::kL1T1}}, - // Expectations: - {{.pixels = 1280 * 720, - .eq_bitrate = {DataRate::KilobitsPerSec(30), - DataRate::KilobitsPerSec(3000)}}}); + InitEncodeTest test( + env(), "VP9", + {{.active = true, + .bitrate = {.min = DataRate::KilobitsPerSec(30), + .max = DataRate::KilobitsPerSec(3000)}, + .scalability_mode = ScalabilityMode::kL1T1}}, + // Expectations: + {{.pixels = 1280 * 720, + .eq_bitrate = {.min = DataRate::KilobitsPerSec(30), + .max = DataRate::KilobitsPerSec(3000)}}}); RunBaseTest(&test); } @@ -260,12 +267,13 @@ TEST_F(ResolutionBitrateLimitsWithScalabilityModeTest, InitEncodeTest test( env(), "VP9", {{.active = true, - .bitrate = {DataRate::KilobitsPerSec(30), - DataRate::KilobitsPerSec(3000)}, + .bitrate = {.min = DataRate::KilobitsPerSec(30), + .max = DataRate::KilobitsPerSec(3000)}, .scalability_mode = ScalabilityMode::kL2T1}}, // Expectations: {{.pixels = 1280 * 720, - .ne_bitrate = {std::nullopt, DataRate::KilobitsPerSec(3000)}}}); + .ne_bitrate = {.min = std::nullopt, + .max = DataRate::KilobitsPerSec(3000)}}}); RunBaseTest(&test); } TEST_F(ResolutionBitrateLimitsWithScalabilityModeTest, @@ -281,8 +289,8 @@ TEST_F(ResolutionBitrateLimitsWithScalabilityModeTest, {{.active = true, .scalability_mode = ScalabilityMode::kL1T1}}, // Expectations: {{.pixels = 1280 * 720, - .eq_bitrate = {DataRate::KilobitsPerSec(32), - DataRate::KilobitsPerSec(3333)}}}); + .eq_bitrate = {.min = DataRate::KilobitsPerSec(32), + .max = DataRate::KilobitsPerSec(3333)}}}); RunBaseTest(&test); } @@ -299,23 +307,24 @@ TEST_F(ResolutionBitrateLimitsWithScalabilityModeTest, {{.active = true, .scalability_mode = ScalabilityMode::kL2T1}}, // Expectations: {{.pixels = 640 * 360, - .ne_bitrate = {DataRate::KilobitsPerSec(31), - DataRate::KilobitsPerSec(2222)}}, + .ne_bitrate = {.min = DataRate::KilobitsPerSec(31), + .max = DataRate::KilobitsPerSec(2222)}}, {.pixels = 1280 * 720, - .ne_bitrate = {DataRate::KilobitsPerSec(32), - DataRate::KilobitsPerSec(3333)}}}); + .ne_bitrate = {.min = DataRate::KilobitsPerSec(32), + .max = DataRate::KilobitsPerSec(3333)}}}); RunBaseTest(&test); } TEST_P(ResolutionBitrateLimitsTest, EncodingsApplied) { - InitEncodeTest test(env(), payload_name_, - {{.active = true, - .bitrate = {DataRate::KilobitsPerSec(22), - DataRate::KilobitsPerSec(3555)}}}, - // Expectations: - {{.pixels = 1280 * 720, - .eq_bitrate = {DataRate::KilobitsPerSec(22), - DataRate::KilobitsPerSec(3555)}}}); + InitEncodeTest test( + env(), payload_name_, + {{.active = true, + .bitrate = {.min = DataRate::KilobitsPerSec(22), + .max = DataRate::KilobitsPerSec(3555)}}}, + // Expectations: + {{.pixels = 1280 * 720, + .eq_bitrate = {.min = DataRate::KilobitsPerSec(22), + .max = DataRate::KilobitsPerSec(3555)}}}); RunBaseTest(&test); } @@ -326,14 +335,15 @@ TEST_P(ResolutionBitrateLimitsTest, IntersectionApplied) { "min_bitrate_bps:32000," "max_bitrate_bps:3333000"); - InitEncodeTest test(env(), payload_name_, - {{.active = true, - .bitrate = {DataRate::KilobitsPerSec(22), - DataRate::KilobitsPerSec(1555)}}}, - // Expectations: - {{.pixels = 1280 * 720, - .eq_bitrate = {DataRate::KilobitsPerSec(32), - DataRate::KilobitsPerSec(1555)}}}); + InitEncodeTest test( + env(), payload_name_, + {{.active = true, + .bitrate = {.min = DataRate::KilobitsPerSec(22), + .max = DataRate::KilobitsPerSec(1555)}}}, + // Expectations: + {{.pixels = 1280 * 720, + .eq_bitrate = {.min = DataRate::KilobitsPerSec(32), + .max = DataRate::KilobitsPerSec(1555)}}}); RunBaseTest(&test); } @@ -344,12 +354,13 @@ TEST_P(ResolutionBitrateLimitsTest, LimitsAppliedMiddleActive) { "min_bitrate_bps:21000|32000," "max_bitrate_bps:2222000|3333000"); - InitEncodeTest test(env(), payload_name_, - {{.active = false}, {.active = true}, {.active = false}}, - // Expectations: - {{.pixels = 640 * 360, - .eq_bitrate = {DataRate::KilobitsPerSec(21), - DataRate::KilobitsPerSec(2222)}}}); + InitEncodeTest test( + env(), payload_name_, + {{.active = false}, {.active = true}, {.active = false}}, + // Expectations: + {{.pixels = 640 * 360, + .eq_bitrate = {.min = DataRate::KilobitsPerSec(21), + .max = DataRate::KilobitsPerSec(2222)}}}); RunBaseTest(&test); } @@ -360,18 +371,19 @@ TEST_P(ResolutionBitrateLimitsTest, EncodingMinMaxBitrateAppliedMiddleActive) { "min_bitrate_bps:31000|32000," "max_bitrate_bps:1111000|3333000"); - InitEncodeTest test(env(), payload_name_, - {{.active = false, - .bitrate = {DataRate::KilobitsPerSec(28), - DataRate::KilobitsPerSec(1000)}}, - {.active = true, - .bitrate = {DataRate::KilobitsPerSec(28), - DataRate::KilobitsPerSec(1555)}}, - {.active = false}}, - // Expectations: - {{.pixels = 640 * 360, - .eq_bitrate = {DataRate::KilobitsPerSec(28), - DataRate::KilobitsPerSec(1555)}}}); + InitEncodeTest test( + env(), payload_name_, + {{.active = false, + .bitrate = {.min = DataRate::KilobitsPerSec(28), + .max = DataRate::KilobitsPerSec(1000)}}, + {.active = true, + .bitrate = {.min = DataRate::KilobitsPerSec(28), + .max = DataRate::KilobitsPerSec(1555)}}, + {.active = false}}, + // Expectations: + {{.pixels = 640 * 360, + .eq_bitrate = {.min = DataRate::KilobitsPerSec(28), + .max = DataRate::KilobitsPerSec(1555)}}}); RunBaseTest(&test); } @@ -386,12 +398,12 @@ TEST_P(ResolutionBitrateLimitsTest, MinBitrateNotAboveEncodingMax) { env(), payload_name_, {{.active = false}, {.active = true, - .bitrate = {std::nullopt, DataRate::KilobitsPerSec(25)}}, + .bitrate = {.min = std::nullopt, .max = DataRate::KilobitsPerSec(25)}}, {.active = false}}, // Expectations: {{.pixels = 640 * 360, - .eq_bitrate = {DataRate::KilobitsPerSec(25), - DataRate::KilobitsPerSec(25)}}}); + .eq_bitrate = {.min = DataRate::KilobitsPerSec(25), + .max = DataRate::KilobitsPerSec(25)}}}); RunBaseTest(&test); } @@ -405,14 +417,14 @@ TEST_P(ResolutionBitrateLimitsTest, MaxBitrateNotBelowEncodingMin) { InitEncodeTest test( env(), payload_name_, {{.active = false, - .bitrate = {DataRate::KilobitsPerSec(50), std::nullopt}}, + .bitrate = {.min = DataRate::KilobitsPerSec(50), .max = std::nullopt}}, {.active = true, - .bitrate = {DataRate::KilobitsPerSec(50), std::nullopt}}, + .bitrate = {.min = DataRate::KilobitsPerSec(50), .max = std::nullopt}}, {.active = false}}, // Expectations: {{.pixels = 640 * 360, - .eq_bitrate = {DataRate::KilobitsPerSec(50), - DataRate::KilobitsPerSec(50)}}}); + .eq_bitrate = {.min = DataRate::KilobitsPerSec(50), + .max = DataRate::KilobitsPerSec(50)}}}); RunBaseTest(&test); } @@ -427,10 +439,10 @@ TEST_P(ResolutionBitrateLimitsTest, DefaultLimitsAppliedMiddleActive) { {{.active = false}, {.active = true}, {.active = false}}, // Expectations: {{.pixels = 640 * 360, - .eq_bitrate = { - DataRate::BitsPerSec(kDefaultSinglecastLimits360p->min_bitrate_bps), - DataRate::BitsPerSec( - kDefaultSinglecastLimits360p->max_bitrate_bps)}}}); + .eq_bitrate = {.min = DataRate::BitsPerSec( + kDefaultSinglecastLimits360p->min_bitrate_bps), + .max = DataRate::BitsPerSec( + kDefaultSinglecastLimits360p->max_bitrate_bps)}}}); RunBaseTest(&test); } @@ -447,10 +459,10 @@ TEST_F(ResolutionBitrateLimitsWithScalabilityModeTest, {.active = false}}, // Expectations: {{.pixels = 1280 * 720, - .eq_bitrate = { - DataRate::BitsPerSec(kDefaultSinglecastLimits720p->min_bitrate_bps), - DataRate::BitsPerSec( - kDefaultSinglecastLimits720p->max_bitrate_bps)}}}); + .eq_bitrate = {.min = DataRate::BitsPerSec( + kDefaultSinglecastLimits720p->min_bitrate_bps), + .max = DataRate::BitsPerSec( + kDefaultSinglecastLimits720p->max_bitrate_bps)}}}); RunBaseTest(&test); } @@ -461,12 +473,13 @@ TEST_P(ResolutionBitrateLimitsTest, LimitsAppliedHighestActive) { "min_bitrate_bps:31000|32000," "max_bitrate_bps:2222000|3333000"); - InitEncodeTest test(env(), payload_name_, - {{.active = false}, {.active = false}, {.active = true}}, - // Expectations: - {{.pixels = 1280 * 720, - .eq_bitrate = {DataRate::KilobitsPerSec(32), - DataRate::KilobitsPerSec(3333)}}}); + InitEncodeTest test( + env(), payload_name_, + {{.active = false}, {.active = false}, {.active = true}}, + // Expectations: + {{.pixels = 1280 * 720, + .eq_bitrate = {.min = DataRate::KilobitsPerSec(32), + .max = DataRate::KilobitsPerSec(3333)}}}); RunBaseTest(&test); } @@ -477,20 +490,21 @@ TEST_P(ResolutionBitrateLimitsTest, EncodingMinMaxBitrateAppliedHighestActive) { "min_bitrate_bps:31000|32000," "max_bitrate_bps:555000|1111000"); - InitEncodeTest test(env(), payload_name_, - {{.active = false, - .bitrate = {DataRate::KilobitsPerSec(28), - DataRate::KilobitsPerSec(500)}}, - {.active = false, - .bitrate = {DataRate::KilobitsPerSec(28), - DataRate::KilobitsPerSec(1000)}}, - {.active = true, - .bitrate = {DataRate::KilobitsPerSec(28), - DataRate::KilobitsPerSec(1555)}}}, - // Expectations: - {{.pixels = 1280 * 720, - .eq_bitrate = {DataRate::KilobitsPerSec(28), - DataRate::KilobitsPerSec(1555)}}}); + InitEncodeTest test( + env(), payload_name_, + {{.active = false, + .bitrate = {.min = DataRate::KilobitsPerSec(28), + .max = DataRate::KilobitsPerSec(500)}}, + {.active = false, + .bitrate = {.min = DataRate::KilobitsPerSec(28), + .max = DataRate::KilobitsPerSec(1000)}}, + {.active = true, + .bitrate = {.min = DataRate::KilobitsPerSec(28), + .max = DataRate::KilobitsPerSec(1555)}}}, + // Expectations: + {{.pixels = 1280 * 720, + .eq_bitrate = {.min = DataRate::KilobitsPerSec(28), + .max = DataRate::KilobitsPerSec(1555)}}}); RunBaseTest(&test); } @@ -501,15 +515,15 @@ TEST_P(ResolutionBitrateLimitsTest, LimitsNotAppliedLowestActive) { "min_bitrate_bps:31000|32000," "max_bitrate_bps:2222000|3333000"); - InitEncodeTest test(env(), payload_name_, - {{.active = true}, {.active = false}}, - // Expectations: - {{.pixels = 640 * 360, - .ne_bitrate = {DataRate::KilobitsPerSec(31), - DataRate::KilobitsPerSec(2222)}}, - {.pixels = 1280 * 720, - .ne_bitrate = {DataRate::KilobitsPerSec(32), - DataRate::KilobitsPerSec(3333)}}}); + InitEncodeTest test( + env(), payload_name_, {{.active = true}, {.active = false}}, + // Expectations: + {{.pixels = 640 * 360, + .ne_bitrate = {.min = DataRate::KilobitsPerSec(31), + .max = DataRate::KilobitsPerSec(2222)}}, + {.pixels = 1280 * 720, + .ne_bitrate = {.min = DataRate::KilobitsPerSec(32), + .max = DataRate::KilobitsPerSec(3333)}}}); RunBaseTest(&test); } @@ -527,8 +541,8 @@ TEST_F(ResolutionBitrateLimitsWithScalabilityModeTest, {.active = false}}, // Expectations: {{.pixels = 1280 * 720, - .eq_bitrate = {DataRate::KilobitsPerSec(32), - DataRate::KilobitsPerSec(3333)}}}); + .eq_bitrate = {.min = DataRate::KilobitsPerSec(32), + .max = DataRate::KilobitsPerSec(3333)}}}); RunBaseTest(&test); } @@ -546,11 +560,11 @@ TEST_F(ResolutionBitrateLimitsWithScalabilityModeTest, {.active = false}}, // Expectations: {{.pixels = 640 * 360, - .ne_bitrate = {DataRate::KilobitsPerSec(31), - DataRate::KilobitsPerSec(2222)}}, + .ne_bitrate = {.min = DataRate::KilobitsPerSec(31), + .max = DataRate::KilobitsPerSec(2222)}}, {.pixels = 1280 * 720, - .ne_bitrate = {DataRate::KilobitsPerSec(32), - DataRate::KilobitsPerSec(3333)}}}); + .ne_bitrate = {.min = DataRate::KilobitsPerSec(32), + .max = DataRate::KilobitsPerSec(3333)}}}); RunBaseTest(&test); } @@ -567,8 +581,8 @@ TEST_F(ResolutionBitrateLimitsWithScalabilityModeTest, {{.active = true, .scalability_mode = ScalabilityMode::kL1T1}}, // Expectations: {{.pixels = 1280 * 720, - .eq_bitrate = {DataRate::KilobitsPerSec(32), - DataRate::KilobitsPerSec(133)}}}); + .eq_bitrate = {.min = DataRate::KilobitsPerSec(32), + .max = DataRate::KilobitsPerSec(133)}}}); RunBaseTest(&test); } @@ -586,8 +600,8 @@ TEST_F(ResolutionBitrateLimitsWithScalabilityModeTest, {.active = false}}, // Expectations: {{.pixels = 1280 * 720, - .eq_bitrate = {DataRate::KilobitsPerSec(80), - DataRate::KilobitsPerSec(1200)}}}); + .eq_bitrate = {.min = DataRate::KilobitsPerSec(80), + .max = DataRate::KilobitsPerSec(1200)}}}); RunBaseTest(&test); } @@ -601,14 +615,14 @@ TEST_F(ResolutionBitrateLimitsWithScalabilityModeTest, InitEncodeTest test(env(), "AV1", {{.active = true, - .bitrate = {DataRate::KilobitsPerSec(28), - DataRate::KilobitsPerSec(100)}, + .bitrate = {.min = DataRate::KilobitsPerSec(28), + .max = DataRate::KilobitsPerSec(100)}, .scalability_mode = ScalabilityMode::kL1T1}, {.active = false}}, // Expectations: {{.pixels = 1280 * 720, - .eq_bitrate = {DataRate::KilobitsPerSec(28), - DataRate::KilobitsPerSec(100)}}}); + .eq_bitrate = {.min = DataRate::KilobitsPerSec(28), + .max = DataRate::KilobitsPerSec(100)}}}); RunBaseTest(&test); } @@ -626,11 +640,11 @@ TEST_F(ResolutionBitrateLimitsWithScalabilityModeTest, {.active = false}}, // Expectations: {{.pixels = 640 * 360, - .ne_bitrate = {DataRate::KilobitsPerSec(20), - DataRate::KilobitsPerSec(900)}}, + .ne_bitrate = {.min = DataRate::KilobitsPerSec(20), + .max = DataRate::KilobitsPerSec(900)}}, {.pixels = 1280 * 720, - .ne_bitrate = {DataRate::KilobitsPerSec(25), - DataRate::KilobitsPerSec(1333)}}}); + .ne_bitrate = {.min = DataRate::KilobitsPerSec(25), + .max = DataRate::KilobitsPerSec(1333)}}}); RunBaseTest(&test); } @@ -641,15 +655,15 @@ TEST_P(ResolutionBitrateLimitsTest, LimitsNotAppliedSimulcast) { "min_bitrate_bps:31000|32000," "max_bitrate_bps:2222000|3333000"); - InitEncodeTest test(env(), payload_name_, - {{.active = true}, {.active = true}}, - // Expectations: - {{.pixels = 640 * 360, - .ne_bitrate = {DataRate::KilobitsPerSec(31), - DataRate::KilobitsPerSec(2222)}}, - {.pixels = 1280 * 720, - .ne_bitrate = {DataRate::KilobitsPerSec(32), - DataRate::KilobitsPerSec(3333)}}}); + InitEncodeTest test( + env(), payload_name_, {{.active = true}, {.active = true}}, + // Expectations: + {{.pixels = 640 * 360, + .ne_bitrate = {.min = DataRate::KilobitsPerSec(31), + .max = DataRate::KilobitsPerSec(2222)}}, + {.pixels = 1280 * 720, + .ne_bitrate = {.min = DataRate::KilobitsPerSec(32), + .max = DataRate::KilobitsPerSec(3333)}}}); RunBaseTest(&test); } diff --git a/third_party/libwebrtc/video/frame_cadence_adapter_unittest.cc b/third_party/libwebrtc/video/frame_cadence_adapter_unittest.cc @@ -139,7 +139,8 @@ TEST(FrameCadenceAdapterTest, FrameRateFollowsMaxFpsWhenZeroHertzActivated) { adapter->Initialize(&callback); adapter->SetZeroHertzModeEnabled( FrameCadenceAdapterInterface::ZeroHertzModeParams{}); - adapter->OnConstraintsChanged(VideoTrackSourceConstraints{0, 1}); + adapter->OnConstraintsChanged( + VideoTrackSourceConstraints{.min_fps = 0, .max_fps = 1}); for (int frame = 0; frame != 10; ++frame) { time_controller.AdvanceTime(TimeDelta::Millis(10)); // FrameCadanceAdapter::OnFrame post the frame to another sequence. @@ -157,12 +158,14 @@ TEST(FrameCadenceAdapterTest, ZeroHertzAdapterSupportsMaxFpsChange) { adapter->Initialize(&callback); adapter->SetZeroHertzModeEnabled( FrameCadenceAdapterInterface::ZeroHertzModeParams{}); - adapter->OnConstraintsChanged(VideoTrackSourceConstraints{0, 1}); + adapter->OnConstraintsChanged( + VideoTrackSourceConstraints{.min_fps = 0, .max_fps = 1}); time_controller.AdvanceTime(TimeDelta::Zero()); EXPECT_EQ(adapter->GetInputFrameRateFps(), 1u); adapter->OnFrame(CreateFrame()); time_controller.AdvanceTime(TimeDelta::Seconds(1)); - adapter->OnConstraintsChanged(VideoTrackSourceConstraints{0, 2}); + adapter->OnConstraintsChanged( + VideoTrackSourceConstraints{.min_fps = 0, .max_fps = 2}); time_controller.AdvanceTime(TimeDelta::Zero()); EXPECT_EQ(adapter->GetInputFrameRateFps(), 2u); adapter->OnFrame(CreateFrame()); @@ -181,7 +184,8 @@ TEST(FrameCadenceAdapterTest, adapter->Initialize(&callback); adapter->SetZeroHertzModeEnabled( FrameCadenceAdapterInterface::ZeroHertzModeParams{}); - adapter->OnConstraintsChanged(VideoTrackSourceConstraints{0, 1}); + adapter->OnConstraintsChanged( + VideoTrackSourceConstraints{.min_fps = 0, .max_fps = 1}); RateStatistics rate( FrameCadenceAdapterInterface::kFrameRateAveragingWindowSizeMs, 1000); constexpr int MAX = 10; @@ -211,7 +215,8 @@ TEST(FrameCadenceAdapterTest, ForwardsFramesDelayed) { adapter->Initialize(&callback); adapter->SetZeroHertzModeEnabled( FrameCadenceAdapterInterface::ZeroHertzModeParams{}); - adapter->OnConstraintsChanged(VideoTrackSourceConstraints{0, 1}); + adapter->OnConstraintsChanged( + VideoTrackSourceConstraints{.min_fps = 0, .max_fps = 1}); constexpr int kNumFrames = 3; NtpTime original_ntp_time = time_controller.GetClock()->CurrentNtpTime(); auto frame = CreateFrameWithTimestamps(&time_controller); @@ -241,7 +246,8 @@ TEST(FrameCadenceAdapterTest, DelayedProcessingUnderSlightContention) { adapter->Initialize(&callback); adapter->SetZeroHertzModeEnabled( FrameCadenceAdapterInterface::ZeroHertzModeParams{}); - adapter->OnConstraintsChanged(VideoTrackSourceConstraints{0, 1}); + adapter->OnConstraintsChanged( + VideoTrackSourceConstraints{.min_fps = 0, .max_fps = 1}); // Expect frame delivery at 1 sec despite target sequence not running // callbacks for the time skipped. @@ -263,7 +269,8 @@ TEST(FrameCadenceAdapterTest, DelayedProcessingUnderHeavyContention) { adapter->Initialize(&callback); adapter->SetZeroHertzModeEnabled( FrameCadenceAdapterInterface::ZeroHertzModeParams{}); - adapter->OnConstraintsChanged(VideoTrackSourceConstraints{0, 1}); + adapter->OnConstraintsChanged( + VideoTrackSourceConstraints{.min_fps = 0, .max_fps = 1}); // Expect frame delivery at origin + `time_skipped` when the target sequence // is not running callbacks for the initial 1+ sec. @@ -291,7 +298,8 @@ TEST(FrameCadenceAdapterTest, RepeatsFramesDelayed) { adapter->Initialize(&callback); adapter->SetZeroHertzModeEnabled( FrameCadenceAdapterInterface::ZeroHertzModeParams{}); - adapter->OnConstraintsChanged(VideoTrackSourceConstraints{0, 1}); + adapter->OnConstraintsChanged( + VideoTrackSourceConstraints{.min_fps = 0, .max_fps = 1}); NtpTime original_ntp_time = time_controller.GetClock()->CurrentNtpTime(); // Send one frame, expect 2 subsequent repeats. @@ -345,7 +353,8 @@ TEST(FrameCadenceAdapterTest, adapter->Initialize(&callback); adapter->SetZeroHertzModeEnabled( FrameCadenceAdapterInterface::ZeroHertzModeParams{}); - adapter->OnConstraintsChanged(VideoTrackSourceConstraints{0, 1}); + adapter->OnConstraintsChanged( + VideoTrackSourceConstraints{.min_fps = 0, .max_fps = 1}); // Send one frame, expect a repeat. adapter->OnFrame(CreateFrame()); @@ -378,7 +387,8 @@ TEST(FrameCadenceAdapterTest, StopsRepeatingFramesDelayed) { adapter->Initialize(&callback); adapter->SetZeroHertzModeEnabled( FrameCadenceAdapterInterface::ZeroHertzModeParams{}); - adapter->OnConstraintsChanged(VideoTrackSourceConstraints{0, 1}); + adapter->OnConstraintsChanged( + VideoTrackSourceConstraints{.min_fps = 0, .max_fps = 1}); NtpTime original_ntp_time = time_controller.GetClock()->CurrentNtpTime(); // Send one frame, expect 1 subsequent repeat. @@ -407,7 +417,8 @@ TEST(FrameCadenceAdapterTest, RequestsRefreshFrameOnKeyFrameRequestWhenNew) { adapter->SetZeroHertzModeEnabled( FrameCadenceAdapterInterface::ZeroHertzModeParams{}); constexpr int kMaxFps = 10; - adapter->OnConstraintsChanged(VideoTrackSourceConstraints{0, kMaxFps}); + adapter->OnConstraintsChanged( + VideoTrackSourceConstraints{.min_fps = 0, .max_fps = kMaxFps}); EXPECT_CALL(callback, RequestRefreshFrame); time_controller.AdvanceTime( TimeDelta::Seconds(1) * @@ -424,7 +435,8 @@ TEST(FrameCadenceAdapterTest, IgnoresKeyFrameRequestShortlyAfterFrame) { adapter->Initialize(&callback); adapter->SetZeroHertzModeEnabled( FrameCadenceAdapterInterface::ZeroHertzModeParams{}); - adapter->OnConstraintsChanged(VideoTrackSourceConstraints{0, 10}); + adapter->OnConstraintsChanged( + VideoTrackSourceConstraints{.min_fps = 0, .max_fps = 10}); adapter->OnFrame(CreateFrame()); time_controller.AdvanceTime(TimeDelta::Zero()); EXPECT_CALL(callback, RequestRefreshFrame).Times(0); @@ -440,7 +452,8 @@ TEST(FrameCadenceAdapterTest, RequestsRefreshFramesUntilArrival) { adapter->SetZeroHertzModeEnabled( FrameCadenceAdapterInterface::ZeroHertzModeParams{}); constexpr int kMaxFps = 10; - adapter->OnConstraintsChanged(VideoTrackSourceConstraints{0, kMaxFps}); + adapter->OnConstraintsChanged( + VideoTrackSourceConstraints{.min_fps = 0, .max_fps = kMaxFps}); // We should see max_fps + 1 - // FrameCadenceAdapterInterface::kOnDiscardedFrameRefreshFramePeriod refresh @@ -466,7 +479,8 @@ TEST(FrameCadenceAdapterTest, RequestsRefreshAfterFrameDrop) { adapter->SetZeroHertzModeEnabled( FrameCadenceAdapterInterface::ZeroHertzModeParams{}); constexpr int kMaxFps = 10; - adapter->OnConstraintsChanged(VideoTrackSourceConstraints{0, kMaxFps}); + adapter->OnConstraintsChanged( + VideoTrackSourceConstraints{.min_fps = 0, .max_fps = kMaxFps}); EXPECT_CALL(callback, RequestRefreshFrame).Times(0); @@ -507,7 +521,8 @@ TEST(FrameCadenceAdapterTest, OmitsRefreshAfterFrameDropWithTimelyFrameEntry) { adapter->SetZeroHertzModeEnabled( FrameCadenceAdapterInterface::ZeroHertzModeParams{}); constexpr int kMaxFps = 10; - adapter->OnConstraintsChanged(VideoTrackSourceConstraints{0, kMaxFps}); + adapter->OnConstraintsChanged( + VideoTrackSourceConstraints{.min_fps = 0, .max_fps = kMaxFps}); // Send a frame through to cancel the initial delayed timer waiting for first // frame entry. @@ -547,7 +562,8 @@ TEST(FrameCadenceAdapterTest, AcceptsUnconfiguredLayerFeedback) { FrameCadenceAdapterInterface::ZeroHertzModeParams{.num_simulcast_layers = 1}); constexpr int kMaxFps = 10; - adapter->OnConstraintsChanged(VideoTrackSourceConstraints{0, kMaxFps}); + adapter->OnConstraintsChanged( + VideoTrackSourceConstraints{.min_fps = 0, .max_fps = kMaxFps}); time_controller.AdvanceTime(TimeDelta::Zero()); adapter->UpdateLayerQualityConvergence(2, false); @@ -570,7 +586,8 @@ TEST(FrameCadenceAdapterTest, IgnoresDropInducedCallbacksPostDestruction) { }); time_controller.AdvanceTime(TimeDelta::Zero()); constexpr int kMaxFps = 10; - adapter->OnConstraintsChanged(VideoTrackSourceConstraints{0, kMaxFps}); + adapter->OnConstraintsChanged( + VideoTrackSourceConstraints{.min_fps = 0, .max_fps = kMaxFps}); adapter->OnDiscardedFrame(); time_controller.AdvanceTime(TimeDelta::Zero()); callback = nullptr; @@ -693,7 +710,8 @@ class FrameCadenceAdapterSimulcastLayersParamTest FrameCadenceAdapterSimulcastLayersParamTest() { adapter_->Initialize(&callback_); - adapter_->OnConstraintsChanged(VideoTrackSourceConstraints{0, kMaxFpsHz}); + adapter_->OnConstraintsChanged( + VideoTrackSourceConstraints{.min_fps = 0, .max_fps = kMaxFpsHz}); time_controller_.AdvanceTime(TimeDelta::Zero()); adapter_->SetZeroHertzModeEnabled( FrameCadenceAdapterInterface::ZeroHertzModeParams{}); @@ -813,7 +831,7 @@ class ZeroHertzLayerQualityConvergenceTest : public ::testing::Test { FrameCadenceAdapterInterface::ZeroHertzModeParams{ /*num_simulcast_layers=*/2}); adapter_->OnConstraintsChanged(VideoTrackSourceConstraints{ - /*min_fps=*/0, /*max_fps=*/TimeDelta::Seconds(1) / kMinFrameDelay}); + .min_fps = 0, .max_fps = TimeDelta::Seconds(1) / kMinFrameDelay}); time_controller_.AdvanceTime(TimeDelta::Zero()); } @@ -960,13 +978,12 @@ TEST_F(ZeroHertzLayerQualityConvergenceTest, }); ScheduleDelayed(2.5 * kMinFrameDelay, [&] { adapter_->OnConstraintsChanged(VideoTrackSourceConstraints{ - /*min_fps=*/0, /*max_fps=*/2 * TimeDelta::Seconds(1) / kMinFrameDelay}); + .min_fps = 0, .max_fps = 2 * TimeDelta::Seconds(1) / kMinFrameDelay}); }); ScheduleDelayed(3 * kMinFrameDelay, [&] { PassFrame(); }); ScheduleDelayed(8 * kMinFrameDelay, [&] { adapter_->OnConstraintsChanged(VideoTrackSourceConstraints{ - /*min_fps=*/0, - /*max_fps=*/0.2 * TimeDelta::Seconds(1) / kMinFrameDelay}); + .min_fps = 0, .max_fps = 0.2 * TimeDelta::Seconds(1) / kMinFrameDelay}); }); ScheduleDelayed(9 * kMinFrameDelay, [&] { PassFrame(); }); ExpectFrameEntriesAtDelaysFromNow({ @@ -1036,7 +1053,8 @@ TEST(FrameCadenceAdapterRealTimeTest, TimestampsDoNotDrift) { adapter->Initialize(&callback); adapter->SetZeroHertzModeEnabled( FrameCadenceAdapterInterface::ZeroHertzModeParams{}); - adapter->OnConstraintsChanged(VideoTrackSourceConstraints{0, 30}); + adapter->OnConstraintsChanged( + VideoTrackSourceConstraints{.min_fps = 0, .max_fps = 30}); auto frame = CreateFrame(); original_ntp_time_ms = clock->CurrentNtpInMilliseconds(); frame.set_ntp_time_ms(original_ntp_time_ms); @@ -1091,7 +1109,8 @@ TEST(FrameCadenceAdapterRealTimeTest, ScheduledRepeatAllowsForSlowEncode) { adapter->Initialize(&callback); adapter->SetZeroHertzModeEnabled( FrameCadenceAdapterInterface::ZeroHertzModeParams{}); - adapter->OnConstraintsChanged(VideoTrackSourceConstraints{0, 2}); + adapter->OnConstraintsChanged( + VideoTrackSourceConstraints{.min_fps = 0, .max_fps = 2}); auto frame = CreateFrame(); constexpr int kSleepMs = 400; constexpr TimeDelta kAllowedBelate = TimeDelta::Millis(150); diff --git a/third_party/libwebrtc/video/frame_encode_metadata_writer.cc b/third_party/libwebrtc/video/frame_encode_metadata_writer.cc @@ -73,7 +73,8 @@ FrameEncodeMetadataWriter::FrameEncodeMetadataWriter( last_timing_frame_time_ms_(-1), reordered_frames_logged_messages_(0), stalled_encoder_logged_messages_(0) { - codec_settings_.timing_frame_thresholds = {-1, 0}; + codec_settings_.timing_frame_thresholds = {.delay_ms = -1, + .outlier_ratio_percent = 0}; } FrameEncodeMetadataWriter::~FrameEncodeMetadataWriter() {} diff --git a/third_party/libwebrtc/video/frame_encode_metadata_writer_unittest.cc b/third_party/libwebrtc/video/frame_encode_metadata_writer_unittest.cc @@ -89,8 +89,9 @@ std::vector<std::vector<FrameType>> GetTimingFrames( FrameEncodeMetadataWriter encode_timer(CreateTestEnvironment(), &sink); VideoCodec codec_settings; codec_settings.numberOfSimulcastStreams = num_streams; - codec_settings.timing_frame_thresholds = {delay_ms, - kDefaultOutlierFrameSizePercent}; + codec_settings.timing_frame_thresholds = { + .delay_ms = delay_ms, + .outlier_ratio_percent = kDefaultOutlierFrameSizePercent}; encode_timer.OnEncoderInit(codec_settings); const size_t kFramerate = 30; VideoBitrateAllocation bitrate_allocation; diff --git a/third_party/libwebrtc/video/full_stack_tests.cc b/third_party/libwebrtc/video/full_stack_tests.cc @@ -50,9 +50,10 @@ struct ParamsWithLogging : public VideoQualityTest::Params { public: ParamsWithLogging() { // Use these logging flags by default, for everything. - logging = {absl::GetFlag(FLAGS_rtc_event_log_name), - absl::GetFlag(FLAGS_rtp_dump_name), - absl::GetFlag(FLAGS_encoded_frame_path)}; + logging = { + .rtc_event_log_name = absl::GetFlag(FLAGS_rtc_event_log_name), + .rtp_dump_name = absl::GetFlag(FLAGS_rtp_dump_name), + .encoded_frame_base_path = absl::GetFlag(FLAGS_encoded_frame_path)}; this->config = BuiltInNetworkBehaviorConfig(); } }; @@ -77,13 +78,26 @@ TEST(FullStackTest, Foreman_Cif_Net_Delay_0_0_Plr_0_VP9) { VideoQualityTest fixture; ParamsWithLogging foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video[0] = { - true, 352, 288, 30, - 700000, 700000, 700000, false, - "VP9", 1, 0, 0, - false, false, true, ClipNameToClipPath("foreman_cif")}; - foreman_cif.analyzer = {"foreman_cif_net_delay_0_0_plr_0_VP9", 0.0, 0.0, - kFullStackTestDurationSecs}; + foreman_cif.video[0] = {.enabled = true, + .width = 352, + .height = 288, + .fps = 30, + .min_bitrate_bps = 700000, + .target_bitrate_bps = 700000, + .max_bitrate_bps = 700000, + .suspend_below_min_bitrate = false, + .codec = "VP9", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = true, + .clip_path = ClipNameToClipPath("foreman_cif")}; + foreman_cif.analyzer = {.test_label = "foreman_cif_net_delay_0_0_plr_0_VP9", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; fixture.RunWithAnalyzer(foreman_cif); } @@ -92,13 +106,27 @@ TEST(GenericDescriptorTest, VideoQualityTest fixture; ParamsWithLogging foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video[0] = { - true, 352, 288, 30, - 30000, 500000, 2000000, false, - "VP9", 1, 0, 0, - false, false, true, ClipNameToClipPath("foreman_cif")}; - foreman_cif.analyzer = {"foreman_cif_delay_50_0_plr_5_VP9_generic_descriptor", - 0.0, 0.0, kFullStackTestDurationSecs}; + foreman_cif.video[0] = {.enabled = true, + .width = 352, + .height = 288, + .fps = 30, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 500000, + .max_bitrate_bps = 2000000, + .suspend_below_min_bitrate = false, + .codec = "VP9", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = true, + .clip_path = ClipNameToClipPath("foreman_cif")}; + foreman_cif.analyzer = { + .test_label = "foreman_cif_delay_50_0_plr_5_VP9_generic_descriptor", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; foreman_cif.config->loss_percent = 5; foreman_cif.config->queue_delay_ms = 50; foreman_cif.call.generic_descriptor = true; @@ -123,11 +151,29 @@ TEST(FullStackTest, Generator_Net_Delay_0_0_Plr_0_VP9Profile2) { {kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile2)}}; ParamsWithLogging generator; generator.call.send_side_bwe = true; - generator.video[0] = { - true, 352, 288, 30, 700000, 700000, 700000, false, "VP9", - 1, 0, 0, false, false, true, "GeneratorI010", 0, vp92}; - generator.analyzer = {"generator_net_delay_0_0_plr_0_VP9Profile2", 0.0, 0.0, - kFullStackTestDurationSecs}; + generator.video[0] = {.enabled = true, + .width = 352, + .height = 288, + .fps = 30, + .min_bitrate_bps = 700000, + .target_bitrate_bps = 700000, + .max_bitrate_bps = 700000, + .suspend_below_min_bitrate = false, + .codec = "VP9", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = true, + .clip_path = "GeneratorI010", + .capture_device_index = 0, + .sdp_params = vp92}; + generator.analyzer = { + .test_label = "generator_net_delay_0_0_plr_0_VP9Profile2", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; fixture.RunWithAnalyzer(generator); } @@ -143,13 +189,26 @@ TEST(FullStackTest, MAYBE_Net_Delay_0_0_Plr_0) { VideoQualityTest fixture; ParamsWithLogging paris_qcif; paris_qcif.call.send_side_bwe = true; - paris_qcif.video[0] = { - true, 176, 144, 30, - 300000, 300000, 300000, false, - "VP8", 1, 0, 0, - false, false, true, ClipNameToClipPath("paris_qcif")}; - paris_qcif.analyzer = {"net_delay_0_0_plr_0", 36.0, 0.96, - kFullStackTestDurationSecs}; + paris_qcif.video[0] = {.enabled = true, + .width = 176, + .height = 144, + .fps = 30, + .min_bitrate_bps = 300000, + .target_bitrate_bps = 300000, + .max_bitrate_bps = 300000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = true, + .clip_path = ClipNameToClipPath("paris_qcif")}; + paris_qcif.analyzer = {.test_label = "net_delay_0_0_plr_0", + .avg_psnr_threshold = 36.0, + .avg_ssim_threshold = 0.96, + .test_durations_secs = kFullStackTestDurationSecs}; fixture.RunWithAnalyzer(paris_qcif); } @@ -159,13 +218,27 @@ TEST(GenericDescriptorTest, // TODO(pbos): Decide on psnr/ssim thresholds for foreman_cif. ParamsWithLogging foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video[0] = { - true, 352, 288, 30, - 700000, 700000, 700000, false, - "VP8", 1, 0, 0, - false, false, true, ClipNameToClipPath("foreman_cif")}; - foreman_cif.analyzer = {"foreman_cif_net_delay_0_0_plr_0_generic_descriptor", - 0.0, 0.0, kFullStackTestDurationSecs}; + foreman_cif.video[0] = {.enabled = true, + .width = 352, + .height = 288, + .fps = 30, + .min_bitrate_bps = 700000, + .target_bitrate_bps = 700000, + .max_bitrate_bps = 700000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = true, + .clip_path = ClipNameToClipPath("foreman_cif")}; + foreman_cif.analyzer = { + .test_label = "foreman_cif_net_delay_0_0_plr_0_generic_descriptor", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; foreman_cif.call.generic_descriptor = true; fixture.RunWithAnalyzer(foreman_cif); } @@ -175,14 +248,27 @@ TEST(GenericDescriptorTest, VideoQualityTest fixture; ParamsWithLogging foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video[0] = { - true, 352, 288, 10, - 30000, 30000, 30000, false, - "VP8", 1, 0, 0, - false, false, true, ClipNameToClipPath("foreman_cif")}; + foreman_cif.video[0] = {.enabled = true, + .width = 352, + .height = 288, + .fps = 10, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 30000, + .max_bitrate_bps = 30000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = true, + .clip_path = ClipNameToClipPath("foreman_cif")}; foreman_cif.analyzer = { - "foreman_cif_30kbps_net_delay_0_0_plr_0_generic_descriptor", 0.0, 0.0, - kFullStackTestDurationSecs}; + .test_label = "foreman_cif_30kbps_net_delay_0_0_plr_0_generic_descriptor", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; foreman_cif.call.generic_descriptor = true; fixture.RunWithAnalyzer(foreman_cif); } @@ -192,13 +278,27 @@ TEST(FullStackTest, Foreman_Cif_Link_150kbps_Net_Delay_0_0_Plr_0) { VideoQualityTest fixture; ParamsWithLogging foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video[0] = { - true, 352, 288, 30, - 30000, 500000, 2000000, false, - "VP8", 1, 0, 0, - false, false, true, ClipNameToClipPath("foreman_cif")}; - foreman_cif.analyzer = {"foreman_cif_link_150kbps_net_delay_0_0_plr_0", 0.0, - 0.0, kFullStackTestDurationSecs}; + foreman_cif.video[0] = {.enabled = true, + .width = 352, + .height = 288, + .fps = 30, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 500000, + .max_bitrate_bps = 2000000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = true, + .clip_path = ClipNameToClipPath("foreman_cif")}; + foreman_cif.analyzer = { + .test_label = "foreman_cif_link_150kbps_net_delay_0_0_plr_0", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; foreman_cif.config->link_capacity = DataRate::KilobitsPerSec(150); fixture.RunWithAnalyzer(foreman_cif); } @@ -209,15 +309,31 @@ TEST(FullStackTest, VideoQualityTest fixture; ParamsWithLogging foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video[0] = { - true, 352, 288, 30, - 30000, 500000, 2000000, false, - "VP8", 1, 0, 0, - false, false, true, ClipNameToClipPath("foreman_cif"), - 0, {}, 1.30}; + foreman_cif.video[0] = {.enabled = true, + .width = 352, + .height = 288, + .fps = 30, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 500000, + .max_bitrate_bps = 2000000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = true, + .clip_path = ClipNameToClipPath("foreman_cif"), + .capture_device_index = 0, + .sdp_params = {}, + .encoder_overshoot_factor = 1.30}; foreman_cif.analyzer = { - "foreman_cif_link_150kbps_delay100ms_30pkts_queue_overshoot30", 0.0, 0.0, - kFullStackTestDurationSecs}; + .test_label = + "foreman_cif_link_150kbps_delay100ms_30pkts_queue_overshoot30", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; foreman_cif.config->link_capacity = DataRate::KilobitsPerSec(150); foreman_cif.config->queue_length_packets = 30; foreman_cif.config->queue_delay_ms = 100; @@ -232,14 +348,30 @@ TEST(FullStackTest, Foreman_Cif_Link_250kbps_Delay100ms_10pkts_Loss1) { VideoQualityTest fixture; ParamsWithLogging foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video[0] = { - true, 352, 288, 30, - 30000, 500000, 2000000, false, - "VP8", 1, 0, 0, - false, false, true, ClipNameToClipPath("foreman_cif"), - 0, {}, 1.30}; - foreman_cif.analyzer = {"foreman_cif_link_250kbps_delay100ms_10pkts_loss1", - 0.0, 0.0, kFullStackTestDurationSecs}; + foreman_cif.video[0] = {.enabled = true, + .width = 352, + .height = 288, + .fps = 30, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 500000, + .max_bitrate_bps = 2000000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = true, + .clip_path = ClipNameToClipPath("foreman_cif"), + .capture_device_index = 0, + .sdp_params = {}, + .encoder_overshoot_factor = 1.30}; + foreman_cif.analyzer = { + .test_label = "foreman_cif_link_250kbps_delay100ms_10pkts_loss1", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; foreman_cif.config->link_capacity = DataRate::KilobitsPerSec(250); foreman_cif.config->queue_length_packets = 10; foreman_cif.config->queue_delay_ms = 100; @@ -251,13 +383,27 @@ TEST(GenericDescriptorTest, Foreman_Cif_Delay_50_0_Plr_5_Generic_Descriptor) { VideoQualityTest fixture; ParamsWithLogging foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video[0] = { - true, 352, 288, 30, - 30000, 500000, 2000000, false, - "VP8", 1, 0, 0, - false, false, true, ClipNameToClipPath("foreman_cif")}; - foreman_cif.analyzer = {"foreman_cif_delay_50_0_plr_5_generic_descriptor", - 0.0, 0.0, kFullStackTestDurationSecs}; + foreman_cif.video[0] = {.enabled = true, + .width = 352, + .height = 288, + .fps = 30, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 500000, + .max_bitrate_bps = 2000000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = true, + .clip_path = ClipNameToClipPath("foreman_cif")}; + foreman_cif.analyzer = { + .test_label = "foreman_cif_delay_50_0_plr_5_generic_descriptor", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; foreman_cif.config->loss_percent = 5; foreman_cif.config->queue_delay_ms = 50; foreman_cif.call.generic_descriptor = true; @@ -269,14 +415,27 @@ TEST(GenericDescriptorTest, VideoQualityTest fixture; ParamsWithLogging foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video[0] = { - true, 352, 288, 30, - 30000, 500000, 2000000, false, - "VP8", 1, 0, 0, - true, false, true, ClipNameToClipPath("foreman_cif")}; + foreman_cif.video[0] = {.enabled = true, + .width = 352, + .height = 288, + .fps = 30, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 500000, + .max_bitrate_bps = 2000000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = true, + .flexfec = false, + .automatic_scaling = true, + .clip_path = ClipNameToClipPath("foreman_cif")}; foreman_cif.analyzer = { - "foreman_cif_delay_50_0_plr_5_ulpfec_generic_descriptor", 0.0, 0.0, - kFullStackTestDurationSecs}; + .test_label = "foreman_cif_delay_50_0_plr_5_ulpfec_generic_descriptor", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; foreman_cif.config->loss_percent = 5; foreman_cif.config->queue_delay_ms = 50; foreman_cif.call.generic_descriptor = true; @@ -287,13 +446,26 @@ TEST(FullStackTest, Foreman_Cif_Delay_50_0_Plr_5_Flexfec) { VideoQualityTest fixture; ParamsWithLogging foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video[0] = { - true, 352, 288, 30, - 30000, 500000, 2000000, false, - "VP8", 1, 0, 0, - false, true, true, ClipNameToClipPath("foreman_cif")}; - foreman_cif.analyzer = {"foreman_cif_delay_50_0_plr_5_flexfec", 0.0, 0.0, - kFullStackTestDurationSecs}; + foreman_cif.video[0] = {.enabled = true, + .width = 352, + .height = 288, + .fps = 30, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 500000, + .max_bitrate_bps = 2000000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = true, + .automatic_scaling = true, + .clip_path = ClipNameToClipPath("foreman_cif")}; + foreman_cif.analyzer = {.test_label = "foreman_cif_delay_50_0_plr_5_flexfec", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; foreman_cif.config->loss_percent = 5; foreman_cif.config->queue_delay_ms = 50; fixture.RunWithAnalyzer(foreman_cif); @@ -303,13 +475,27 @@ TEST(FullStackTest, Foreman_Cif_500kbps_Delay_50_0_Plr_3_Flexfec) { VideoQualityTest fixture; ParamsWithLogging foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video[0] = { - true, 352, 288, 30, - 30000, 500000, 2000000, false, - "VP8", 1, 0, 0, - false, true, true, ClipNameToClipPath("foreman_cif")}; - foreman_cif.analyzer = {"foreman_cif_500kbps_delay_50_0_plr_3_flexfec", 0.0, - 0.0, kFullStackTestDurationSecs}; + foreman_cif.video[0] = {.enabled = true, + .width = 352, + .height = 288, + .fps = 30, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 500000, + .max_bitrate_bps = 2000000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = true, + .automatic_scaling = true, + .clip_path = ClipNameToClipPath("foreman_cif")}; + foreman_cif.analyzer = { + .test_label = "foreman_cif_500kbps_delay_50_0_plr_3_flexfec", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; foreman_cif.config->loss_percent = 3; foreman_cif.config->link_capacity = DataRate::KilobitsPerSec(500); foreman_cif.config->queue_delay_ms = 50; @@ -320,13 +506,27 @@ TEST(FullStackTest, Foreman_Cif_500kbps_Delay_50_0_Plr_3_Ulpfec) { VideoQualityTest fixture; ParamsWithLogging foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video[0] = { - true, 352, 288, 30, - 30000, 500000, 2000000, false, - "VP8", 1, 0, 0, - true, false, true, ClipNameToClipPath("foreman_cif")}; - foreman_cif.analyzer = {"foreman_cif_500kbps_delay_50_0_plr_3_ulpfec", 0.0, - 0.0, kFullStackTestDurationSecs}; + foreman_cif.video[0] = {.enabled = true, + .width = 352, + .height = 288, + .fps = 30, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 500000, + .max_bitrate_bps = 2000000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = true, + .flexfec = false, + .automatic_scaling = true, + .clip_path = ClipNameToClipPath("foreman_cif")}; + foreman_cif.analyzer = { + .test_label = "foreman_cif_500kbps_delay_50_0_plr_3_ulpfec", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; foreman_cif.config->loss_percent = 3; foreman_cif.config->link_capacity = DataRate::KilobitsPerSec(500); foreman_cif.config->queue_delay_ms = 50; @@ -339,13 +539,26 @@ TEST(FullStackTest, Foreman_Cif_Net_Delay_0_0_Plr_0_H264) { // TODO(pbos): Decide on psnr/ssim thresholds for foreman_cif. ParamsWithLogging foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video[0] = { - true, 352, 288, 30, - 700000, 700000, 700000, false, - "H264", 1, 0, 0, - false, false, true, ClipNameToClipPath("foreman_cif")}; - foreman_cif.analyzer = {"foreman_cif_net_delay_0_0_plr_0_H264", 0.0, 0.0, - kFullStackTestDurationSecs}; + foreman_cif.video[0] = {.enabled = true, + .width = 352, + .height = 288, + .fps = 30, + .min_bitrate_bps = 700000, + .target_bitrate_bps = 700000, + .max_bitrate_bps = 700000, + .suspend_below_min_bitrate = false, + .codec = "H264", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = true, + .clip_path = ClipNameToClipPath("foreman_cif")}; + foreman_cif.analyzer = {.test_label = "foreman_cif_net_delay_0_0_plr_0_H264", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; fixture.RunWithAnalyzer(foreman_cif); } @@ -353,13 +566,27 @@ TEST(FullStackTest, Foreman_Cif_30kbps_Net_Delay_0_0_Plr_0_H264) { VideoQualityTest fixture; ParamsWithLogging foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video[0] = { - true, 352, 288, 10, - 30000, 30000, 30000, false, - "H264", 1, 0, 0, - false, false, true, ClipNameToClipPath("foreman_cif")}; - foreman_cif.analyzer = {"foreman_cif_30kbps_net_delay_0_0_plr_0_H264", 0.0, - 0.0, kFullStackTestDurationSecs}; + foreman_cif.video[0] = {.enabled = true, + .width = 352, + .height = 288, + .fps = 10, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 30000, + .max_bitrate_bps = 30000, + .suspend_below_min_bitrate = false, + .codec = "H264", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = true, + .clip_path = ClipNameToClipPath("foreman_cif")}; + foreman_cif.analyzer = { + .test_label = "foreman_cif_30kbps_net_delay_0_0_plr_0_H264", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; fixture.RunWithAnalyzer(foreman_cif); } @@ -368,14 +595,27 @@ TEST(GenericDescriptorTest, VideoQualityTest fixture; ParamsWithLogging foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video[0] = { - true, 352, 288, 30, - 30000, 500000, 2000000, false, - "H264", 1, 0, 0, - false, false, true, ClipNameToClipPath("foreman_cif")}; + foreman_cif.video[0] = {.enabled = true, + .width = 352, + .height = 288, + .fps = 30, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 500000, + .max_bitrate_bps = 2000000, + .suspend_below_min_bitrate = false, + .codec = "H264", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = true, + .clip_path = ClipNameToClipPath("foreman_cif")}; foreman_cif.analyzer = { - "foreman_cif_delay_50_0_plr_5_H264_generic_descriptor", 0.0, 0.0, - kFullStackTestDurationSecs}; + .test_label = "foreman_cif_delay_50_0_plr_5_H264_generic_descriptor", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; foreman_cif.config->loss_percent = 5; foreman_cif.config->queue_delay_ms = 50; foreman_cif.call.generic_descriptor = true; @@ -388,13 +628,27 @@ TEST(FullStackTest, Foreman_Cif_Delay_50_0_Plr_5_H264_Sps_Pps_Idr) { ParamsWithLogging foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video[0] = { - true, 352, 288, 30, - 30000, 500000, 2000000, false, - "H264", 1, 0, 0, - false, false, true, ClipNameToClipPath("foreman_cif")}; - foreman_cif.analyzer = {"foreman_cif_delay_50_0_plr_5_H264_sps_pps_idr", 0.0, - 0.0, kFullStackTestDurationSecs}; + foreman_cif.video[0] = {.enabled = true, + .width = 352, + .height = 288, + .fps = 30, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 500000, + .max_bitrate_bps = 2000000, + .suspend_below_min_bitrate = false, + .codec = "H264", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = true, + .clip_path = ClipNameToClipPath("foreman_cif")}; + foreman_cif.analyzer = { + .test_label = "foreman_cif_delay_50_0_plr_5_H264_sps_pps_idr", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; foreman_cif.config->loss_percent = 5; foreman_cif.config->queue_delay_ms = 50; fixture.RunWithAnalyzer(foreman_cif); @@ -405,13 +659,27 @@ TEST(FullStackTest, Foreman_Cif_Delay_50_0_Plr_5_H264_Flexfec) { VideoQualityTest fixture; ParamsWithLogging foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video[0] = { - true, 352, 288, 30, - 30000, 500000, 2000000, false, - "H264", 1, 0, 0, - false, true, true, ClipNameToClipPath("foreman_cif")}; - foreman_cif.analyzer = {"foreman_cif_delay_50_0_plr_5_H264_flexfec", 0.0, 0.0, - kFullStackTestDurationSecs}; + foreman_cif.video[0] = {.enabled = true, + .width = 352, + .height = 288, + .fps = 30, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 500000, + .max_bitrate_bps = 2000000, + .suspend_below_min_bitrate = false, + .codec = "H264", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = true, + .automatic_scaling = true, + .clip_path = ClipNameToClipPath("foreman_cif")}; + foreman_cif.analyzer = { + .test_label = "foreman_cif_delay_50_0_plr_5_H264_flexfec", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; foreman_cif.config->loss_percent = 5; foreman_cif.config->queue_delay_ms = 50; fixture.RunWithAnalyzer(foreman_cif); @@ -423,13 +691,27 @@ TEST(FullStackTest, DISABLED_Foreman_Cif_Delay_50_0_Plr_5_H264_Ulpfec) { VideoQualityTest fixture; ParamsWithLogging foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video[0] = { - true, 352, 288, 30, - 30000, 500000, 2000000, false, - "H264", 1, 0, 0, - true, false, true, ClipNameToClipPath("foreman_cif")}; - foreman_cif.analyzer = {"foreman_cif_delay_50_0_plr_5_H264_ulpfec", 0.0, 0.0, - kFullStackTestDurationSecs}; + foreman_cif.video[0] = {.enabled = true, + .width = 352, + .height = 288, + .fps = 30, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 500000, + .max_bitrate_bps = 2000000, + .suspend_below_min_bitrate = false, + .codec = "H264", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = true, + .flexfec = false, + .automatic_scaling = true, + .clip_path = ClipNameToClipPath("foreman_cif")}; + foreman_cif.analyzer = { + .test_label = "foreman_cif_delay_50_0_plr_5_H264_ulpfec", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; foreman_cif.config->loss_percent = 5; foreman_cif.config->queue_delay_ms = 50; fixture.RunWithAnalyzer(foreman_cif); @@ -440,13 +722,26 @@ TEST(FullStackTest, Foreman_Cif_500kbps) { VideoQualityTest fixture; ParamsWithLogging foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video[0] = { - true, 352, 288, 30, - 30000, 500000, 2000000, false, - "VP8", 1, 0, 0, - false, false, true, ClipNameToClipPath("foreman_cif")}; - foreman_cif.analyzer = {"foreman_cif_500kbps", 0.0, 0.0, - kFullStackTestDurationSecs}; + foreman_cif.video[0] = {.enabled = true, + .width = 352, + .height = 288, + .fps = 30, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 500000, + .max_bitrate_bps = 2000000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = true, + .clip_path = ClipNameToClipPath("foreman_cif")}; + foreman_cif.analyzer = {.test_label = "foreman_cif_500kbps", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; foreman_cif.config->queue_length_packets = 0; foreman_cif.config->queue_delay_ms = 0; foreman_cif.config->link_capacity = DataRate::KilobitsPerSec(500); @@ -457,13 +752,26 @@ TEST(FullStackTest, Foreman_Cif_500kbps_32pkts_Queue) { VideoQualityTest fixture; ParamsWithLogging foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video[0] = { - true, 352, 288, 30, - 30000, 500000, 2000000, false, - "VP8", 1, 0, 0, - false, false, true, ClipNameToClipPath("foreman_cif")}; - foreman_cif.analyzer = {"foreman_cif_500kbps_32pkts_queue", 0.0, 0.0, - kFullStackTestDurationSecs}; + foreman_cif.video[0] = {.enabled = true, + .width = 352, + .height = 288, + .fps = 30, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 500000, + .max_bitrate_bps = 2000000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = true, + .clip_path = ClipNameToClipPath("foreman_cif")}; + foreman_cif.analyzer = {.test_label = "foreman_cif_500kbps_32pkts_queue", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; foreman_cif.config->queue_length_packets = 32; foreman_cif.config->queue_delay_ms = 0; foreman_cif.config->link_capacity = DataRate::KilobitsPerSec(500); @@ -474,13 +782,26 @@ TEST(FullStackTest, Foreman_Cif_500kbps_100ms) { VideoQualityTest fixture; ParamsWithLogging foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video[0] = { - true, 352, 288, 30, - 30000, 500000, 2000000, false, - "VP8", 1, 0, 0, - false, false, true, ClipNameToClipPath("foreman_cif")}; - foreman_cif.analyzer = {"foreman_cif_500kbps_100ms", 0.0, 0.0, - kFullStackTestDurationSecs}; + foreman_cif.video[0] = {.enabled = true, + .width = 352, + .height = 288, + .fps = 30, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 500000, + .max_bitrate_bps = 2000000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = true, + .clip_path = ClipNameToClipPath("foreman_cif")}; + foreman_cif.analyzer = {.test_label = "foreman_cif_500kbps_100ms", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; foreman_cif.config->queue_length_packets = 0; foreman_cif.config->queue_delay_ms = 100; foreman_cif.config->link_capacity = DataRate::KilobitsPerSec(500); @@ -492,14 +813,27 @@ TEST(GenericDescriptorTest, VideoQualityTest fixture; ParamsWithLogging foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video[0] = { - true, 352, 288, 30, - 30000, 500000, 2000000, false, - "VP8", 1, 0, 0, - false, false, true, ClipNameToClipPath("foreman_cif")}; + foreman_cif.video[0] = {.enabled = true, + .width = 352, + .height = 288, + .fps = 30, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 500000, + .max_bitrate_bps = 2000000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = true, + .clip_path = ClipNameToClipPath("foreman_cif")}; foreman_cif.analyzer = { - "foreman_cif_500kbps_100ms_32pkts_queue_generic_descriptor", 0.0, 0.0, - kFullStackTestDurationSecs}; + .test_label = "foreman_cif_500kbps_100ms_32pkts_queue_generic_descriptor", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; foreman_cif.config->queue_length_packets = 32; foreman_cif.config->queue_delay_ms = 100; foreman_cif.config->link_capacity = DataRate::KilobitsPerSec(500); @@ -511,13 +845,27 @@ TEST(FullStackTest, Foreman_Cif_500kbps_100ms_32pkts_Queue_Recv_Bwe) { VideoQualityTest fixture; ParamsWithLogging foreman_cif; foreman_cif.call.send_side_bwe = false; - foreman_cif.video[0] = { - true, 352, 288, 30, - 30000, 500000, 2000000, false, - "VP8", 1, 0, 0, - false, false, true, ClipNameToClipPath("foreman_cif")}; - foreman_cif.analyzer = {"foreman_cif_500kbps_100ms_32pkts_queue_recv_bwe", - 0.0, 0.0, kFullStackTestDurationSecs}; + foreman_cif.video[0] = {.enabled = true, + .width = 352, + .height = 288, + .fps = 30, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 500000, + .max_bitrate_bps = 2000000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = true, + .clip_path = ClipNameToClipPath("foreman_cif")}; + foreman_cif.analyzer = { + .test_label = "foreman_cif_500kbps_100ms_32pkts_queue_recv_bwe", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; foreman_cif.config->queue_length_packets = 32; foreman_cif.config->queue_delay_ms = 100; foreman_cif.config->link_capacity = DataRate::KilobitsPerSec(500); @@ -528,13 +876,27 @@ TEST(FullStackTest, Foreman_Cif_1000kbps_100ms_32pkts_Queue) { VideoQualityTest fixture; ParamsWithLogging foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video[0] = { - true, 352, 288, 30, - 30000, 2000000, 2000000, false, - "VP8", 1, 0, 0, - false, false, true, ClipNameToClipPath("foreman_cif")}; - foreman_cif.analyzer = {"foreman_cif_1000kbps_100ms_32pkts_queue", 0.0, 0.0, - kFullStackTestDurationSecs}; + foreman_cif.video[0] = {.enabled = true, + .width = 352, + .height = 288, + .fps = 30, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 2000000, + .max_bitrate_bps = 2000000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = true, + .clip_path = ClipNameToClipPath("foreman_cif")}; + foreman_cif.analyzer = { + .test_label = "foreman_cif_1000kbps_100ms_32pkts_queue", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; foreman_cif.config->queue_length_packets = 32; foreman_cif.config->queue_delay_ms = 100; foreman_cif.config->link_capacity = DataRate::KilobitsPerSec(1000); @@ -547,16 +909,27 @@ TEST(FullStackTest, Conference_Motion_Hd_2000kbps_100ms_32pkts_Queue) { ParamsWithLogging conf_motion_hd; conf_motion_hd.call.send_side_bwe = true; conf_motion_hd.video[0] = { - true, 1280, - 720, 50, - 30000, 3000000, - 3000000, false, - "VP8", 1, - 0, 0, - false, false, - false, ClipNameToClipPath("ConferenceMotion_1280_720_50")}; - conf_motion_hd.analyzer = {"conference_motion_hd_2000kbps_100ms_32pkts_queue", - 0.0, 0.0, kFullStackTestDurationSecs}; + .enabled = true, + .width = 1280, + .height = 720, + .fps = 50, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 3000000, + .max_bitrate_bps = 3000000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = false, + .clip_path = ClipNameToClipPath("ConferenceMotion_1280_720_50")}; + conf_motion_hd.analyzer = { + .test_label = "conference_motion_hd_2000kbps_100ms_32pkts_queue", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; conf_motion_hd.config->queue_length_packets = 32; conf_motion_hd.config->queue_delay_ms = 100; conf_motion_hd.config->link_capacity = DataRate::KilobitsPerSec(2000); @@ -569,17 +942,28 @@ TEST(GenericDescriptorTest, ParamsWithLogging conf_motion_hd; conf_motion_hd.call.send_side_bwe = true; conf_motion_hd.video[0] = { - true, 1280, - 720, 50, - 30000, 3000000, - 3000000, false, - "VP8", 2, - -1, 0, - false, false, - false, ClipNameToClipPath("ConferenceMotion_1280_720_50")}; + .enabled = true, + .width = 1280, + .height = 720, + .fps = 50, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 3000000, + .max_bitrate_bps = 3000000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 2, + .selected_tl = -1, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = false, + .clip_path = ClipNameToClipPath("ConferenceMotion_1280_720_50")}; conf_motion_hd.analyzer = { - "conference_motion_hd_2tl_moderate_limits_generic_descriptor", 0.0, 0.0, - kFullStackTestDurationSecs}; + .test_label = + "conference_motion_hd_2tl_moderate_limits_generic_descriptor", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; conf_motion_hd.config->queue_length_packets = 50; conf_motion_hd.config->loss_percent = 3; conf_motion_hd.config->queue_delay_ms = 100; @@ -593,16 +977,27 @@ TEST(FullStackTest, Conference_Motion_Hd_3tl_Moderate_Limits) { ParamsWithLogging conf_motion_hd; conf_motion_hd.call.send_side_bwe = true; conf_motion_hd.video[0] = { - true, 1280, - 720, 50, - 30000, 3000000, - 3000000, false, - "VP8", 3, - -1, 0, - false, false, - false, ClipNameToClipPath("ConferenceMotion_1280_720_50")}; - conf_motion_hd.analyzer = {"conference_motion_hd_3tl_moderate_limits", 0.0, - 0.0, kFullStackTestDurationSecs}; + .enabled = true, + .width = 1280, + .height = 720, + .fps = 50, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 3000000, + .max_bitrate_bps = 3000000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 3, + .selected_tl = -1, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = false, + .clip_path = ClipNameToClipPath("ConferenceMotion_1280_720_50")}; + conf_motion_hd.analyzer = { + .test_label = "conference_motion_hd_3tl_moderate_limits", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; conf_motion_hd.config->queue_length_packets = 50; conf_motion_hd.config->loss_percent = 3; conf_motion_hd.config->queue_delay_ms = 100; @@ -615,16 +1010,27 @@ TEST(FullStackTest, Conference_Motion_Hd_4tl_Moderate_Limits) { ParamsWithLogging conf_motion_hd; conf_motion_hd.call.send_side_bwe = true; conf_motion_hd.video[0] = { - true, 1280, - 720, 50, - 30000, 3000000, - 3000000, false, - "VP8", 4, - -1, 0, - false, false, - false, ClipNameToClipPath("ConferenceMotion_1280_720_50")}; - conf_motion_hd.analyzer = {"conference_motion_hd_4tl_moderate_limits", 0.0, - 0.0, kFullStackTestDurationSecs}; + .enabled = true, + .width = 1280, + .height = 720, + .fps = 50, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 3000000, + .max_bitrate_bps = 3000000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 4, + .selected_tl = -1, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = false, + .clip_path = ClipNameToClipPath("ConferenceMotion_1280_720_50")}; + conf_motion_hd.analyzer = { + .test_label = "conference_motion_hd_4tl_moderate_limits", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; conf_motion_hd.config->queue_length_packets = 50; conf_motion_hd.config->loss_percent = 3; conf_motion_hd.config->queue_delay_ms = 100; @@ -744,17 +1150,27 @@ TEST(FullStackTest, Conference_Motion_Hd_2000kbps_100ms_32pkts_Queue_Vp9) { ParamsWithLogging conf_motion_hd; conf_motion_hd.call.send_side_bwe = true; conf_motion_hd.video[0] = { - true, 1280, - 720, 50, - 30000, 3000000, - 3000000, false, - "VP9", 1, - 0, 0, - false, false, - false, ClipNameToClipPath("ConferenceMotion_1280_720_50")}; + .enabled = true, + .width = 1280, + .height = 720, + .fps = 50, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 3000000, + .max_bitrate_bps = 3000000, + .suspend_below_min_bitrate = false, + .codec = "VP9", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = false, + .clip_path = ClipNameToClipPath("ConferenceMotion_1280_720_50")}; conf_motion_hd.analyzer = { - "conference_motion_hd_2000kbps_100ms_32pkts_queue_vp9", 0.0, 0.0, - kFullStackTestDurationSecs}; + .test_label = "conference_motion_hd_2000kbps_100ms_32pkts_queue_vp9", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; conf_motion_hd.config->queue_length_packets = 32; conf_motion_hd.config->queue_delay_ms = 100; conf_motion_hd.config->link_capacity = DataRate::KilobitsPerSec(2000); @@ -766,12 +1182,28 @@ TEST(FullStackTest, Screenshare_Slides) { VideoQualityTest fixture; ParamsWithLogging screenshare; screenshare.call.send_side_bwe = true; - screenshare.video[0] = {true, 1850, 1110, 5, 50000, 200000, - 1000000, false, "VP8", 2, 1, 400000, - false, false, false, ""}; - screenshare.screenshare[0] = {true, false, 10}; - screenshare.analyzer = {"screenshare_slides", 0.0, 0.0, - kFullStackTestDurationSecs}; + screenshare.video[0] = {.enabled = true, + .width = 1850, + .height = 1110, + .fps = 5, + .min_bitrate_bps = 50000, + .target_bitrate_bps = 200000, + .max_bitrate_bps = 1000000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 2, + .selected_tl = 1, + .min_transmit_bps = 400000, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = false, + .clip_path = ""}; + screenshare.screenshare[0] = { + .enabled = true, .generate_slides = false, .slide_change_interval = 10}; + screenshare.analyzer = {.test_label = "screenshare_slides", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; fixture.RunWithAnalyzer(screenshare); } @@ -781,27 +1213,73 @@ TEST(FullStackTest, Screenshare_Slides_Simulcast) { VideoQualityTest fixture; ParamsWithLogging screenshare; screenshare.call.send_side_bwe = true; - screenshare.screenshare[0] = {true, false, 10}; - screenshare.video[0] = {true, 1850, 1110, 30, 800000, 2500000, - 2500000, false, "VP8", 2, 1, 400000, - false, false, false, ""}; - screenshare.analyzer = {"screenshare_slides_simulcast", 0.0, 0.0, - kFullStackTestDurationSecs}; + screenshare.screenshare[0] = { + .enabled = true, .generate_slides = false, .slide_change_interval = 10}; + screenshare.video[0] = {.enabled = true, + .width = 1850, + .height = 1110, + .fps = 30, + .min_bitrate_bps = 800000, + .target_bitrate_bps = 2500000, + .max_bitrate_bps = 2500000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 2, + .selected_tl = 1, + .min_transmit_bps = 400000, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = false, + .clip_path = ""}; + screenshare.analyzer = {.test_label = "screenshare_slides_simulcast", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; ParamsWithLogging screenshare_params_high; - screenshare_params_high.video[0] = { - true, 1850, 1110, 60, 600000, 1250000, 1250000, false, - "VP8", 2, 0, 400000, false, false, false, ""}; + screenshare_params_high.video[0] = {.enabled = true, + .width = 1850, + .height = 1110, + .fps = 60, + .min_bitrate_bps = 600000, + .target_bitrate_bps = 1250000, + .max_bitrate_bps = 1250000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 2, + .selected_tl = 0, + .min_transmit_bps = 400000, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = false, + .clip_path = ""}; VideoQualityTest::Params screenshare_params_low; - screenshare_params_low.video[0] = {true, 1850, 1110, 5, 30000, 200000, - 1000000, false, "VP8", 2, 0, 400000, - false, false, false, ""}; + screenshare_params_low.video[0] = {.enabled = true, + .width = 1850, + .height = 1110, + .fps = 5, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 200000, + .max_bitrate_bps = 1000000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 2, + .selected_tl = 0, + .min_transmit_bps = 400000, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = false, + .clip_path = ""}; std::vector<VideoStream> streams = { VideoQualityTest::DefaultVideoStream(screenshare_params_low, 0), VideoQualityTest::DefaultVideoStream(screenshare_params_high, 0)}; - screenshare.ss[0] = { - streams, 1, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(), - false}; + screenshare.ss[0] = {.streams = streams, + .selected_stream = 1, + .num_spatial_layers = 1, + .selected_sl = 0, + .inter_layer_pred = InterLayerPredMode::kOn, + .spatial_layers = std::vector<SpatialLayer>(), + .infer_streams = false}; fixture.RunWithAnalyzer(screenshare); } @@ -811,12 +1289,30 @@ TEST(FullStackTest, Screenshare_Slides_Scrolling) { VideoQualityTest fixture; ParamsWithLogging config; config.call.send_side_bwe = true; - config.video[0] = {true, 1850, 1110 / 2, 5, 50000, 200000, - 1000000, false, "VP8", 2, 1, 400000, - false, false, false, ""}; - config.screenshare[0] = {true, false, 10, 2}; - config.analyzer = {"screenshare_slides_scrolling", 0.0, 0.0, - kFullStackTestDurationSecs}; + config.video[0] = {.enabled = true, + .width = 1850, + .height = 1110 / 2, + .fps = 5, + .min_bitrate_bps = 50000, + .target_bitrate_bps = 200000, + .max_bitrate_bps = 1000000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 2, + .selected_tl = 1, + .min_transmit_bps = 400000, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = false, + .clip_path = ""}; + config.screenshare[0] = {.enabled = true, + .generate_slides = false, + .slide_change_interval = 10, + .scroll_duration = 2}; + config.analyzer = {.test_label = "screenshare_slides_scrolling", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; fixture.RunWithAnalyzer(config); } @@ -824,12 +1320,29 @@ TEST(GenericDescriptorTest, Screenshare_Slides_Lossy_Net_Generic_Descriptor) { VideoQualityTest fixture; ParamsWithLogging screenshare; screenshare.call.send_side_bwe = true; - screenshare.video[0] = {true, 1850, 1110, 5, 50000, 200000, - 1000000, false, "VP8", 2, 1, 400000, - false, false, false, ""}; - screenshare.screenshare[0] = {true, false, 10}; - screenshare.analyzer = {"screenshare_slides_lossy_net_generic_descriptor", - 0.0, 0.0, kFullStackTestDurationSecs}; + screenshare.video[0] = {.enabled = true, + .width = 1850, + .height = 1110, + .fps = 5, + .min_bitrate_bps = 50000, + .target_bitrate_bps = 200000, + .max_bitrate_bps = 1000000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 2, + .selected_tl = 1, + .min_transmit_bps = 400000, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = false, + .clip_path = ""}; + screenshare.screenshare[0] = { + .enabled = true, .generate_slides = false, .slide_change_interval = 10}; + screenshare.analyzer = { + .test_label = "screenshare_slides_lossy_net_generic_descriptor", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; screenshare.config->loss_percent = 5; screenshare.config->queue_delay_ms = 200; screenshare.config->link_capacity = DataRate::KilobitsPerSec(500); @@ -841,12 +1354,28 @@ TEST(FullStackTest, Screenshare_Slides_Very_Lossy) { VideoQualityTest fixture; ParamsWithLogging screenshare; screenshare.call.send_side_bwe = true; - screenshare.video[0] = {true, 1850, 1110, 5, 50000, 200000, - 1000000, false, "VP8", 2, 1, 400000, - false, false, false, ""}; - screenshare.screenshare[0] = {true, false, 10}; - screenshare.analyzer = {"screenshare_slides_very_lossy", 0.0, 0.0, - kFullStackTestDurationSecs}; + screenshare.video[0] = {.enabled = true, + .width = 1850, + .height = 1110, + .fps = 5, + .min_bitrate_bps = 50000, + .target_bitrate_bps = 200000, + .max_bitrate_bps = 1000000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 2, + .selected_tl = 1, + .min_transmit_bps = 400000, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = false, + .clip_path = ""}; + screenshare.screenshare[0] = { + .enabled = true, .generate_slides = false, .slide_change_interval = 10}; + screenshare.analyzer = {.test_label = "screenshare_slides_very_lossy", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; screenshare.config->loss_percent = 10; screenshare.config->queue_delay_ms = 200; screenshare.config->link_capacity = DataRate::KilobitsPerSec(500); @@ -857,12 +1386,28 @@ TEST(FullStackTest, Screenshare_Slides_Lossy_Limited) { VideoQualityTest fixture; ParamsWithLogging screenshare; screenshare.call.send_side_bwe = true; - screenshare.video[0] = {true, 1850, 1110, 5, 50000, 200000, - 1000000, false, "VP8", 2, 1, 400000, - false, false, false, ""}; - screenshare.screenshare[0] = {true, false, 10}; - screenshare.analyzer = {"screenshare_slides_lossy_limited", 0.0, 0.0, - kFullStackTestDurationSecs}; + screenshare.video[0] = {.enabled = true, + .width = 1850, + .height = 1110, + .fps = 5, + .min_bitrate_bps = 50000, + .target_bitrate_bps = 200000, + .max_bitrate_bps = 1000000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 2, + .selected_tl = 1, + .min_transmit_bps = 400000, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = false, + .clip_path = ""}; + screenshare.screenshare[0] = { + .enabled = true, .generate_slides = false, .slide_change_interval = 10}; + screenshare.analyzer = {.test_label = "screenshare_slides_lossy_limited", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; screenshare.config->loss_percent = 5; screenshare.config->link_capacity = DataRate::KilobitsPerSec(200); screenshare.config->queue_length_packets = 30; @@ -874,12 +1419,29 @@ TEST(FullStackTest, Screenshare_Slides_Moderately_Restricted) { VideoQualityTest fixture; ParamsWithLogging screenshare; screenshare.call.send_side_bwe = true; - screenshare.video[0] = {true, 1850, 1110, 5, 50000, 200000, - 1000000, false, "VP8", 2, 1, 400000, - false, false, false, ""}; - screenshare.screenshare[0] = {true, false, 10}; - screenshare.analyzer = {"screenshare_slides_moderately_restricted", 0.0, 0.0, - kFullStackTestDurationSecs}; + screenshare.video[0] = {.enabled = true, + .width = 1850, + .height = 1110, + .fps = 5, + .min_bitrate_bps = 50000, + .target_bitrate_bps = 200000, + .max_bitrate_bps = 1000000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 2, + .selected_tl = 1, + .min_transmit_bps = 400000, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = false, + .clip_path = ""}; + screenshare.screenshare[0] = { + .enabled = true, .generate_slides = false, .slide_change_interval = 10}; + screenshare.analyzer = { + .test_label = "screenshare_slides_moderately_restricted", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; screenshare.config->loss_percent = 1; screenshare.config->link_capacity = DataRate::KilobitsPerSec(1200); screenshare.config->queue_length_packets = 30; @@ -891,50 +1453,82 @@ TEST(FullStackTest, Screenshare_Slides_Moderately_Restricted) { // store these structs as const globals. ParamsWithLogging::Video SvcVp9Video() { return ParamsWithLogging::Video{ - true, 1280, - 720, 30, - 800000, 2500000, - 2500000, false, - "VP9", 3, - 2, 400000, - false, false, - false, ClipNameToClipPath("ConferenceMotion_1280_720_50")}; + .enabled = true, + .width = 1280, + .height = 720, + .fps = 30, + .min_bitrate_bps = 800000, + .target_bitrate_bps = 2500000, + .max_bitrate_bps = 2500000, + .suspend_below_min_bitrate = false, + .codec = "VP9", + .num_temporal_layers = 3, + .selected_tl = 2, + .min_transmit_bps = 400000, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = false, + .clip_path = ClipNameToClipPath("ConferenceMotion_1280_720_50")}; } ParamsWithLogging::Video SimulcastVp8VideoHigh() { return ParamsWithLogging::Video{ - true, 1280, - 720, 30, - 800000, 2500000, - 2500000, false, - "VP8", 3, - 2, 400000, - false, false, - false, ClipNameToClipPath("ConferenceMotion_1280_720_50")}; + .enabled = true, + .width = 1280, + .height = 720, + .fps = 30, + .min_bitrate_bps = 800000, + .target_bitrate_bps = 2500000, + .max_bitrate_bps = 2500000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 3, + .selected_tl = 2, + .min_transmit_bps = 400000, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = false, + .clip_path = ClipNameToClipPath("ConferenceMotion_1280_720_50")}; } ParamsWithLogging::Video SimulcastVp8VideoMedium() { return ParamsWithLogging::Video{ - true, 640, - 360, 30, - 150000, 500000, - 700000, false, - "VP8", 3, - 2, 400000, - false, false, - false, ClipNameToClipPath("ConferenceMotion_1280_720_50")}; + .enabled = true, + .width = 640, + .height = 360, + .fps = 30, + .min_bitrate_bps = 150000, + .target_bitrate_bps = 500000, + .max_bitrate_bps = 700000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 3, + .selected_tl = 2, + .min_transmit_bps = 400000, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = false, + .clip_path = ClipNameToClipPath("ConferenceMotion_1280_720_50")}; } ParamsWithLogging::Video SimulcastVp8VideoLow() { return ParamsWithLogging::Video{ - true, 320, - 180, 30, - 30000, 150000, - 200000, false, - "VP8", 3, - 2, 400000, - false, false, - false, ClipNameToClipPath("ConferenceMotion_1280_720_50")}; + .enabled = true, + .width = 320, + .height = 180, + .fps = 30, + .min_bitrate_bps = 30000, + .target_bitrate_bps = 150000, + .max_bitrate_bps = 200000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 3, + .selected_tl = 2, + .min_transmit_bps = 400000, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = false, + .clip_path = ClipNameToClipPath("ConferenceMotion_1280_720_50")}; } #if defined(RTC_ENABLE_VP9) @@ -943,15 +1537,35 @@ TEST(FullStackTest, Screenshare_Slides_Vp9_3sl_High_Fps) { VideoQualityTest fixture; ParamsWithLogging screenshare; screenshare.call.send_side_bwe = true; - screenshare.video[0] = {true, 1850, 1110, 30, 50000, 200000, - 2000000, false, "VP9", 1, 0, 400000, - false, false, false, ""}; - screenshare.screenshare[0] = {true, false, 10}; - screenshare.analyzer = {"screenshare_slides_vp9_3sl_high_fps", 0.0, 0.0, - kFullStackTestDurationSecs}; - screenshare.ss[0] = { - std::vector<VideoStream>(), 0, 3, 2, InterLayerPredMode::kOn, - std::vector<SpatialLayer>(), true}; + screenshare.video[0] = {.enabled = true, + .width = 1850, + .height = 1110, + .fps = 30, + .min_bitrate_bps = 50000, + .target_bitrate_bps = 200000, + .max_bitrate_bps = 2000000, + .suspend_below_min_bitrate = false, + .codec = "VP9", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 400000, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = false, + .clip_path = ""}; + screenshare.screenshare[0] = { + .enabled = true, .generate_slides = false, .slide_change_interval = 10}; + screenshare.analyzer = {.test_label = "screenshare_slides_vp9_3sl_high_fps", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; + screenshare.ss[0] = {.streams = std::vector<VideoStream>(), + .selected_stream = 0, + .num_spatial_layers = 3, + .selected_sl = 2, + .inter_layer_pred = InterLayerPredMode::kOn, + .spatial_layers = std::vector<SpatialLayer>(), + .infer_streams = true}; fixture.RunWithAnalyzer(screenshare); } @@ -964,11 +1578,17 @@ TEST(FullStackTest, Vp9ksvc_3sl_High) { ParamsWithLogging simulcast; simulcast.call.send_side_bwe = true; simulcast.video[0] = SvcVp9Video(); - simulcast.analyzer = {"vp9ksvc_3sl_high", 0.0, 0.0, - kFullStackTestDurationSecs}; - simulcast.ss[0] = { - std::vector<VideoStream>(), 0, 3, 2, InterLayerPredMode::kOnKeyPic, - std::vector<SpatialLayer>(), false}; + simulcast.analyzer = {.test_label = "vp9ksvc_3sl_high", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; + simulcast.ss[0] = {.streams = std::vector<VideoStream>(), + .selected_stream = 0, + .num_spatial_layers = 3, + .selected_sl = 2, + .inter_layer_pred = InterLayerPredMode::kOnKeyPic, + .spatial_layers = std::vector<SpatialLayer>(), + .infer_streams = false}; fixture.RunWithAnalyzer(simulcast); } @@ -978,11 +1598,17 @@ TEST(FullStackTest, Vp9ksvc_3sl_Low) { ParamsWithLogging simulcast; simulcast.call.send_side_bwe = true; simulcast.video[0] = SvcVp9Video(); - simulcast.analyzer = {"vp9ksvc_3sl_low", 0.0, 0.0, - kFullStackTestDurationSecs}; - simulcast.ss[0] = { - std::vector<VideoStream>(), 0, 3, 0, InterLayerPredMode::kOnKeyPic, - std::vector<SpatialLayer>(), false}; + simulcast.analyzer = {.test_label = "vp9ksvc_3sl_low", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; + simulcast.ss[0] = {.streams = std::vector<VideoStream>(), + .selected_stream = 0, + .num_spatial_layers = 3, + .selected_sl = 0, + .inter_layer_pred = InterLayerPredMode::kOnKeyPic, + .spatial_layers = std::vector<SpatialLayer>(), + .infer_streams = false}; fixture.RunWithAnalyzer(simulcast); } @@ -993,11 +1619,17 @@ TEST(FullStackTest, Vp9ksvc_3sl_Low_Bw_Limited) { simulcast.config->link_capacity = DataRate::KilobitsPerSec(500); simulcast.call.send_side_bwe = true; simulcast.video[0] = SvcVp9Video(); - simulcast.analyzer = {"vp9ksvc_3sl_low_bw_limited", 0.0, 0.0, - kFullStackTestDurationSecs}; - simulcast.ss[0] = { - std::vector<VideoStream>(), 0, 3, 0, InterLayerPredMode::kOnKeyPic, - std::vector<SpatialLayer>(), false}; + simulcast.analyzer = {.test_label = "vp9ksvc_3sl_low_bw_limited", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; + simulcast.ss[0] = {.streams = std::vector<VideoStream>(), + .selected_stream = 0, + .num_spatial_layers = 3, + .selected_sl = 0, + .inter_layer_pred = InterLayerPredMode::kOnKeyPic, + .spatial_layers = std::vector<SpatialLayer>(), + .infer_streams = false}; fixture.RunWithAnalyzer(simulcast); } @@ -1007,11 +1639,17 @@ TEST(FullStackTest, Vp9ksvc_3sl_Medium_Network_Restricted) { ParamsWithLogging simulcast; simulcast.call.send_side_bwe = true; simulcast.video[0] = SvcVp9Video(); - simulcast.analyzer = {"vp9ksvc_3sl_medium_network_restricted", 0.0, 0.0, - kFullStackTestDurationSecs}; - simulcast.ss[0] = { - std::vector<VideoStream>(), 0, 3, -1, InterLayerPredMode::kOnKeyPic, - std::vector<SpatialLayer>(), false}; + simulcast.analyzer = {.test_label = "vp9ksvc_3sl_medium_network_restricted", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; + simulcast.ss[0] = {.streams = std::vector<VideoStream>(), + .selected_stream = 0, + .num_spatial_layers = 3, + .selected_sl = -1, + .inter_layer_pred = InterLayerPredMode::kOnKeyPic, + .spatial_layers = std::vector<SpatialLayer>(), + .infer_streams = false}; simulcast.config->link_capacity = DataRate::KilobitsPerSec(1000); simulcast.config->queue_delay_ms = 100; fixture.RunWithAnalyzer(simulcast); @@ -1024,11 +1662,18 @@ TEST(FullStackTest, Vp9ksvc_3sl_Medium_Network_Restricted_Trusted_Rate) { ParamsWithLogging simulcast; simulcast.call.send_side_bwe = true; simulcast.video[0] = SvcVp9Video(); - simulcast.analyzer = {"vp9ksvc_3sl_medium_network_restricted_trusted_rate", - 0.0, 0.0, kFullStackTestDurationSecs}; - simulcast.ss[0] = { - std::vector<VideoStream>(), 0, 3, -1, InterLayerPredMode::kOnKeyPic, - std::vector<SpatialLayer>(), false}; + simulcast.analyzer = { + .test_label = "vp9ksvc_3sl_medium_network_restricted_trusted_rate", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; + simulcast.ss[0] = {.streams = std::vector<VideoStream>(), + .selected_stream = 0, + .num_spatial_layers = 3, + .selected_sl = -1, + .inter_layer_pred = InterLayerPredMode::kOnKeyPic, + .spatial_layers = std::vector<SpatialLayer>(), + .infer_streams = false}; simulcast.config->link_capacity = DataRate::KilobitsPerSec(1000); simulcast.config->queue_delay_ms = 100; fixture.RunWithAnalyzer(simulcast); @@ -1051,20 +1696,39 @@ TEST(FullStackTest, MAYBE_Simulcast_HD_High) { "WebRTC-ForceSimulatedOveruseIntervalMs/1000-50000-300/"}); ParamsWithLogging simulcast; simulcast.call.send_side_bwe = true; - simulcast.video[0] = {true, 1920, 1080, 30, 800000, 2500000, - 2500000, false, "VP8", 3, 2, 400000, - false, false, false, "Generator"}; - simulcast.analyzer = {"simulcast_HD_high", 0.0, 0.0, - kFullStackTestDurationSecs}; + simulcast.video[0] = {.enabled = true, + .width = 1920, + .height = 1080, + .fps = 30, + .min_bitrate_bps = 800000, + .target_bitrate_bps = 2500000, + .max_bitrate_bps = 2500000, + .suspend_below_min_bitrate = false, + .codec = "VP8", + .num_temporal_layers = 3, + .selected_tl = 2, + .min_transmit_bps = 400000, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = false, + .clip_path = "Generator"}; + simulcast.analyzer = {.test_label = "simulcast_HD_high", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; simulcast.config->loss_percent = 0; simulcast.config->queue_delay_ms = 100; std::vector<VideoStream> streams = { VideoQualityTest::DefaultVideoStream(simulcast, 0), VideoQualityTest::DefaultVideoStream(simulcast, 0), VideoQualityTest::DefaultVideoStream(simulcast, 0)}; - simulcast.ss[0] = { - streams, 2, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(), - true}; + simulcast.ss[0] = {.streams = streams, + .selected_stream = 2, + .num_spatial_layers = 1, + .selected_sl = 0, + .inter_layer_pred = InterLayerPredMode::kOn, + .spatial_layers = std::vector<SpatialLayer>(), + .infer_streams = true}; fixture.RunWithAnalyzer(simulcast); } @@ -1073,8 +1737,10 @@ TEST(FullStackTest, Simulcast_Vp8_3sl_High) { ParamsWithLogging simulcast; simulcast.call.send_side_bwe = true; simulcast.video[0] = SimulcastVp8VideoHigh(); - simulcast.analyzer = {"simulcast_vp8_3sl_high", 0.0, 0.0, - kFullStackTestDurationSecs}; + simulcast.analyzer = {.test_label = "simulcast_vp8_3sl_high", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; simulcast.config->loss_percent = 0; simulcast.config->queue_delay_ms = 100; ParamsWithLogging video_params_high; @@ -1088,9 +1754,13 @@ TEST(FullStackTest, Simulcast_Vp8_3sl_High) { VideoQualityTest::DefaultVideoStream(video_params_low, 0), VideoQualityTest::DefaultVideoStream(video_params_medium, 0), VideoQualityTest::DefaultVideoStream(video_params_high, 0)}; - simulcast.ss[0] = { - streams, 2, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(), - false}; + simulcast.ss[0] = {.streams = streams, + .selected_stream = 2, + .num_spatial_layers = 1, + .selected_sl = 0, + .inter_layer_pred = InterLayerPredMode::kOn, + .spatial_layers = std::vector<SpatialLayer>(), + .infer_streams = false}; fixture.RunWithAnalyzer(simulcast); } @@ -1099,8 +1769,10 @@ TEST(FullStackTest, Simulcast_Vp8_3sl_Low) { ParamsWithLogging simulcast; simulcast.call.send_side_bwe = true; simulcast.video[0] = SimulcastVp8VideoHigh(); - simulcast.analyzer = {"simulcast_vp8_3sl_low", 0.0, 0.0, - kFullStackTestDurationSecs}; + simulcast.analyzer = {.test_label = "simulcast_vp8_3sl_low", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; simulcast.config->loss_percent = 0; simulcast.config->queue_delay_ms = 100; ParamsWithLogging video_params_high; @@ -1114,9 +1786,13 @@ TEST(FullStackTest, Simulcast_Vp8_3sl_Low) { VideoQualityTest::DefaultVideoStream(video_params_low, 0), VideoQualityTest::DefaultVideoStream(video_params_medium, 0), VideoQualityTest::DefaultVideoStream(video_params_high, 0)}; - simulcast.ss[0] = { - streams, 0, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(), - false}; + simulcast.ss[0] = {.streams = streams, + .selected_stream = 0, + .num_spatial_layers = 1, + .selected_sl = 0, + .inter_layer_pred = InterLayerPredMode::kOn, + .spatial_layers = std::vector<SpatialLayer>(), + .infer_streams = false}; fixture.RunWithAnalyzer(simulcast); } @@ -1136,24 +1812,26 @@ TEST(FullStackTest, MAYBE_High_Bitrate_With_Fake_Codec) { generator.call.call_bitrate_config.min_bitrate_bps = target_bitrate; generator.call.call_bitrate_config.start_bitrate_bps = target_bitrate; generator.call.call_bitrate_config.max_bitrate_bps = target_bitrate; - generator.video[0] = {true, - 360, - 240, - 30, - target_bitrate / 2, - target_bitrate, - target_bitrate * 2, - false, - "FakeCodec", - 1, - 0, - 0, - false, - false, - false, - "Generator"}; - generator.analyzer = {"high_bitrate_with_fake_codec", 0.0, 0.0, - kFullStackTestDurationSecs}; + generator.video[0] = {.enabled = true, + .width = 360, + .height = 240, + .fps = 30, + .min_bitrate_bps = target_bitrate / 2, + .target_bitrate_bps = target_bitrate, + .max_bitrate_bps = target_bitrate * 2, + .suspend_below_min_bitrate = false, + .codec = "FakeCodec", + .num_temporal_layers = 1, + .selected_tl = 0, + .min_transmit_bps = 0, + .ulpfec = false, + .flexfec = false, + .automatic_scaling = false, + .clip_path = "Generator"}; + generator.analyzer = {.test_label = "high_bitrate_with_fake_codec", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; fixture.RunWithAnalyzer(generator); } @@ -1170,8 +1848,10 @@ TEST(FullStackTest, MAYBE_Largeroom_50thumb) { ParamsWithLogging large_room; large_room.call.send_side_bwe = true; large_room.video[0] = SimulcastVp8VideoHigh(); - large_room.analyzer = {"largeroom_50thumb", 0.0, 0.0, - kFullStackTestDurationSecs}; + large_room.analyzer = {.test_label = "largeroom_50thumb", + .avg_psnr_threshold = 0.0, + .avg_ssim_threshold = 0.0, + .test_durations_secs = kFullStackTestDurationSecs}; large_room.config->loss_percent = 0; large_room.config->queue_delay_ms = 100; ParamsWithLogging video_params_high; @@ -1186,9 +1866,13 @@ TEST(FullStackTest, MAYBE_Largeroom_50thumb) { VideoQualityTest::DefaultVideoStream(video_params_medium, 0), VideoQualityTest::DefaultVideoStream(video_params_high, 0)}; large_room.call.num_thumbnails = 50; - large_room.ss[0] = { - streams, 2, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(), - false}; + large_room.ss[0] = {.streams = streams, + .selected_stream = 2, + .num_spatial_layers = 1, + .selected_sl = 0, + .inter_layer_pred = InterLayerPredMode::kOn, + .spatial_layers = std::vector<SpatialLayer>(), + .infer_streams = false}; fixture.RunWithAnalyzer(large_room); } diff --git a/third_party/libwebrtc/video/rtp_video_stream_receiver2_unittest.cc b/third_party/libwebrtc/video/rtp_video_stream_receiver2_unittest.cc @@ -668,9 +668,9 @@ TEST_F(RtpVideoStreamReceiver2Test, PacketInfoIsPropagatedIntoVideoFrames) { rtp_packet.SetSequenceNumber(1); rtp_packet.SetTimestamp(1); rtp_packet.SetSsrc(kSsrc); - rtp_packet.SetExtension<AbsoluteCaptureTimeExtension>( - AbsoluteCaptureTime{kAbsoluteCaptureTimestamp, - /*estimated_capture_clock_offset=*/std::nullopt}); + rtp_packet.SetExtension<AbsoluteCaptureTimeExtension>(AbsoluteCaptureTime{ + .absolute_capture_timestamp = kAbsoluteCaptureTimestamp, + .estimated_capture_clock_offset = std::nullopt}); RTPVideoHeader video_header = GetGenericVideoHeader(VideoFrameType::kVideoFrameKey); @@ -701,9 +701,9 @@ TEST_F(RtpVideoStreamReceiver2Test, rtp_packet.SetSequenceNumber(sequence_number); rtp_packet.SetTimestamp(rtp_timestamp); rtp_packet.SetSsrc(kSsrc); - rtp_packet.SetExtension<AbsoluteCaptureTimeExtension>( - AbsoluteCaptureTime{kAbsoluteCaptureTimestamp, - /*estimated_capture_clock_offset=*/std::nullopt}); + rtp_packet.SetExtension<AbsoluteCaptureTimeExtension>(AbsoluteCaptureTime{ + .absolute_capture_timestamp = kAbsoluteCaptureTimestamp, + .estimated_capture_clock_offset = std::nullopt}); RTPVideoHeader video_header = GetGenericVideoHeader(VideoFrameType::kVideoFrameKey); diff --git a/third_party/libwebrtc/video/send_statistics_proxy.cc b/third_party/libwebrtc/video/send_statistics_proxy.cc @@ -1100,9 +1100,10 @@ void SendStatisticsProxy::OnSendEncodedImage( void SendStatisticsProxy::OnEncoderImplementationChanged( EncoderImplementation implementation) { MutexLock lock(&mutex_); - encoder_changed_ = - EncoderChangeEvent{stats_.encoder_implementation_name.value_or("unknown"), - implementation.name}; + encoder_changed_ = EncoderChangeEvent{ + .previous_encoder_implementation = + stats_.encoder_implementation_name.value_or("unknown"), + .new_encoder_implementation = implementation.name}; stats_.encoder_implementation_name = implementation.name; stats_.power_efficient_encoder = implementation.is_hardware_accelerated; // Clear cached scalability mode values, they may no longer be accurate. diff --git a/third_party/libwebrtc/video/video_analyzer.cc b/third_party/libwebrtc/video/video_analyzer.cc @@ -835,7 +835,8 @@ void VideoAnalyzer::PerformFrameComparison( MutexLock lock(&comparison_lock_); if (psnr >= 0.0 && (!worst_frame_ || worst_frame_->psnr > psnr)) { - worst_frame_.emplace(FrameWithPsnr{psnr, *comparison.render}); + worst_frame_.emplace( + FrameWithPsnr{.psnr = psnr, .frame = *comparison.render}); } if (graph_data_output_file_) { diff --git a/third_party/libwebrtc/video/video_receive_stream2.cc b/third_party/libwebrtc/video/video_receive_stream2.cc @@ -736,8 +736,8 @@ void VideoReceiveStream2::OnFrame(const VideoFrame& video_frame) { << video_frame.height(); } pending_resolution_ = RecordableEncodedFrame::EncodedResolution{ - static_cast<unsigned>(video_frame.width()), - static_cast<unsigned>(video_frame.height())}; + .width = static_cast<unsigned>(video_frame.width()), + .height = static_cast<unsigned>(video_frame.height())}; } } @@ -1021,8 +1021,8 @@ int VideoReceiveStream2::DecodeAndMaybeDispatchEncodedFrame( // Flush the buffered frames. for (const auto& buffered_frame : buffered_encoded_frames_) { RecordableEncodedFrame::EncodedResolution resolution{ - buffered_frame->EncodedImage()._encodedWidth, - buffered_frame->EncodedImage()._encodedHeight}; + .width = buffered_frame->EncodedImage()._encodedWidth, + .height = buffered_frame->EncodedImage()._encodedHeight}; if (IsKeyFrameAndUnspecifiedResolution(*buffered_frame)) { RTC_DCHECK(!pending_resolution->empty()); resolution = *pending_resolution; diff --git a/third_party/libwebrtc/video/video_receive_stream_timeout_tracker_unittest.cc b/third_party/libwebrtc/video/video_receive_stream_timeout_tracker_unittest.cc @@ -25,7 +25,8 @@ namespace { constexpr auto kMaxWaitForKeyframe = TimeDelta::Millis(500); constexpr auto kMaxWaitForFrame = TimeDelta::Millis(1500); constexpr VideoReceiveStreamTimeoutTracker::Timeouts config = { - kMaxWaitForKeyframe, kMaxWaitForFrame}; + .max_wait_for_keyframe = kMaxWaitForKeyframe, + .max_wait_for_frame = kMaxWaitForFrame}; } // namespace class VideoReceiveStreamTimeoutTrackerTest : public ::testing::Test { diff --git a/third_party/libwebrtc/video/video_send_stream_impl.cc b/third_party/libwebrtc/video/video_send_stream_impl.cc @@ -785,15 +785,17 @@ void VideoSendStreamImpl::SignalEncoderActive() { MediaStreamAllocationConfig VideoSendStreamImpl::GetAllocationConfig() const { return MediaStreamAllocationConfig{ - static_cast<uint32_t>(encoder_min_bitrate_bps_), - encoder_max_bitrate_bps_, - static_cast<uint32_t>(disable_padding_ ? 0 : max_padding_bitrate_), - encoder_av1_priority_bitrate_override_bps_, - !config_.suspend_below_min_bitrate, - encoder_bitrate_priority_, - (content_type_ == VideoEncoderConfig::ContentType::kRealtimeVideo) - ? std::optional(TrackRateElasticity::kCanConsumeExtraRate) - : std::nullopt}; + .min_bitrate_bps = static_cast<uint32_t>(encoder_min_bitrate_bps_), + .max_bitrate_bps = encoder_max_bitrate_bps_, + .pad_up_bitrate_bps = + static_cast<uint32_t>(disable_padding_ ? 0 : max_padding_bitrate_), + .priority_bitrate_bps = encoder_av1_priority_bitrate_override_bps_, + .enforce_min_bitrate = !config_.suspend_below_min_bitrate, + .bitrate_priority = encoder_bitrate_priority_, + .rate_elasticity = + (content_type_ == VideoEncoderConfig::ContentType::kRealtimeVideo) + ? std::optional(TrackRateElasticity::kCanConsumeExtraRate) + : std::nullopt}; } void VideoSendStreamImpl::OnEncoderConfigurationChanged( diff --git a/third_party/libwebrtc/video/video_send_stream_tests.cc b/third_party/libwebrtc/video/video_send_stream_tests.cc @@ -2931,7 +2931,9 @@ TEST_F(VideoSendStreamTest, ReportsSentResolution) { static const struct { int width; int height; - } kEncodedResolution[kNumStreams] = {{241, 181}, {300, 121}, {121, 221}}; + } kEncodedResolution[kNumStreams] = {{.width = 241, .height = 181}, + {.width = 300, .height = 121}, + {.width = 121, .height = 221}}; class ScreencastTargetBitrateTest : public test::SendTest, public test::FakeEncoder { public: @@ -3623,7 +3625,10 @@ TEST_F(VideoSendStreamTest, Vp9NonFlexModeSmallResolution) { } }; - Vp9TestParams params{"L1T1", 1, 1, InterLayerPredMode::kOn}; + Vp9TestParams params{.scalability_mode = "L1T1", + .num_spatial_layers = 1, + .num_temporal_layers = 1, + .inter_layer_pred = InterLayerPredMode::kOn}; NonFlexibleModeResolution test(params); RunBaseTest(&test); @@ -3667,7 +3672,10 @@ TEST_F(VideoSendStreamTest, MAYBE_Vp9FlexModeRefCount) { } }; - Vp9TestParams params{"L2T1", 2, 1, InterLayerPredMode::kOn}; + Vp9TestParams params{.scalability_mode = "L2T1", + .num_spatial_layers = 2, + .num_temporal_layers = 1, + .inter_layer_pred = InterLayerPredMode::kOn}; FlexibleMode test(params); RunBaseTest(&test); diff --git a/third_party/libwebrtc/video/video_stream_encoder.cc b/third_party/libwebrtc/video/video_stream_encoder.cc @@ -1832,7 +1832,10 @@ void VideoStreamEncoder::MaybeEncodeVideoFrame(const VideoFrame& video_frame, << ", texture=" << last_frame_info_->is_texture << "."; // Force full frame update, since resolution has changed. accumulated_update_rect_ = - VideoFrame::UpdateRect{0, 0, video_frame.width(), video_frame.height()}; + VideoFrame::UpdateRect{.offset_x = 0, + .offset_y = 0, + .width = video_frame.width(), + .height = video_frame.height()}; } // We have to create the encoder before the frame drop logic, @@ -2022,8 +2025,10 @@ void VideoStreamEncoder::EncodeVideoFrame(const VideoFrame& video_frame, cropped_height); update_rect.offset_x -= offset_x; update_rect.offset_y -= offset_y; - update_rect.Intersect( - VideoFrame::UpdateRect{0, 0, cropped_width, cropped_height}); + update_rect.Intersect(VideoFrame::UpdateRect{.offset_x = 0, + .offset_y = 0, + .width = cropped_width, + .height = cropped_height}); } else { // The difference is large, scale it. @@ -2032,8 +2037,10 @@ void VideoStreamEncoder::EncodeVideoFrame(const VideoFrame& video_frame, if (!update_rect.IsEmpty()) { // Since we can't reason about pixels after scaling, we invalidate whole // picture, if anything changed. - update_rect = - VideoFrame::UpdateRect{0, 0, cropped_width, cropped_height}; + update_rect = VideoFrame::UpdateRect{.offset_x = 0, + .offset_y = 0, + .width = cropped_width, + .height = cropped_height}; } } if (!cropped_buffer) { @@ -2050,7 +2057,10 @@ void VideoStreamEncoder::EncodeVideoFrame(const VideoFrame& video_frame, // frame here. if (!accumulated_update_rect_.IsEmpty()) { accumulated_update_rect_ = - VideoFrame::UpdateRect{0, 0, out_frame.width(), out_frame.height()}; + VideoFrame::UpdateRect{.offset_x = 0, + .offset_y = 0, + .width = out_frame.width(), + .height = out_frame.height()}; accumulated_update_rect_is_valid_ = false; } } @@ -2061,7 +2071,10 @@ void VideoStreamEncoder::EncodeVideoFrame(const VideoFrame& video_frame, out_frame.has_update_rect()) { accumulated_update_rect_.Union(out_frame.update_rect()); accumulated_update_rect_.Intersect( - VideoFrame::UpdateRect{0, 0, out_frame.width(), out_frame.height()}); + VideoFrame::UpdateRect{.offset_x = 0, + .offset_y = 0, + .width = out_frame.width(), + .height = out_frame.height()}); out_frame.set_update_rect(accumulated_update_rect_); accumulated_update_rect_.MakeEmptyUpdate(); } diff --git a/third_party/libwebrtc/video/video_stream_encoder_unittest.cc b/third_party/libwebrtc/video/video_stream_encoder_unittest.cc @@ -1008,7 +1008,8 @@ class VideoStreamEncoderTest : public ::testing::Test { .set_ntp_time_ms(ntp_time_ms) .set_timestamp_ms(ntp_time_ms) .set_rotation(kVideoRotation_0) - .set_update_rect(VideoFrame::UpdateRect{offset_x, 0, 1, 1}) + .set_update_rect(VideoFrame::UpdateRect{ + .offset_x = offset_x, .offset_y = 0, .width = 1, .height = 1}) .build(); } @@ -1413,8 +1414,8 @@ class VideoStreamEncoderTest : public ::testing::Test { uint32_t last_framerate_ RTC_GUARDED_BY(local_mutex_) = 0; std::optional<VideoEncoder::RateControlParameters> last_rate_control_settings_; - VideoFrame::UpdateRect last_update_rect_ RTC_GUARDED_BY(local_mutex_) = { - 0, 0, 0, 0}; + VideoFrame::UpdateRect last_update_rect_ RTC_GUARDED_BY( + local_mutex_) = {.offset_x = 0, .offset_y = 0, .width = 0, .height = 0}; std::vector<VideoFrameType> last_frame_types_; bool expect_null_frame_ = false; EncodedImageCallback* encoded_image_callback_ RTC_GUARDED_BY(local_mutex_) = @@ -10164,7 +10165,8 @@ TEST(VideoStreamEncoderFrameCadenceTest, EXPECT_CALL(mock_source, RequestRefreshFrame); video_stream_encoder->SendKeyFrame(); constexpr int kMaxFps = 30; - adapter_ptr->OnConstraintsChanged(VideoTrackSourceConstraints{0, kMaxFps}); + adapter_ptr->OnConstraintsChanged( + VideoTrackSourceConstraints{.min_fps = 0, .max_fps = kMaxFps}); factory.GetTimeController()->AdvanceTime( TimeDelta::Seconds(1) * FrameCadenceAdapterInterface::kOnDiscardedFrameRefreshFramePeriod /