video_stream_input_state.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. #ifndef CALL_ADAPTATION_VIDEO_STREAM_INPUT_STATE_H_
  11. #define CALL_ADAPTATION_VIDEO_STREAM_INPUT_STATE_H_
  12. #include "absl/types/optional.h"
  13. #include "api/video/video_codec_type.h"
  14. namespace webrtc {
  15. // The source resolution, frame rate and other properties of a
  16. // VideoStreamEncoder.
  17. class VideoStreamInputState {
  18. public:
  19. VideoStreamInputState();
  20. void set_has_input(bool has_input);
  21. void set_frame_size_pixels(absl::optional<int> frame_size_pixels);
  22. void set_frames_per_second(int frames_per_second);
  23. void set_video_codec_type(VideoCodecType video_codec_type);
  24. void set_min_pixels_per_frame(int min_pixels_per_frame);
  25. bool has_input() const;
  26. absl::optional<int> frame_size_pixels() const;
  27. int frames_per_second() const;
  28. VideoCodecType video_codec_type() const;
  29. int min_pixels_per_frame() const;
  30. bool HasInputFrameSizeAndFramesPerSecond() const;
  31. private:
  32. bool has_input_;
  33. absl::optional<int> frame_size_pixels_;
  34. int frames_per_second_;
  35. VideoCodecType video_codec_type_;
  36. int min_pixels_per_frame_;
  37. };
  38. } // namespace webrtc
  39. #endif // CALL_ADAPTATION_VIDEO_STREAM_INPUT_STATE_H_