Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(476)

Side by Side Diff: webrtc/modules/video_coding/codecs/vp8/realtime_temporal_layers.cc

Issue 2641133002: Reland of Add experimental simulcast screen content mode (Closed)
Patch Set: Rebase Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/BUILD.gn ('k') | webrtc/modules/video_coding/codecs/vp8/screenshare_layers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698