Niels Möller | c0a9f35 | 2022-05-20 11:38:49 | [diff] [blame] | 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_SIMULCAST_STREAM_H_ |
| 12 | #define API_VIDEO_CODECS_SIMULCAST_STREAM_H_ |
| 13 | |
Florent Castelli | 8037fc6 | 2024-08-29 13:00:40 | [diff] [blame] | 14 | #include <optional> |
| 15 | |
Niels Möller | 7992457 | 2022-07-05 12:22:27 | [diff] [blame] | 16 | #include "api/video_codecs/scalability_mode.h" |
Dor Hen | d7d940e | 2024-08-19 08:13:31 | [diff] [blame] | 17 | #include "rtc_base/system/rtc_export.h" |
Niels Möller | 7992457 | 2022-07-05 12:22:27 | [diff] [blame] | 18 | |
Niels Möller | c0a9f35 | 2022-05-20 11:38:49 | [diff] [blame] | 19 | namespace webrtc { |
| 20 | |
| 21 | // TODO(bugs.webrtc.org/6883): Unify with struct VideoStream, part of |
| 22 | // VideoEncoderConfig. |
Hirokazu Honda | 48ae22f | 2024-05-20 23:14:55 | [diff] [blame] | 23 | struct RTC_EXPORT SimulcastStream { |
Niels Möller | 7992457 | 2022-07-05 12:22:27 | [diff] [blame] | 24 | // Temporary utility methods for transition from numberOfTemporalLayers |
| 25 | // setting to ScalabilityMode. |
| 26 | unsigned char GetNumberOfTemporalLayers() const; |
Florent Castelli | 8037fc6 | 2024-08-29 13:00:40 | [diff] [blame] | 27 | std::optional<ScalabilityMode> GetScalabilityMode() const; |
Niels Möller | f2d090a | 2022-07-18 11:43:23 | [diff] [blame] | 28 | void SetNumberOfTemporalLayers(unsigned char n); |
Niels Möller | 7992457 | 2022-07-05 12:22:27 | [diff] [blame] | 29 | |
Sergey Silkin | 29d4062 | 2024-05-08 06:51:44 | [diff] [blame] | 30 | bool operator==(const SimulcastStream& other) const; |
| 31 | bool operator!=(const SimulcastStream& other) const { |
| 32 | return !(*this == other); |
| 33 | } |
| 34 | |
Niels Möller | 865e45d | 2022-07-04 15:16:52 | [diff] [blame] | 35 | int width = 0; |
| 36 | int height = 0; |
| 37 | float maxFramerate = 0; // fps. |
| 38 | unsigned char numberOfTemporalLayers = 1; |
| 39 | unsigned int maxBitrate = 0; // kilobits/sec. |
| 40 | unsigned int targetBitrate = 0; // kilobits/sec. |
| 41 | unsigned int minBitrate = 0; // kilobits/sec. |
| 42 | unsigned int qpMax = 0; // minimum quality |
| 43 | bool active = false; // encoded and sent. |
Niels Möller | c4b5f4d | 2022-05-20 13:18:21 | [diff] [blame] | 44 | }; |
Niels Möller | c0a9f35 | 2022-05-20 11:38:49 | [diff] [blame] | 45 | |
| 46 | } // namespace webrtc |
| 47 | #endif // API_VIDEO_CODECS_SIMULCAST_STREAM_H_ |