Skip to content

Commit 0171666

Browse files
Artem TitovWebRTC LUCI CQ
authored andcommitted
Remove dependency of video_replay on TestADM.
This should remove requirement to build TestADM in chromium build. Bug: b/272350185, webrtc:15081 Change-Id: Iceb8862aa81099c22bd378ae692229f01ab3314c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/302380 Reviewed-by: Henrik Andreassson <henrika@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Artem Titov <titovartem@webrtc.org> Cr-Commit-Position: refs/heads/main@{#39934}
1 parent 47701c8 commit 0171666

40 files changed

+785
-498
lines changed

audio/BUILD.gn

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ if (rtc_include_tests) {
139139
"../system_wrappers",
140140
"../test:test_common",
141141
"../test:test_support",
142+
"../test:video_test_constants",
142143
]
143144
}
144145

@@ -216,6 +217,7 @@ if (rtc_include_tests) {
216217
"../test:scoped_key_value_config",
217218
"../test:test_common",
218219
"../test:test_support",
220+
"../test:video_test_constants",
219221
"../test/time_controller:time_controller",
220222
"utility:utility_tests",
221223
"//testing/gtest",
@@ -277,6 +279,7 @@ if (rtc_include_tests) {
277279
"../test:test_common",
278280
"../test:test_main",
279281
"../test:test_support",
282+
"../test:video_test_constants",
280283
"../test/pc/e2e:network_quality_metrics_reporter",
281284
"//testing/gtest",
282285
]

audio/audio_send_stream_tests.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "test/field_trial.h"
2020
#include "test/gtest.h"
2121
#include "test/rtcp_packet_parser.h"
22+
#include "test/video_test_constants.h"
2223

2324
namespace webrtc {
2425
namespace test {
@@ -31,7 +32,7 @@ enum : int { // The first valid value is 1.
3132

3233
class AudioSendTest : public SendTest {
3334
public:
34-
AudioSendTest() : SendTest(CallTest::kDefaultTimeout) {}
35+
AudioSendTest() : SendTest(VideoTestConstants::kDefaultTimeout) {}
3536

3637
size_t GetNumVideoStreams() const override { return 0; }
3738
size_t GetNumAudioStreams() const override { return 1; }

audio/test/audio_end_to_end_test.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "modules/audio_device/include/test_audio_device.h"
2020
#include "system_wrappers/include/sleep.h"
2121
#include "test/gtest.h"
22+
#include "test/video_test_constants.h"
2223

2324
namespace webrtc {
2425
namespace test {
@@ -29,7 +30,7 @@ constexpr int kSampleRate = 48000;
2930
} // namespace
3031

3132
AudioEndToEndTest::AudioEndToEndTest()
32-
: EndToEndTest(CallTest::kDefaultTimeout) {}
33+
: EndToEndTest(VideoTestConstants::kDefaultTimeout) {}
3334

3435
size_t AudioEndToEndTest::GetNumVideoStreams() const {
3536
return 0;
@@ -66,7 +67,7 @@ void AudioEndToEndTest::ModifyAudioConfigs(
6667
const webrtc::SdpAudioFormat kDefaultFormat("opus", 48000, 2,
6768
{{"stereo", "1"}});
6869
send_config->send_codec_spec = AudioSendStream::Config::SendCodecSpec(
69-
test::CallTest::kAudioSendPayloadType, kDefaultFormat);
70+
test::VideoTestConstants::kAudioSendPayloadType, kDefaultFormat);
7071
send_config->min_bitrate_bps = 32000;
7172
send_config->max_bitrate_bps = 32000;
7273
}

audio/test/low_bandwidth_audio_test.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "audio/test/audio_end_to_end_test.h"
1515
#include "system_wrappers/include/sleep.h"
1616
#include "test/testsupport/file_utils.h"
17+
#include "test/video_test_constants.h"
1718

1819
ABSL_DECLARE_FLAG(int, sample_rate_hz);
1920
ABSL_DECLARE_FLAG(bool, quick);
@@ -78,7 +79,7 @@ class Mobile2GNetworkTest : public AudioQualityTest {
7879
std::vector<AudioReceiveStreamInterface::Config>*
7980
receive_configs) override {
8081
send_config->send_codec_spec = AudioSendStream::Config::SendCodecSpec(
81-
test::CallTest::kAudioSendPayloadType,
82+
test::VideoTestConstants::kAudioSendPayloadType,
8283
{"OPUS",
8384
48000,
8485
2,

call/BUILD.gn

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,7 @@ if (rtc_include_tests) {
532532
"../test:scoped_key_value_config",
533533
"../test:test_common",
534534
"../test:test_support",
535+
"../test:video_test_constants",
535536
"../test/scenario",
536537
"../test/time_controller:time_controller",
537538
"../video",
@@ -606,6 +607,7 @@ if (rtc_include_tests) {
606607
"../test:test_common",
607608
"../test:test_support",
608609
"../test:video_test_common",
610+
"../test:video_test_constants",
609611
"../video",
610612
"../video/config:encoder_config",
611613
"//testing/gtest",

call/bitrate_estimator_tests.cc

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "test/fake_encoder.h"
3030
#include "test/frame_generator_capturer.h"
3131
#include "test/gtest.h"
32+
#include "test/video_test_constants.h"
3233

3334
namespace webrtc {
3435
namespace {
@@ -80,7 +81,9 @@ class LogObserver {
8081
}
8182
}
8283

83-
bool Wait() { return done_.Wait(test::CallTest::kDefaultTimeout); }
84+
bool Wait() {
85+
return done_.Wait(test::VideoTestConstants::kDefaultTimeout);
86+
}
8487

8588
void PushExpectedLogLine(absl::string_view expected_log_line) {
8689
MutexLock lock(&mutex_);
@@ -122,13 +125,15 @@ class BitrateEstimatorTest : public test::CallTest {
122125
/*observer=*/nullptr);
123126

124127
VideoSendStream::Config video_send_config(send_transport_.get());
125-
video_send_config.rtp.ssrcs.push_back(kVideoSendSsrcs[0]);
128+
video_send_config.rtp.ssrcs.push_back(
129+
test::VideoTestConstants::kVideoSendSsrcs[0]);
126130
video_send_config.encoder_settings.encoder_factory =
127131
&fake_encoder_factory_;
128132
video_send_config.encoder_settings.bitrate_allocator_factory =
129133
bitrate_allocator_factory_.get();
130134
video_send_config.rtp.payload_name = "FAKE";
131-
video_send_config.rtp.payload_type = kFakeVideoSendPayloadType;
135+
video_send_config.rtp.payload_type =
136+
test::VideoTestConstants::kFakeVideoSendPayloadType;
132137
SetVideoSendConfig(video_send_config);
133138
VideoEncoderConfig video_encoder_config;
134139
test::FillEncoderConfiguration(kVideoCodecVP8, 1, &video_encoder_config);
@@ -138,7 +143,8 @@ class BitrateEstimatorTest : public test::CallTest {
138143
VideoReceiveStreamInterface::Config(receive_transport_.get());
139144
// receive_config_.decoders will be set by every stream separately.
140145
receive_config_.rtp.remote_ssrc = GetVideoSendConfig()->rtp.ssrcs[0];
141-
receive_config_.rtp.local_ssrc = kReceiverLocalVideoSsrc;
146+
receive_config_.rtp.local_ssrc =
147+
test::VideoTestConstants::kReceiverLocalVideoSsrc;
142148
});
143149
}
144150

@@ -173,9 +179,12 @@ class BitrateEstimatorTest : public test::CallTest {
173179
frame_generator_capturer_ =
174180
std::make_unique<test::FrameGeneratorCapturer>(
175181
test->clock_,
176-
test::CreateSquareFrameGenerator(kDefaultWidth, kDefaultHeight,
177-
absl::nullopt, absl::nullopt),
178-
kDefaultFramerate, *test->task_queue_factory_);
182+
test::CreateSquareFrameGenerator(
183+
test::VideoTestConstants::kDefaultWidth,
184+
test::VideoTestConstants::kDefaultHeight, absl::nullopt,
185+
absl::nullopt),
186+
test::VideoTestConstants::kDefaultFramerate,
187+
*test->task_queue_factory_);
179188
frame_generator_capturer_->Init();
180189
send_stream_->SetSource(frame_generator_capturer_.get(),
181190
DegradationPreference::MAINTAIN_FRAMERATE);

call/call_perf_tests.cc

Lines changed: 39 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
#include "test/rtp_rtcp_observer.h"
5555
#include "test/testsupport/file_utils.h"
5656
#include "test/video_encoder_proxy_factory.h"
57+
#include "test/video_test_constants.h"
5758
#include "video/config/video_encoder_config.h"
5859
#include "video/transport_adapter.h"
5960

@@ -116,7 +117,7 @@ class VideoRtcpAndSyncObserver : public test::RtpRtcpObserver,
116117
explicit VideoRtcpAndSyncObserver(TaskQueueBase* task_queue,
117118
Clock* clock,
118119
absl::string_view test_label)
119-
: test::RtpRtcpObserver(CallPerfTest::kLongTimeout),
120+
: test::RtpRtcpObserver(test::VideoTestConstants::kLongTimeout),
120121
clock_(clock),
121122
test_label_(test_label),
122123
creation_time_ms_(clock_->TimeInMilliseconds()),
@@ -274,31 +275,37 @@ void CallPerfTest::TestAudioVideoSync(FecMode fec,
274275
audio_send_config.rtp.ssrc = kAudioSendSsrc;
275276
// TODO(bugs.webrtc.org/14683): Let the tests fail with invalid config.
276277
audio_send_config.send_codec_spec = AudioSendStream::Config::SendCodecSpec(
277-
kAudioSendPayloadType, {"OPUS", 48000, 2});
278+
test::VideoTestConstants::kAudioSendPayloadType, {"OPUS", 48000, 2});
278279
audio_send_config.min_bitrate_bps = 6000;
279280
audio_send_config.max_bitrate_bps = 510000;
280281
audio_send_config.encoder_factory = CreateBuiltinAudioEncoderFactory();
281282
audio_send_stream = sender_call_->CreateAudioSendStream(audio_send_config);
282283

283-
GetVideoSendConfig()->rtp.nack.rtp_history_ms = kNackRtpHistoryMs;
284+
GetVideoSendConfig()->rtp.nack.rtp_history_ms =
285+
test::VideoTestConstants::kNackRtpHistoryMs;
284286
if (fec == FecMode::kOn) {
285-
GetVideoSendConfig()->rtp.ulpfec.red_payload_type = kRedPayloadType;
286-
GetVideoSendConfig()->rtp.ulpfec.ulpfec_payload_type = kUlpfecPayloadType;
287-
video_receive_configs_[0].rtp.red_payload_type = kRedPayloadType;
288-
video_receive_configs_[0].rtp.ulpfec_payload_type = kUlpfecPayloadType;
287+
GetVideoSendConfig()->rtp.ulpfec.red_payload_type =
288+
test::VideoTestConstants::kRedPayloadType;
289+
GetVideoSendConfig()->rtp.ulpfec.ulpfec_payload_type =
290+
test::VideoTestConstants::kUlpfecPayloadType;
291+
video_receive_configs_[0].rtp.red_payload_type =
292+
test::VideoTestConstants::kRedPayloadType;
293+
video_receive_configs_[0].rtp.ulpfec_payload_type =
294+
test::VideoTestConstants::kUlpfecPayloadType;
289295
}
290296
video_receive_configs_[0].rtp.nack.rtp_history_ms = 1000;
291297
video_receive_configs_[0].renderer = observer.get();
292298
video_receive_configs_[0].sync_group = kSyncGroup;
293299

294300
AudioReceiveStreamInterface::Config audio_recv_config;
295-
audio_recv_config.rtp.remote_ssrc = kAudioSendSsrc;
301+
audio_recv_config.rtp.remote_ssrc =
302+
test::VideoTestConstants::kAudioSendSsrc;
296303
audio_recv_config.rtp.local_ssrc = kAudioRecvSsrc;
297304
audio_recv_config.rtcp_send_transport = receive_transport.get();
298305
audio_recv_config.sync_group = kSyncGroup;
299306
audio_recv_config.decoder_factory = audio_decoder_factory_;
300307
audio_recv_config.decoder_map = {
301-
{kAudioSendPayloadType, {"OPUS", 48000, 2}}};
308+
{test::VideoTestConstants::kAudioSendPayloadType, {"OPUS", 48000, 2}}};
302309

303310
if (create_first == CreateOrder::kAudioFirst) {
304311
audio_receive_stream =
@@ -312,9 +319,11 @@ void CallPerfTest::TestAudioVideoSync(FecMode fec,
312319
EXPECT_EQ(1u, video_receive_streams_.size());
313320
observer->set_receive_stream(video_receive_streams_[0]);
314321
drifting_clock = std::make_unique<DriftingClock>(clock_, video_ntp_speed);
315-
CreateFrameGeneratorCapturerWithDrift(drifting_clock.get(), video_rtp_speed,
316-
kDefaultFramerate, kDefaultWidth,
317-
kDefaultHeight);
322+
CreateFrameGeneratorCapturerWithDrift(
323+
drifting_clock.get(), video_rtp_speed,
324+
test::VideoTestConstants::kDefaultFramerate,
325+
test::VideoTestConstants::kDefaultWidth,
326+
test::VideoTestConstants::kDefaultHeight);
318327

319328
Start();
320329

@@ -405,7 +414,7 @@ void CallPerfTest::TestCaptureNtpTime(
405414
int threshold_ms,
406415
int start_time_ms,
407416
int run_time_ms)
408-
: EndToEndTest(kLongTimeout),
417+
: EndToEndTest(test::VideoTestConstants::kLongTimeout),
409418
net_config_(net_config),
410419
clock_(Clock::GetRealTimeClock()),
411420
threshold_ms_(threshold_ms),
@@ -558,7 +567,9 @@ TEST_F(CallPerfTest, ReceivesCpuOveruseAndUnderuse) {
558567
class LoadObserver : public test::SendTest,
559568
public test::FrameGeneratorCapturer::SinkWantsObserver {
560569
public:
561-
LoadObserver() : SendTest(kLongTimeout), test_phase_(TestPhase::kInit) {}
570+
LoadObserver()
571+
: SendTest(test::VideoTestConstants::kLongTimeout),
572+
test_phase_(TestPhase::kInit) {}
562573

563574
void OnFrameGeneratorCapturerCreated(
564575
test::FrameGeneratorCapturer* frame_generator_capturer) override {
@@ -667,7 +678,7 @@ void CallPerfTest::TestMinTransmitBitrate(bool pad_to_min_bitrate) {
667678
public:
668679
explicit BitrateObserver(bool using_min_transmit_bitrate,
669680
TaskQueueBase* task_queue)
670-
: EndToEndTest(kLongTimeout),
681+
: EndToEndTest(test::VideoTestConstants::kLongTimeout),
671682
send_stream_(nullptr),
672683
converged_(false),
673684
pad_to_min_bitrate_(using_min_transmit_bitrate),
@@ -794,7 +805,7 @@ TEST_F(CallPerfTest, MAYBE_KeepsHighBitrateWhenReconfiguringSender) {
794805
class BitrateObserver : public test::EndToEndTest, public test::FakeEncoder {
795806
public:
796807
explicit BitrateObserver(TaskQueueBase* task_queue)
797-
: EndToEndTest(kDefaultTimeout),
808+
: EndToEndTest(test::VideoTestConstants::kDefaultTimeout),
798809
FakeEncoder(Clock::GetRealTimeClock()),
799810
encoder_inits_(0),
800811
last_set_bitrate_kbps_(0),
@@ -818,11 +829,11 @@ TEST_F(CallPerfTest, MAYBE_KeepsHighBitrateWhenReconfiguringSender) {
818829
: kInitialBitrateKbps - kInitialBitrateOverheadKpbs;
819830
EXPECT_EQ(expected_bitrate, config->startBitrate)
820831
<< "Encoder not initialized at expected bitrate.";
821-
EXPECT_EQ(kDefaultWidth, config->width);
822-
EXPECT_EQ(kDefaultHeight, config->height);
832+
EXPECT_EQ(test::VideoTestConstants::kDefaultWidth, config->width);
833+
EXPECT_EQ(test::VideoTestConstants::kDefaultHeight, config->height);
823834
} else if (encoder_inits_ == 2) {
824-
EXPECT_EQ(2 * kDefaultWidth, config->width);
825-
EXPECT_EQ(2 * kDefaultHeight, config->height);
835+
EXPECT_EQ(2 * test::VideoTestConstants::kDefaultWidth, config->width);
836+
EXPECT_EQ(2 * test::VideoTestConstants::kDefaultHeight, config->height);
826837
EXPECT_GE(last_set_bitrate_kbps_, kReconfigureThresholdKbps);
827838
EXPECT_GT(config->startBitrate, kReconfigureThresholdKbps)
828839
<< "Encoder reconfigured with bitrate too far away from last set.";
@@ -871,9 +882,12 @@ TEST_F(CallPerfTest, MAYBE_KeepsHighBitrateWhenReconfiguringSender) {
871882
}
872883

873884
void PerformTest() override {
874-
ASSERT_TRUE(time_to_reconfigure_.Wait(kDefaultTimeout))
885+
ASSERT_TRUE(
886+
time_to_reconfigure_.Wait(test::VideoTestConstants::kDefaultTimeout))
875887
<< "Timed out before receiving an initial high bitrate.";
876-
frame_generator_->ChangeResolution(kDefaultWidth * 2, kDefaultHeight * 2);
888+
frame_generator_->ChangeResolution(
889+
test::VideoTestConstants::kDefaultWidth * 2,
890+
test::VideoTestConstants::kDefaultHeight * 2);
877891
SendTask(task_queue_, [&]() {
878892
send_stream_->ReconfigureVideoEncoder(encoder_config_.Copy());
879893
});
@@ -1057,7 +1071,7 @@ void CallPerfTest::TestEncodeFramerate(VideoEncoderFactory* encoder_factory,
10571071
absl::string_view payload_name,
10581072
const std::vector<int>& max_framerates,
10591073
TaskQueueBase* task_queue)
1060-
: EndToEndTest(kDefaultTimeout),
1074+
: EndToEndTest(test::VideoTestConstants::kDefaultTimeout),
10611075
clock_(Clock::GetRealTimeClock()),
10621076
encoder_factory_(encoder_factory),
10631077
payload_name_(payload_name),
@@ -1096,7 +1110,8 @@ void CallPerfTest::TestEncodeFramerate(VideoEncoderFactory* encoder_factory,
10961110
VideoEncoderConfig* encoder_config) override {
10971111
send_config->encoder_settings.encoder_factory = encoder_factory_;
10981112
send_config->rtp.payload_name = payload_name_;
1099-
send_config->rtp.payload_type = test::CallTest::kVideoSendPayloadType;
1113+
send_config->rtp.payload_type =
1114+
test::VideoTestConstants::kVideoSendPayloadType;
11001115
encoder_config->video_format.name = payload_name_;
11011116
encoder_config->codec_type = PayloadStringToCodecType(payload_name_);
11021117
encoder_config->max_bitrate_bps = kMaxBitrate.bps();

0 commit comments

Comments
 (0)