blob: aa3486dc5d461c4b89e15f4a3ca33dc167fe9a6f [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}
20
21ScalabilityMode SimulcastStream::GetScalabilityMode() const {
22 RTC_CHECK_GE(numberOfTemporalLayers, 1);
23 RTC_CHECK_LE(numberOfTemporalLayers, 3);
24 static const ScalabilityMode scalability_modes[3] = {
25 ScalabilityMode::kL1T1,
26 ScalabilityMode::kL1T2,
27 ScalabilityMode::kL1T3,
28 };
29 return scalability_modes[numberOfTemporalLayers - 1];
30}
31
32} // namespace webrtc