blob: b26f32eb2224536b3294ebb4cb181ca0e0202c75 [file] [log] [blame]
Niels Möller79d566b2022-04-29 09:03:131/*
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#ifndef API_VIDEO_CODECS_SCALABILITY_MODE_H_
12#define API_VIDEO_CODECS_SCALABILITY_MODE_H_
13
Byoungchan Leea1a7c632022-07-05 12:06:2814#include <stddef.h>
15#include <stdint.h>
16
17#include "absl/strings/string_view.h"
18#include "rtc_base/system/rtc_export.h"
19
Niels Möller79d566b2022-04-29 09:03:1320namespace webrtc {
21
22// Supported scalability modes. Most applications should use the
23// PeerConnection-level apis where scalability mode is represented as a string.
24// This list of currently recognized modes is intended for the api boundary
25// between webrtc and injected encoders. Any application usage outside of
26// injected encoders is strongly discouraged.
Byoungchan Leea1a7c632022-07-05 12:06:2827enum class ScalabilityMode : uint8_t {
Niels Möller79d566b2022-04-29 09:03:1328 kL1T1,
29 kL1T2,
30 kL1T3,
31 kL2T1,
32 kL2T1h,
33 kL2T1_KEY,
34 kL2T2,
Niels Möller3b048132022-05-05 12:37:0535 kL2T2h,
Niels Möller79d566b2022-04-29 09:03:1336 kL2T2_KEY,
37 kL2T2_KEY_SHIFT,
Niels Möller3b048132022-05-05 12:37:0538 kL2T3,
39 kL2T3h,
Niels Möller79d566b2022-04-29 09:03:1340 kL2T3_KEY,
41 kL3T1,
Niels Möller3b048132022-05-05 12:37:0542 kL3T1h,
43 kL3T1_KEY,
44 kL3T2,
45 kL3T2h,
46 kL3T2_KEY,
Niels Möller79d566b2022-04-29 09:03:1347 kL3T3,
Niels Möller3b048132022-05-05 12:37:0548 kL3T3h,
Niels Möller79d566b2022-04-29 09:03:1349 kL3T3_KEY,
50 kS2T1,
Åsa Perssonecfe8da2022-08-31 07:46:4151 kS2T1h,
Åsa Persson6d051642022-08-29 07:05:0052 kS2T2,
Åsa Perssonecfe8da2022-08-31 07:46:4153 kS2T2h,
Niels Möller3c24c092022-06-30 13:42:5154 kS2T3,
Åsa Perssonecfe8da2022-08-31 07:46:4155 kS2T3h,
Åsa Persson6d051642022-08-29 07:05:0056 kS3T1,
Åsa Perssonecfe8da2022-08-31 07:46:4157 kS3T1h,
Åsa Persson6d051642022-08-29 07:05:0058 kS3T2,
Åsa Perssonecfe8da2022-08-31 07:46:4159 kS3T2h,
Niels Möller79d566b2022-04-29 09:03:1360 kS3T3,
Åsa Perssonecfe8da2022-08-31 07:46:4161 kS3T3h,
Niels Möller79d566b2022-04-29 09:03:1362};
63
Byoungchan Leea1a7c632022-07-05 12:06:2864inline constexpr ScalabilityMode kAllScalabilityModes[] = {
65 // clang-format off
66 ScalabilityMode::kL1T1,
67 ScalabilityMode::kL1T2,
Byoungchan Leea1a7c632022-07-05 12:06:2868 ScalabilityMode::kL1T3,
Byoungchan Leea1a7c632022-07-05 12:06:2869 ScalabilityMode::kL2T1,
70 ScalabilityMode::kL2T1h,
71 ScalabilityMode::kL2T1_KEY,
72 ScalabilityMode::kL2T2,
73 ScalabilityMode::kL2T2h,
74 ScalabilityMode::kL2T2_KEY,
75 ScalabilityMode::kL2T2_KEY_SHIFT,
76 ScalabilityMode::kL2T3,
77 ScalabilityMode::kL2T3h,
78 ScalabilityMode::kL2T3_KEY,
79 ScalabilityMode::kL3T1,
80 ScalabilityMode::kL3T1h,
81 ScalabilityMode::kL3T1_KEY,
82 ScalabilityMode::kL3T2,
83 ScalabilityMode::kL3T2h,
84 ScalabilityMode::kL3T2_KEY,
85 ScalabilityMode::kL3T3,
86 ScalabilityMode::kL3T3h,
87 ScalabilityMode::kL3T3_KEY,
88 ScalabilityMode::kS2T1,
Åsa Perssonecfe8da2022-08-31 07:46:4189 ScalabilityMode::kS2T1h,
Åsa Persson6d051642022-08-29 07:05:0090 ScalabilityMode::kS2T2,
Åsa Perssonecfe8da2022-08-31 07:46:4191 ScalabilityMode::kS2T2h,
Byoungchan Leea1a7c632022-07-05 12:06:2892 ScalabilityMode::kS2T3,
Åsa Perssonecfe8da2022-08-31 07:46:4193 ScalabilityMode::kS2T3h,
Åsa Persson6d051642022-08-29 07:05:0094 ScalabilityMode::kS3T1,
Åsa Perssonecfe8da2022-08-31 07:46:4195 ScalabilityMode::kS3T1h,
Åsa Persson6d051642022-08-29 07:05:0096 ScalabilityMode::kS3T2,
Åsa Perssonecfe8da2022-08-31 07:46:4197 ScalabilityMode::kS3T2h,
Byoungchan Leea1a7c632022-07-05 12:06:2898 ScalabilityMode::kS3T3,
Åsa Perssonecfe8da2022-08-31 07:46:4199 ScalabilityMode::kS3T3h,
Byoungchan Leea1a7c632022-07-05 12:06:28100 // clang-format on
101};
102
103inline constexpr size_t kScalabilityModeCount =
104 sizeof(kAllScalabilityModes) / sizeof(ScalabilityMode);
105
106RTC_EXPORT
107absl::string_view ScalabilityModeToString(ScalabilityMode scalability_mode);
108
Niels Möller79d566b2022-04-29 09:03:13109} // namespace webrtc
Byoungchan Leea1a7c632022-07-05 12:06:28110
Niels Möller79d566b2022-04-29 09:03:13111#endif // API_VIDEO_CODECS_SCALABILITY_MODE_H_