xref: /aosp_15_r20/external/webrtc/api/video_codecs/scalability_mode_helper.h (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1 /*
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_HELPER_H_
12 #define API_VIDEO_CODECS_SCALABILITY_MODE_HELPER_H_
13 
14 #include "absl/strings/string_view.h"
15 #include "absl/types/optional.h"
16 
17 namespace webrtc {
18 
19 // Returns the number of spatial layers from the `scalability_mode_string`
20 // or nullopt if the given mode is unknown.
21 absl::optional<int> ScalabilityModeStringToNumSpatialLayers(
22     absl::string_view scalability_mode_string);
23 
24 // Returns the number of temporal layers from the `scalability_mode_string`
25 // or nullopt if the given mode is unknown.
26 absl::optional<int> ScalabilityModeStringToNumTemporalLayers(
27     absl::string_view scalability_mode_string);
28 
29 }  // namespace webrtc
30 
31 #endif  // API_VIDEO_CODECS_SCALABILITY_MODE_HELPER_H_
32