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

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

Issue 1242043002: Selectable number of TL screenshare loopback test (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Updated test case Created 5 years, 4 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 TEST_F(ScreenshareLayerTest, 1Layer) { 107 TEST_F(ScreenshareLayerTest, 1Layer) {
108 layers_.reset(new ScreenshareLayers(1, 0)); 108 layers_.reset(new ScreenshareLayers(1, 0));
109 ConfigureBitrates(); 109 ConfigureBitrates();
110 int flags = 0; 110 int flags = 0;
111 uint32_t timestamp = 0; 111 uint32_t timestamp = 0;
112 CodecSpecificInfoVP8 vp8_info; 112 CodecSpecificInfoVP8 vp8_info;
113 // One layer screenshare should not use the frame dropper as all frames will 113 // One layer screenshare should not use the frame dropper as all frames will
114 // belong to the base layer. 114 // belong to the base layer.
115 flags = layers_->EncodeFlags(timestamp); 115 flags = layers_->EncodeFlags(timestamp);
116 EXPECT_EQ(0, flags); 116 EXPECT_EQ(ScreenshareLayers::kTl0Flags, flags);
117 layers_->PopulateCodecSpecific(false, &vp8_info, timestamp); 117 layers_->PopulateCodecSpecific(false, &vp8_info, timestamp);
118 EXPECT_EQ(static_cast<uint8_t>(kNoTemporalIdx), vp8_info.temporalIdx); 118 EXPECT_EQ(static_cast<uint8_t>(kNoTemporalIdx), vp8_info.temporalIdx);
119 EXPECT_FALSE(vp8_info.layerSync); 119 EXPECT_FALSE(vp8_info.layerSync);
120 EXPECT_EQ(kNoTl0PicIdx, vp8_info.tl0PicIdx); 120 EXPECT_EQ(kNoTl0PicIdx, vp8_info.tl0PicIdx);
121 layers_->FrameEncoded(frame_size_, timestamp, kDefaultQp); 121 layers_->FrameEncoded(frame_size_, timestamp, kDefaultQp);
122 flags = layers_->EncodeFlags(timestamp); 122 flags = layers_->EncodeFlags(timestamp);
123 EXPECT_EQ(0, flags); 123 EXPECT_EQ(ScreenshareLayers::kTl0Flags, flags);
124 timestamp += kTimestampDelta5Fps; 124 timestamp += kTimestampDelta5Fps;
125 layers_->PopulateCodecSpecific(false, &vp8_info, timestamp); 125 layers_->PopulateCodecSpecific(false, &vp8_info, timestamp);
126 EXPECT_EQ(static_cast<uint8_t>(kNoTemporalIdx), vp8_info.temporalIdx); 126 EXPECT_EQ(static_cast<uint8_t>(kNoTemporalIdx), vp8_info.temporalIdx);
127 EXPECT_FALSE(vp8_info.layerSync); 127 EXPECT_FALSE(vp8_info.layerSync);
128 EXPECT_EQ(kNoTl0PicIdx, vp8_info.tl0PicIdx); 128 EXPECT_EQ(kNoTl0PicIdx, vp8_info.tl0PicIdx);
129 layers_->FrameEncoded(frame_size_, timestamp, kDefaultQp); 129 layers_->FrameEncoded(frame_size_, timestamp, kDefaultQp);
130 } 130 }
131 131
132 TEST_F(ScreenshareLayerTest, 2Layer) { 132 TEST_F(ScreenshareLayerTest, 2Layer) {
133 layers_.reset(new ScreenshareLayers(2, 0)); 133 layers_.reset(new ScreenshareLayers(2, 0));
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 435
436 layers_->EncodeFlags(timestamp); 436 layers_->EncodeFlags(timestamp);
437 timestamp += kTimestampDelta5Fps; 437 timestamp += kTimestampDelta5Fps;
438 EXPECT_TRUE(layers_->UpdateConfiguration(&cfg)); 438 EXPECT_TRUE(layers_->UpdateConfiguration(&cfg));
439 layers_->PopulateCodecSpecific(false, &vp8_info, timestamp); 439 layers_->PopulateCodecSpecific(false, &vp8_info, timestamp);
440 EXPECT_EQ(cfg.rc_max_quantizer, static_cast<unsigned int>(kDefaultQp)); 440 EXPECT_EQ(cfg.rc_max_quantizer, static_cast<unsigned int>(kDefaultQp));
441 layers_->FrameEncoded(frame_size_, timestamp, kDefaultQp); 441 layers_->FrameEncoded(frame_size_, timestamp, kDefaultQp);
442 } 442 }
443 443
444 } // namespace webrtc 444 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698