blob: 76c85cbbad71774fd31069c44827a6546442c094 [file] [log] [blame]
Rasmus Brandt3dde4502019-03-21 11:46:17 +01001/*
2 * Copyright (c) 2019 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 "rtc_base/experiments/keyframe_interval_settings.h"
12
13#include "api/transport/field_trial_based_config.h"
14
15namespace webrtc {
16
17namespace {
18
19constexpr char kFieldTrialName[] = "WebRTC-KeyframeInterval";
20
21} // namespace
22
23KeyframeIntervalSettings::KeyframeIntervalSettings(
24 const WebRtcKeyValueConfig* const key_value_config)
Erik Språngac732f62021-03-24 15:18:57 +010025 : min_keyframe_send_interval_ms_("min_keyframe_send_interval_ms") {
26 ParseFieldTrial({&min_keyframe_send_interval_ms_},
Rasmus Brandt3dde4502019-03-21 11:46:17 +010027 key_value_config->Lookup(kFieldTrialName));
28}
29
30KeyframeIntervalSettings KeyframeIntervalSettings::ParseFromFieldTrials() {
31 FieldTrialBasedConfig field_trial_config;
32 return KeyframeIntervalSettings(&field_trial_config);
33}
34
35absl::optional<int> KeyframeIntervalSettings::MinKeyframeSendIntervalMs()
36 const {
37 return min_keyframe_send_interval_ms_.GetOptional();
38}
Rasmus Brandt3dde4502019-03-21 11:46:17 +010039} // namespace webrtc