/* * Copyright (c) 2019 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef TEST_PC_E2E_PEER_CONNECTION_QUALITY_TEST_H_ #define TEST_PC_E2E_PEER_CONNECTION_QUALITY_TEST_H_ #include #include #include #include "pc/test/frame_generator_capturer_video_track_source.h" #include "rtc_base/thread.h" #include "system_wrappers/include/clock.h" #include "test/pc/e2e/analyzer/video/single_process_encoded_image_id_injector.h" #include "test/pc/e2e/analyzer/video/video_quality_analyzer_injection_helper.h" #include "test/pc/e2e/api/peerconnection_quality_test_fixture.h" #include "test/pc/e2e/test_peer.h" #include "test/testsupport/video_frame_writer.h" namespace webrtc { namespace test { class PeerConnectionE2EQualityTest : public PeerConnectionE2EQualityTestFixture { public: using Params = PeerConnectionE2EQualityTestFixture::Params; using Analyzers = PeerConnectionE2EQualityTestFixture::Analyzers; using InjectableComponents = PeerConnectionE2EQualityTestFixture::InjectableComponents; using VideoGeneratorType = PeerConnectionE2EQualityTestFixture::VideoGeneratorType; using RunParams = PeerConnectionE2EQualityTestFixture::RunParams; using VideoConfig = PeerConnectionE2EQualityTestFixture::VideoConfig; PeerConnectionE2EQualityTest(std::unique_ptr analyzers); ~PeerConnectionE2EQualityTest() override = default; void Run(std::unique_ptr alice_components, std::unique_ptr alice_params, std::unique_ptr bob_components, std::unique_ptr bob_params, RunParams run_params) override; private: // Sets video stream labels that are not specified in VideoConfigs to unique // generated values. void SetMissedVideoStreamLabels(std::vector params); // Validate peer's parameters, also ensure uniqueness of all video stream // labels. void ValidateParams(std::vector params); void SetupVideoSink(rtc::scoped_refptr transceiver, std::vector remote_video_configs); // Have to be run on the signaling thread. void RunOnSignalingThread(RunParams run_params); std::vector> AddMedia(TestPeer* peer); std::vector> AddVideo(TestPeer* peer); std::unique_ptr CreateFrameGenerator( const VideoConfig& video_config); void AddAudio(TestPeer* peer); void SetupCall(); void StartVideo( const std::vector< rtc::scoped_refptr>& sources); void TearDownCall(); VideoFrameWriter* MaybeCreateVideoWriter( absl::optional file_name, const VideoConfig& config); Clock* const clock_; std::unique_ptr video_quality_analyzer_injection_helper_; std::unique_ptr encoded_image_id_controller_; std::unique_ptr alice_; std::unique_ptr bob_; std::vector> alice_video_sources_; std::vector> bob_video_sources_; std::vector> video_writers_; std::vector>> output_video_sinks_; }; } // namespace test } // namespace webrtc #endif // TEST_PC_E2E_PEER_CONNECTION_QUALITY_TEST_H_