From 0b44314b76cb84c855103458e93e2eeb0c6ee2a2 Mon Sep 17 00:00:00 2001 From: Artem Titov Date: Wed, 20 Mar 2019 11:11:08 +0100 Subject: [PATCH] Move PC e2e test framework into its own namespace Bug: webrtc:10138 Change-Id: I7fc02967058d3c53da73e280a7a1533a0860ba4c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128403 Commit-Queue: Artem Titov Reviewed-by: Ilya Nikolaevskiy Reviewed-by: Mirko Bonadei Reviewed-by: Peter Slatala Reviewed-by: Karl Wiberg Cr-Commit-Position: refs/heads/master@{#27203} --- .../audio/default_audio_quality_analyzer.cc | 4 +- .../audio/default_audio_quality_analyzer.h | 4 +- .../default_encoded_image_data_injector.cc | 4 +- .../default_encoded_image_data_injector.h | 4 +- ...lt_encoded_image_data_injector_unittest.cc | 4 +- .../video/default_video_quality_analyzer.cc | 4 +- .../video/default_video_quality_analyzer.h | 4 +- .../video/encoded_image_data_injector.h | 4 +- .../video/example_video_quality_analyzer.cc | 4 +- .../video/example_video_quality_analyzer.h | 4 +- test/pc/e2e/analyzer/video/id_generator.cc | 4 +- test/pc/e2e/analyzer/video/id_generator.h | 4 +- .../video/quality_analyzing_video_decoder.cc | 4 +- .../video/quality_analyzing_video_decoder.h | 4 +- .../video/quality_analyzing_video_encoder.cc | 4 +- .../video/quality_analyzing_video_encoder.h | 4 +- ...gle_process_encoded_image_data_injector.cc | 4 +- ...ngle_process_encoded_image_data_injector.h | 4 +- ...ss_encoded_image_data_injector_unittest.cc | 4 +- ...video_quality_analyzer_injection_helper.cc | 26 ++++++------- .../video_quality_analyzer_injection_helper.h | 12 +++--- .../api/audio_quality_analyzer_interface.h | 4 +- ...ate_peerconnection_quality_test_fixture.cc | 6 +-- ...eate_peerconnection_quality_test_fixture.h | 4 +- .../api/peerconnection_quality_test_fixture.h | 4 +- test/pc/e2e/api/stats_observer_interface.h | 4 +- .../api/video_quality_analyzer_interface.h | 4 +- test/pc/e2e/peer_connection_e2e_smoke_test.cc | 4 +- test/pc/e2e/peer_connection_quality_test.cc | 37 ++++++++++--------- test/pc/e2e/peer_connection_quality_test.h | 10 ++--- test/pc/e2e/stats_poller.cc | 4 +- test/pc/e2e/stats_poller.h | 4 +- test/pc/e2e/test_peer.cc | 6 +-- test/pc/e2e/test_peer.h | 4 +- 34 files changed, 105 insertions(+), 104 deletions(-) diff --git a/test/pc/e2e/analyzer/audio/default_audio_quality_analyzer.cc b/test/pc/e2e/analyzer/audio/default_audio_quality_analyzer.cc index a5b3e1b786..ed21024d8c 100644 --- a/test/pc/e2e/analyzer/audio/default_audio_quality_analyzer.cc +++ b/test/pc/e2e/analyzer/audio/default_audio_quality_analyzer.cc @@ -13,7 +13,7 @@ #include "rtc_base/logging.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { void DefaultAudioQualityAnalyzer::Start(std::string test_case_name) { test_case_name_ = std::move(test_case_name); @@ -25,5 +25,5 @@ void DefaultAudioQualityAnalyzer::OnStatsReports( // TODO(bugs.webrtc.org/10138): Implement audio stats collection. } -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc diff --git a/test/pc/e2e/analyzer/audio/default_audio_quality_analyzer.h b/test/pc/e2e/analyzer/audio/default_audio_quality_analyzer.h index 83bcbfcb80..c3478aeca4 100644 --- a/test/pc/e2e/analyzer/audio/default_audio_quality_analyzer.h +++ b/test/pc/e2e/analyzer/audio/default_audio_quality_analyzer.h @@ -16,7 +16,7 @@ #include "test/pc/e2e/api/audio_quality_analyzer_interface.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { class DefaultAudioQualityAnalyzer : public AudioQualityAnalyzerInterface { public: @@ -28,7 +28,7 @@ class DefaultAudioQualityAnalyzer : public AudioQualityAnalyzerInterface { std::string test_case_name_; }; -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc #endif // TEST_PC_E2E_ANALYZER_AUDIO_DEFAULT_AUDIO_QUALITY_ANALYZER_H_ diff --git a/test/pc/e2e/analyzer/video/default_encoded_image_data_injector.cc b/test/pc/e2e/analyzer/video/default_encoded_image_data_injector.cc index a7ae25338f..7127ef2e7f 100644 --- a/test/pc/e2e/analyzer/video/default_encoded_image_data_injector.cc +++ b/test/pc/e2e/analyzer/video/default_encoded_image_data_injector.cc @@ -18,7 +18,7 @@ #include "rtc_base/checks.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { namespace { // The amount on which encoded image buffer will be expanded to inject frame id. @@ -126,5 +126,5 @@ EncodedImageExtractionResult DefaultEncodedImageDataInjector::ExtractData( return EncodedImageExtractionResult{id.value(), out, discard}; } -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc diff --git a/test/pc/e2e/analyzer/video/default_encoded_image_data_injector.h b/test/pc/e2e/analyzer/video/default_encoded_image_data_injector.h index 2b6846da0a..9f2f530a01 100644 --- a/test/pc/e2e/analyzer/video/default_encoded_image_data_injector.h +++ b/test/pc/e2e/analyzer/video/default_encoded_image_data_injector.h @@ -23,7 +23,7 @@ #include "test/pc/e2e/analyzer/video/encoded_image_data_injector.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { // Injects frame id and discard flag into EncodedImage payload buffer. The // payload buffer will be appended in the injector with 2 bytes frame id and 4 @@ -69,7 +69,7 @@ class DefaultEncodedImageDataInjector : public EncodedImageDataInjector, int coding_entity_id) override; }; -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc #endif // TEST_PC_E2E_ANALYZER_VIDEO_DEFAULT_ENCODED_IMAGE_DATA_INJECTOR_H_ diff --git a/test/pc/e2e/analyzer/video/default_encoded_image_data_injector_unittest.cc b/test/pc/e2e/analyzer/video/default_encoded_image_data_injector_unittest.cc index 8dc341e33a..3ad978f66a 100644 --- a/test/pc/e2e/analyzer/video/default_encoded_image_data_injector_unittest.cc +++ b/test/pc/e2e/analyzer/video/default_encoded_image_data_injector_unittest.cc @@ -17,7 +17,7 @@ #include "test/gtest.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { namespace { rtc::Buffer CreateBufferOfSizeNFilledWithValuesFromX(size_t n, uint8_t x) { @@ -187,5 +187,5 @@ TEST(DefaultEncodedImageDataInjector, EXPECT_EQ(out.image.size(), 0ul); } -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc diff --git a/test/pc/e2e/analyzer/video/default_video_quality_analyzer.cc b/test/pc/e2e/analyzer/video/default_video_quality_analyzer.cc index f4f4ce3c12..579e1c04f4 100644 --- a/test/pc/e2e/analyzer/video/default_video_quality_analyzer.cc +++ b/test/pc/e2e/analyzer/video/default_video_quality_analyzer.cc @@ -20,7 +20,7 @@ #include "test/testsupport/perf_test.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { namespace { constexpr int kMaxActiveComparisons = 10; @@ -547,5 +547,5 @@ DefaultVideoQualityAnalyzer::FrameComparison::FrameComparison( dropped(dropped), frame_stats(std::move(frame_stats)) {} -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc diff --git a/test/pc/e2e/analyzer/video/default_video_quality_analyzer.h b/test/pc/e2e/analyzer/video/default_video_quality_analyzer.h index 1703454efb..43edecf89d 100644 --- a/test/pc/e2e/analyzer/video/default_video_quality_analyzer.h +++ b/test/pc/e2e/analyzer/video/default_video_quality_analyzer.h @@ -30,7 +30,7 @@ #include "test/pc/e2e/api/video_quality_analyzer_interface.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { class RateCounter { public: @@ -275,7 +275,7 @@ class DefaultVideoQualityAnalyzer : public VideoQualityAnalyzerInterface { rtc::Event comparison_available_event_; }; -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc #endif // TEST_PC_E2E_ANALYZER_VIDEO_DEFAULT_VIDEO_QUALITY_ANALYZER_H_ diff --git a/test/pc/e2e/analyzer/video/encoded_image_data_injector.h b/test/pc/e2e/analyzer/video/encoded_image_data_injector.h index bf541ba826..8e218629fc 100644 --- a/test/pc/e2e/analyzer/video/encoded_image_data_injector.h +++ b/test/pc/e2e/analyzer/video/encoded_image_data_injector.h @@ -17,7 +17,7 @@ #include "api/video/encoded_image.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { // Injects frame id into EncodedImage on encoder side class EncodedImageDataInjector { @@ -54,7 +54,7 @@ class EncodedImageDataExtractor { int coding_entity_id) = 0; }; -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc #endif // TEST_PC_E2E_ANALYZER_VIDEO_ENCODED_IMAGE_DATA_INJECTOR_H_ diff --git a/test/pc/e2e/analyzer/video/example_video_quality_analyzer.cc b/test/pc/e2e/analyzer/video/example_video_quality_analyzer.cc index 2ff5633391..cc5fba89ee 100644 --- a/test/pc/e2e/analyzer/video/example_video_quality_analyzer.cc +++ b/test/pc/e2e/analyzer/video/example_video_quality_analyzer.cc @@ -13,7 +13,7 @@ #include "rtc_base/logging.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { ExampleVideoQualityAnalyzer::ExampleVideoQualityAnalyzer() = default; ExampleVideoQualityAnalyzer::~ExampleVideoQualityAnalyzer() = default; @@ -149,5 +149,5 @@ uint64_t ExampleVideoQualityAnalyzer::frames_dropped() const { return frames_dropped_; } -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc diff --git a/test/pc/e2e/analyzer/video/example_video_quality_analyzer.h b/test/pc/e2e/analyzer/video/example_video_quality_analyzer.h index 7bd93823f5..1db1cf4c34 100644 --- a/test/pc/e2e/analyzer/video/example_video_quality_analyzer.h +++ b/test/pc/e2e/analyzer/video/example_video_quality_analyzer.h @@ -22,7 +22,7 @@ #include "test/pc/e2e/api/video_quality_analyzer_interface.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { // This class is an example implementation of // webrtc::VideoQualityAnalyzerInterface and calculates simple metrics @@ -81,7 +81,7 @@ class ExampleVideoQualityAnalyzer : public VideoQualityAnalyzerInterface { uint64_t frames_dropped_ RTC_GUARDED_BY(lock_) = 0; }; -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc #endif // TEST_PC_E2E_ANALYZER_VIDEO_EXAMPLE_VIDEO_QUALITY_ANALYZER_H_ diff --git a/test/pc/e2e/analyzer/video/id_generator.cc b/test/pc/e2e/analyzer/video/id_generator.cc index 615defd757..f1ead37e2f 100644 --- a/test/pc/e2e/analyzer/video/id_generator.cc +++ b/test/pc/e2e/analyzer/video/id_generator.cc @@ -11,7 +11,7 @@ #include "test/pc/e2e/analyzer/video/id_generator.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { IntIdGenerator::IntIdGenerator(int start_value) : next_id_(start_value) {} IntIdGenerator::~IntIdGenerator() = default; @@ -20,5 +20,5 @@ int IntIdGenerator::GetNextId() { return next_id_++; } -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc diff --git a/test/pc/e2e/analyzer/video/id_generator.h b/test/pc/e2e/analyzer/video/id_generator.h index 47bdcaffb6..8c988f211a 100644 --- a/test/pc/e2e/analyzer/video/id_generator.h +++ b/test/pc/e2e/analyzer/video/id_generator.h @@ -14,7 +14,7 @@ #include namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { // IdGenerator generates ids. All provided ids have to be unique. There is no // any order guarantees for provided ids. @@ -40,7 +40,7 @@ class IntIdGenerator : public IdGenerator { std::atomic next_id_; }; -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc #endif // TEST_PC_E2E_ANALYZER_VIDEO_ID_GENERATOR_H_ diff --git a/test/pc/e2e/analyzer/video/quality_analyzing_video_decoder.cc b/test/pc/e2e/analyzer/video/quality_analyzing_video_decoder.cc index e9161437ba..88294dfa0e 100644 --- a/test/pc/e2e/analyzer/video/quality_analyzing_video_decoder.cc +++ b/test/pc/e2e/analyzer/video/quality_analyzing_video_decoder.cc @@ -21,7 +21,7 @@ #include "rtc_base/logging.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { namespace { constexpr size_t kIrrelatedSimulcastStreamFrameWidth = 320; @@ -285,5 +285,5 @@ QualityAnalyzingVideoDecoderFactory::LegacyCreateVideoDecoder( id_generator_->GetNextId(), std::move(decoder), extractor_, analyzer_); } -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc diff --git a/test/pc/e2e/analyzer/video/quality_analyzing_video_decoder.h b/test/pc/e2e/analyzer/video/quality_analyzing_video_decoder.h index a32393774e..c912f25560 100644 --- a/test/pc/e2e/analyzer/video/quality_analyzing_video_decoder.h +++ b/test/pc/e2e/analyzer/video/quality_analyzing_video_decoder.h @@ -27,7 +27,7 @@ #include "test/pc/e2e/api/video_quality_analyzer_interface.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { // QualityAnalyzingVideoDecoder is used to wrap origin video decoder and inject // VideoQualityAnalyzerInterface before and after decoder. @@ -155,7 +155,7 @@ class QualityAnalyzingVideoDecoderFactory : public VideoDecoderFactory { VideoQualityAnalyzerInterface* const analyzer_; }; -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc #endif // TEST_PC_E2E_ANALYZER_VIDEO_QUALITY_ANALYZING_VIDEO_DECODER_H_ diff --git a/test/pc/e2e/analyzer/video/quality_analyzing_video_encoder.cc b/test/pc/e2e/analyzer/video/quality_analyzing_video_encoder.cc index e2f16cc22a..2e863753ef 100644 --- a/test/pc/e2e/analyzer/video/quality_analyzing_video_encoder.cc +++ b/test/pc/e2e/analyzer/video/quality_analyzing_video_encoder.cc @@ -19,7 +19,7 @@ #include "rtc_base/logging.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { namespace { constexpr size_t kMaxFrameInPipelineCount = 1000; @@ -290,5 +290,5 @@ QualityAnalyzingVideoEncoderFactory::CreateVideoEncoder( stream_required_spatial_index_, injector_, analyzer_); } -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc diff --git a/test/pc/e2e/analyzer/video/quality_analyzing_video_encoder.h b/test/pc/e2e/analyzer/video/quality_analyzing_video_encoder.h index 693817c24c..15c3a6f4af 100644 --- a/test/pc/e2e/analyzer/video/quality_analyzing_video_encoder.h +++ b/test/pc/e2e/analyzer/video/quality_analyzing_video_encoder.h @@ -27,7 +27,7 @@ #include "test/pc/e2e/api/video_quality_analyzer_interface.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { // QualityAnalyzingVideoEncoder is used to wrap origin video encoder and inject // VideoQualityAnalyzerInterface before and after encoder. @@ -178,7 +178,7 @@ class QualityAnalyzingVideoEncoderFactory : public VideoEncoderFactory { VideoQualityAnalyzerInterface* const analyzer_; }; -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc #endif // TEST_PC_E2E_ANALYZER_VIDEO_QUALITY_ANALYZING_VIDEO_ENCODER_H_ diff --git a/test/pc/e2e/analyzer/video/single_process_encoded_image_data_injector.cc b/test/pc/e2e/analyzer/video/single_process_encoded_image_data_injector.cc index dc0deeee0c..8f2dfe2cc6 100644 --- a/test/pc/e2e/analyzer/video/single_process_encoded_image_data_injector.cc +++ b/test/pc/e2e/analyzer/video/single_process_encoded_image_data_injector.cc @@ -18,7 +18,7 @@ #include "rtc_base/checks.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { namespace { // Number of bytes from the beginning of the EncodedImage buffer that will be @@ -145,5 +145,5 @@ SingleProcessEncodedImageDataInjector::ExtractionInfoVector:: SingleProcessEncodedImageDataInjector::ExtractionInfoVector:: ~ExtractionInfoVector() = default; -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc diff --git a/test/pc/e2e/analyzer/video/single_process_encoded_image_data_injector.h b/test/pc/e2e/analyzer/video/single_process_encoded_image_data_injector.h index 50141eb205..3787cc51aa 100644 --- a/test/pc/e2e/analyzer/video/single_process_encoded_image_data_injector.h +++ b/test/pc/e2e/analyzer/video/single_process_encoded_image_data_injector.h @@ -22,7 +22,7 @@ #include "test/pc/e2e/analyzer/video/encoded_image_data_injector.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { // Based on assumption that all call participants are in the same OS process // and uses same QualityAnalyzingVideoContext to obtain @@ -87,7 +87,7 @@ class SingleProcessEncodedImageDataInjector : public EncodedImageDataInjector, RTC_GUARDED_BY(lock_); }; -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc #endif // TEST_PC_E2E_ANALYZER_VIDEO_SINGLE_PROCESS_ENCODED_IMAGE_DATA_INJECTOR_H_ diff --git a/test/pc/e2e/analyzer/video/single_process_encoded_image_data_injector_unittest.cc b/test/pc/e2e/analyzer/video/single_process_encoded_image_data_injector_unittest.cc index 636877df40..67cafa75a6 100644 --- a/test/pc/e2e/analyzer/video/single_process_encoded_image_data_injector_unittest.cc +++ b/test/pc/e2e/analyzer/video/single_process_encoded_image_data_injector_unittest.cc @@ -17,7 +17,7 @@ #include "test/gtest.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { namespace { rtc::Buffer CreateBufferOfSizeNFilledWithValuesFromX(size_t n, uint8_t x) { @@ -194,5 +194,5 @@ TEST(SingleProcessEncodedImageDataInjector, EXPECT_EQ(out.image.capacity(), 3 * 10ul); } -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc diff --git a/test/pc/e2e/analyzer/video/video_quality_analyzer_injection_helper.cc b/test/pc/e2e/analyzer/video/video_quality_analyzer_injection_helper.cc index d146e71da9..939f594936 100644 --- a/test/pc/e2e/analyzer/video/video_quality_analyzer_injection_helper.cc +++ b/test/pc/e2e/analyzer/video/video_quality_analyzer_injection_helper.cc @@ -17,18 +17,18 @@ #include "test/pc/e2e/analyzer/video/quality_analyzing_video_encoder.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { namespace { // Intercepts generated frames and passes them also to video quality analyzer // and into video frame writer, if the last one is provided. -class InterceptingFrameGenerator : public FrameGenerator { +class InterceptingFrameGenerator : public test::FrameGenerator { public: InterceptingFrameGenerator(std::string stream_label, - std::unique_ptr delegate, + std::unique_ptr delegate, VideoQualityAnalyzerInterface* analyzer, - VideoFrameWriter* video_writer) + test::VideoFrameWriter* video_writer) : stream_label_(std::move(stream_label)), delegate_(std::move(delegate)), analyzer_(analyzer), @@ -54,9 +54,9 @@ class InterceptingFrameGenerator : public FrameGenerator { private: std::string stream_label_; - std::unique_ptr delegate_; + std::unique_ptr delegate_; VideoQualityAnalyzerInterface* analyzer_; - VideoFrameWriter* video_writer_; + test::VideoFrameWriter* video_writer_; }; // Implements the video sink, that forwards rendered frames to the video quality @@ -64,7 +64,7 @@ class InterceptingFrameGenerator : public FrameGenerator { class AnalyzingVideoSink : public rtc::VideoSinkInterface { public: AnalyzingVideoSink(VideoQualityAnalyzerInterface* analyzer, - VideoFrameWriter* video_writer) + test::VideoFrameWriter* video_writer) : analyzer_(analyzer), video_writer_(video_writer) { RTC_DCHECK(analyzer_); } @@ -81,7 +81,7 @@ class AnalyzingVideoSink : public rtc::VideoSinkInterface { private: VideoQualityAnalyzerInterface* analyzer_; - VideoFrameWriter* video_writer_; + test::VideoFrameWriter* video_writer_; }; } // namespace @@ -118,18 +118,18 @@ VideoQualityAnalyzerInjectionHelper::WrapVideoDecoderFactory( analyzer_.get()); } -std::unique_ptr +std::unique_ptr VideoQualityAnalyzerInjectionHelper::WrapFrameGenerator( std::string stream_label, - std::unique_ptr delegate, - VideoFrameWriter* writer) const { + std::unique_ptr delegate, + test::VideoFrameWriter* writer) const { return absl::make_unique( std::move(stream_label), std::move(delegate), analyzer_.get(), writer); } std::unique_ptr> VideoQualityAnalyzerInjectionHelper::CreateVideoSink( - VideoFrameWriter* writer) const { + test::VideoFrameWriter* writer) const { return absl::make_unique(analyzer_.get(), writer); } @@ -148,5 +148,5 @@ void VideoQualityAnalyzerInjectionHelper::Stop() { analyzer_->Stop(); } -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc diff --git a/test/pc/e2e/analyzer/video/video_quality_analyzer_injection_helper.h b/test/pc/e2e/analyzer/video/video_quality_analyzer_injection_helper.h index fbe93cb430..8e880a47ba 100644 --- a/test/pc/e2e/analyzer/video/video_quality_analyzer_injection_helper.h +++ b/test/pc/e2e/analyzer/video/video_quality_analyzer_injection_helper.h @@ -28,7 +28,7 @@ #include "test/testsupport/video_frame_writer.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { // Provides factory methods for components, that will be used to inject // VideoQualityAnalyzerInterface into PeerConnection pipeline. @@ -54,15 +54,15 @@ class VideoQualityAnalyzerInjectionHelper : public StatsObserverInterface { // Wraps frame generator, so video quality analyzer will gain access to the // captured frames. If |writer| in not nullptr, will dump captured frames // with provided writer. - std::unique_ptr WrapFrameGenerator( + std::unique_ptr WrapFrameGenerator( std::string stream_label, - std::unique_ptr delegate, - VideoFrameWriter* writer) const; + std::unique_ptr delegate, + test::VideoFrameWriter* writer) const; // Creates sink, that will allow video quality analyzer to get access to the // rendered frames. If |writer| in not nullptr, will dump rendered frames // with provided writer. std::unique_ptr> CreateVideoSink( - VideoFrameWriter* writer) const; + test::VideoFrameWriter* writer) const; void Start(std::string test_case_name, int max_threads_count); @@ -82,7 +82,7 @@ class VideoQualityAnalyzerInjectionHelper : public StatsObserverInterface { std::unique_ptr> encoding_entities_id_generator_; }; -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc #endif // TEST_PC_E2E_ANALYZER_VIDEO_VIDEO_QUALITY_ANALYZER_INJECTION_HELPER_H_ diff --git a/test/pc/e2e/api/audio_quality_analyzer_interface.h b/test/pc/e2e/api/audio_quality_analyzer_interface.h index 66da75a5e5..02d31cbe48 100644 --- a/test/pc/e2e/api/audio_quality_analyzer_interface.h +++ b/test/pc/e2e/api/audio_quality_analyzer_interface.h @@ -14,7 +14,7 @@ #include "test/pc/e2e/api/stats_observer_interface.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { class AudioQualityAnalyzerInterface : public StatsObserverInterface { public: @@ -26,7 +26,7 @@ class AudioQualityAnalyzerInterface : public StatsObserverInterface { virtual void Start(std::string test_case_name) = 0; }; -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc #endif // TEST_PC_E2E_API_AUDIO_QUALITY_ANALYZER_INTERFACE_H_ diff --git a/test/pc/e2e/api/create_peerconnection_quality_test_fixture.cc b/test/pc/e2e/api/create_peerconnection_quality_test_fixture.cc index 3b69d56919..355e939dd4 100644 --- a/test/pc/e2e/api/create_peerconnection_quality_test_fixture.cc +++ b/test/pc/e2e/api/create_peerconnection_quality_test_fixture.cc @@ -16,17 +16,17 @@ #include "test/pc/e2e/peer_connection_quality_test.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { std::unique_ptr CreatePeerConnectionE2EQualityTestFixture( std::string test_case_name, std::unique_ptr audio_quality_analyzer, std::unique_ptr video_quality_analyzer) { - return absl::make_unique( + return absl::make_unique( std::move(test_case_name), std::move(audio_quality_analyzer), std::move(video_quality_analyzer)); } -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc diff --git a/test/pc/e2e/api/create_peerconnection_quality_test_fixture.h b/test/pc/e2e/api/create_peerconnection_quality_test_fixture.h index b4dd2ab81d..0ab777691f 100644 --- a/test/pc/e2e/api/create_peerconnection_quality_test_fixture.h +++ b/test/pc/e2e/api/create_peerconnection_quality_test_fixture.h @@ -17,7 +17,7 @@ #include "test/pc/e2e/api/video_quality_analyzer_interface.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { // API is in development. Can be changed/removed without notice. // Create test fixture to establish test call between Alice and Bob. @@ -30,7 +30,7 @@ CreatePeerConnectionE2EQualityTestFixture( std::unique_ptr audio_quality_analyzer, std::unique_ptr video_quality_analyzer); -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc #endif // TEST_PC_E2E_API_CREATE_PEERCONNECTION_QUALITY_TEST_FIXTURE_H_ diff --git a/test/pc/e2e/api/peerconnection_quality_test_fixture.h b/test/pc/e2e/api/peerconnection_quality_test_fixture.h index 8984398c60..e09b934ce8 100644 --- a/test/pc/e2e/api/peerconnection_quality_test_fixture.h +++ b/test/pc/e2e/api/peerconnection_quality_test_fixture.h @@ -35,7 +35,7 @@ #include "test/pc/e2e/api/video_quality_analyzer_interface.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { // TODO(titovartem) move to API when it will be stabilized. class PeerConnectionE2EQualityTestFixture { @@ -230,7 +230,7 @@ class PeerConnectionE2EQualityTestFixture { virtual ~PeerConnectionE2EQualityTestFixture() = default; }; -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc #endif // TEST_PC_E2E_API_PEERCONNECTION_QUALITY_TEST_FIXTURE_H_ diff --git a/test/pc/e2e/api/stats_observer_interface.h b/test/pc/e2e/api/stats_observer_interface.h index 40b4cc551e..9782191b96 100644 --- a/test/pc/e2e/api/stats_observer_interface.h +++ b/test/pc/e2e/api/stats_observer_interface.h @@ -15,7 +15,7 @@ #include "api/stats_types.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { class StatsObserverInterface { public: @@ -27,7 +27,7 @@ class StatsObserverInterface { const StatsReports& reports) = 0; }; -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc #endif // TEST_PC_E2E_API_STATS_OBSERVER_INTERFACE_H_ diff --git a/test/pc/e2e/api/video_quality_analyzer_interface.h b/test/pc/e2e/api/video_quality_analyzer_interface.h index 5d90ab94c5..d7436e7c88 100644 --- a/test/pc/e2e/api/video_quality_analyzer_interface.h +++ b/test/pc/e2e/api/video_quality_analyzer_interface.h @@ -22,7 +22,7 @@ #include "test/pc/e2e/api/stats_observer_interface.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { // Base interface for video quality analyzer for peer connection level end-2-end // tests. Interface has only one abstract method, which have to return frame id. @@ -107,7 +107,7 @@ class VideoQualityAnalyzerInterface : public StatsObserverInterface { virtual std::string GetStreamLabel(uint16_t frame_id) = 0; }; -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc #endif // TEST_PC_E2E_API_VIDEO_QUALITY_ANALYZER_INTERFACE_H_ diff --git a/test/pc/e2e/peer_connection_e2e_smoke_test.cc b/test/pc/e2e/peer_connection_e2e_smoke_test.cc index 9a8ae7bc67..04d5b6cffc 100644 --- a/test/pc/e2e/peer_connection_e2e_smoke_test.cc +++ b/test/pc/e2e/peer_connection_e2e_smoke_test.cc @@ -23,7 +23,7 @@ #include "test/testsupport/file_utils.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { namespace { void PrintFrameCounters(const std::string& name, @@ -139,5 +139,5 @@ TEST(PeerConnectionE2EQualityTestSmokeTest, RunWithEmulatedNetwork) { } } -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc diff --git a/test/pc/e2e/peer_connection_quality_test.cc b/test/pc/e2e/peer_connection_quality_test.cc index b26c58ed23..91df37671f 100644 --- a/test/pc/e2e/peer_connection_quality_test.cc +++ b/test/pc/e2e/peer_connection_quality_test.cc @@ -32,7 +32,7 @@ #include "test/testsupport/file_utils.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { namespace { using VideoConfig = PeerConnectionE2EQualityTestFixture::VideoConfig; @@ -430,7 +430,8 @@ void PeerConnectionE2EQualityTest::ValidateParams(std::vector params) { } if (p->audio_config.value().mode == AudioConfig::Mode::kFile) { RTC_CHECK(p->audio_config.value().input_file_name); - RTC_CHECK(FileExists(p->audio_config.value().input_file_name.value())); + RTC_CHECK( + test::FileExists(p->audio_config.value().input_file_name.value())); } } } @@ -457,7 +458,7 @@ void PeerConnectionE2EQualityTest::SetupVideoSink( } } RTC_CHECK(video_config); - VideoFrameWriter* writer = MaybeCreateVideoWriter( + test::VideoFrameWriter* writer = MaybeCreateVideoWriter( video_config->output_dump_file_name, *video_config); // It is safe to cast here, because it is checked above that // track->kind() is kVideoKind. @@ -509,12 +510,12 @@ PeerConnectionE2EQualityTest::MaybeAddVideo(TestPeer* peer) { std::vector> out; for (auto video_config : params->video_configs) { // Create video generator. - std::unique_ptr frame_generator = + std::unique_ptr frame_generator = CreateFrameGenerator(video_config); // Wrap it to inject video quality analyzer and enable dump of input video // if required. - VideoFrameWriter* writer = + test::VideoFrameWriter* writer = MaybeCreateVideoWriter(video_config.input_dump_file_name, video_config); frame_generator = video_quality_analyzer_injection_helper_->WrapFrameGenerator( @@ -522,8 +523,8 @@ PeerConnectionE2EQualityTest::MaybeAddVideo(TestPeer* peer) { writer); // Setup FrameGenerator into peer connection. - std::unique_ptr capturer = - absl::WrapUnique(FrameGeneratorCapturer::Create( + std::unique_ptr capturer = + absl::WrapUnique(test::FrameGeneratorCapturer::Create( std::move(frame_generator), video_config.fps, clock_)); rtc::scoped_refptr source = new rtc::RefCountedObject( @@ -539,26 +540,26 @@ PeerConnectionE2EQualityTest::MaybeAddVideo(TestPeer* peer) { return out; } -std::unique_ptr +std::unique_ptr PeerConnectionE2EQualityTest::CreateFrameGenerator( const VideoConfig& video_config) { if (video_config.generator) { - absl::optional frame_generator_type = + absl::optional frame_generator_type = absl::nullopt; if (video_config.generator == VideoGeneratorType::kDefault) { - frame_generator_type = FrameGenerator::OutputType::I420; + frame_generator_type = test::FrameGenerator::OutputType::I420; } else if (video_config.generator == VideoGeneratorType::kI420A) { - frame_generator_type = FrameGenerator::OutputType::I420A; + frame_generator_type = test::FrameGenerator::OutputType::I420A; } else if (video_config.generator == VideoGeneratorType::kI010) { - frame_generator_type = FrameGenerator::OutputType::I010; + frame_generator_type = test::FrameGenerator::OutputType::I010; } - return FrameGenerator::CreateSquareGenerator( + return test::FrameGenerator::CreateSquareGenerator( static_cast(video_config.width), static_cast(video_config.height), frame_generator_type, absl::nullopt); } if (video_config.input_file_name) { - return FrameGenerator::CreateFromYuvFile( + return test::FrameGenerator::CreateFromYuvFile( std::vector(/*count=*/1, video_config.input_file_name.value()), video_config.width, video_config.height, /*frame_repeat_count=*/1); @@ -634,15 +635,15 @@ void PeerConnectionE2EQualityTest::TearDownCall() { bob_.reset(); } -VideoFrameWriter* PeerConnectionE2EQualityTest::MaybeCreateVideoWriter( +test::VideoFrameWriter* PeerConnectionE2EQualityTest::MaybeCreateVideoWriter( absl::optional file_name, const VideoConfig& config) { if (!file_name) { return nullptr; } - auto video_writer = absl::make_unique( + auto video_writer = absl::make_unique( file_name.value(), config.width, config.height, config.fps); - VideoFrameWriter* out = video_writer.get(); + test::VideoFrameWriter* out = video_writer.get(); video_writers_.push_back(std::move(video_writer)); return out; } @@ -659,5 +660,5 @@ PeerConnectionE2EQualityTest::ScheduledActivity::ScheduledActivity( interval(std::move(interval)), func(std::move(func)) {} -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc diff --git a/test/pc/e2e/peer_connection_quality_test.h b/test/pc/e2e/peer_connection_quality_test.h index af7a6cee08..8da8464795 100644 --- a/test/pc/e2e/peer_connection_quality_test.h +++ b/test/pc/e2e/peer_connection_quality_test.h @@ -31,7 +31,7 @@ #include "test/testsupport/video_frame_writer.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { class PeerConnectionE2EQualityTest : public PeerConnectionE2EQualityTestFixture { @@ -95,7 +95,7 @@ class PeerConnectionE2EQualityTest MaybeAddMedia(TestPeer* peer); std::vector> MaybeAddVideo(TestPeer* peer); - std::unique_ptr CreateFrameGenerator( + std::unique_ptr CreateFrameGenerator( const VideoConfig& video_config); void MaybeAddAudio(TestPeer* peer); void SetupCall(); @@ -103,7 +103,7 @@ class PeerConnectionE2EQualityTest const std::vector< rtc::scoped_refptr>& sources); void TearDownCall(); - VideoFrameWriter* MaybeCreateVideoWriter( + test::VideoFrameWriter* MaybeCreateVideoWriter( absl::optional file_name, const VideoConfig& config); Timestamp Now() const; @@ -123,7 +123,7 @@ class PeerConnectionE2EQualityTest alice_video_sources_; std::vector> bob_video_sources_; - std::vector> video_writers_; + std::vector> video_writers_; std::vector>> output_video_sinks_; @@ -148,7 +148,7 @@ class PeerConnectionE2EQualityTest std::unique_ptr task_queue_; }; -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc #endif // TEST_PC_E2E_PEER_CONNECTION_QUALITY_TEST_H_ diff --git a/test/pc/e2e/stats_poller.cc b/test/pc/e2e/stats_poller.cc index 3bbb3965f4..987f26e7e8 100644 --- a/test/pc/e2e/stats_poller.cc +++ b/test/pc/e2e/stats_poller.cc @@ -15,7 +15,7 @@ #include "rtc_base/logging.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { void InternalStatsObserver::PollStats() { peer_->pc()->GetStats(this, nullptr, @@ -43,5 +43,5 @@ void StatsPoller::PollStatsAndNotifyObservers() { } } -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc diff --git a/test/pc/e2e/stats_poller.h b/test/pc/e2e/stats_poller.h index 3d44cfec8b..71c16899b2 100644 --- a/test/pc/e2e/stats_poller.h +++ b/test/pc/e2e/stats_poller.h @@ -21,7 +21,7 @@ #include "test/pc/e2e/test_peer.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { // Helper class that will notify all the webrtc::test::StatsObserverInterface // objects subscribed. @@ -58,7 +58,7 @@ class StatsPoller { std::vector> pollers_; }; -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc #endif // TEST_PC_E2E_STATS_POLLER_H_ diff --git a/test/pc/e2e/test_peer.cc b/test/pc/e2e/test_peer.cc index 54a9ce96f3..18736ea5ad 100644 --- a/test/pc/e2e/test_peer.cc +++ b/test/pc/e2e/test_peer.cc @@ -27,7 +27,7 @@ #include "test/testsupport/copy_to_file_audio_capturer.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { namespace { constexpr int16_t kGeneratedAudioMaxAmplitude = 32000; @@ -91,7 +91,7 @@ rtc::scoped_refptr CreateAudioDeviceModule( RTC_DCHECK(capturer); if (audio_config && audio_config->input_dump_file_name) { - capturer = absl::make_unique( + capturer = absl::make_unique( std::move(capturer), audio_config->input_dump_file_name.value()); } @@ -297,5 +297,5 @@ TestPeer::TestPeer( std::move(observer)), params_(std::move(params)) {} -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc diff --git a/test/pc/e2e/test_peer.h b/test/pc/e2e/test_peer.h index 86f7f6a20f..fa2f8eb7ef 100644 --- a/test/pc/e2e/test_peer.h +++ b/test/pc/e2e/test_peer.h @@ -26,7 +26,7 @@ #include "test/pc/e2e/api/peerconnection_quality_test_fixture.h" namespace webrtc { -namespace test { +namespace webrtc_pc_e2e { // Describes a single participant in the call. class TestPeer final : public PeerConnectionWrapper { @@ -72,7 +72,7 @@ class TestPeer final : public PeerConnectionWrapper { std::unique_ptr params_; }; -} // namespace test +} // namespace webrtc_pc_e2e } // namespace webrtc #endif // TEST_PC_E2E_TEST_PEER_H_