encoder_settings.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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_ENCODER_SETTINGS_H_
  11. #define CALL_ADAPTATION_ENCODER_SETTINGS_H_
  12. #include "absl/types/optional.h"
  13. #include "api/video_codecs/video_codec.h"
  14. #include "api/video_codecs/video_encoder.h"
  15. #include "api/video_codecs/video_encoder_config.h"
  16. namespace webrtc {
  17. // Information about an encoder available when reconfiguring the encoder.
  18. class EncoderSettings {
  19. public:
  20. EncoderSettings(VideoEncoder::EncoderInfo encoder_info,
  21. VideoEncoderConfig encoder_config,
  22. VideoCodec video_codec);
  23. EncoderSettings(const EncoderSettings& other);
  24. EncoderSettings& operator=(const EncoderSettings& other);
  25. // Encoder capabilities, implementation info, etc.
  26. const VideoEncoder::EncoderInfo& encoder_info() const;
  27. // Configuration parameters, ultimately coming from the API and negotiation.
  28. const VideoEncoderConfig& encoder_config() const;
  29. // Lower level config, heavily based on the VideoEncoderConfig.
  30. const VideoCodec& video_codec() const;
  31. private:
  32. VideoEncoder::EncoderInfo encoder_info_;
  33. VideoEncoderConfig encoder_config_;
  34. VideoCodec video_codec_;
  35. };
  36. VideoCodecType GetVideoCodecTypeOrGeneric(
  37. const absl::optional<EncoderSettings>& settings);
  38. } // namespace webrtc
  39. #endif // CALL_ADAPTATION_ENCODER_SETTINGS_H_