diff --git a/api/BUILD.gn b/api/BUILD.gn index 9768c6d5ee..de839adeb1 100644 --- a/api/BUILD.gn +++ b/api/BUILD.gn @@ -659,9 +659,9 @@ rtc_library("create_peer_connection_quality_test_frame_generator") { deps = [ ":create_frame_generator", ":frame_generator_api", - ":peer_connection_quality_test_fixture_api", "../rtc_base:checks", "../test:fileutils", + "test/pclf:media_configuration", ] absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ] } diff --git a/api/test/create_peer_connection_quality_test_frame_generator.cc b/api/test/create_peer_connection_quality_test_frame_generator.cc index 29eb41ca42..a1c53635f9 100644 --- a/api/test/create_peer_connection_quality_test_frame_generator.cc +++ b/api/test/create_peer_connection_quality_test_frame_generator.cc @@ -14,18 +14,13 @@ #include #include "api/test/create_frame_generator.h" -#include "api/test/peerconnection_quality_test_fixture.h" +#include "api/test/pclf/media_configuration.h" #include "rtc_base/checks.h" #include "test/testsupport/file_utils.h" namespace webrtc { namespace webrtc_pc_e2e { -using VideoConfig = - ::webrtc::webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture::VideoConfig; -using ScreenShareConfig = ::webrtc::webrtc_pc_e2e:: - PeerConnectionE2EQualityTestFixture::ScreenShareConfig; - void ValidateScreenShareConfig(const VideoConfig& video_config, const ScreenShareConfig& screen_share_config) { if (screen_share_config.slides_yuv_file_names.empty()) { diff --git a/api/test/create_peer_connection_quality_test_frame_generator.h b/api/test/create_peer_connection_quality_test_frame_generator.h index ab3f65aa57..62043d140a 100644 --- a/api/test/create_peer_connection_quality_test_frame_generator.h +++ b/api/test/create_peer_connection_quality_test_frame_generator.h @@ -15,7 +15,7 @@ #include "absl/types/optional.h" #include "api/test/frame_generator_interface.h" -#include "api/test/peerconnection_quality_test_fixture.h" +#include "api/test/pclf/media_configuration.h" namespace webrtc { namespace webrtc_pc_e2e { @@ -25,19 +25,18 @@ namespace webrtc_pc_e2e { // FrameGeneratorInterface::OutputType::I420. video_config specifies frame // weight and height. std::unique_ptr CreateSquareFrameGenerator( - const PeerConnectionE2EQualityTestFixture::VideoConfig& video_config, + const VideoConfig& video_config, absl::optional type); // Creates a frame generator that plays frames from the yuv file. std::unique_ptr CreateFromYuvFileFrameGenerator( - const PeerConnectionE2EQualityTestFixture::VideoConfig& video_config, + const VideoConfig& video_config, std::string filename); // Creates a proper frame generator for testing screen sharing. std::unique_ptr CreateScreenShareFrameGenerator( - const PeerConnectionE2EQualityTestFixture::VideoConfig& video_config, - const PeerConnectionE2EQualityTestFixture::ScreenShareConfig& - screen_share_config); + const VideoConfig& video_config, + const ScreenShareConfig& screen_share_config); } // namespace webrtc_pc_e2e } // namespace webrtc diff --git a/api/test/pclf/BUILD.gn b/api/test/pclf/BUILD.gn index 6375e45f49..218331541b 100644 --- a/api/test/pclf/BUILD.gn +++ b/api/test/pclf/BUILD.gn @@ -88,6 +88,7 @@ rtc_library("peer_configurer") { "peer_configurer.h", ] deps = [ + ":media_configuration", ":media_quality_test_params", "../../../api:callfactory_api", "../../../api:create_peer_connection_quality_test_frame_generator", diff --git a/api/test/pclf/media_configuration.cc b/api/test/pclf/media_configuration.cc index b1694dfacc..56b9e52e01 100644 --- a/api/test/pclf/media_configuration.cc +++ b/api/test/pclf/media_configuration.cc @@ -44,14 +44,6 @@ void AppendResolution(const VideoResolution& resolution, } // namespace -ScrollingParams::ScrollingParams(TimeDelta duration, - size_t source_width, - size_t source_height) - : duration(duration), - source_width(source_width), - source_height(source_height) { - RTC_CHECK_GT(duration.ms(), 0); -} ScreenShareConfig::ScreenShareConfig(TimeDelta slide_change_interval) : slide_change_interval(slide_change_interval) { RTC_CHECK_GT(slide_change_interval.ms(), 0); diff --git a/api/test/pclf/media_configuration.h b/api/test/pclf/media_configuration.h index c6ce16072b..8e841a265b 100644 --- a/api/test/pclf/media_configuration.h +++ b/api/test/pclf/media_configuration.h @@ -58,6 +58,9 @@ namespace webrtc { namespace webrtc_pc_e2e { +constexpr size_t kDefaultSlidesWidth = 1850; +constexpr size_t kDefaultSlidesHeight = 1110; + // The index of required capturing device in OS provided list of video // devices. On Linux and Windows the list will be obtained via // webrtc::VideoCaptureModule::DeviceInfo, on Mac OS via @@ -83,16 +86,12 @@ enum class CapturingDeviceIndex : size_t {}; // `duration` must be less or equal to // `ScreenShareConfig::slide_change_interval`. struct ScrollingParams { - ScrollingParams(TimeDelta duration, - size_t source_width, - size_t source_height); - // Duration of scrolling. TimeDelta duration; // Width of source slides video. - size_t source_width; + size_t source_width = kDefaultSlidesWidth; // Height of source slides video. - size_t source_height; + size_t source_height = kDefaultSlidesHeight; }; // Contains screen share video stream properties. diff --git a/api/test/pclf/peer_configurer.cc b/api/test/pclf/peer_configurer.cc index c404908d20..91235835d4 100644 --- a/api/test/pclf/peer_configurer.cc +++ b/api/test/pclf/peer_configurer.cc @@ -13,6 +13,8 @@ #include #include "absl/strings/string_view.h" +#include "api/test/pclf/media_configuration.h" +#include "api/test/pclf/media_quality_test_params.h" #include "api/test/peer_network_dependencies.h" #include "modules/video_coding/svc/create_scalability_structure.h" #include "modules/video_coding/svc/scalability_mode_util.h" @@ -23,10 +25,6 @@ namespace webrtc { namespace webrtc_pc_e2e { namespace { -using AudioConfig = PeerConnectionE2EQualityTestFixture::AudioConfig; -using VideoConfig = PeerConnectionE2EQualityTestFixture::VideoConfig; -using RunParams = PeerConnectionE2EQualityTestFixture::RunParams; -using VideoCodecConfig = PeerConnectionE2EQualityTestFixture::VideoCodecConfig; using PeerConfigurer = PeerConnectionE2EQualityTestFixture::PeerConfigurer; // List of default names of generic participants according to @@ -111,34 +109,31 @@ PeerConfigurer* PeerConfigurerImpl::SetSSLCertificateVerifier( return this; } -PeerConfigurer* PeerConfigurerImpl::AddVideoConfig( - PeerConnectionE2EQualityTestFixture::VideoConfig config) { +PeerConfigurer* PeerConfigurerImpl::AddVideoConfig(VideoConfig config) { video_sources_.push_back( CreateSquareFrameGenerator(config, /*type=*/absl::nullopt)); configurable_params_->video_configs.push_back(std::move(config)); return this; } PeerConfigurer* PeerConfigurerImpl::AddVideoConfig( - PeerConnectionE2EQualityTestFixture::VideoConfig config, + VideoConfig config, std::unique_ptr generator) { configurable_params_->video_configs.push_back(std::move(config)); video_sources_.push_back(std::move(generator)); return this; } -PeerConfigurer* PeerConfigurerImpl::AddVideoConfig( - PeerConnectionE2EQualityTestFixture::VideoConfig config, - PeerConnectionE2EQualityTestFixture::CapturingDeviceIndex index) { +PeerConfigurer* PeerConfigurerImpl::AddVideoConfig(VideoConfig config, + CapturingDeviceIndex index) { configurable_params_->video_configs.push_back(std::move(config)); video_sources_.push_back(index); return this; } PeerConfigurer* PeerConfigurerImpl::SetVideoSubscription( - PeerConnectionE2EQualityTestFixture::VideoSubscription subscription) { + VideoSubscription subscription) { configurable_params_->video_subscription = std::move(subscription); return this; } -PeerConfigurer* PeerConfigurerImpl::SetAudioConfig( - PeerConnectionE2EQualityTestFixture::AudioConfig config) { +PeerConfigurer* PeerConfigurerImpl::SetAudioConfig(AudioConfig config) { params_->audio_config = std::move(config); return this; } @@ -200,8 +195,7 @@ PeerConfigurer* PeerConfigurerImpl::SetBitrateSettings( return this; } PeerConfigurer* PeerConfigurerImpl::SetVideoCodecs( - std::vector - video_codecs) { + std::vector video_codecs) { params_->video_codecs = std::move(video_codecs); return this; } @@ -301,9 +295,7 @@ void PeerParamsPreprocessor::SetDefaultValuesForMissingParams( } if (params->video_codecs.empty()) { - params->video_codecs.push_back( - PeerConnectionE2EQualityTestFixture::VideoCodecConfig( - cricket::kVp8CodecName)); + params->video_codecs.push_back(VideoCodecConfig(cricket::kVp8CodecName)); } } diff --git a/api/test/pclf/peer_configurer.h b/api/test/pclf/peer_configurer.h index 1c23b1b02c..e6fc2522f3 100644 --- a/api/test/pclf/peer_configurer.h +++ b/api/test/pclf/peer_configurer.h @@ -24,6 +24,7 @@ #include "api/rtc_event_log/rtc_event_log_factory_interface.h" #include "api/task_queue/task_queue_factory.h" #include "api/test/create_peer_connection_quality_test_frame_generator.h" +#include "api/test/pclf/media_configuration.h" #include "api/test/pclf/media_quality_test_params.h" #include "api/test/peer_network_dependencies.h" #include "api/test/peerconnection_quality_test_fixture.h" @@ -45,7 +46,7 @@ class PeerConfigurerImpl final public: using VideoSource = absl::variant, - PeerConnectionE2EQualityTestFixture::CapturingDeviceIndex>; + CapturingDeviceIndex>; explicit PeerConfigurerImpl( const PeerNetworkDependencies& network_dependencies); @@ -116,25 +117,21 @@ class PeerConfigurerImpl final // Add new video stream to the call that will be sent from this peer. // Default implementation of video frames generator will be used. - PeerConfigurer* AddVideoConfig( - PeerConnectionE2EQualityTestFixture::VideoConfig config) override; + PeerConfigurer* AddVideoConfig(VideoConfig config) override; // Add new video stream to the call that will be sent from this peer with // provided own implementation of video frames generator. PeerConfigurer* AddVideoConfig( - PeerConnectionE2EQualityTestFixture::VideoConfig config, + VideoConfig config, std::unique_ptr generator) override; // Add new video stream to the call that will be sent from this peer. // Capturing device with specified index will be used to get input video. PeerConfigurer* AddVideoConfig( - PeerConnectionE2EQualityTestFixture::VideoConfig config, - PeerConnectionE2EQualityTestFixture::CapturingDeviceIndex - capturing_device_index) override; + VideoConfig config, + CapturingDeviceIndex capturing_device_index) override; // Sets video subscription for the peer. By default subscription will // include all streams with `VideoSubscription::kSameAsSendStream` // resolution. To override this behavior use this method. - PeerConfigurer* SetVideoSubscription( - PeerConnectionE2EQualityTestFixture::VideoSubscription subscription) - override; + PeerConfigurer* SetVideoSubscription(VideoSubscription subscription) override; // Set the list of video codecs used by the peer during the test. These // codecs will be negotiated in SDP during offer/answer exchange. The order // of these codecs during negotiation will be the same as in `video_codecs`. @@ -142,12 +139,10 @@ class PeerConfigurerImpl final // be negotiated. If some of specified codecs won't be found, the test will // crash. PeerConfigurer* SetVideoCodecs( - std::vector - video_codecs) override; + std::vector video_codecs) override; // Set the audio stream for the call from this peer. If this method won't // be invoked, this peer will send no audio. - PeerConfigurer* SetAudioConfig( - PeerConnectionE2EQualityTestFixture::AudioConfig config) override; + PeerConfigurer* SetAudioConfig(AudioConfig config) override; // Set if ULP FEC should be used or not. False by default. PeerConfigurer* SetUseUlpFEC(bool value) override; diff --git a/api/test/peerconnection_quality_test_fixture.h b/api/test/peerconnection_quality_test_fixture.h index 167170cfde..9bf08239ac 100644 --- a/api/test/peerconnection_quality_test_fixture.h +++ b/api/test/peerconnection_quality_test_fixture.h @@ -60,9 +60,6 @@ namespace webrtc { namespace webrtc_pc_e2e { -constexpr size_t kDefaultSlidesWidth = 1850; -constexpr size_t kDefaultSlidesHeight = 1110; - // API is in development. Can be changed/removed without notice. class PeerConnectionE2EQualityTestFixture { public: diff --git a/test/pc/e2e/BUILD.gn b/test/pc/e2e/BUILD.gn index 2a2ef58dbf..92b8f9a531 100644 --- a/test/pc/e2e/BUILD.gn +++ b/test/pc/e2e/BUILD.gn @@ -170,8 +170,8 @@ if (!build_with_chromium) { ] deps = [ ":encoded_image_data_injector_api", - "../../../api:peer_connection_quality_test_fixture_api", "../../../api:video_quality_analyzer_api", + "../../../api/test/pclf:media_configuration", "../../../api/video:encoded_image", "../../../api/video:video_frame", "../../../api/video:video_rtp_headers", @@ -208,7 +208,7 @@ if (!build_with_chromium) { "analyzer/video/analyzing_video_sinks_helper.h", ] deps = [ - "../../../api:peer_connection_quality_test_fixture_api", + "../../../api/test/pclf:media_configuration", "../../../api/test/video:video_frame_writer", "../../../rtc_base:macromagic", "../../../rtc_base/synchronization:mutex", @@ -231,9 +231,9 @@ if (!build_with_chromium) { ":video_dumping", "../..:fixed_fps_video_frame_writer_adapter", "../..:test_renderer", - "../../../api:peer_connection_quality_test_fixture_api", "../../../api:video_quality_analyzer_api", "../../../api/numerics", + "../../../api/test/pclf:media_configuration", "../../../api/test/video:video_frame_writer", "../../../api/units:timestamp", "../../../api/video:video_frame", @@ -268,9 +268,9 @@ if (!build_with_chromium) { "../..:fixed_fps_video_frame_writer_adapter", "../..:test_renderer", "../../../api:array_view", - "../../../api:peer_connection_quality_test_fixture_api", "../../../api:stats_observer_interface", "../../../api:video_quality_analyzer_api", + "../../../api/test/pclf:media_configuration", "../../../api/video:video_frame", "../../../api/video:video_rtp_headers", "../../../api/video_codecs:video_codecs_api", @@ -297,7 +297,7 @@ if (!build_with_chromium) { "echo/echo_emulation.h", ] deps = [ - "../../../api:peer_connection_quality_test_fixture_api", + "../../../api/test/pclf:media_configuration", "../../../modules/audio_device:audio_device_impl", "../../../rtc_base:swap_queue", ] @@ -315,10 +315,10 @@ if (!build_with_chromium) { "../../../api:frame_generator_api", "../../../api:function_view", "../../../api:libjingle_peerconnection_api", - "../../../api:peer_connection_quality_test_fixture_api", "../../../api:scoped_refptr", "../../../api:sequence_checker", "../../../api/task_queue:pending_task_safety_flag", + "../../../api/test/pclf:media_configuration", "../../../api/test/pclf:media_quality_test_params", "../../../api/test/pclf:peer_configurer", "../../../modules/audio_processing:api", @@ -352,6 +352,7 @@ if (!build_with_chromium) { "../../../api:time_controller", "../../../api/rtc_event_log:rtc_event_log_factory", "../../../api/task_queue:default_task_queue_factory", + "../../../api/test/pclf:media_configuration", "../../../api/test/pclf:media_quality_test_params", "../../../api/test/pclf:peer_configurer", "../../../api/transport:field_trial_based_config", @@ -388,7 +389,7 @@ if (!build_with_chromium) { "../../../api:create_frame_generator", "../../../api:frame_generator_api", "../../../api:media_stream_interface", - "../../../api:peer_connection_quality_test_fixture_api", + "../../../api/test/pclf:media_configuration", "../../../api/test/pclf:peer_configurer", "../../../api/video:video_frame", "../../../pc:session_description", @@ -468,6 +469,7 @@ if (!build_with_chromium) { "../../../api/task_queue", "../../../api/test/metrics:metric", "../../../api/test/metrics:metrics_logger", + "../../../api/test/pclf:media_configuration", "../../../api/test/pclf:media_quality_test_params", "../../../api/test/pclf:peer_configurer", "../../../api/units:time_delta", @@ -519,7 +521,7 @@ if (!build_with_chromium) { deps = [ ":analyzing_video_sinks_helper", "../..:test_support", - "../../../api:peer_connection_quality_test_fixture_api", + "../../../api/test/pclf:media_configuration", ] absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ] } @@ -535,8 +537,8 @@ if (!build_with_chromium) { "../..:video_test_support", "../../../api:create_frame_generator", "../../../api:frame_generator_api", - "../../../api:peer_connection_quality_test_fixture_api", "../../../api:scoped_refptr", + "../../../api/test/pclf:media_configuration", "../../../api/units:time_delta", "../../../api/units:timestamp", "../../../api/video:video_frame", @@ -586,6 +588,8 @@ if (!build_with_chromium) { "../../../api/audio_codecs:builtin_audio_decoder_factory", "../../../api/audio_codecs:builtin_audio_encoder_factory", "../../../api/test/metrics:global_metrics_logger_and_exporter", + "../../../api/test/pclf:media_configuration", + "../../../api/test/pclf:media_quality_test_params", "../../../api/video_codecs:builtin_video_decoder_factory", "../../../api/video_codecs:builtin_video_encoder_factory", "../../../call:simulated_network", @@ -626,6 +630,8 @@ if (!build_with_chromium) { "../../../api:peer_connection_quality_test_fixture_api", "../../../api/test/metrics:metrics_logger", "../../../api/test/metrics:stdout_metrics_exporter", + "../../../api/test/pclf:media_configuration", + "../../../api/test/pclf:media_quality_test_params", "../../../api/units:time_delta", ] } @@ -642,6 +648,8 @@ if (!build_with_chromium) { "../../../api:network_emulation_manager_api", "../../../api:peer_connection_quality_test_fixture_api", "../../../api/test/metrics:global_metrics_logger_and_exporter", + "../../../api/test/pclf:media_configuration", + "../../../api/test/pclf:media_quality_test_params", "../../../api/units:time_delta", "../../../rtc_base:timeutils", ] @@ -1082,8 +1090,8 @@ if (!build_with_chromium) { deps = [ "../../../api:array_view", "../../../api:libjingle_peerconnection_api", - "../../../api:peer_connection_quality_test_fixture_api", "../../../api:rtp_parameters", + "../../../api/test/pclf:media_configuration", "../../../media:rtc_media_base", "../../../p2p:rtc_p2p", "../../../pc:sdp_utils", diff --git a/test/pc/e2e/analyzer/video/analyzing_video_sink.cc b/test/pc/e2e/analyzer/video/analyzing_video_sink.cc index acf273c893..fb221e6797 100644 --- a/test/pc/e2e/analyzer/video/analyzing_video_sink.cc +++ b/test/pc/e2e/analyzer/video/analyzing_video_sink.cc @@ -16,7 +16,7 @@ #include "absl/memory/memory.h" #include "absl/strings/string_view.h" #include "absl/types/optional.h" -#include "api/test/peerconnection_quality_test_fixture.h" +#include "api/test/pclf/media_configuration.h" #include "api/test/video/video_frame_writer.h" #include "api/units/timestamp.h" #include "api/video/i420_buffer.h" @@ -32,13 +32,6 @@ namespace webrtc { namespace webrtc_pc_e2e { -using VideoSubscription = ::webrtc::webrtc_pc_e2e:: - PeerConnectionE2EQualityTestFixture::VideoSubscription; -using VideoResolution = ::webrtc::webrtc_pc_e2e:: - PeerConnectionE2EQualityTestFixture::VideoResolution; -using VideoConfig = - ::webrtc::webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture::VideoConfig; - AnalyzingVideoSink::AnalyzingVideoSink(absl::string_view peer_name, Clock* clock, VideoQualityAnalyzerInterface& analyzer, diff --git a/test/pc/e2e/analyzer/video/analyzing_video_sink.h b/test/pc/e2e/analyzer/video/analyzing_video_sink.h index af75e0c873..1834bbe469 100644 --- a/test/pc/e2e/analyzer/video/analyzing_video_sink.h +++ b/test/pc/e2e/analyzer/video/analyzing_video_sink.h @@ -18,7 +18,7 @@ #include "absl/strings/string_view.h" #include "api/numerics/samples_stats_counter.h" -#include "api/test/peerconnection_quality_test_fixture.h" +#include "api/test/pclf/media_configuration.h" #include "api/test/video/video_frame_writer.h" #include "api/test/video_quality_analyzer_interface.h" #include "api/video/video_frame.h" @@ -44,19 +44,15 @@ class AnalyzingVideoSink : public rtc::VideoSinkInterface { SamplesStatsCounter analyzing_sink_processing_time_ms; }; - AnalyzingVideoSink( - absl::string_view peer_name, - Clock* clock, - VideoQualityAnalyzerInterface& analyzer, - AnalyzingVideoSinksHelper& sinks_helper, - const PeerConnectionE2EQualityTestFixture::VideoSubscription& - subscription, - bool report_infra_stats); + AnalyzingVideoSink(absl::string_view peer_name, + Clock* clock, + VideoQualityAnalyzerInterface& analyzer, + AnalyzingVideoSinksHelper& sinks_helper, + const VideoSubscription& subscription, + bool report_infra_stats); // Updates subscription used by this peer to render received video. - void UpdateSubscription( - const PeerConnectionE2EQualityTestFixture::VideoSubscription& - subscription); + void UpdateSubscription(const VideoSubscription& subscription); void OnFrame(const VideoFrame& frame) override; @@ -64,16 +60,15 @@ class AnalyzingVideoSink : public rtc::VideoSinkInterface { private: struct SinksDescriptor { - SinksDescriptor( - absl::string_view sender_peer_name, - const PeerConnectionE2EQualityTestFixture::VideoResolution& resolution) + SinksDescriptor(absl::string_view sender_peer_name, + const VideoResolution& resolution) : sender_peer_name(sender_peer_name), resolution(resolution) {} // Required to be able to resolve resolutions on new subscription and // understand if we need to recreate `video_frame_writer` and `sinks`. std::string sender_peer_name; // Resolution which was used to create `video_frame_writer` and `sinks`. - PeerConnectionE2EQualityTestFixture::VideoResolution resolution; + VideoResolution resolution; // Is set if dumping of output video was requested; test::VideoFrameWriter* video_frame_writer = nullptr; @@ -82,10 +77,9 @@ class AnalyzingVideoSink : public rtc::VideoSinkInterface { // Scales video frame to `required_resolution` if necessary. Crashes if video // frame and `required_resolution` have different aspect ratio. - VideoFrame ScaleVideoFrame( - const VideoFrame& frame, - const PeerConnectionE2EQualityTestFixture::VideoResolution& - required_resolution) RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + VideoFrame ScaleVideoFrame(const VideoFrame& frame, + const VideoResolution& required_resolution) + RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_); // Creates full copy of the frame to free any frame owned internal buffers // and passes created copy to analyzer. Uses `I420Buffer` to represent // frame content. @@ -101,8 +95,7 @@ class AnalyzingVideoSink : public rtc::VideoSinkInterface { AnalyzingVideoSinksHelper* const sinks_helper_; mutable Mutex mutex_; - PeerConnectionE2EQualityTestFixture::VideoSubscription subscription_ - RTC_GUARDED_BY(mutex_); + VideoSubscription subscription_ RTC_GUARDED_BY(mutex_); std::map stream_sinks_ RTC_GUARDED_BY(mutex_); Stats stats_ RTC_GUARDED_BY(mutex_); }; diff --git a/test/pc/e2e/analyzer/video/analyzing_video_sink_test.cc b/test/pc/e2e/analyzer/video/analyzing_video_sink_test.cc index 4607eddab3..fe88bc0bd7 100644 --- a/test/pc/e2e/analyzer/video/analyzing_video_sink_test.cc +++ b/test/pc/e2e/analyzer/video/analyzing_video_sink_test.cc @@ -19,7 +19,7 @@ #include "api/scoped_refptr.h" #include "api/test/create_frame_generator.h" #include "api/test/frame_generator_interface.h" -#include "api/test/peerconnection_quality_test_fixture.h" +#include "api/test/pclf/media_configuration.h" #include "api/units/time_delta.h" #include "api/units/timestamp.h" #include "api/video/i420_buffer.h" @@ -43,15 +43,6 @@ using ::testing::Eq; using ::testing::Ge; using ::testing::Test; -using VideoConfig = - ::webrtc::webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture::VideoConfig; -using VideoSubscription = ::webrtc::webrtc_pc_e2e:: - PeerConnectionE2EQualityTestFixture::VideoSubscription; -using VideoResolution = ::webrtc::webrtc_pc_e2e:: - PeerConnectionE2EQualityTestFixture::VideoResolution; -using VideoDumpOptions = ::webrtc::webrtc_pc_e2e:: - PeerConnectionE2EQualityTestFixture::VideoDumpOptions; - // Remove files and directories in a directory non-recursively. void CleanDir(absl::string_view dir, size_t expected_output_files_count) { absl::optional> dir_content = diff --git a/test/pc/e2e/analyzer/video/analyzing_video_sinks_helper.cc b/test/pc/e2e/analyzer/video/analyzing_video_sinks_helper.cc index 64c37e576f..70dc4b00b5 100644 --- a/test/pc/e2e/analyzer/video/analyzing_video_sinks_helper.cc +++ b/test/pc/e2e/analyzer/video/analyzing_video_sinks_helper.cc @@ -15,16 +15,13 @@ #include #include "absl/strings/string_view.h" -#include "api/test/peerconnection_quality_test_fixture.h" +#include "api/test/pclf/media_configuration.h" #include "api/test/video/video_frame_writer.h" #include "rtc_base/synchronization/mutex.h" namespace webrtc { namespace webrtc_pc_e2e { -using VideoConfig = - ::webrtc::webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture::VideoConfig; - void AnalyzingVideoSinksHelper::AddConfig(absl::string_view sender_peer_name, VideoConfig config) { MutexLock lock(&mutex_); diff --git a/test/pc/e2e/analyzer/video/analyzing_video_sinks_helper.h b/test/pc/e2e/analyzer/video/analyzing_video_sinks_helper.h index 38e8ccc350..5f38c5a40e 100644 --- a/test/pc/e2e/analyzer/video/analyzing_video_sinks_helper.h +++ b/test/pc/e2e/analyzer/video/analyzing_video_sinks_helper.h @@ -20,7 +20,7 @@ #include "absl/strings/string_view.h" #include "absl/types/optional.h" -#include "api/test/peerconnection_quality_test_fixture.h" +#include "api/test/pclf/media_configuration.h" #include "api/test/video/video_frame_writer.h" #include "rtc_base/synchronization/mutex.h" #include "rtc_base/thread_annotations.h" @@ -34,11 +34,9 @@ class AnalyzingVideoSinksHelper { public: // Adds config in the registry. If config with such stream label was // registered before, the new value will override the old one. - void AddConfig(absl::string_view sender_peer_name, - PeerConnectionE2EQualityTestFixture::VideoConfig config); - absl::optional< - std::pair> - GetPeerAndConfig(absl::string_view stream_label); + void AddConfig(absl::string_view sender_peer_name, VideoConfig config); + absl::optional> GetPeerAndConfig( + absl::string_view stream_label); // Removes video config for specified stream label. If there are no know video // config for such stream label - does nothing. void RemoveConfig(absl::string_view stream_label); @@ -63,10 +61,8 @@ class AnalyzingVideoSinksHelper { private: Mutex mutex_; - std::map< - std::string, - std::pair> - video_configs_ RTC_GUARDED_BY(mutex_); + std::map> video_configs_ + RTC_GUARDED_BY(mutex_); std::list> video_writers_ RTC_GUARDED_BY(mutex_); }; diff --git a/test/pc/e2e/analyzer/video/analyzing_video_sinks_helper_test.cc b/test/pc/e2e/analyzer/video/analyzing_video_sinks_helper_test.cc index 67f8f75bf4..1a820a5229 100644 --- a/test/pc/e2e/analyzer/video/analyzing_video_sinks_helper_test.cc +++ b/test/pc/e2e/analyzer/video/analyzing_video_sinks_helper_test.cc @@ -14,7 +14,7 @@ #include #include "absl/types/optional.h" -#include "api/test/peerconnection_quality_test_fixture.h" +#include "api/test/pclf/media_configuration.h" #include "test/gmock.h" #include "test/gtest.h" @@ -24,9 +24,6 @@ namespace { using ::testing::Eq; -using VideoConfig = - ::webrtc::webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture::VideoConfig; - // Asserts equality of the main fields of the video config. We don't compare // the full config due to the lack of equality definition for a lot of subtypes. void AssertConfigsAreEquals(const VideoConfig& actual, 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 4e765911b4..476136c468 100644 --- a/test/pc/e2e/analyzer/video/quality_analyzing_video_encoder.h +++ b/test/pc/e2e/analyzer/video/quality_analyzing_video_encoder.h @@ -17,7 +17,7 @@ #include #include "absl/strings/string_view.h" -#include "api/test/peerconnection_quality_test_fixture.h" +#include "api/test/pclf/media_configuration.h" #include "api/test/video_quality_analyzer_interface.h" #include "api/video/video_frame.h" #include "api/video_codecs/sdp_video_format.h" @@ -50,9 +50,8 @@ namespace webrtc_pc_e2e { class QualityAnalyzingVideoEncoder : public VideoEncoder, public EncodedImageCallback { public: - using EmulatedSFUConfigMap = std::map< - std::string, - absl::optional>; + using EmulatedSFUConfigMap = + std::map>; QualityAnalyzingVideoEncoder(absl::string_view peer_name, std::unique_ptr delegate, 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 7ce7932658..4bdc60168b 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 @@ -19,6 +19,7 @@ #include "absl/memory/memory.h" #include "absl/strings/string_view.h" #include "api/array_view.h" +#include "api/test/pclf/media_configuration.h" #include "api/video/i420_buffer.h" #include "rtc_base/checks.h" #include "rtc_base/logging.h" @@ -38,8 +39,6 @@ namespace { using EmulatedSFUConfigMap = ::webrtc::webrtc_pc_e2e::QualityAnalyzingVideoEncoder::EmulatedSFUConfigMap; -using VideoSubscription = ::webrtc::webrtc_pc_e2e:: - PeerConnectionE2EQualityTestFixture::VideoSubscription; class AnalyzingFramePreprocessor : public test::TestVideoCapturer::FramePreprocessor { @@ -150,7 +149,7 @@ VideoQualityAnalyzerInjectionHelper::CreateVideoSink( std::unique_ptr VideoQualityAnalyzerInjectionHelper::CreateVideoSink( absl::string_view peer_name, - const PeerConnectionE2EQualityTestFixture::VideoSubscription& subscription, + const VideoSubscription& subscription, bool report_infra_metrics) { return std::make_unique(peer_name, clock_, *analyzer_, sinks_helper_, subscription, 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 db49e05c90..6407890bb2 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 @@ -20,7 +20,7 @@ #include "absl/strings/string_view.h" #include "api/array_view.h" -#include "api/test/peerconnection_quality_test_fixture.h" +#include "api/test/pclf/media_configuration.h" #include "api/test/stats_observer_interface.h" #include "api/test/video_quality_analyzer_interface.h" #include "api/video/video_frame.h" @@ -43,7 +43,7 @@ namespace webrtc_pc_e2e { // VideoQualityAnalyzerInterface into PeerConnection pipeline. class VideoQualityAnalyzerInjectionHelper : public StatsObserverInterface { public: - using VideoConfig = PeerConnectionE2EQualityTestFixture::VideoConfig; + using VideoConfig = ::webrtc::webrtc_pc_e2e::VideoConfig; VideoQualityAnalyzerInjectionHelper( Clock* clock, @@ -83,8 +83,7 @@ class VideoQualityAnalyzerInjectionHelper : public StatsObserverInterface { // TODO(titovartem): Remove default value for `report_infra_metrics`. std::unique_ptr CreateVideoSink( absl::string_view peer_name, - const PeerConnectionE2EQualityTestFixture::VideoSubscription& - subscription, + const VideoSubscription& subscription, bool report_infra_metrics = false); void Start(std::string test_case_name, diff --git a/test/pc/e2e/echo/echo_emulation.cc b/test/pc/e2e/echo/echo_emulation.cc index f2b4be9e0d..8fdabeb16f 100644 --- a/test/pc/e2e/echo/echo_emulation.cc +++ b/test/pc/e2e/echo/echo_emulation.cc @@ -12,6 +12,8 @@ #include #include +#include "api/test/pclf/media_configuration.h" + namespace webrtc { namespace webrtc_pc_e2e { namespace { @@ -22,7 +24,7 @@ constexpr int kSingleBufferDurationMs = 10; EchoEmulatingCapturer::EchoEmulatingCapturer( std::unique_ptr capturer, - PeerConnectionE2EQualityTestFixture::EchoEmulationConfig config) + EchoEmulationConfig config) : delegate_(std::move(capturer)), config_(config), renderer_queue_(2 * config_.echo_delay.ms() / kSingleBufferDurationMs), diff --git a/test/pc/e2e/echo/echo_emulation.h b/test/pc/e2e/echo/echo_emulation.h index d1d41f63a8..359a481e46 100644 --- a/test/pc/e2e/echo/echo_emulation.h +++ b/test/pc/e2e/echo/echo_emulation.h @@ -16,7 +16,7 @@ #include #include -#include "api/test/peerconnection_quality_test_fixture.h" +#include "api/test/pclf/media_configuration.h" #include "modules/audio_device/include/test_audio_device.h" #include "rtc_base/swap_queue.h" @@ -29,7 +29,7 @@ class EchoEmulatingCapturer : public TestAudioDeviceModule::Capturer { public: EchoEmulatingCapturer( std::unique_ptr capturer, - PeerConnectionE2EQualityTestFixture::EchoEmulationConfig config); + EchoEmulationConfig config); void OnAudioRendered(rtc::ArrayView data); @@ -41,7 +41,7 @@ class EchoEmulatingCapturer : public TestAudioDeviceModule::Capturer { private: std::unique_ptr delegate_; - const PeerConnectionE2EQualityTestFixture::EchoEmulationConfig config_; + const EchoEmulationConfig config_; SwapQueue> renderer_queue_; diff --git a/test/pc/e2e/media/media_helper.cc b/test/pc/e2e/media/media_helper.cc index 4885a28ad0..b4b317ac97 100644 --- a/test/pc/e2e/media/media_helper.cc +++ b/test/pc/e2e/media/media_helper.cc @@ -15,22 +15,13 @@ #include "absl/types/variant.h" #include "api/media_stream_interface.h" #include "api/test/create_frame_generator.h" +#include "api/test/pclf/media_configuration.h" #include "test/frame_generator_capturer.h" #include "test/platform_video_capturer.h" #include "test/testsupport/file_utils.h" namespace webrtc { namespace webrtc_pc_e2e { -namespace { - -using VideoConfig = - ::webrtc::webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture::VideoConfig; -using AudioConfig = - ::webrtc::webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture::AudioConfig; -using CapturingDeviceIndex = ::webrtc::webrtc_pc_e2e:: - PeerConnectionE2EQualityTestFixture::CapturingDeviceIndex; - -} // namespace void MediaHelper::MaybeAddAudio(TestPeer* peer) { if (!peer->params().audio_config) { diff --git a/test/pc/e2e/media/media_helper.h b/test/pc/e2e/media/media_helper.h index 42ee7f117a..9f0f1f79a1 100644 --- a/test/pc/e2e/media/media_helper.h +++ b/test/pc/e2e/media/media_helper.h @@ -15,8 +15,8 @@ #include #include "api/test/frame_generator_interface.h" +#include "api/test/pclf/media_configuration.h" #include "api/test/pclf/peer_configurer.h" -#include "api/test/peerconnection_quality_test_fixture.h" #include "test/pc/e2e/analyzer/video/video_quality_analyzer_injection_helper.h" #include "test/pc/e2e/media/test_video_capturer_video_track_source.h" #include "test/pc/e2e/test_peer.h" @@ -42,7 +42,7 @@ class MediaHelper { private: std::unique_ptr CreateVideoCapturer( - const PeerConnectionE2EQualityTestFixture::VideoConfig& video_config, + const VideoConfig& video_config, PeerConfigurerImpl::VideoSource source, std::unique_ptr frame_preprocessor); diff --git a/test/pc/e2e/peer_connection_e2e_smoke_test.cc b/test/pc/e2e/peer_connection_e2e_smoke_test.cc index cb96546a0f..52c525f494 100644 --- a/test/pc/e2e/peer_connection_e2e_smoke_test.cc +++ b/test/pc/e2e/peer_connection_e2e_smoke_test.cc @@ -18,6 +18,8 @@ #include "api/test/create_peerconnection_quality_test_fixture.h" #include "api/test/metrics/global_metrics_logger_and_exporter.h" #include "api/test/network_emulation_manager.h" +#include "api/test/pclf/media_configuration.h" +#include "api/test/pclf/media_quality_test_params.h" #include "api/test/peerconnection_quality_test_fixture.h" #include "call/simulated_network.h" #include "system_wrappers/include/field_trial.h" @@ -39,21 +41,7 @@ namespace { class PeerConnectionE2EQualityTestSmokeTest : public ::testing::Test { public: - using EmulatedSFUConfig = - PeerConnectionE2EQualityTestFixture::EmulatedSFUConfig; using PeerConfigurer = PeerConnectionE2EQualityTestFixture::PeerConfigurer; - using RunParams = PeerConnectionE2EQualityTestFixture::RunParams; - using VideoConfig = PeerConnectionE2EQualityTestFixture::VideoConfig; - using VideoCodecConfig = - PeerConnectionE2EQualityTestFixture::VideoCodecConfig; - using AudioConfig = PeerConnectionE2EQualityTestFixture::AudioConfig; - using ScreenShareConfig = - PeerConnectionE2EQualityTestFixture::ScreenShareConfig; - using ScrollingParams = PeerConnectionE2EQualityTestFixture::ScrollingParams; - using VideoSimulcastConfig = - PeerConnectionE2EQualityTestFixture::VideoSimulcastConfig; - using EchoEmulationConfig = - PeerConnectionE2EQualityTestFixture::EchoEmulationConfig; void SetUp() override { network_emulation_ = CreateNetworkEmulationManager(); @@ -400,8 +388,8 @@ TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Screenshare) { screenshare.content_hint = VideoTrackInterface::ContentHint::kText; ScreenShareConfig screen_share_config = ScreenShareConfig(TimeDelta::Seconds(2)); - screen_share_config.scrolling_params = ScrollingParams( - TimeDelta::Millis(1800), kDefaultSlidesWidth, kDefaultSlidesHeight); + screen_share_config.scrolling_params = + ScrollingParams{.duration = TimeDelta::Millis(1800)}; auto screen_share_frame_generator = CreateScreenShareFrameGenerator(screenshare, screen_share_config); alice->AddVideoConfig(std::move(screenshare), diff --git a/test/pc/e2e/peer_connection_quality_test.cc b/test/pc/e2e/peer_connection_quality_test.cc index e0b0ce9a99..aa959f9227 100644 --- a/test/pc/e2e/peer_connection_quality_test.cc +++ b/test/pc/e2e/peer_connection_quality_test.cc @@ -22,6 +22,7 @@ #include "api/rtc_event_log_output_file.h" #include "api/scoped_refptr.h" #include "api/test/metrics/metric.h" +#include "api/test/pclf/media_configuration.h" #include "api/test/time_controller.h" #include "api/test/video_quality_analyzer_interface.h" #include "pc/sdp_utils.h" @@ -49,8 +50,6 @@ namespace { using ::webrtc::test::ImprovementDirection; using ::webrtc::test::Unit; -using VideoConfig = - ::webrtc::webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture::VideoConfig; constexpr TimeDelta kDefaultTimeout = TimeDelta::Seconds(10); constexpr char kSignalThreadName[] = "signaling_thread"; diff --git a/test/pc/e2e/peer_connection_quality_test.h b/test/pc/e2e/peer_connection_quality_test.h index 22c3bbe5da..1cf03198b5 100644 --- a/test/pc/e2e/peer_connection_quality_test.h +++ b/test/pc/e2e/peer_connection_quality_test.h @@ -19,6 +19,7 @@ #include "api/task_queue/task_queue_factory.h" #include "api/test/audio_quality_analyzer_interface.h" #include "api/test/metrics/metrics_logger.h" +#include "api/test/pclf/media_configuration.h" #include "api/test/pclf/media_quality_test_params.h" #include "api/test/pclf/peer_configurer.h" #include "api/test/peerconnection_quality_test_fixture.h" @@ -44,10 +45,6 @@ namespace webrtc_pc_e2e { class PeerConnectionE2EQualityTest : public PeerConnectionE2EQualityTestFixture { public: - using RunParams = PeerConnectionE2EQualityTestFixture::RunParams; - using VideoConfig = PeerConnectionE2EQualityTestFixture::VideoConfig; - using VideoSimulcastConfig = - PeerConnectionE2EQualityTestFixture::VideoSimulcastConfig; using PeerConfigurer = PeerConnectionE2EQualityTestFixture::PeerConfigurer; using QualityMetricsReporter = PeerConnectionE2EQualityTestFixture::QualityMetricsReporter; diff --git a/test/pc/e2e/peer_connection_quality_test_metric_names_test.cc b/test/pc/e2e/peer_connection_quality_test_metric_names_test.cc index a8775e280a..195cbc8baa 100644 --- a/test/pc/e2e/peer_connection_quality_test_metric_names_test.cc +++ b/test/pc/e2e/peer_connection_quality_test_metric_names_test.cc @@ -17,6 +17,8 @@ #include "api/test/metrics/metrics_logger.h" #include "api/test/metrics/stdout_metrics_exporter.h" #include "api/test/network_emulation_manager.h" +#include "api/test/pclf/media_configuration.h" +#include "api/test/pclf/media_quality_test_params.h" #include "api/test/peerconnection_quality_test_fixture.h" #include "api/units/time_delta.h" #include "test/gmock.h" @@ -37,16 +39,8 @@ using ::webrtc::test::Metric; using ::webrtc::test::MetricsExporter; using ::webrtc::test::StdoutMetricsExporter; using ::webrtc::test::Unit; -using RunParams = - ::webrtc::webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture::RunParams; -using VideoConfig = - ::webrtc::webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture::VideoConfig; -using AudioConfig = - ::webrtc::webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture::AudioConfig; using PeerConfigurer = ::webrtc::webrtc_pc_e2e:: PeerConnectionE2EQualityTestFixture::PeerConfigurer; -using VideoCodecConfig = ::webrtc::webrtc_pc_e2e:: - PeerConnectionE2EQualityTestFixture::VideoCodecConfig; // Adds a peer with some audio and video (the client should not care about // details about audio and video configs). diff --git a/test/pc/e2e/peer_connection_quality_test_test.cc b/test/pc/e2e/peer_connection_quality_test_test.cc index 704fafd441..2511bd2bdf 100644 --- a/test/pc/e2e/peer_connection_quality_test_test.cc +++ b/test/pc/e2e/peer_connection_quality_test_test.cc @@ -18,6 +18,8 @@ #include "api/test/create_network_emulation_manager.h" #include "api/test/metrics/global_metrics_logger_and_exporter.h" #include "api/test/network_emulation_manager.h" +#include "api/test/pclf/media_configuration.h" +#include "api/test/pclf/media_quality_test_params.h" #include "api/test/peerconnection_quality_test_fixture.h" #include "api/units/time_delta.h" #include "rtc_base/time_utils.h" @@ -33,14 +35,8 @@ namespace { using ::testing::Eq; using ::testing::Test; -using RunParams = - ::webrtc::webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture::RunParams; -using VideoConfig = - ::webrtc::webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture::VideoConfig; using PeerConfigurer = ::webrtc::webrtc_pc_e2e:: PeerConnectionE2EQualityTestFixture::PeerConfigurer; -using VideoDumpOptions = ::webrtc::webrtc_pc_e2e:: - PeerConnectionE2EQualityTestFixture::VideoDumpOptions; // Remove files and directories in a directory non-recursively. void CleanDir(absl::string_view dir, size_t expected_output_files_count) { diff --git a/test/pc/e2e/sdp/sdp_changer.cc b/test/pc/e2e/sdp/sdp_changer.cc index b3ee3b78bb..af55f29175 100644 --- a/test/pc/e2e/sdp/sdp_changer.cc +++ b/test/pc/e2e/sdp/sdp_changer.cc @@ -14,6 +14,7 @@ #include "absl/memory/memory.h" #include "api/jsep_session_description.h" +#include "api/test/pclf/media_configuration.h" #include "media/base/media_constants.h" #include "p2p/base/p2p_constants.h" #include "pc/sdp_utils.h" @@ -23,8 +24,6 @@ namespace webrtc { namespace webrtc_pc_e2e { namespace { -using VideoCodecConfig = PeerConnectionE2EQualityTestFixture::VideoCodecConfig; - std::string CodecRequiredParamsToString( const std::map& codec_required_params) { rtc::StringBuilder out; @@ -167,7 +166,7 @@ void SignalingInterceptor::FillSimulcastContext( LocalAndRemoteSdp SignalingInterceptor::PatchOffer( std::unique_ptr offer, - const PeerConnectionE2EQualityTestFixture::VideoCodecConfig& first_codec) { + const VideoCodecConfig& first_codec) { for (auto& content : offer->description()->contents()) { context_.mids_order.push_back(content.mid()); cricket::MediaContentDescription* media_desc = content.media_description(); @@ -364,7 +363,7 @@ LocalAndRemoteSdp SignalingInterceptor::PatchVp9Offer( LocalAndRemoteSdp SignalingInterceptor::PatchAnswer( std::unique_ptr answer, - const PeerConnectionE2EQualityTestFixture::VideoCodecConfig& first_codec) { + const VideoCodecConfig& first_codec) { for (auto& content : answer->description()->contents()) { cricket::MediaContentDescription* media_desc = content.media_description(); if (media_desc->type() != cricket::MediaType::MEDIA_TYPE_VIDEO) { diff --git a/test/pc/e2e/sdp/sdp_changer.h b/test/pc/e2e/sdp/sdp_changer.h index 115ed5ba2c..6f68d03f52 100644 --- a/test/pc/e2e/sdp/sdp_changer.h +++ b/test/pc/e2e/sdp/sdp_changer.h @@ -20,7 +20,7 @@ #include "api/array_view.h" #include "api/jsep.h" #include "api/rtp_parameters.h" -#include "api/test/peerconnection_quality_test_fixture.h" +#include "api/test/pclf/media_configuration.h" #include "media/base/rid_description.h" #include "pc/session_description.h" #include "pc/simulcast_description.h" @@ -40,8 +40,7 @@ namespace webrtc_pc_e2e { // vector and they will be added in the same order, as they were in // `supported_codecs`. std::vector FilterVideoCodecCapabilities( - rtc::ArrayView - video_codecs, + rtc::ArrayView video_codecs, bool use_rtx, bool use_ulpfec, bool use_flexfec, @@ -77,10 +76,10 @@ class SignalingInterceptor { LocalAndRemoteSdp PatchOffer( std::unique_ptr offer, - const PeerConnectionE2EQualityTestFixture::VideoCodecConfig& first_codec); + const VideoCodecConfig& first_codec); LocalAndRemoteSdp PatchAnswer( std::unique_ptr answer, - const PeerConnectionE2EQualityTestFixture::VideoCodecConfig& first_codec); + const VideoCodecConfig& first_codec); std::vector> PatchOffererIceCandidates( rtc::ArrayView candidates); diff --git a/test/pc/e2e/test_peer.cc b/test/pc/e2e/test_peer.cc index d978f10665..3e01c03f13 100644 --- a/test/pc/e2e/test_peer.cc +++ b/test/pc/e2e/test_peer.cc @@ -15,17 +15,13 @@ #include "absl/memory/memory.h" #include "absl/strings/string_view.h" #include "api/scoped_refptr.h" +#include "api/test/pclf/media_configuration.h" #include "modules/audio_processing/include/audio_processing.h" namespace webrtc { namespace webrtc_pc_e2e { namespace { -using VideoSubscription = ::webrtc::webrtc_pc_e2e:: - PeerConnectionE2EQualityTestFixture::VideoSubscription; -using VideoConfig = - ::webrtc::webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture::VideoConfig; - class SetRemoteDescriptionCallback : public webrtc::SetRemoteDescriptionObserverInterface { public: diff --git a/test/pc/e2e/test_peer.h b/test/pc/e2e/test_peer.h index 57bfba165a..dc4a699674 100644 --- a/test/pc/e2e/test_peer.h +++ b/test/pc/e2e/test_peer.h @@ -22,9 +22,9 @@ #include "api/set_remote_description_observer_interface.h" #include "api/task_queue/pending_task_safety_flag.h" #include "api/test/frame_generator_interface.h" +#include "api/test/pclf/media_configuration.h" #include "api/test/pclf/media_quality_test_params.h" #include "api/test/pclf/peer_configurer.h" -#include "api/test/peerconnection_quality_test_fixture.h" #include "pc/peer_connection_wrapper.h" #include "rtc_base/logging.h" #include "rtc_base/synchronization/mutex.h" @@ -41,12 +41,11 @@ class TestPeer final : public StatsProvider { const Params& params() const { return params_; } ConfigurableParams configurable_params() const; - void AddVideoConfig(PeerConnectionE2EQualityTestFixture::VideoConfig config); + void AddVideoConfig(VideoConfig config); // Removes video config with specified name. Crashes if the config with // specified name isn't found. void RemoveVideoConfig(absl::string_view stream_label); - void SetVideoSubscription( - PeerConnectionE2EQualityTestFixture::VideoSubscription subscription); + void SetVideoSubscription(VideoSubscription subscription); void GetStats(RTCStatsCollectorCallback* callback) override; diff --git a/test/pc/e2e/test_peer_factory.cc b/test/pc/e2e/test_peer_factory.cc index 72455f1d29..389fa3f821 100644 --- a/test/pc/e2e/test_peer_factory.cc +++ b/test/pc/e2e/test_peer_factory.cc @@ -15,6 +15,7 @@ #include "absl/strings/string_view.h" #include "api/task_queue/default_task_queue_factory.h" #include "api/test/create_time_controller.h" +#include "api/test/pclf/media_configuration.h" #include "api/test/pclf/peer_configurer.h" #include "api/test/time_controller.h" #include "api/transport/field_trial_based_config.h" @@ -33,12 +34,6 @@ namespace webrtc { namespace webrtc_pc_e2e { namespace { -using AudioConfig = - ::webrtc::webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture::AudioConfig; -using VideoConfig = - ::webrtc::webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture::VideoConfig; -using EchoEmulationConfig = ::webrtc::webrtc_pc_e2e:: - PeerConnectionE2EQualityTestFixture::EchoEmulationConfig; using EmulatedSFUConfigMap = ::webrtc::webrtc_pc_e2e::QualityAnalyzingVideoEncoder::EmulatedSFUConfigMap; @@ -298,8 +293,7 @@ std::unique_ptr TestPeerFactory::CreateTestPeer( std::unique_ptr configurer, std::unique_ptr observer, absl::optional remote_audio_config, - absl::optional - echo_emulation_config) { + absl::optional echo_emulation_config) { std::unique_ptr components = configurer->ReleaseComponents(); std::unique_ptr params = configurer->ReleaseParams(); diff --git a/test/pc/e2e/test_peer_factory.h b/test/pc/e2e/test_peer_factory.h index e1abd0dff0..1b9530b141 100644 --- a/test/pc/e2e/test_peer_factory.h +++ b/test/pc/e2e/test_peer_factory.h @@ -18,6 +18,7 @@ #include "absl/strings/string_view.h" #include "api/rtc_event_log/rtc_event_log_factory.h" +#include "api/test/pclf/media_configuration.h" #include "api/test/pclf/media_quality_test_params.h" #include "api/test/pclf/peer_configurer.h" #include "api/test/peerconnection_quality_test_fixture.h" @@ -31,13 +32,12 @@ namespace webrtc { namespace webrtc_pc_e2e { struct RemotePeerAudioConfig { - explicit RemotePeerAudioConfig( - PeerConnectionE2EQualityTestFixture::AudioConfig config) + explicit RemotePeerAudioConfig(AudioConfig config) : sampling_frequency_in_hz(config.sampling_frequency_in_hz), output_file_name(config.output_dump_file_name) {} static absl::optional Create( - absl::optional config); + absl::optional config); int sampling_frequency_in_hz; absl::optional output_file_name; @@ -70,8 +70,7 @@ class TestPeerFactory { std::unique_ptr configurer, std::unique_ptr observer, absl::optional remote_audio_config, - absl::optional - echo_emulation_config); + absl::optional echo_emulation_config); private: rtc::Thread* signaling_thread_;