OLD | NEW |
1 /* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 1 /* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
2 * | 2 * |
3 * Use of this source code is governed by a BSD-style license | 3 * Use of this source code is governed by a BSD-style license |
4 * that can be found in the LICENSE file in the root of the source | 4 * that can be found in the LICENSE file in the root of the source |
5 * tree. An additional intellectual property rights grant can be found | 5 * tree. An additional intellectual property rights grant can be found |
6 * in the file PATENTS. All contributing project authors may | 6 * in the file PATENTS. All contributing project authors may |
7 * be found in the AUTHORS file in the root of the source tree. | 7 * be found in the AUTHORS file in the root of the source tree. |
8 */ | 8 */ |
9 | 9 |
10 #include <stdlib.h> | 10 #include <stdlib.h> |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 public: | 87 public: |
88 RealTimeTemporalLayers(int max_num_temporal_layers, | 88 RealTimeTemporalLayers(int max_num_temporal_layers, |
89 uint8_t initial_tl0_pic_idx) | 89 uint8_t initial_tl0_pic_idx) |
90 : temporal_layers_(1), | 90 : temporal_layers_(1), |
91 max_temporal_layers_(max_num_temporal_layers), | 91 max_temporal_layers_(max_num_temporal_layers), |
92 tl0_pic_idx_(initial_tl0_pic_idx), | 92 tl0_pic_idx_(initial_tl0_pic_idx), |
93 frame_counter_(static_cast<unsigned int>(-1)), | 93 frame_counter_(static_cast<unsigned int>(-1)), |
94 timestamp_(0), | 94 timestamp_(0), |
95 last_base_layer_sync_(0), | 95 last_base_layer_sync_(0), |
96 layer_ids_length_(0), | 96 layer_ids_length_(0), |
97 layer_ids_(NULL), | 97 layer_ids_(nullptr), |
98 encode_flags_length_(0), | 98 encode_flags_length_(0), |
99 encode_flags_(NULL) { | 99 encode_flags_(nullptr) { |
100 RTC_CHECK_GE(max_temporal_layers_, 1); | 100 RTC_CHECK_GE(max_temporal_layers_, 1); |
101 RTC_CHECK_GE(max_temporal_layers_, 3); | 101 RTC_CHECK_LE(max_temporal_layers_, 3); |
102 } | 102 } |
103 | 103 |
104 virtual ~RealTimeTemporalLayers() {} | 104 virtual ~RealTimeTemporalLayers() {} |
105 | 105 |
106 std::vector<uint32_t> OnRatesUpdated(int bitrate_kbps, | 106 std::vector<uint32_t> OnRatesUpdated(int bitrate_kbps, |
107 int max_bitrate_kbps, | 107 int max_bitrate_kbps, |
108 int framerate) override { | 108 int framerate) override { |
109 temporal_layers_ = | 109 temporal_layers_ = |
110 CalculateNumberOfTemporalLayers(temporal_layers_, framerate); | 110 CalculateNumberOfTemporalLayers(temporal_layers_, framerate); |
111 temporal_layers_ = std::min(temporal_layers_, max_temporal_layers_); | 111 temporal_layers_ = std::min(temporal_layers_, max_temporal_layers_); |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 int simulcast_id, | 302 int simulcast_id, |
303 int max_temporal_layers, | 303 int max_temporal_layers, |
304 uint8_t initial_tl0_pic_idx) const { | 304 uint8_t initial_tl0_pic_idx) const { |
305 TemporalLayers* tl = | 305 TemporalLayers* tl = |
306 new RealTimeTemporalLayers(max_temporal_layers, initial_tl0_pic_idx); | 306 new RealTimeTemporalLayers(max_temporal_layers, initial_tl0_pic_idx); |
307 if (listener_) | 307 if (listener_) |
308 listener_->OnTemporalLayersCreated(simulcast_id, tl); | 308 listener_->OnTemporalLayersCreated(simulcast_id, tl); |
309 return tl; | 309 return tl; |
310 } | 310 } |
311 } // namespace webrtc | 311 } // namespace webrtc |
OLD | NEW |