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