Henrik Boström | b0f2e0c | 2020-03-06 13:32:03 +0100 | [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 | #include "call/adaptation/encoder_settings.h" |
| 12 | |
| 13 | #include <utility> |
| 14 | |
| 15 | namespace webrtc { |
| 16 | |
| 17 | EncoderSettings::EncoderSettings(VideoEncoder::EncoderInfo encoder_info, |
| 18 | VideoEncoderConfig encoder_config, |
| 19 | VideoCodec video_codec) |
| 20 | : encoder_info_(std::move(encoder_info)), |
| 21 | encoder_config_(std::move(encoder_config)), |
| 22 | video_codec_(std::move(video_codec)) {} |
| 23 | |
| 24 | const VideoEncoder::EncoderInfo& EncoderSettings::encoder_info() const { |
| 25 | return encoder_info_; |
| 26 | } |
| 27 | |
| 28 | const VideoEncoderConfig& EncoderSettings::encoder_config() const { |
| 29 | return encoder_config_; |
| 30 | } |
| 31 | |
| 32 | const VideoCodec& EncoderSettings::video_codec() const { |
| 33 | return video_codec_; |
| 34 | } |
| 35 | |
| 36 | VideoCodecType GetVideoCodecTypeOrGeneric( |
| 37 | const absl::optional<EncoderSettings>& settings) { |
| 38 | return settings.has_value() ? settings->encoder_config().codec_type |
| 39 | : kVideoCodecGeneric; |
| 40 | } |
| 41 | |
| 42 | } // namespace webrtc |