OLD | NEW |
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 |
11 #include <limits> | 11 #include <limits> |
12 #include <utility> | 12 #include <utility> |
13 | 13 |
14 #include "webrtc/base/logging.h" | 14 #include "webrtc/base/logging.h" |
15 #include "webrtc/system_wrappers/include/metrics_default.h" | 15 #include "webrtc/system_wrappers/include/metrics_default.h" |
16 #include "webrtc/test/encoder_settings.h" | 16 #include "webrtc/test/encoder_settings.h" |
17 #include "webrtc/test/fake_encoder.h" | 17 #include "webrtc/test/fake_encoder.h" |
18 #include "webrtc/test/frame_generator.h" | 18 #include "webrtc/test/frame_generator.h" |
19 #include "webrtc/test/gtest.h" | 19 #include "webrtc/test/gtest.h" |
20 #include "webrtc/video/send_statistics_proxy.h" | 20 #include "webrtc/video/send_statistics_proxy.h" |
21 #include "webrtc/video/vie_encoder.h" | 21 #include "webrtc/video/vie_encoder.h" |
22 | 22 |
23 namespace webrtc { | 23 namespace webrtc { |
24 | 24 |
25 namespace { | 25 namespace { |
26 const size_t kMaxPayloadLength = 1440; | 26 const size_t kMaxPayloadLength = 1440; |
27 const int kTargetBitrateBps = 100000; | 27 const int kTargetBitrateBps = 100000; |
| 28 const unsigned char kNumSlDummy = 0; |
28 | 29 |
29 class TestBuffer : public webrtc::I420Buffer { | 30 class TestBuffer : public webrtc::I420Buffer { |
30 public: | 31 public: |
31 TestBuffer(rtc::Event* event, int width, int height) | 32 TestBuffer(rtc::Event* event, int width, int height) |
32 : I420Buffer(width, height), event_(event) {} | 33 : I420Buffer(width, height), event_(event) {} |
33 | 34 |
34 private: | 35 private: |
35 friend class rtc::RefCountedObject<TestBuffer>; | 36 friend class rtc::RefCountedObject<TestBuffer>; |
36 ~TestBuffer() override { | 37 ~TestBuffer() override { |
37 if (event_) | 38 if (event_) |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 vie_encoder_->SetSource(&video_source_, | 134 vie_encoder_->SetSource(&video_source_, |
134 VideoSendStream::DegradationPreference::kBalanced); | 135 VideoSendStream::DegradationPreference::kBalanced); |
135 vie_encoder_->SetStartBitrate(10000); | 136 vie_encoder_->SetStartBitrate(10000); |
136 vie_encoder_->ConfigureEncoder(std::move(video_encoder_config), | 137 vie_encoder_->ConfigureEncoder(std::move(video_encoder_config), |
137 kMaxPayloadLength, nack_enabled); | 138 kMaxPayloadLength, nack_enabled); |
138 } | 139 } |
139 | 140 |
140 void ResetEncoder(const std::string& payload_name, | 141 void ResetEncoder(const std::string& payload_name, |
141 size_t num_streams, | 142 size_t num_streams, |
142 size_t num_temporal_layers, | 143 size_t num_temporal_layers, |
| 144 unsigned char num_spatial_layers, |
143 bool nack_enabled) { | 145 bool nack_enabled) { |
144 video_send_config_.encoder_settings.payload_name = payload_name; | 146 video_send_config_.encoder_settings.payload_name = payload_name; |
145 | 147 |
146 VideoEncoderConfig video_encoder_config; | 148 VideoEncoderConfig video_encoder_config; |
147 video_encoder_config.number_of_streams = num_streams; | 149 video_encoder_config.number_of_streams = num_streams; |
148 video_encoder_config.max_bitrate_bps = 1000000; | 150 video_encoder_config.max_bitrate_bps = 1000000; |
149 video_encoder_config.video_stream_factory = | 151 video_encoder_config.video_stream_factory = |
150 new rtc::RefCountedObject<VideoStreamFactory>(num_temporal_layers); | 152 new rtc::RefCountedObject<VideoStreamFactory>(num_temporal_layers); |
| 153 if (payload_name == "VP9") { |
| 154 VideoCodecVP9 vp9_settings = VideoEncoder::GetDefaultVp9Settings(); |
| 155 vp9_settings.numberOfSpatialLayers = num_spatial_layers; |
| 156 video_encoder_config.encoder_specific_settings = |
| 157 new rtc::RefCountedObject< |
| 158 VideoEncoderConfig::Vp9EncoderSpecificSettings>(vp9_settings); |
| 159 } |
151 ConfigureEncoder(std::move(video_encoder_config), nack_enabled); | 160 ConfigureEncoder(std::move(video_encoder_config), nack_enabled); |
152 } | 161 } |
153 | 162 |
154 VideoFrame CreateFrame(int64_t ntp_ts, rtc::Event* destruction_event) const { | 163 VideoFrame CreateFrame(int64_t ntp_ts, rtc::Event* destruction_event) const { |
155 VideoFrame frame(new rtc::RefCountedObject<TestBuffer>( | 164 VideoFrame frame(new rtc::RefCountedObject<TestBuffer>( |
156 destruction_event, codec_width_, codec_height_), | 165 destruction_event, codec_width_, codec_height_), |
157 99, 99, kVideoRotation_0); | 166 99, 99, kVideoRotation_0); |
158 frame.set_ntp_time_ms(ntp_ts); | 167 frame.set_ntp_time_ms(ntp_ts); |
159 return frame; | 168 return frame; |
160 } | 169 } |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 EXPECT_EQ(codec_height_, fake_encoder_.codec_config().height); | 430 EXPECT_EQ(codec_height_, fake_encoder_.codec_config().height); |
422 EXPECT_EQ(2, sink_.number_of_reconfigurations()); | 431 EXPECT_EQ(2, sink_.number_of_reconfigurations()); |
423 | 432 |
424 vie_encoder_->Stop(); | 433 vie_encoder_->Stop(); |
425 } | 434 } |
426 | 435 |
427 TEST_F(ViEEncoderTest, Vp8ResilienceIsOffFor1S1TLWithNackEnabled) { | 436 TEST_F(ViEEncoderTest, Vp8ResilienceIsOffFor1S1TLWithNackEnabled) { |
428 const bool kNackEnabled = true; | 437 const bool kNackEnabled = true; |
429 const size_t kNumStreams = 1; | 438 const size_t kNumStreams = 1; |
430 const size_t kNumTl = 1; | 439 const size_t kNumTl = 1; |
431 ResetEncoder("VP8", kNumStreams, kNumTl, kNackEnabled); | 440 ResetEncoder("VP8", kNumStreams, kNumTl, kNumSlDummy, kNackEnabled); |
432 vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); | 441 vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
433 | 442 |
434 // Capture a frame and wait for it to synchronize with the encoder thread. | 443 // Capture a frame and wait for it to synchronize with the encoder thread. |
435 video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr)); | 444 video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr)); |
436 sink_.WaitForEncodedFrame(1); | 445 sink_.WaitForEncodedFrame(1); |
437 // The encoder have been configured once when the first frame is received. | 446 // The encoder have been configured once when the first frame is received. |
438 EXPECT_EQ(1, sink_.number_of_reconfigurations()); | 447 EXPECT_EQ(1, sink_.number_of_reconfigurations()); |
439 EXPECT_EQ(kVideoCodecVP8, fake_encoder_.codec_config().codecType); | 448 EXPECT_EQ(kVideoCodecVP8, fake_encoder_.codec_config().codecType); |
440 EXPECT_EQ(kNumStreams, fake_encoder_.codec_config().numberOfSimulcastStreams); | 449 EXPECT_EQ(kNumStreams, fake_encoder_.codec_config().numberOfSimulcastStreams); |
441 EXPECT_EQ(kNumTl, fake_encoder_.codec_config().VP8()->numberOfTemporalLayers); | 450 EXPECT_EQ(kNumTl, fake_encoder_.codec_config().VP8()->numberOfTemporalLayers); |
442 // Resilience is off for no temporal layers with nack on. | 451 // Resilience is off for no temporal layers with nack on. |
443 EXPECT_EQ(kResilienceOff, fake_encoder_.codec_config().VP8()->resilience); | 452 EXPECT_EQ(kResilienceOff, fake_encoder_.codec_config().VP8()->resilience); |
444 vie_encoder_->Stop(); | 453 vie_encoder_->Stop(); |
445 } | 454 } |
446 | 455 |
447 TEST_F(ViEEncoderTest, Vp8ResilienceIsOffFor2S1TlWithNackEnabled) { | 456 TEST_F(ViEEncoderTest, Vp8ResilienceIsOffFor2S1TlWithNackEnabled) { |
448 const bool kNackEnabled = true; | 457 const bool kNackEnabled = true; |
449 const size_t kNumStreams = 2; | 458 const size_t kNumStreams = 2; |
450 const size_t kNumTl = 1; | 459 const size_t kNumTl = 1; |
451 ResetEncoder("VP8", kNumStreams, kNumTl, kNackEnabled); | 460 ResetEncoder("VP8", kNumStreams, kNumTl, kNumSlDummy, kNackEnabled); |
452 vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); | 461 vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
453 | 462 |
454 // Capture a frame and wait for it to synchronize with the encoder thread. | 463 // Capture a frame and wait for it to synchronize with the encoder thread. |
455 video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr)); | 464 video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr)); |
456 sink_.WaitForEncodedFrame(1); | 465 sink_.WaitForEncodedFrame(1); |
457 // The encoder have been configured once when the first frame is received. | 466 // The encoder have been configured once when the first frame is received. |
458 EXPECT_EQ(1, sink_.number_of_reconfigurations()); | 467 EXPECT_EQ(1, sink_.number_of_reconfigurations()); |
459 EXPECT_EQ(kVideoCodecVP8, fake_encoder_.codec_config().codecType); | 468 EXPECT_EQ(kVideoCodecVP8, fake_encoder_.codec_config().codecType); |
460 EXPECT_EQ(kNumStreams, fake_encoder_.codec_config().numberOfSimulcastStreams); | 469 EXPECT_EQ(kNumStreams, fake_encoder_.codec_config().numberOfSimulcastStreams); |
461 EXPECT_EQ(kNumTl, fake_encoder_.codec_config().VP8()->numberOfTemporalLayers); | 470 EXPECT_EQ(kNumTl, fake_encoder_.codec_config().VP8()->numberOfTemporalLayers); |
462 // Resilience is off for no temporal layers and >1 streams with nack on. | 471 // Resilience is off for no temporal layers and >1 streams with nack on. |
463 EXPECT_EQ(kResilienceOff, fake_encoder_.codec_config().VP8()->resilience); | 472 EXPECT_EQ(kResilienceOff, fake_encoder_.codec_config().VP8()->resilience); |
464 vie_encoder_->Stop(); | 473 vie_encoder_->Stop(); |
465 } | 474 } |
466 | 475 |
467 TEST_F(ViEEncoderTest, Vp8ResilienceIsOnFor1S1TLWithNackDisabled) { | 476 TEST_F(ViEEncoderTest, Vp8ResilienceIsOnFor1S1TLWithNackDisabled) { |
468 const bool kNackEnabled = false; | 477 const bool kNackEnabled = false; |
469 const size_t kNumStreams = 1; | 478 const size_t kNumStreams = 1; |
470 const size_t kNumTl = 1; | 479 const size_t kNumTl = 1; |
471 ResetEncoder("VP8", kNumStreams, kNumTl, kNackEnabled); | 480 ResetEncoder("VP8", kNumStreams, kNumTl, kNumSlDummy, kNackEnabled); |
472 vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); | 481 vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
473 | 482 |
474 // Capture a frame and wait for it to synchronize with the encoder thread. | 483 // Capture a frame and wait for it to synchronize with the encoder thread. |
475 video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr)); | 484 video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr)); |
476 sink_.WaitForEncodedFrame(1); | 485 sink_.WaitForEncodedFrame(1); |
477 // The encoder have been configured once when the first frame is received. | 486 // The encoder have been configured once when the first frame is received. |
478 EXPECT_EQ(1, sink_.number_of_reconfigurations()); | 487 EXPECT_EQ(1, sink_.number_of_reconfigurations()); |
479 EXPECT_EQ(kVideoCodecVP8, fake_encoder_.codec_config().codecType); | 488 EXPECT_EQ(kVideoCodecVP8, fake_encoder_.codec_config().codecType); |
480 EXPECT_EQ(kNumStreams, fake_encoder_.codec_config().numberOfSimulcastStreams); | 489 EXPECT_EQ(kNumStreams, fake_encoder_.codec_config().numberOfSimulcastStreams); |
481 EXPECT_EQ(kNumTl, fake_encoder_.codec_config().VP8()->numberOfTemporalLayers); | 490 EXPECT_EQ(kNumTl, fake_encoder_.codec_config().VP8()->numberOfTemporalLayers); |
482 // Resilience is on for no temporal layers with nack off. | 491 // Resilience is on for no temporal layers with nack off. |
483 EXPECT_EQ(kResilientStream, fake_encoder_.codec_config().VP8()->resilience); | 492 EXPECT_EQ(kResilientStream, fake_encoder_.codec_config().VP8()->resilience); |
484 vie_encoder_->Stop(); | 493 vie_encoder_->Stop(); |
485 } | 494 } |
486 | 495 |
487 TEST_F(ViEEncoderTest, Vp8ResilienceIsOnFor1S2TlWithNackEnabled) { | 496 TEST_F(ViEEncoderTest, Vp8ResilienceIsOnFor1S2TlWithNackEnabled) { |
488 const bool kNackEnabled = true; | 497 const bool kNackEnabled = true; |
489 const size_t kNumStreams = 1; | 498 const size_t kNumStreams = 1; |
490 const size_t kNumTl = 2; | 499 const size_t kNumTl = 2; |
491 ResetEncoder("VP8", kNumStreams, kNumTl, kNackEnabled); | 500 ResetEncoder("VP8", kNumStreams, kNumTl, kNumSlDummy, kNackEnabled); |
492 vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); | 501 vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
493 | 502 |
494 // Capture a frame and wait for it to synchronize with the encoder thread. | 503 // Capture a frame and wait for it to synchronize with the encoder thread. |
495 video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr)); | 504 video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr)); |
496 sink_.WaitForEncodedFrame(1); | 505 sink_.WaitForEncodedFrame(1); |
497 // The encoder have been configured once when the first frame is received. | 506 // The encoder have been configured once when the first frame is received. |
498 EXPECT_EQ(1, sink_.number_of_reconfigurations()); | 507 EXPECT_EQ(1, sink_.number_of_reconfigurations()); |
499 EXPECT_EQ(kVideoCodecVP8, fake_encoder_.codec_config().codecType); | 508 EXPECT_EQ(kVideoCodecVP8, fake_encoder_.codec_config().codecType); |
500 EXPECT_EQ(kNumStreams, fake_encoder_.codec_config().numberOfSimulcastStreams); | 509 EXPECT_EQ(kNumStreams, fake_encoder_.codec_config().numberOfSimulcastStreams); |
501 EXPECT_EQ(kNumTl, fake_encoder_.codec_config().VP8()->numberOfTemporalLayers); | 510 EXPECT_EQ(kNumTl, fake_encoder_.codec_config().VP8()->numberOfTemporalLayers); |
502 // Resilience is on for temporal layers. | 511 // Resilience is on for temporal layers. |
503 EXPECT_EQ(kResilientStream, fake_encoder_.codec_config().VP8()->resilience); | 512 EXPECT_EQ(kResilientStream, fake_encoder_.codec_config().VP8()->resilience); |
504 vie_encoder_->Stop(); | 513 vie_encoder_->Stop(); |
505 } | 514 } |
506 | 515 |
| 516 TEST_F(ViEEncoderTest, Vp9ResilienceIsOffFor1SL1TLWithNackEnabled) { |
| 517 const bool kNackEnabled = true; |
| 518 const size_t kNumStreams = 1; |
| 519 const size_t kNumTl = 1; |
| 520 const unsigned char kNumSl = 1; |
| 521 ResetEncoder("VP9", kNumStreams, kNumTl, kNumSl, kNackEnabled); |
| 522 vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
| 523 |
| 524 // Capture a frame and wait for it to synchronize with the encoder thread. |
| 525 video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr)); |
| 526 sink_.WaitForEncodedFrame(1); |
| 527 // The encoder have been configured once when the first frame is received. |
| 528 EXPECT_EQ(1, sink_.number_of_reconfigurations()); |
| 529 EXPECT_EQ(kVideoCodecVP9, fake_encoder_.codec_config().codecType); |
| 530 EXPECT_EQ(kNumStreams, fake_encoder_.codec_config().numberOfSimulcastStreams); |
| 531 EXPECT_EQ(kNumTl, fake_encoder_.codec_config().VP9()->numberOfTemporalLayers); |
| 532 EXPECT_EQ(kNumSl, fake_encoder_.codec_config().VP9()->numberOfSpatialLayers); |
| 533 // Resilience is off for no spatial and temporal layers with nack on. |
| 534 EXPECT_FALSE(fake_encoder_.codec_config().VP9()->resilienceOn); |
| 535 vie_encoder_->Stop(); |
| 536 } |
| 537 |
| 538 TEST_F(ViEEncoderTest, Vp9ResilienceIsOnFor1SL1TLWithNackDisabled) { |
| 539 const bool kNackEnabled = false; |
| 540 const size_t kNumStreams = 1; |
| 541 const size_t kNumTl = 1; |
| 542 const unsigned char kNumSl = 1; |
| 543 ResetEncoder("VP9", kNumStreams, kNumTl, kNumSl, kNackEnabled); |
| 544 vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
| 545 |
| 546 // Capture a frame and wait for it to synchronize with the encoder thread. |
| 547 video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr)); |
| 548 sink_.WaitForEncodedFrame(1); |
| 549 // The encoder have been configured once when the first frame is received. |
| 550 EXPECT_EQ(1, sink_.number_of_reconfigurations()); |
| 551 EXPECT_EQ(kVideoCodecVP9, fake_encoder_.codec_config().codecType); |
| 552 EXPECT_EQ(kNumStreams, fake_encoder_.codec_config().numberOfSimulcastStreams); |
| 553 EXPECT_EQ(kNumTl, fake_encoder_.codec_config().VP9()->numberOfTemporalLayers); |
| 554 EXPECT_EQ(kNumSl, fake_encoder_.codec_config().VP9()->numberOfSpatialLayers); |
| 555 // Resilience is on if nack is off. |
| 556 EXPECT_TRUE(fake_encoder_.codec_config().VP9()->resilienceOn); |
| 557 vie_encoder_->Stop(); |
| 558 } |
| 559 |
| 560 TEST_F(ViEEncoderTest, Vp9ResilienceIsOnFor2SL1TLWithNackEnabled) { |
| 561 const bool kNackEnabled = true; |
| 562 const size_t kNumStreams = 1; |
| 563 const size_t kNumTl = 1; |
| 564 const unsigned char kNumSl = 2; |
| 565 ResetEncoder("VP9", kNumStreams, kNumTl, kNumSl, kNackEnabled); |
| 566 vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
| 567 |
| 568 // Capture a frame and wait for it to synchronize with the encoder thread. |
| 569 video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr)); |
| 570 sink_.WaitForEncodedFrame(1); |
| 571 // The encoder have been configured once when the first frame is received. |
| 572 EXPECT_EQ(1, sink_.number_of_reconfigurations()); |
| 573 EXPECT_EQ(kVideoCodecVP9, fake_encoder_.codec_config().codecType); |
| 574 EXPECT_EQ(kNumStreams, fake_encoder_.codec_config().numberOfSimulcastStreams); |
| 575 EXPECT_EQ(kNumTl, fake_encoder_.codec_config().VP9()->numberOfTemporalLayers); |
| 576 EXPECT_EQ(kNumSl, fake_encoder_.codec_config().VP9()->numberOfSpatialLayers); |
| 577 // Resilience is on for spatial layers. |
| 578 EXPECT_TRUE(fake_encoder_.codec_config().VP9()->resilienceOn); |
| 579 vie_encoder_->Stop(); |
| 580 } |
| 581 |
| 582 TEST_F(ViEEncoderTest, Vp9ResilienceIsOnFor1SL2TLWithNackEnabled) { |
| 583 const bool kNackEnabled = true; |
| 584 const size_t kNumStreams = 1; |
| 585 const size_t kNumTl = 2; |
| 586 const unsigned char kNumSl = 1; |
| 587 ResetEncoder("VP9", kNumStreams, kNumTl, kNumSl, kNackEnabled); |
| 588 vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
| 589 |
| 590 // Capture a frame and wait for it to synchronize with the encoder thread. |
| 591 video_source_.IncomingCapturedFrame(CreateFrame(1, nullptr)); |
| 592 sink_.WaitForEncodedFrame(1); |
| 593 // The encoder have been configured once when the first frame is received. |
| 594 EXPECT_EQ(1, sink_.number_of_reconfigurations()); |
| 595 EXPECT_EQ(kVideoCodecVP9, fake_encoder_.codec_config().codecType); |
| 596 EXPECT_EQ(kNumStreams, fake_encoder_.codec_config().numberOfSimulcastStreams); |
| 597 EXPECT_EQ(kNumTl, fake_encoder_.codec_config().VP9()->numberOfTemporalLayers); |
| 598 EXPECT_EQ(kNumSl, fake_encoder_.codec_config().VP9()->numberOfSpatialLayers); |
| 599 // Resilience is on for temporal layers. |
| 600 EXPECT_TRUE(fake_encoder_.codec_config().VP9()->resilienceOn); |
| 601 vie_encoder_->Stop(); |
| 602 } |
| 603 |
507 TEST_F(ViEEncoderTest, SwitchSourceDeregisterEncoderAsSink) { | 604 TEST_F(ViEEncoderTest, SwitchSourceDeregisterEncoderAsSink) { |
508 EXPECT_TRUE(video_source_.has_sinks()); | 605 EXPECT_TRUE(video_source_.has_sinks()); |
509 test::FrameForwarder new_video_source; | 606 test::FrameForwarder new_video_source; |
510 vie_encoder_->SetSource(&new_video_source, | 607 vie_encoder_->SetSource(&new_video_source, |
511 VideoSendStream::DegradationPreference::kBalanced); | 608 VideoSendStream::DegradationPreference::kBalanced); |
512 EXPECT_FALSE(video_source_.has_sinks()); | 609 EXPECT_FALSE(video_source_.has_sinks()); |
513 EXPECT_TRUE(new_video_source.has_sinks()); | 610 EXPECT_TRUE(new_video_source.has_sinks()); |
514 | 611 |
515 vie_encoder_->Stop(); | 612 vie_encoder_->Stop(); |
516 } | 613 } |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 vie_encoder_->Stop(); | 848 vie_encoder_->Stop(); |
752 | 849 |
753 stats_proxy_.reset(); | 850 stats_proxy_.reset(); |
754 EXPECT_EQ(1, | 851 EXPECT_EQ(1, |
755 metrics::NumSamples("WebRTC.Video.CpuLimitedResolutionInPercent")); | 852 metrics::NumSamples("WebRTC.Video.CpuLimitedResolutionInPercent")); |
756 EXPECT_EQ( | 853 EXPECT_EQ( |
757 1, metrics::NumEvents("WebRTC.Video.CpuLimitedResolutionInPercent", 50)); | 854 1, metrics::NumEvents("WebRTC.Video.CpuLimitedResolutionInPercent", 50)); |
758 } | 855 } |
759 | 856 |
760 } // namespace webrtc | 857 } // namespace webrtc |
OLD | NEW |