blob: 84b4b17ccddd24e5fb6f5c1f2c149340cc7310c0 [file] [log] [blame]
Henrik Boströmb0f2e0c2020-03-06 13:32:03 +01001/*
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
15namespace webrtc {
16
17EncoderSettings::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
24const VideoEncoder::EncoderInfo& EncoderSettings::encoder_info() const {
25 return encoder_info_;
26}
27
28const VideoEncoderConfig& EncoderSettings::encoder_config() const {
29 return encoder_config_;
30}
31
32const VideoCodec& EncoderSettings::video_codec() const {
33 return video_codec_;
34}
35
36VideoCodecType GetVideoCodecTypeOrGeneric(
37 const absl::optional<EncoderSettings>& settings) {
38 return settings.has_value() ? settings->encoder_config().codec_type
39 : kVideoCodecGeneric;
40}
41
42} // namespace webrtc