blob: 191e22386a6bffc32b961aa7e6570a9cd64bccba [file] [log] [blame]
Henrik Boströmd516b252020-04-17 12:10:59 +02001/*
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
17namespace webrtc {
18
19// The source resolution, frame rate and other properties of a
20// VideoStreamEncoder.
21class 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öm722fa4d2020-04-29 16:46:30 +020027 void set_frames_per_second(int frames_per_second);
Henrik Boströmd516b252020-04-17 12:10:59 +020028 void set_video_codec_type(VideoCodecType video_codec_type);
29 void set_min_pixels_per_frame(int min_pixels_per_frame);
Åsa Persson1dd94a02021-02-18 14:20:03 +010030 void set_single_active_stream_pixels(
31 absl::optional<int> single_active_stream_pixels);
Henrik Boströmd516b252020-04-17 12:10:59 +020032
33 bool has_input() const;
34 absl::optional<int> frame_size_pixels() const;
Henrik Boström722fa4d2020-04-29 16:46:30 +020035 int frames_per_second() const;
Henrik Boströmd516b252020-04-17 12:10:59 +020036 VideoCodecType video_codec_type() const;
37 int min_pixels_per_frame() const;
Åsa Persson1dd94a02021-02-18 14:20:03 +010038 absl::optional<int> single_active_stream_pixels() const;
Henrik Boströmd516b252020-04-17 12:10:59 +020039
40 bool HasInputFrameSizeAndFramesPerSecond() const;
41
42 private:
43 bool has_input_;
44 absl::optional<int> frame_size_pixels_;
Henrik Boström722fa4d2020-04-29 16:46:30 +020045 int frames_per_second_;
Henrik Boströmd516b252020-04-17 12:10:59 +020046 VideoCodecType video_codec_type_;
47 int min_pixels_per_frame_;
Åsa Persson1dd94a02021-02-18 14:20:03 +010048 absl::optional<int> single_active_stream_pixels_;
Henrik Boströmd516b252020-04-17 12:10:59 +020049};
50
51} // namespace webrtc
52
53#endif // CALL_ADAPTATION_VIDEO_STREAM_INPUT_STATE_H_