media_helper.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright (c) 2020 The WebRTC project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef TEST_PC_E2E_MEDIA_MEDIA_HELPER_H_
  11. #define TEST_PC_E2E_MEDIA_MEDIA_HELPER_H_
  12. #include <memory>
  13. #include <vector>
  14. #include "api/test/frame_generator_interface.h"
  15. #include "api/test/peerconnection_quality_test_fixture.h"
  16. #include "test/pc/e2e/analyzer/video/video_quality_analyzer_injection_helper.h"
  17. #include "test/pc/e2e/media/test_video_capturer_video_track_source.h"
  18. #include "test/pc/e2e/peer_configurer.h"
  19. #include "test/pc/e2e/test_peer.h"
  20. namespace webrtc {
  21. namespace webrtc_pc_e2e {
  22. class MediaHelper {
  23. public:
  24. MediaHelper(VideoQualityAnalyzerInjectionHelper*
  25. video_quality_analyzer_injection_helper,
  26. TaskQueueFactory* task_queue_factory,
  27. Clock* clock)
  28. : clock_(clock),
  29. task_queue_factory_(task_queue_factory),
  30. video_quality_analyzer_injection_helper_(
  31. video_quality_analyzer_injection_helper) {}
  32. void MaybeAddAudio(TestPeer* peer);
  33. std::vector<rtc::scoped_refptr<TestVideoCapturerVideoTrackSource>>
  34. MaybeAddVideo(TestPeer* peer);
  35. private:
  36. std::unique_ptr<test::TestVideoCapturer> CreateVideoCapturer(
  37. const PeerConnectionE2EQualityTestFixture::VideoConfig& video_config,
  38. PeerConfigurerImpl::VideoSource source,
  39. std::unique_ptr<test::TestVideoCapturer::FramePreprocessor>
  40. frame_preprocessor);
  41. Clock* const clock_;
  42. TaskQueueFactory* const task_queue_factory_;
  43. VideoQualityAnalyzerInjectionHelper* video_quality_analyzer_injection_helper_;
  44. };
  45. } // namespace webrtc_pc_e2e
  46. } // namespace webrtc
  47. #endif // TEST_PC_E2E_MEDIA_MEDIA_HELPER_H_