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