blob: 312429ef9f47cf97a9d12e75a8ec862cba09c777 [file] [log] [blame]
Niels Möller79924572022-07-05 14:22:27 +02001/*
2 * Copyright (c) 2022 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 "api/video_codecs/simulcast_stream.h"
12
13#include "rtc_base/checks.h"
14
15namespace webrtc {
16
17unsigned char SimulcastStream::GetNumberOfTemporalLayers() const {
18 return numberOfTemporalLayers;
19}
Niels Möllerf2d090a2022-07-18 13:43:23 +020020void SimulcastStream::SetNumberOfTemporalLayers(unsigned char n) {
21 RTC_DCHECK_GE(n, 1);
22 RTC_DCHECK_LE(n, 3);
23 numberOfTemporalLayers = n;
24}
Niels Möller79924572022-07-05 14:22:27 +020025
26ScalabilityMode SimulcastStream::GetScalabilityMode() const {
27 RTC_CHECK_GE(numberOfTemporalLayers, 1);
28 RTC_CHECK_LE(numberOfTemporalLayers, 3);
29 static const ScalabilityMode scalability_modes[3] = {
30 ScalabilityMode::kL1T1,
31 ScalabilityMode::kL1T2,
32 ScalabilityMode::kL1T3,
33 };
34 return scalability_modes[numberOfTemporalLayers - 1];
35}
36
37} // namespace webrtc