diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn index 5256c02e70..e926ff84d7 100644 --- a/modules/video_coding/BUILD.gn +++ b/modules/video_coding/BUILD.gn @@ -1014,6 +1014,7 @@ if (rtc_include_tests) { "../../modules/video_coding/svc:scalability_mode_util", "../../rtc_base:logging", "../../rtc_base:stringutils", + "../../test:explicit_key_value_config", "../../test:fileutils", "../../test:test_flags", "../../test:test_main", diff --git a/modules/video_coding/codecs/test/video_codec_test.cc b/modules/video_coding/codecs/test/video_codec_test.cc index d5c7b51484..b6d5967589 100644 --- a/modules/video_coding/codecs/test/video_codec_test.cc +++ b/modules/video_coding/codecs/test/video_codec_test.cc @@ -28,6 +28,7 @@ #include "modules/video_coding/svc/scalability_mode_util.h" #include "rtc_base/logging.h" #include "rtc_base/strings/string_builder.h" +#include "test/explicit_key_value_config.h" #include "test/gtest.h" #include "test/test_flags.h" #include "test/testsupport/file_utils.h" @@ -60,6 +61,7 @@ ABSL_FLAG(double, 30.0, "Encode target frame rate of the top temporal layer in fps."); ABSL_FLAG(int, num_frames, 300, "Number of frames to encode and/or decode."); +ABSL_FLAG(std::string, field_trials, "", "Field trials to apply."); ABSL_FLAG(std::string, test_name, "", "Test name."); ABSL_FLAG(bool, dump_decoder_input, false, "Dump decoder input."); ABSL_FLAG(bool, dump_decoder_output, false, "Dump decoder output."); @@ -531,7 +533,10 @@ INSTANTIATE_TEST_SUITE_P( FramerateAdaptationTest::TestParamsToString); TEST(VideoCodecTest, DISABLED_EncodeDecode) { - const Environment env = CreateEnvironment(); + const Environment env = + CreateEnvironment(std::make_unique( + absl::GetFlag(FLAGS_field_trials))); + std::vector bitrate_str = absl::GetFlag(FLAGS_bitrate_kbps); std::vector bitrate_kbps; std::transform(bitrate_str.begin(), bitrate_str.end(), diff --git a/test/video_codec_tester.cc b/test/video_codec_tester.cc index e7674dfdab..9aef46d44e 100644 --- a/test/video_codec_tester.cc +++ b/test/video_codec_tester.cc @@ -985,7 +985,8 @@ class Encoder : public EncodedImageCallback { // layer >X receive encoded lower layers. int num_spatial_layers = ScalabilityModeToNumSpatialLayers(last_superframe_->scalability_mode); - for (int sidx = *last_superframe_->encoded_frame.SpatialIndex() + 1; + for (int sidx = + last_superframe_->encoded_frame.SpatialIndex().value_or(0) + 1; sidx < num_spatial_layers; ++sidx) { last_superframe_->encoded_frame.SetSpatialIndex(sidx); DeliverEncodedFrame(last_superframe_->encoded_frame);