Niels Möller | a6cc0f9 | 2018-02-12 17:14:55 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 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 MEDIA_BASE_FAKEFRAMESOURCE_H_ |
| 12 | #define MEDIA_BASE_FAKEFRAMESOURCE_H_ |
| 13 | |
| 14 | #include "api/video/video_frame.h" |
| 15 | |
| 16 | #include "rtc_base/timeutils.h" |
| 17 | |
| 18 | namespace cricket { |
| 19 | |
| 20 | class FakeFrameSource { |
| 21 | public: |
Johannes Kron | 965e794 | 2018-09-13 15:36:20 +0200 | [diff] [blame] | 22 | FakeFrameSource(int width, |
| 23 | int height, |
| 24 | int interval_us, |
| 25 | int64_t timestamp_offset_us); |
Niels Möller | a6cc0f9 | 2018-02-12 17:14:55 +0100 | [diff] [blame] | 26 | FakeFrameSource(int width, int height, int interval_us); |
| 27 | |
Niels Möller | 5c7efe7 | 2018-05-11 10:34:46 +0200 | [diff] [blame] | 28 | webrtc::VideoRotation GetRotation() const; |
Niels Möller | a6cc0f9 | 2018-02-12 17:14:55 +0100 | [diff] [blame] | 29 | void SetRotation(webrtc::VideoRotation rotation); |
| 30 | |
| 31 | webrtc::VideoFrame GetFrame(); |
Niels Möller | 5c7efe7 | 2018-05-11 10:34:46 +0200 | [diff] [blame] | 32 | webrtc::VideoFrame GetFrameRotationApplied(); |
| 33 | |
| 34 | // Override configuration. |
| 35 | webrtc::VideoFrame GetFrame(int width, |
| 36 | int height, |
| 37 | webrtc::VideoRotation rotation, |
| 38 | int interval_us); |
Niels Möller | a6cc0f9 | 2018-02-12 17:14:55 +0100 | [diff] [blame] | 39 | |
| 40 | private: |
| 41 | const int width_; |
| 42 | const int height_; |
| 43 | const int interval_us_; |
| 44 | |
| 45 | webrtc::VideoRotation rotation_ = webrtc::kVideoRotation_0; |
Johannes Kron | 965e794 | 2018-09-13 15:36:20 +0200 | [diff] [blame] | 46 | int64_t next_timestamp_us_; |
Niels Möller | a6cc0f9 | 2018-02-12 17:14:55 +0100 | [diff] [blame] | 47 | }; |
| 48 | |
| 49 | } // namespace cricket |
| 50 | |
| 51 | #endif // MEDIA_BASE_FAKEFRAMESOURCE_H_ |