kwiberg@webrtc.org | ac2d27d | 2015-02-26 13:59:22 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2012 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 | |
Mirko Bonadei | 7120742 | 2017-09-15 11:58:09 | [diff] [blame] | 11 | #include "common_types.h" // NOLINT(build/include) |
kwiberg@webrtc.org | ac2d27d | 2015-02-26 13:59:22 | [diff] [blame] | 12 | |
| 13 | #include <string.h> |
eladalon | d0244c2 | 2017-06-08 11:19:13 | [diff] [blame] | 14 | #include <algorithm> |
danilchap | ef8d773 | 2017-04-19 09:59:48 | [diff] [blame] | 15 | #include <limits> |
| 16 | #include <type_traits> |
kwiberg@webrtc.org | ac2d27d | 2015-02-26 13:59:22 | [diff] [blame] | 17 | |
Mirko Bonadei | 92ea95e | 2017-09-15 04:47:31 | [diff] [blame] | 18 | #include "rtc_base/checks.h" |
Erik Språng | bb60a3a | 2018-03-19 17:25:10 | [diff] [blame] | 19 | #include "rtc_base/strings/string_builder.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 04:47:31 | [diff] [blame] | 20 | #include "rtc_base/stringutils.h" |
magjed | 10165ab | 2016-11-22 18:16:57 | [diff] [blame] | 21 | |
kwiberg@webrtc.org | ac2d27d | 2015-02-26 13:59:22 | [diff] [blame] | 22 | namespace webrtc { |
| 23 | |
Niels Möller | def1ef5 | 2018-03-19 12:48:44 | [diff] [blame] | 24 | bool VideoCodecVP8::operator==(const VideoCodecVP8& other) const { |
Niels Möller | def1ef5 | 2018-03-19 12:48:44 | [diff] [blame] | 25 | return (complexity == other.complexity && |
| 26 | resilience == other.resilience && |
| 27 | numberOfTemporalLayers == other.numberOfTemporalLayers && |
| 28 | denoisingOn == other.denoisingOn && |
| 29 | automaticResizeOn == other.automaticResizeOn && |
| 30 | frameDroppingOn == other.frameDroppingOn && |
| 31 | keyFrameInterval == other.keyFrameInterval); |
| 32 | } |
| 33 | |
| 34 | bool VideoCodecVP9::operator==(const VideoCodecVP9& other) const { |
| 35 | return (complexity == other.complexity && |
| 36 | resilienceOn == other.resilienceOn && |
| 37 | numberOfTemporalLayers == other.numberOfTemporalLayers && |
| 38 | denoisingOn == other.denoisingOn && |
| 39 | frameDroppingOn == other.frameDroppingOn && |
| 40 | keyFrameInterval == other.keyFrameInterval && |
| 41 | adaptiveQpMode == other.adaptiveQpMode && |
| 42 | automaticResizeOn == other.automaticResizeOn && |
| 43 | numberOfSpatialLayers == other.numberOfSpatialLayers && |
| 44 | flexibleMode == other.flexibleMode); |
| 45 | } |
| 46 | |
| 47 | bool VideoCodecH264::operator==(const VideoCodecH264& other) const { |
| 48 | return (frameDroppingOn == other.frameDroppingOn && |
| 49 | keyFrameInterval == other.keyFrameInterval && |
| 50 | spsLen == other.spsLen && |
| 51 | ppsLen == other.ppsLen && |
| 52 | profile == other.profile && |
| 53 | (spsLen == 0 || memcmp(spsData, other.spsData, spsLen) == 0) && |
| 54 | (ppsLen == 0 || memcmp(ppsData, other.ppsData, ppsLen) == 0)); |
| 55 | } |
| 56 | |
| 57 | bool SpatialLayer::operator==(const SpatialLayer& other) const { |
| 58 | return (width == other.width && |
| 59 | height == other.height && |
| 60 | numberOfTemporalLayers == other.numberOfTemporalLayers && |
| 61 | maxBitrate == other.maxBitrate && |
| 62 | targetBitrate == other.targetBitrate && |
| 63 | minBitrate == other.minBitrate && |
| 64 | qpMax == other.qpMax && |
| 65 | active == other.active); |
| 66 | } |
| 67 | |
hta | 257dc39 | 2016-10-25 16:05:06 | [diff] [blame] | 68 | VideoCodec::VideoCodec() |
| 69 | : codecType(kVideoCodecUnknown), |
hta | 257dc39 | 2016-10-25 16:05:06 | [diff] [blame] | 70 | plType(0), |
| 71 | width(0), |
| 72 | height(0), |
| 73 | startBitrate(0), |
| 74 | maxBitrate(0), |
| 75 | minBitrate(0), |
| 76 | targetBitrate(0), |
| 77 | maxFramerate(0), |
Seth Hampson | f6464c9 | 2018-01-17 21:55:14 | [diff] [blame] | 78 | active(true), |
hta | 257dc39 | 2016-10-25 16:05:06 | [diff] [blame] | 79 | qpMax(0), |
| 80 | numberOfSimulcastStreams(0), |
| 81 | simulcastStream(), |
| 82 | spatialLayers(), |
| 83 | mode(kRealtimeVideo), |
Erik Språng | 08127a9 | 2016-11-16 15:41:30 | [diff] [blame] | 84 | expect_encode_from_texture(false), |
ilnik | 04f4d12 | 2017-06-19 14:18:55 | [diff] [blame] | 85 | timing_frame_thresholds({0, 0}), |
hta | 527d347 | 2016-11-17 07:23:04 | [diff] [blame] | 86 | codec_specific_() {} |
hta | 257dc39 | 2016-10-25 16:05:06 | [diff] [blame] | 87 | |
| 88 | VideoCodecVP8* VideoCodec::VP8() { |
| 89 | RTC_DCHECK_EQ(codecType, kVideoCodecVP8); |
hta | 527d347 | 2016-11-17 07:23:04 | [diff] [blame] | 90 | return &codec_specific_.VP8; |
hta | 257dc39 | 2016-10-25 16:05:06 | [diff] [blame] | 91 | } |
| 92 | |
| 93 | const VideoCodecVP8& VideoCodec::VP8() const { |
| 94 | RTC_DCHECK_EQ(codecType, kVideoCodecVP8); |
hta | 527d347 | 2016-11-17 07:23:04 | [diff] [blame] | 95 | return codec_specific_.VP8; |
hta | 257dc39 | 2016-10-25 16:05:06 | [diff] [blame] | 96 | } |
| 97 | |
| 98 | VideoCodecVP9* VideoCodec::VP9() { |
| 99 | RTC_DCHECK_EQ(codecType, kVideoCodecVP9); |
hta | 527d347 | 2016-11-17 07:23:04 | [diff] [blame] | 100 | return &codec_specific_.VP9; |
hta | 257dc39 | 2016-10-25 16:05:06 | [diff] [blame] | 101 | } |
| 102 | |
| 103 | const VideoCodecVP9& VideoCodec::VP9() const { |
| 104 | RTC_DCHECK_EQ(codecType, kVideoCodecVP9); |
hta | 527d347 | 2016-11-17 07:23:04 | [diff] [blame] | 105 | return codec_specific_.VP9; |
hta | 257dc39 | 2016-10-25 16:05:06 | [diff] [blame] | 106 | } |
| 107 | |
| 108 | VideoCodecH264* VideoCodec::H264() { |
| 109 | RTC_DCHECK_EQ(codecType, kVideoCodecH264); |
hta | 527d347 | 2016-11-17 07:23:04 | [diff] [blame] | 110 | return &codec_specific_.H264; |
hta | 257dc39 | 2016-10-25 16:05:06 | [diff] [blame] | 111 | } |
| 112 | |
| 113 | const VideoCodecH264& VideoCodec::H264() const { |
| 114 | RTC_DCHECK_EQ(codecType, kVideoCodecH264); |
hta | 527d347 | 2016-11-17 07:23:04 | [diff] [blame] | 115 | return codec_specific_.H264; |
hta | 257dc39 | 2016-10-25 16:05:06 | [diff] [blame] | 116 | } |
| 117 | |
Erik Språng | 08127a9 | 2016-11-16 15:41:30 | [diff] [blame] | 118 | static const char* kPayloadNameVp8 = "VP8"; |
| 119 | static const char* kPayloadNameVp9 = "VP9"; |
| 120 | static const char* kPayloadNameH264 = "H264"; |
| 121 | static const char* kPayloadNameI420 = "I420"; |
| 122 | static const char* kPayloadNameRED = "RED"; |
| 123 | static const char* kPayloadNameULPFEC = "ULPFEC"; |
Danil Chapovalov | 3c70697 | 2018-01-30 10:11:08 | [diff] [blame] | 124 | static const char* kPayloadNameFlexfec = "flexfec-03"; |
Erik Språng | 08127a9 | 2016-11-16 15:41:30 | [diff] [blame] | 125 | static const char* kPayloadNameGeneric = "Generic"; |
Emircan Uysaler | d7ae3c3 | 2018-01-25 21:01:09 | [diff] [blame] | 126 | static const char* kPayloadNameMultiplex = "Multiplex"; |
Erik Språng | 08127a9 | 2016-11-16 15:41:30 | [diff] [blame] | 127 | |
magjed | 10165ab | 2016-11-22 18:16:57 | [diff] [blame] | 128 | static bool CodecNamesEq(const char* name1, const char* name2) { |
| 129 | return _stricmp(name1, name2) == 0; |
| 130 | } |
| 131 | |
kthelgason | 1cdddc9 | 2017-08-24 10:52:48 | [diff] [blame] | 132 | const char* CodecTypeToPayloadString(VideoCodecType type) { |
Erik Språng | 08127a9 | 2016-11-16 15:41:30 | [diff] [blame] | 133 | switch (type) { |
| 134 | case kVideoCodecVP8: |
kthelgason | 1cdddc9 | 2017-08-24 10:52:48 | [diff] [blame] | 135 | return kPayloadNameVp8; |
Erik Språng | 08127a9 | 2016-11-16 15:41:30 | [diff] [blame] | 136 | case kVideoCodecVP9: |
kthelgason | 1cdddc9 | 2017-08-24 10:52:48 | [diff] [blame] | 137 | return kPayloadNameVp9; |
Erik Språng | 08127a9 | 2016-11-16 15:41:30 | [diff] [blame] | 138 | case kVideoCodecH264: |
kthelgason | 1cdddc9 | 2017-08-24 10:52:48 | [diff] [blame] | 139 | return kPayloadNameH264; |
Erik Språng | 08127a9 | 2016-11-16 15:41:30 | [diff] [blame] | 140 | case kVideoCodecI420: |
kthelgason | 1cdddc9 | 2017-08-24 10:52:48 | [diff] [blame] | 141 | return kPayloadNameI420; |
Erik Språng | 08127a9 | 2016-11-16 15:41:30 | [diff] [blame] | 142 | case kVideoCodecRED: |
kthelgason | 1cdddc9 | 2017-08-24 10:52:48 | [diff] [blame] | 143 | return kPayloadNameRED; |
Erik Språng | 08127a9 | 2016-11-16 15:41:30 | [diff] [blame] | 144 | case kVideoCodecULPFEC: |
kthelgason | 1cdddc9 | 2017-08-24 10:52:48 | [diff] [blame] | 145 | return kPayloadNameULPFEC; |
Danil Chapovalov | 3c70697 | 2018-01-30 10:11:08 | [diff] [blame] | 146 | case kVideoCodecFlexfec: |
| 147 | return kPayloadNameFlexfec; |
Emircan Uysaler | 0a37547 | 2017-12-11 06:51:02 | [diff] [blame] | 148 | // Other codecs default to generic. |
Emircan Uysaler | d7ae3c3 | 2018-01-25 21:01:09 | [diff] [blame] | 149 | case kVideoCodecMultiplex: |
Emircan Uysaler | 0a37547 | 2017-12-11 06:51:02 | [diff] [blame] | 150 | case kVideoCodecGeneric: |
| 151 | case kVideoCodecUnknown: |
kthelgason | 1cdddc9 | 2017-08-24 10:52:48 | [diff] [blame] | 152 | return kPayloadNameGeneric; |
Erik Språng | 08127a9 | 2016-11-16 15:41:30 | [diff] [blame] | 153 | } |
Emircan Uysaler | 0a37547 | 2017-12-11 06:51:02 | [diff] [blame] | 154 | return kPayloadNameGeneric; |
Erik Språng | 08127a9 | 2016-11-16 15:41:30 | [diff] [blame] | 155 | } |
| 156 | |
kthelgason | 1cdddc9 | 2017-08-24 10:52:48 | [diff] [blame] | 157 | VideoCodecType PayloadStringToCodecType(const std::string& name) { |
magjed | 10165ab | 2016-11-22 18:16:57 | [diff] [blame] | 158 | if (CodecNamesEq(name.c_str(), kPayloadNameVp8)) |
kthelgason | 1cdddc9 | 2017-08-24 10:52:48 | [diff] [blame] | 159 | return kVideoCodecVP8; |
magjed | 10165ab | 2016-11-22 18:16:57 | [diff] [blame] | 160 | if (CodecNamesEq(name.c_str(), kPayloadNameVp9)) |
kthelgason | 1cdddc9 | 2017-08-24 10:52:48 | [diff] [blame] | 161 | return kVideoCodecVP9; |
magjed | 10165ab | 2016-11-22 18:16:57 | [diff] [blame] | 162 | if (CodecNamesEq(name.c_str(), kPayloadNameH264)) |
kthelgason | 1cdddc9 | 2017-08-24 10:52:48 | [diff] [blame] | 163 | return kVideoCodecH264; |
magjed | 10165ab | 2016-11-22 18:16:57 | [diff] [blame] | 164 | if (CodecNamesEq(name.c_str(), kPayloadNameI420)) |
kthelgason | 1cdddc9 | 2017-08-24 10:52:48 | [diff] [blame] | 165 | return kVideoCodecI420; |
magjed | 10165ab | 2016-11-22 18:16:57 | [diff] [blame] | 166 | if (CodecNamesEq(name.c_str(), kPayloadNameRED)) |
kthelgason | 1cdddc9 | 2017-08-24 10:52:48 | [diff] [blame] | 167 | return kVideoCodecRED; |
magjed | 10165ab | 2016-11-22 18:16:57 | [diff] [blame] | 168 | if (CodecNamesEq(name.c_str(), kPayloadNameULPFEC)) |
kthelgason | 1cdddc9 | 2017-08-24 10:52:48 | [diff] [blame] | 169 | return kVideoCodecULPFEC; |
Danil Chapovalov | 3c70697 | 2018-01-30 10:11:08 | [diff] [blame] | 170 | if (CodecNamesEq(name.c_str(), kPayloadNameFlexfec)) |
| 171 | return kVideoCodecFlexfec; |
Emircan Uysaler | d7ae3c3 | 2018-01-25 21:01:09 | [diff] [blame] | 172 | if (CodecNamesEq(name.c_str(), kPayloadNameMultiplex)) |
| 173 | return kVideoCodecMultiplex; |
kthelgason | 1cdddc9 | 2017-08-24 10:52:48 | [diff] [blame] | 174 | return kVideoCodecGeneric; |
| 175 | } |
| 176 | |
Erik Språng | 08127a9 | 2016-11-16 15:41:30 | [diff] [blame] | 177 | const uint32_t BitrateAllocation::kMaxBitrateBps = |
| 178 | std::numeric_limits<uint32_t>::max(); |
| 179 | |
erikvarga@webrtc.org | 01f2ec3 | 2017-11-15 13:58:23 | [diff] [blame] | 180 | BitrateAllocation::BitrateAllocation() : sum_(0), bitrates_{}, has_bitrate_{} {} |
Erik Språng | 08127a9 | 2016-11-16 15:41:30 | [diff] [blame] | 181 | |
| 182 | bool BitrateAllocation::SetBitrate(size_t spatial_index, |
| 183 | size_t temporal_index, |
| 184 | uint32_t bitrate_bps) { |
sprang | 6d314c7 | 2016-12-06 14:08:53 | [diff] [blame] | 185 | RTC_CHECK_LT(spatial_index, kMaxSpatialLayers); |
| 186 | RTC_CHECK_LT(temporal_index, kMaxTemporalStreams); |
| 187 | RTC_CHECK_LE(bitrates_[spatial_index][temporal_index], sum_); |
Erik Språng | 08127a9 | 2016-11-16 15:41:30 | [diff] [blame] | 188 | uint64_t new_bitrate_sum_bps = sum_; |
| 189 | new_bitrate_sum_bps -= bitrates_[spatial_index][temporal_index]; |
| 190 | new_bitrate_sum_bps += bitrate_bps; |
| 191 | if (new_bitrate_sum_bps > kMaxBitrateBps) |
| 192 | return false; |
| 193 | |
| 194 | bitrates_[spatial_index][temporal_index] = bitrate_bps; |
erikvarga@webrtc.org | 01f2ec3 | 2017-11-15 13:58:23 | [diff] [blame] | 195 | has_bitrate_[spatial_index][temporal_index] = true; |
Erik Språng | 08127a9 | 2016-11-16 15:41:30 | [diff] [blame] | 196 | sum_ = static_cast<uint32_t>(new_bitrate_sum_bps); |
| 197 | return true; |
| 198 | } |
| 199 | |
erikvarga@webrtc.org | 01f2ec3 | 2017-11-15 13:58:23 | [diff] [blame] | 200 | bool BitrateAllocation::HasBitrate(size_t spatial_index, |
| 201 | size_t temporal_index) const { |
| 202 | RTC_CHECK_LT(spatial_index, kMaxSpatialLayers); |
| 203 | RTC_CHECK_LT(temporal_index, kMaxTemporalStreams); |
| 204 | return has_bitrate_[spatial_index][temporal_index]; |
| 205 | } |
| 206 | |
Erik Språng | 08127a9 | 2016-11-16 15:41:30 | [diff] [blame] | 207 | uint32_t BitrateAllocation::GetBitrate(size_t spatial_index, |
| 208 | size_t temporal_index) const { |
sprang | 6d314c7 | 2016-12-06 14:08:53 | [diff] [blame] | 209 | RTC_CHECK_LT(spatial_index, kMaxSpatialLayers); |
| 210 | RTC_CHECK_LT(temporal_index, kMaxTemporalStreams); |
Erik Språng | 08127a9 | 2016-11-16 15:41:30 | [diff] [blame] | 211 | return bitrates_[spatial_index][temporal_index]; |
| 212 | } |
| 213 | |
erikvarga@webrtc.org | 01f2ec3 | 2017-11-15 13:58:23 | [diff] [blame] | 214 | // Whether the specific spatial layers has the bitrate set in any of its |
| 215 | // temporal layers. |
| 216 | bool BitrateAllocation::IsSpatialLayerUsed(size_t spatial_index) const { |
| 217 | RTC_CHECK_LT(spatial_index, kMaxSpatialLayers); |
| 218 | for (int i = 0; i < kMaxTemporalStreams; ++i) { |
| 219 | if (has_bitrate_[spatial_index][i]) |
| 220 | return true; |
| 221 | } |
| 222 | return false; |
| 223 | } |
| 224 | |
Erik Språng | 08127a9 | 2016-11-16 15:41:30 | [diff] [blame] | 225 | // Get the sum of all the temporal layer for a specific spatial layer. |
| 226 | uint32_t BitrateAllocation::GetSpatialLayerSum(size_t spatial_index) const { |
sprang | 6d314c7 | 2016-12-06 14:08:53 | [diff] [blame] | 227 | RTC_CHECK_LT(spatial_index, kMaxSpatialLayers); |
Sergey Silkin | 8668496 | 2018-03-28 17:32:37 | [diff] [blame] | 228 | return GetTemporalLayerSum(spatial_index, kMaxTemporalStreams - 1); |
| 229 | } |
| 230 | |
| 231 | uint32_t BitrateAllocation::GetTemporalLayerSum(size_t spatial_index, |
| 232 | size_t temporal_index) const { |
| 233 | RTC_CHECK_LT(spatial_index, kMaxSpatialLayers); |
| 234 | RTC_CHECK_LT(temporal_index, kMaxTemporalStreams); |
Erik Språng | 08127a9 | 2016-11-16 15:41:30 | [diff] [blame] | 235 | uint32_t sum = 0; |
Sergey Silkin | 8668496 | 2018-03-28 17:32:37 | [diff] [blame] | 236 | for (size_t i = 0; i <= temporal_index; ++i) { |
Erik Språng | 08127a9 | 2016-11-16 15:41:30 | [diff] [blame] | 237 | sum += bitrates_[spatial_index][i]; |
Sergey Silkin | 8668496 | 2018-03-28 17:32:37 | [diff] [blame] | 238 | } |
Erik Språng | 08127a9 | 2016-11-16 15:41:30 | [diff] [blame] | 239 | return sum; |
| 240 | } |
| 241 | |
Erik Språng | bb60a3a | 2018-03-19 17:25:10 | [diff] [blame] | 242 | std::vector<uint32_t> BitrateAllocation::GetTemporalLayerAllocation( |
| 243 | size_t spatial_index) const { |
| 244 | RTC_CHECK_LT(spatial_index, kMaxSpatialLayers); |
| 245 | std::vector<uint32_t> temporal_rates; |
| 246 | |
| 247 | // Find the highest temporal layer with a defined bitrate in order to |
| 248 | // determine the size of the temporal layer allocation. |
| 249 | for (size_t i = kMaxTemporalStreams; i > 0; --i) { |
| 250 | if (has_bitrate_[spatial_index][i - 1]) { |
| 251 | temporal_rates.resize(i); |
| 252 | break; |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | for (size_t i = 0; i < temporal_rates.size(); ++i) { |
| 257 | temporal_rates[i] = bitrates_[spatial_index][i]; |
| 258 | } |
| 259 | |
| 260 | return temporal_rates; |
| 261 | } |
| 262 | |
sprang | d0fc37a | 2017-06-22 12:40:25 | [diff] [blame] | 263 | std::string BitrateAllocation::ToString() const { |
| 264 | if (sum_ == 0) |
| 265 | return "BitrateAllocation [ [] ]"; |
| 266 | |
Erik Språng | bb60a3a | 2018-03-19 17:25:10 | [diff] [blame] | 267 | // Max string length in practice is 260, but let's have some overhead and |
| 268 | // round up to nearest power of two. |
| 269 | char string_buf[512]; |
| 270 | rtc::SimpleStringBuilder ssb(string_buf); |
| 271 | |
| 272 | ssb << "BitrateAllocation ["; |
sprang | d0fc37a | 2017-06-22 12:40:25 | [diff] [blame] | 273 | uint32_t spatial_cumulator = 0; |
| 274 | for (int si = 0; si < kMaxSpatialLayers; ++si) { |
| 275 | RTC_DCHECK_LE(spatial_cumulator, sum_); |
| 276 | if (spatial_cumulator == sum_) |
| 277 | break; |
| 278 | |
| 279 | const uint32_t layer_sum = GetSpatialLayerSum(si); |
| 280 | if (layer_sum == sum_) { |
Erik Språng | bb60a3a | 2018-03-19 17:25:10 | [diff] [blame] | 281 | ssb << " ["; |
sprang | d0fc37a | 2017-06-22 12:40:25 | [diff] [blame] | 282 | } else { |
| 283 | if (si > 0) |
Erik Språng | bb60a3a | 2018-03-19 17:25:10 | [diff] [blame] | 284 | ssb << ","; |
| 285 | ssb << '\n' << " ["; |
sprang | d0fc37a | 2017-06-22 12:40:25 | [diff] [blame] | 286 | } |
| 287 | spatial_cumulator += layer_sum; |
| 288 | |
| 289 | uint32_t temporal_cumulator = 0; |
| 290 | for (int ti = 0; ti < kMaxTemporalStreams; ++ti) { |
| 291 | RTC_DCHECK_LE(temporal_cumulator, layer_sum); |
| 292 | if (temporal_cumulator == layer_sum) |
| 293 | break; |
| 294 | |
| 295 | if (ti > 0) |
Erik Språng | bb60a3a | 2018-03-19 17:25:10 | [diff] [blame] | 296 | ssb << ", "; |
sprang | d0fc37a | 2017-06-22 12:40:25 | [diff] [blame] | 297 | |
| 298 | uint32_t bitrate = bitrates_[si][ti]; |
Erik Språng | bb60a3a | 2018-03-19 17:25:10 | [diff] [blame] | 299 | ssb << bitrate; |
sprang | d0fc37a | 2017-06-22 12:40:25 | [diff] [blame] | 300 | temporal_cumulator += bitrate; |
| 301 | } |
Erik Språng | bb60a3a | 2018-03-19 17:25:10 | [diff] [blame] | 302 | ssb << "]"; |
sprang | d0fc37a | 2017-06-22 12:40:25 | [diff] [blame] | 303 | } |
| 304 | |
| 305 | RTC_DCHECK_EQ(spatial_cumulator, sum_); |
Erik Språng | bb60a3a | 2018-03-19 17:25:10 | [diff] [blame] | 306 | ssb << " ]"; |
| 307 | return ssb.str(); |
sprang | d0fc37a | 2017-06-22 12:40:25 | [diff] [blame] | 308 | } |
| 309 | |
kwiberg@webrtc.org | ac2d27d | 2015-02-26 13:59:22 | [diff] [blame] | 310 | } // namespace webrtc |