Skip to content

Commit 8a9f3a8

Browse files
Artem TitovWebRTC LUCI CQ
authored andcommitted
Reland "Remove dependency of video_replay on TestADM."
This reverts commit f9e3bdd. Reason for revert: reland with fix Original change's description: > Revert "Remove dependency of video_replay on TestADM." > > This reverts commit 0171666. > > Reason for revert: breaking CallPerfTest > https://ci.chromium.org/ui/p/webrtc/builders/perf/Perf%20Android32%20(R%20Pixel5)/967/overview > > Original change's description: > > 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} > > Bug: b/272350185, webrtc:15081 > Change-Id: I73aa0fd3c3d8c244d20e5f29f5792a4c7d7e4165 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/303160 > Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> > Owners-Override: Jeremy Leconte <jleconte@google.com> > Commit-Queue: Jeremy Leconte <jleconte@google.com> > Cr-Commit-Position: refs/heads/main@{#39939} Bug: b/272350185, webrtc:15081 Change-Id: I360ef3e140e60fc21d622480d1f3326e40a76f58 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/303400 Commit-Queue: Artem Titov <titovartem@webrtc.org> Reviewed-by: Henrik Andreassson <henrika@webrtc.org> Commit-Queue: Henrik Andreassson <henrika@webrtc.org> Auto-Submit: Artem Titov <titovartem@webrtc.org> Cr-Commit-Position: refs/heads/main@{#39946}
1 parent b11caa3 commit 8a9f3a8

40 files changed

+783
-497
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

@@ -217,6 +218,7 @@ if (rtc_include_tests) {
217218
"../test:scoped_key_value_config",
218219
"../test:test_common",
219220
"../test:test_support",
221+
"../test:video_test_constants",
220222
"../test/time_controller:time_controller",
221223
"utility:utility_tests",
222224
"//testing/gtest",
@@ -278,6 +280,7 @@ if (rtc_include_tests) {
278280
"../test:test_common",
279281
"../test:test_main",
280282
"../test:test_support",
283+
"../test:video_test_constants",
281284
"../test/pc/e2e:network_quality_metrics_reporter",
282285
"//testing/gtest",
283286
]

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: 37 additions & 23 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,18 +275,23 @@ 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();
@@ -298,7 +304,7 @@ void CallPerfTest::TestAudioVideoSync(FecMode fec,
298304
audio_recv_config.sync_group = kSyncGroup;
299305
audio_recv_config.decoder_factory = audio_decoder_factory_;
300306
audio_recv_config.decoder_map = {
301-
{kAudioSendPayloadType, {"OPUS", 48000, 2}}};
307+
{test::VideoTestConstants::kAudioSendPayloadType, {"OPUS", 48000, 2}}};
302308

303309
if (create_first == CreateOrder::kAudioFirst) {
304310
audio_receive_stream =
@@ -312,9 +318,11 @@ void CallPerfTest::TestAudioVideoSync(FecMode fec,
312318
EXPECT_EQ(1u, video_receive_streams_.size());
313319
observer->set_receive_stream(video_receive_streams_[0]);
314320
drifting_clock = std::make_unique<DriftingClock>(clock_, video_ntp_speed);
315-
CreateFrameGeneratorCapturerWithDrift(drifting_clock.get(), video_rtp_speed,
316-
kDefaultFramerate, kDefaultWidth,
317-
kDefaultHeight);
321+
CreateFrameGeneratorCapturerWithDrift(
322+
drifting_clock.get(), video_rtp_speed,
323+
test::VideoTestConstants::kDefaultFramerate,
324+
test::VideoTestConstants::kDefaultWidth,
325+
test::VideoTestConstants::kDefaultHeight);
318326

319327
Start();
320328

@@ -405,7 +413,7 @@ void CallPerfTest::TestCaptureNtpTime(
405413
int threshold_ms,
406414
int start_time_ms,
407415
int run_time_ms)
408-
: EndToEndTest(kLongTimeout),
416+
: EndToEndTest(test::VideoTestConstants::kLongTimeout),
409417
net_config_(net_config),
410418
clock_(Clock::GetRealTimeClock()),
411419
threshold_ms_(threshold_ms),
@@ -558,7 +566,9 @@ TEST_F(CallPerfTest, ReceivesCpuOveruseAndUnderuse) {
558566
class LoadObserver : public test::SendTest,
559567
public test::FrameGeneratorCapturer::SinkWantsObserver {
560568
public:
561-
LoadObserver() : SendTest(kLongTimeout), test_phase_(TestPhase::kInit) {}
569+
LoadObserver()
570+
: SendTest(test::VideoTestConstants::kLongTimeout),
571+
test_phase_(TestPhase::kInit) {}
562572

563573
void OnFrameGeneratorCapturerCreated(
564574
test::FrameGeneratorCapturer* frame_generator_capturer) override {
@@ -667,7 +677,7 @@ void CallPerfTest::TestMinTransmitBitrate(bool pad_to_min_bitrate) {
667677
public:
668678
explicit BitrateObserver(bool using_min_transmit_bitrate,
669679
TaskQueueBase* task_queue)
670-
: EndToEndTest(kLongTimeout),
680+
: EndToEndTest(test::VideoTestConstants::kLongTimeout),
671681
send_stream_(nullptr),
672682
converged_(false),
673683
pad_to_min_bitrate_(using_min_transmit_bitrate),
@@ -794,7 +804,7 @@ TEST_F(CallPerfTest, MAYBE_KeepsHighBitrateWhenReconfiguringSender) {
794804
class BitrateObserver : public test::EndToEndTest, public test::FakeEncoder {
795805
public:
796806
explicit BitrateObserver(TaskQueueBase* task_queue)
797-
: EndToEndTest(kDefaultTimeout),
807+
: EndToEndTest(test::VideoTestConstants::kDefaultTimeout),
798808
FakeEncoder(Clock::GetRealTimeClock()),
799809
encoder_inits_(0),
800810
last_set_bitrate_kbps_(0),
@@ -818,11 +828,11 @@ TEST_F(CallPerfTest, MAYBE_KeepsHighBitrateWhenReconfiguringSender) {
818828
: kInitialBitrateKbps - kInitialBitrateOverheadKpbs;
819829
EXPECT_EQ(expected_bitrate, config->startBitrate)
820830
<< "Encoder not initialized at expected bitrate.";
821-
EXPECT_EQ(kDefaultWidth, config->width);
822-
EXPECT_EQ(kDefaultHeight, config->height);
831+
EXPECT_EQ(test::VideoTestConstants::kDefaultWidth, config->width);
832+
EXPECT_EQ(test::VideoTestConstants::kDefaultHeight, config->height);
823833
} else if (encoder_inits_ == 2) {
824-
EXPECT_EQ(2 * kDefaultWidth, config->width);
825-
EXPECT_EQ(2 * kDefaultHeight, config->height);
834+
EXPECT_EQ(2 * test::VideoTestConstants::kDefaultWidth, config->width);
835+
EXPECT_EQ(2 * test::VideoTestConstants::kDefaultHeight, config->height);
826836
EXPECT_GE(last_set_bitrate_kbps_, kReconfigureThresholdKbps);
827837
EXPECT_GT(config->startBitrate, kReconfigureThresholdKbps)
828838
<< "Encoder reconfigured with bitrate too far away from last set.";
@@ -871,9 +881,12 @@ TEST_F(CallPerfTest, MAYBE_KeepsHighBitrateWhenReconfiguringSender) {
871881
}
872882

873883
void PerformTest() override {
874-
ASSERT_TRUE(time_to_reconfigure_.Wait(kDefaultTimeout))
884+
ASSERT_TRUE(
885+
time_to_reconfigure_.Wait(test::VideoTestConstants::kDefaultTimeout))
875886
<< "Timed out before receiving an initial high bitrate.";
876-
frame_generator_->ChangeResolution(kDefaultWidth * 2, kDefaultHeight * 2);
887+
frame_generator_->ChangeResolution(
888+
test::VideoTestConstants::kDefaultWidth * 2,
889+
test::VideoTestConstants::kDefaultHeight * 2);
877890
SendTask(task_queue_, [&]() {
878891
send_stream_->ReconfigureVideoEncoder(encoder_config_.Copy());
879892
});
@@ -1057,7 +1070,7 @@ void CallPerfTest::TestEncodeFramerate(VideoEncoderFactory* encoder_factory,
10571070
absl::string_view payload_name,
10581071
const std::vector<int>& max_framerates,
10591072
TaskQueueBase* task_queue)
1060-
: EndToEndTest(kDefaultTimeout),
1073+
: EndToEndTest(test::VideoTestConstants::kDefaultTimeout),
10611074
clock_(Clock::GetRealTimeClock()),
10621075
encoder_factory_(encoder_factory),
10631076
payload_name_(payload_name),
@@ -1096,7 +1109,8 @@ void CallPerfTest::TestEncodeFramerate(VideoEncoderFactory* encoder_factory,
10961109
VideoEncoderConfig* encoder_config) override {
10971110
send_config->encoder_settings.encoder_factory = encoder_factory_;
10981111
send_config->rtp.payload_name = payload_name_;
1099-
send_config->rtp.payload_type = test::CallTest::kVideoSendPayloadType;
1112+
send_config->rtp.payload_type =
1113+
test::VideoTestConstants::kVideoSendPayloadType;
11001114
encoder_config->video_format.name = payload_name_;
11011115
encoder_config->codec_type = PayloadStringToCodecType(payload_name_);
11021116
encoder_config->max_bitrate_bps = kMaxBitrate.bps();

0 commit comments

Comments
 (0)