| 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 ElementsAre(kTl0_kbps)); | 411 ElementsAre(kTl0_kbps)); |
| 412 EXPECT_TRUE(layers_->UpdateConfiguration(&cfg)); | 412 EXPECT_TRUE(layers_->UpdateConfiguration(&cfg)); |
| 413 | 413 |
| 414 EXPECT_EQ(static_cast<uint32_t>(kTl1_kbps), cfg.rc_target_bitrate); | 414 EXPECT_EQ(static_cast<uint32_t>(kTl1_kbps), cfg.rc_target_bitrate); |
| 415 } | 415 } |
| 416 | 416 |
| 417 TEST_F(ScreenshareLayerTest, EncoderDrop) { | 417 TEST_F(ScreenshareLayerTest, EncoderDrop) { |
| 418 ConfigureBitrates(); | 418 ConfigureBitrates(); |
| 419 CodecSpecificInfoVP8 vp8_info; | 419 CodecSpecificInfoVP8 vp8_info; |
| 420 vpx_codec_enc_cfg_t cfg = GetConfig(); | 420 vpx_codec_enc_cfg_t cfg = GetConfig(); |
| 421 // Updates cfg with current target bitrate. |
| 422 EXPECT_TRUE(layers_->UpdateConfiguration(&cfg)); |
| 421 | 423 |
| 422 uint32_t timestamp = RunGracePeriod(); | 424 uint32_t timestamp = RunGracePeriod(); |
| 423 timestamp = SkipUntilTl(0, timestamp); | 425 timestamp = SkipUntilTl(0, timestamp); |
| 424 | 426 |
| 425 // Size 0 indicates dropped frame. | 427 // Size 0 indicates dropped frame. |
| 426 layers_->FrameEncoded(0, timestamp, kDefaultQp); | 428 layers_->FrameEncoded(0, timestamp, kDefaultQp); |
| 427 timestamp += kTimestampDelta5Fps; | 429 timestamp += kTimestampDelta5Fps; |
| 428 EXPECT_FALSE(layers_->UpdateConfiguration(&cfg)); | 430 EXPECT_FALSE(layers_->UpdateConfiguration(&cfg)); |
| 429 EXPECT_EQ(ScreenshareLayers::kTl0Flags, layers_->EncodeFlags(timestamp)); | 431 EXPECT_EQ(ScreenshareLayers::kTl0Flags, layers_->EncodeFlags(timestamp)); |
| 430 layers_->PopulateCodecSpecific(false, &vp8_info, timestamp); | 432 layers_->PopulateCodecSpecific(false, &vp8_info, timestamp); |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 metrics::NumEvents("WebRTC.Video.Screenshare.Layer1.TargetBitrate", | 571 metrics::NumEvents("WebRTC.Video.Screenshare.Layer1.TargetBitrate", |
| 570 kDefaultTl1BitrateKbps)); | 572 kDefaultTl1BitrateKbps)); |
| 571 } | 573 } |
| 572 | 574 |
| 573 TEST_F(ScreenshareLayerTest, AllowsUpdateConfigBeforeSetRates) { | 575 TEST_F(ScreenshareLayerTest, AllowsUpdateConfigBeforeSetRates) { |
| 574 vpx_codec_enc_cfg_t cfg = GetConfig(); | 576 vpx_codec_enc_cfg_t cfg = GetConfig(); |
| 575 EXPECT_FALSE(layers_->UpdateConfiguration(&cfg)); | 577 EXPECT_FALSE(layers_->UpdateConfiguration(&cfg)); |
| 576 } | 578 } |
| 577 | 579 |
| 578 } // namespace webrtc | 580 } // namespace webrtc |
| OLD | NEW |