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