Henrik Boström | d516b25 | 2020-04-17 12:10:59 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 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 | |
| 11 | #ifndef CALL_ADAPTATION_VIDEO_STREAM_INPUT_STATE_H_ |
| 12 | #define CALL_ADAPTATION_VIDEO_STREAM_INPUT_STATE_H_ |
| 13 | |
| 14 | #include "absl/types/optional.h" |
| 15 | #include "api/video/video_codec_type.h" |
| 16 | |
| 17 | namespace webrtc { |
| 18 | |
| 19 | // The source resolution, frame rate and other properties of a |
| 20 | // VideoStreamEncoder. |
| 21 | class VideoStreamInputState { |
| 22 | public: |
| 23 | VideoStreamInputState(); |
| 24 | |
| 25 | void set_has_input(bool has_input); |
| 26 | void set_frame_size_pixels(absl::optional<int> frame_size_pixels); |
Henrik Boström | 722fa4d | 2020-04-29 16:46:30 +0200 | [diff] [blame] | 27 | void set_frames_per_second(int frames_per_second); |
Henrik Boström | d516b25 | 2020-04-17 12:10:59 +0200 | [diff] [blame] | 28 | void set_video_codec_type(VideoCodecType video_codec_type); |
| 29 | void set_min_pixels_per_frame(int min_pixels_per_frame); |
Åsa Persson | 1dd94a0 | 2021-02-18 14:20:03 +0100 | [diff] [blame] | 30 | void set_single_active_stream_pixels( |
| 31 | absl::optional<int> single_active_stream_pixels); |
Henrik Boström | d516b25 | 2020-04-17 12:10:59 +0200 | [diff] [blame] | 32 | |
| 33 | bool has_input() const; |
| 34 | absl::optional<int> frame_size_pixels() const; |
Henrik Boström | 722fa4d | 2020-04-29 16:46:30 +0200 | [diff] [blame] | 35 | int frames_per_second() const; |
Henrik Boström | d516b25 | 2020-04-17 12:10:59 +0200 | [diff] [blame] | 36 | VideoCodecType video_codec_type() const; |
| 37 | int min_pixels_per_frame() const; |
Åsa Persson | 1dd94a0 | 2021-02-18 14:20:03 +0100 | [diff] [blame] | 38 | absl::optional<int> single_active_stream_pixels() const; |
Henrik Boström | d516b25 | 2020-04-17 12:10:59 +0200 | [diff] [blame] | 39 | |
| 40 | bool HasInputFrameSizeAndFramesPerSecond() const; |
| 41 | |
| 42 | private: |
| 43 | bool has_input_; |
| 44 | absl::optional<int> frame_size_pixels_; |
Henrik Boström | 722fa4d | 2020-04-29 16:46:30 +0200 | [diff] [blame] | 45 | int frames_per_second_; |
Henrik Boström | d516b25 | 2020-04-17 12:10:59 +0200 | [diff] [blame] | 46 | VideoCodecType video_codec_type_; |
| 47 | int min_pixels_per_frame_; |
Åsa Persson | 1dd94a0 | 2021-02-18 14:20:03 +0100 | [diff] [blame] | 48 | absl::optional<int> single_active_stream_pixels_; |
Henrik Boström | d516b25 | 2020-04-17 12:10:59 +0200 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | } // namespace webrtc |
| 52 | |
| 53 | #endif // CALL_ADAPTATION_VIDEO_STREAM_INPUT_STATE_H_ |