OLD | NEW |
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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 }; | 105 }; |
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 const int kSingleLayerFlags = 0; |
115 flags = layers_->EncodeFlags(timestamp); | 116 flags = layers_->EncodeFlags(timestamp); |
116 EXPECT_EQ(0, flags); | 117 EXPECT_EQ(kSingleLayerFlags, flags); |
117 layers_->PopulateCodecSpecific(false, &vp8_info, timestamp); | 118 layers_->PopulateCodecSpecific(false, &vp8_info, timestamp); |
118 EXPECT_EQ(static_cast<uint8_t>(kNoTemporalIdx), vp8_info.temporalIdx); | 119 EXPECT_EQ(static_cast<uint8_t>(kNoTemporalIdx), vp8_info.temporalIdx); |
119 EXPECT_FALSE(vp8_info.layerSync); | 120 EXPECT_FALSE(vp8_info.layerSync); |
120 EXPECT_EQ(kNoTl0PicIdx, vp8_info.tl0PicIdx); | 121 EXPECT_EQ(kNoTl0PicIdx, vp8_info.tl0PicIdx); |
121 layers_->FrameEncoded(frame_size_, timestamp, kDefaultQp); | 122 layers_->FrameEncoded(frame_size_, timestamp, kDefaultQp); |
122 flags = layers_->EncodeFlags(timestamp); | 123 flags = layers_->EncodeFlags(timestamp); |
123 EXPECT_EQ(0, flags); | 124 EXPECT_EQ(kSingleLayerFlags, flags); |
124 timestamp += kTimestampDelta5Fps; | 125 timestamp += kTimestampDelta5Fps; |
125 layers_->PopulateCodecSpecific(false, &vp8_info, timestamp); | 126 layers_->PopulateCodecSpecific(false, &vp8_info, timestamp); |
126 EXPECT_EQ(static_cast<uint8_t>(kNoTemporalIdx), vp8_info.temporalIdx); | 127 EXPECT_EQ(static_cast<uint8_t>(kNoTemporalIdx), vp8_info.temporalIdx); |
127 EXPECT_FALSE(vp8_info.layerSync); | 128 EXPECT_FALSE(vp8_info.layerSync); |
128 EXPECT_EQ(kNoTl0PicIdx, vp8_info.tl0PicIdx); | 129 EXPECT_EQ(kNoTl0PicIdx, vp8_info.tl0PicIdx); |
129 layers_->FrameEncoded(frame_size_, timestamp, kDefaultQp); | 130 layers_->FrameEncoded(frame_size_, timestamp, kDefaultQp); |
130 } | 131 } |
131 | 132 |
132 TEST_F(ScreenshareLayerTest, 2Layer) { | 133 TEST_F(ScreenshareLayerTest, 2Layer) { |
133 layers_.reset(new ScreenshareLayers(2, 0)); | 134 layers_.reset(new ScreenshareLayers(2, 0)); |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 | 436 |
436 layers_->EncodeFlags(timestamp); | 437 layers_->EncodeFlags(timestamp); |
437 timestamp += kTimestampDelta5Fps; | 438 timestamp += kTimestampDelta5Fps; |
438 EXPECT_TRUE(layers_->UpdateConfiguration(&cfg)); | 439 EXPECT_TRUE(layers_->UpdateConfiguration(&cfg)); |
439 layers_->PopulateCodecSpecific(false, &vp8_info, timestamp); | 440 layers_->PopulateCodecSpecific(false, &vp8_info, timestamp); |
440 EXPECT_EQ(cfg.rc_max_quantizer, static_cast<unsigned int>(kDefaultQp)); | 441 EXPECT_EQ(cfg.rc_max_quantizer, static_cast<unsigned int>(kDefaultQp)); |
441 layers_->FrameEncoded(frame_size_, timestamp, kDefaultQp); | 442 layers_->FrameEncoded(frame_size_, timestamp, kDefaultQp); |
442 } | 443 } |
443 | 444 |
444 } // namespace webrtc | 445 } // namespace webrtc |
OLD | NEW |