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

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

Issue 2924993002: Move temporal-layer properties to FrameConfig. (Closed)
Patch Set: improve unittests Created 3 years, 5 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 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 int EncodeFrame(bool base_sync) { 65 int EncodeFrame(bool base_sync) {
66 int flags = ConfigureFrame(base_sync); 66 int flags = ConfigureFrame(base_sync);
67 if (flags != -1) 67 if (flags != -1)
68 layers_->FrameEncoded(frame_size_, kDefaultQp); 68 layers_->FrameEncoded(frame_size_, kDefaultQp);
69 return flags; 69 return flags;
70 } 70 }
71 71
72 int ConfigureFrame(bool key_frame) { 72 int ConfigureFrame(bool key_frame) {
73 tl_config_ = layers_->UpdateLayerConfig(timestamp_); 73 tl_config_ = layers_->UpdateLayerConfig(timestamp_);
74 EXPECT_EQ(0, tl_config_.encoder_layer_id)
75 << "ScreenshareLayers always encodes using the bitrate allocator for "
76 "layer 0, but may reference different buffers and packetize "
77 "differently.";
74 if (tl_config_.drop_frame) { 78 if (tl_config_.drop_frame) {
75 return -1; 79 return -1;
76 } 80 }
77 config_updated_ = layers_->UpdateConfiguration(&cfg_); 81 config_updated_ = layers_->UpdateConfiguration(&cfg_);
78 int flags = VP8EncoderImpl::EncodeFlags(tl_config_); 82 int flags = VP8EncoderImpl::EncodeFlags(tl_config_);
79 layers_->PopulateCodecSpecific(key_frame, tl_config_, &vp8_info_, 83 layers_->PopulateCodecSpecific(key_frame, tl_config_, &vp8_info_,
80 timestamp_); 84 timestamp_);
81 EXPECT_NE(-1, frame_size_); 85 EXPECT_NE(-1, frame_size_);
82 return flags; 86 return flags;
83 } 87 }
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 598
595 config_updated_ = layers_->UpdateConfiguration(&cfg_); 599 config_updated_ = layers_->UpdateConfiguration(&cfg_);
596 EXPECT_EQ(kTl1SyncFlags, VP8EncoderImpl::EncodeFlags(tl_config_)); 600 EXPECT_EQ(kTl1SyncFlags, VP8EncoderImpl::EncodeFlags(tl_config_));
597 601
598 CodecSpecificInfoVP8 new_vp8_info; 602 CodecSpecificInfoVP8 new_vp8_info;
599 layers_->PopulateCodecSpecific(false, tl_config_, &new_vp8_info, timestamp_); 603 layers_->PopulateCodecSpecific(false, tl_config_, &new_vp8_info, timestamp_);
600 EXPECT_TRUE(new_vp8_info.layerSync); 604 EXPECT_TRUE(new_vp8_info.layerSync);
601 } 605 }
602 606
603 } // namespace webrtc 607 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/codecs/vp8/screenshare_layers.cc ('k') | webrtc/modules/video_coding/codecs/vp8/temporal_layers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698