tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

scalability_mode.cc (2886B)


      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 #include "api/video_codecs/scalability_mode.h"
     12 
     13 #include <optional>
     14 
     15 #include "absl/strings/string_view.h"
     16 #include "rtc_base/checks.h"
     17 
     18 namespace webrtc {
     19 
     20 absl::string_view ScalabilityModeToString(ScalabilityMode scalability_mode) {
     21  switch (scalability_mode) {
     22    case ScalabilityMode::kL1T1:
     23      return "L1T1";
     24    case ScalabilityMode::kL1T2:
     25      return "L1T2";
     26    case ScalabilityMode::kL1T3:
     27      return "L1T3";
     28    case ScalabilityMode::kL2T1:
     29      return "L2T1";
     30    case ScalabilityMode::kL2T1h:
     31      return "L2T1h";
     32    case ScalabilityMode::kL2T1_KEY:
     33      return "L2T1_KEY";
     34    case ScalabilityMode::kL2T2:
     35      return "L2T2";
     36    case ScalabilityMode::kL2T2h:
     37      return "L2T2h";
     38    case ScalabilityMode::kL2T2_KEY:
     39      return "L2T2_KEY";
     40    case ScalabilityMode::kL2T2_KEY_SHIFT:
     41      return "L2T2_KEY_SHIFT";
     42    case ScalabilityMode::kL2T3:
     43      return "L2T3";
     44    case ScalabilityMode::kL2T3h:
     45      return "L2T3h";
     46    case ScalabilityMode::kL2T3_KEY:
     47      return "L2T3_KEY";
     48    case ScalabilityMode::kL3T1:
     49      return "L3T1";
     50    case ScalabilityMode::kL3T1h:
     51      return "L3T1h";
     52    case ScalabilityMode::kL3T1_KEY:
     53      return "L3T1_KEY";
     54    case ScalabilityMode::kL3T2:
     55      return "L3T2";
     56    case ScalabilityMode::kL3T2h:
     57      return "L3T2h";
     58    case ScalabilityMode::kL3T2_KEY:
     59      return "L3T2_KEY";
     60    case ScalabilityMode::kL3T3:
     61      return "L3T3";
     62    case ScalabilityMode::kL3T3h:
     63      return "L3T3h";
     64    case ScalabilityMode::kL3T3_KEY:
     65      return "L3T3_KEY";
     66    case ScalabilityMode::kS2T1:
     67      return "S2T1";
     68    case ScalabilityMode::kS2T1h:
     69      return "S2T1h";
     70    case ScalabilityMode::kS2T2:
     71      return "S2T2";
     72    case ScalabilityMode::kS2T2h:
     73      return "S2T2h";
     74    case ScalabilityMode::kS2T3:
     75      return "S2T3";
     76    case ScalabilityMode::kS2T3h:
     77      return "S2T3h";
     78    case ScalabilityMode::kS3T1:
     79      return "S3T1";
     80    case ScalabilityMode::kS3T1h:
     81      return "S3T1h";
     82    case ScalabilityMode::kS3T2:
     83      return "S3T2";
     84    case ScalabilityMode::kS3T2h:
     85      return "S3T2h";
     86    case ScalabilityMode::kS3T3:
     87      return "S3T3";
     88    case ScalabilityMode::kS3T3h:
     89      return "S3T3h";
     90  }
     91  RTC_CHECK_NOTREACHED();
     92 }
     93 
     94 absl::string_view ScalabilityModeToString(
     95    std::optional<ScalabilityMode> scalability_mode) {
     96  return scalability_mode.has_value()
     97             ? ScalabilityModeToString(*scalability_mode)
     98             : "nullopt";
     99 }
    100 
    101 }  // namespace webrtc