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

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

Issue 2745523002: Add FullStack test for simulcast screenshare mode. (Closed)
Patch Set: Implement Stefan@ comments Created 3 years, 9 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
« no previous file with comments | « webrtc/common_video/include/frame_callback.h ('k') | webrtc/video/full_stack_tests.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 12 matching lines...) Expand all
23 const VideoCodec& codec, 23 const VideoCodec& codec,
24 std::unique_ptr<TemporalLayersFactory> tl_factory) 24 std::unique_ptr<TemporalLayersFactory> tl_factory)
25 : codec_(codec), tl_factory_(std::move(tl_factory)) { 25 : codec_(codec), tl_factory_(std::move(tl_factory)) {
26 if (tl_factory_.get()) 26 if (tl_factory_.get())
27 tl_factory_->SetListener(this); 27 tl_factory_->SetListener(this);
28 } 28 }
29 29
30 void SimulcastRateAllocator::OnTemporalLayersCreated(int simulcast_id, 30 void SimulcastRateAllocator::OnTemporalLayersCreated(int simulcast_id,
31 TemporalLayers* layers) { 31 TemporalLayers* layers) {
32 RTC_DCHECK(temporal_layers_.find(simulcast_id) == temporal_layers_.end()); 32 RTC_DCHECK(temporal_layers_.find(simulcast_id) == temporal_layers_.end());
33 RTC_DCHECK(layers);
33 temporal_layers_[simulcast_id] = layers; 34 temporal_layers_[simulcast_id] = layers;
34 } 35 }
35 36
36 BitrateAllocation SimulcastRateAllocator::GetAllocation( 37 BitrateAllocation SimulcastRateAllocator::GetAllocation(
37 uint32_t total_bitrate_bps, 38 uint32_t total_bitrate_bps,
38 uint32_t framerate) { 39 uint32_t framerate) {
39 uint32_t left_to_allocate = total_bitrate_bps; 40 uint32_t left_to_allocate = total_bitrate_bps;
40 if (codec_.maxBitrate && codec_.maxBitrate * 1000 < left_to_allocate) 41 if (codec_.maxBitrate && codec_.maxBitrate * 1000 < left_to_allocate)
41 left_to_allocate = codec_.maxBitrate * 1000; 42 left_to_allocate = codec_.maxBitrate * 1000;
42 43
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 BitrateAllocation allocation = 154 BitrateAllocation allocation =
154 temp_allocator.GetAllocation(codec_.maxBitrate * 1000, framerate); 155 temp_allocator.GetAllocation(codec_.maxBitrate * 1000, framerate);
155 return allocation.get_sum_bps(); 156 return allocation.get_sum_bps();
156 } 157 }
157 158
158 const VideoCodec& webrtc::SimulcastRateAllocator::GetCodec() const { 159 const VideoCodec& webrtc::SimulcastRateAllocator::GetCodec() const {
159 return codec_; 160 return codec_;
160 } 161 }
161 162
162 } // namespace webrtc 163 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/common_video/include/frame_callback.h ('k') | webrtc/video/full_stack_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698