fake_periodic_video_track_source.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright 2018 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 PC_TEST_FAKE_PERIODIC_VIDEO_TRACK_SOURCE_H_
  11. #define PC_TEST_FAKE_PERIODIC_VIDEO_TRACK_SOURCE_H_
  12. #include "pc/test/fake_periodic_video_source.h"
  13. #include "pc/video_track_source.h"
  14. namespace webrtc {
  15. // A VideoTrackSource generating frames with configured size and frame interval.
  16. class FakePeriodicVideoTrackSource : public VideoTrackSource {
  17. public:
  18. explicit FakePeriodicVideoTrackSource(bool remote)
  19. : FakePeriodicVideoTrackSource(FakePeriodicVideoSource::Config(),
  20. remote) {}
  21. FakePeriodicVideoTrackSource(FakePeriodicVideoSource::Config config,
  22. bool remote)
  23. : VideoTrackSource(remote), source_(config) {}
  24. ~FakePeriodicVideoTrackSource() = default;
  25. const FakePeriodicVideoSource& fake_periodic_source() const {
  26. return source_;
  27. }
  28. protected:
  29. rtc::VideoSourceInterface<VideoFrame>* source() override { return &source_; }
  30. private:
  31. FakePeriodicVideoSource source_;
  32. };
  33. } // namespace webrtc
  34. #endif // PC_TEST_FAKE_PERIODIC_VIDEO_TRACK_SOURCE_H_