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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 FakeNetworkPipe::Config net_config; | 461 FakeNetworkPipe::Config net_config; |
462 net_config.queue_delay_ms = 100; | 462 net_config.queue_delay_ms = 100; |
463 net_config.delay_standard_deviation_ms = 10; | 463 net_config.delay_standard_deviation_ms = 10; |
464 // TODO(wu): lower the threshold as the calculation/estimatation becomes more | 464 // TODO(wu): lower the threshold as the calculation/estimatation becomes more |
465 // accurate. | 465 // accurate. |
466 const int kThresholdMs = 100; | 466 const int kThresholdMs = 100; |
467 const int kStartTimeMs = 10000; | 467 const int kStartTimeMs = 10000; |
468 const int kRunTimeMs = 20000; | 468 const int kRunTimeMs = 20000; |
469 TestCaptureNtpTime(net_config, kThresholdMs, kStartTimeMs, kRunTimeMs); | 469 TestCaptureNtpTime(net_config, kThresholdMs, kStartTimeMs, kRunTimeMs); |
470 } | 470 } |
471 #if defined(WEBRTC_ANDROID) | 471 |
472 // This test is disabled on android as it does not update | |
473 // sinkWants below 320x180, the starting resolution for these | |
474 // tests. | |
475 #define ReceivesCpuOveruseAndUnderuse DISABLED_ReceivesCpuOveruseAndUnderuse | |
476 #endif | |
477 TEST_F(CallPerfTest, ReceivesCpuOveruseAndUnderuse) { | 472 TEST_F(CallPerfTest, ReceivesCpuOveruseAndUnderuse) { |
478 class LoadObserver : public test::SendTest, | 473 class LoadObserver : public test::SendTest, |
479 public test::FrameGeneratorCapturer::SinkWantsObserver { | 474 public test::FrameGeneratorCapturer::SinkWantsObserver { |
480 public: | 475 public: |
481 LoadObserver() | 476 LoadObserver() |
482 : SendTest(kLongTimeoutMs), | 477 : SendTest(kLongTimeoutMs), |
483 expect_lower_resolution_wants_(true), | 478 expect_lower_resolution_wants_(true), |
484 encoder_(Clock::GetRealTimeClock(), 35 /* delay_ms */) {} | 479 encoder_(Clock::GetRealTimeClock(), 35 /* delay_ms */) {} |
485 | 480 |
486 void OnFrameGeneratorCapturerCreated( | 481 void OnFrameGeneratorCapturerCreated( |
487 test::FrameGeneratorCapturer* frame_generator_capturer) override { | 482 test::FrameGeneratorCapturer* frame_generator_capturer) override { |
488 frame_generator_capturer->SetSinkWantsObserver(this); | 483 frame_generator_capturer->SetSinkWantsObserver(this); |
| 484 // Set a high initial resolution to be sure that we can scale down. |
| 485 frame_generator_capturer->ChangeResolution(1920, 1080); |
489 } | 486 } |
490 | 487 |
491 // OnSinkWantsChanged is called when FrameGeneratorCapturer::AddOrUpdateSink | 488 // OnSinkWantsChanged is called when FrameGeneratorCapturer::AddOrUpdateSink |
492 // is called. | 489 // is called. |
493 void OnSinkWantsChanged(rtc::VideoSinkInterface<VideoFrame>* sink, | 490 void OnSinkWantsChanged(rtc::VideoSinkInterface<VideoFrame>* sink, |
494 const rtc::VideoSinkWants& wants) override { | 491 const rtc::VideoSinkWants& wants) override { |
495 // First expect CPU overuse. Then expect CPU underuse when the encoder | 492 // First expect CPU overuse. Then expect CPU underuse when the encoder |
496 // delay has been decreased. | 493 // delay has been decreased. |
497 if (wants.target_pixel_count && | 494 if (wants.target_pixel_count && |
498 *wants.target_pixel_count < | 495 *wants.target_pixel_count < |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 uint32_t last_set_bitrate_kbps_; | 736 uint32_t last_set_bitrate_kbps_; |
740 VideoSendStream* send_stream_; | 737 VideoSendStream* send_stream_; |
741 test::FrameGeneratorCapturer* frame_generator_; | 738 test::FrameGeneratorCapturer* frame_generator_; |
742 VideoEncoderConfig encoder_config_; | 739 VideoEncoderConfig encoder_config_; |
743 } test; | 740 } test; |
744 | 741 |
745 RunBaseTest(&test); | 742 RunBaseTest(&test); |
746 } | 743 } |
747 | 744 |
748 } // namespace webrtc | 745 } // namespace webrtc |
OLD | NEW |