Niels Möller | 0f40582 | 2018-05-17 09:16:41 +0200 | [diff] [blame] | 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 | |
| 11 | #ifndef PC_TEST_FAKEPERIODICVIDEOTRACKSOURCE_H_ |
| 12 | #define PC_TEST_FAKEPERIODICVIDEOTRACKSOURCE_H_ |
| 13 | |
Niels Möller | 0f40582 | 2018-05-17 09:16:41 +0200 | [diff] [blame] | 14 | #include "pc/test/fakeperiodicvideosource.h" |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 15 | #include "pc/videotracksource.h" |
Niels Möller | 0f40582 | 2018-05-17 09:16:41 +0200 | [diff] [blame] | 16 | |
| 17 | namespace webrtc { |
| 18 | |
| 19 | // A VideoTrackSource generating frames with configured size and frame interval. |
| 20 | class FakePeriodicVideoTrackSource : public VideoTrackSource { |
| 21 | public: |
| 22 | explicit FakePeriodicVideoTrackSource(bool remote) |
| 23 | : FakePeriodicVideoTrackSource(FakePeriodicVideoSource::Config(), |
| 24 | remote) {} |
| 25 | |
| 26 | FakePeriodicVideoTrackSource(FakePeriodicVideoSource::Config config, |
| 27 | bool remote) |
Niels Möller | 5d67f82 | 2018-05-23 16:28:17 +0200 | [diff] [blame] | 28 | : VideoTrackSource(remote), source_(config) {} |
Niels Möller | 0f40582 | 2018-05-17 09:16:41 +0200 | [diff] [blame] | 29 | |
| 30 | ~FakePeriodicVideoTrackSource() = default; |
| 31 | |
Niels Möller | 5d67f82 | 2018-05-23 16:28:17 +0200 | [diff] [blame] | 32 | protected: |
| 33 | rtc::VideoSourceInterface<VideoFrame>* source() override { return &source_; } |
| 34 | |
Niels Möller | 0f40582 | 2018-05-17 09:16:41 +0200 | [diff] [blame] | 35 | private: |
| 36 | FakePeriodicVideoSource source_; |
| 37 | }; |
| 38 | |
| 39 | } // namespace webrtc |
| 40 | |
| 41 | #endif // PC_TEST_FAKEPERIODICVIDEOTRACKSOURCE_H_ |