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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
487 frame_generator_capturer->ChangeResolution(1920, 1080); | 487 frame_generator_capturer->ChangeResolution(1920, 1080); |
488 } | 488 } |
489 | 489 |
490 // OnSinkWantsChanged is called when FrameGeneratorCapturer::AddOrUpdateSink | 490 // OnSinkWantsChanged is called when FrameGeneratorCapturer::AddOrUpdateSink |
491 // is called. | 491 // is called. |
492 void OnSinkWantsChanged(rtc::VideoSinkInterface<VideoFrame>* sink, | 492 void OnSinkWantsChanged(rtc::VideoSinkInterface<VideoFrame>* sink, |
493 const rtc::VideoSinkWants& wants) override { | 493 const rtc::VideoSinkWants& wants) override { |
494 // First expect CPU overuse. Then expect CPU underuse when the encoder | 494 // First expect CPU overuse. Then expect CPU underuse when the encoder |
495 // delay has been decreased. | 495 // delay has been decreased. |
496 if (wants.target_pixel_count && | 496 if (wants.target_pixel_count && |
497 *wants.target_pixel_count < | 497 *wants.target_pixel_count < wants.max_pixel_count) { |
498 wants.max_pixel_count.value_or(std::numeric_limits<int>::max())) { | |
499 // On adapting up, ViEEncoder::VideoSourceProxy will set the target | 498 // On adapting up, ViEEncoder::VideoSourceProxy will set the target |
500 // pixel count to a step up from the current and the max value to | 499 // pixel count to a step up from the current and the max value to |
501 // something higher than the target. | 500 // something higher than the target. |
502 EXPECT_FALSE(expect_lower_resolution_wants_); | 501 EXPECT_FALSE(expect_lower_resolution_wants_); |
503 observation_complete_.Set(); | 502 observation_complete_.Set(); |
504 } else if (wants.max_pixel_count) { | 503 } else if (wants.max_pixel_count < std::numeric_limits<int>::max()) { |
stefan-webrtc
2017/03/21 15:37:36
It's not clear to me what this change means. Can y
sprang_webrtc
2017/03/21 15:59:18
max_pixel_count is now a plain int instead of an r
| |
505 // On adapting down, ViEEncoder::VideoSourceProxy will set only the max | 504 // On adapting down, ViEEncoder::VideoSourceProxy will set only the max |
506 // pixel count, leaving the target unset. | 505 // pixel count, leaving the target unset. |
507 EXPECT_TRUE(expect_lower_resolution_wants_); | 506 EXPECT_TRUE(expect_lower_resolution_wants_); |
508 expect_lower_resolution_wants_ = false; | 507 expect_lower_resolution_wants_ = false; |
509 encoder_.SetDelay(2); | 508 encoder_.SetDelay(2); |
510 } | 509 } |
511 } | 510 } |
512 | 511 |
513 void ModifyVideoConfigs( | 512 void ModifyVideoConfigs( |
514 VideoSendStream::Config* send_config, | 513 VideoSendStream::Config* send_config, |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
738 uint32_t last_set_bitrate_kbps_; | 737 uint32_t last_set_bitrate_kbps_; |
739 VideoSendStream* send_stream_; | 738 VideoSendStream* send_stream_; |
740 test::FrameGeneratorCapturer* frame_generator_; | 739 test::FrameGeneratorCapturer* frame_generator_; |
741 VideoEncoderConfig encoder_config_; | 740 VideoEncoderConfig encoder_config_; |
742 } test; | 741 } test; |
743 | 742 |
744 RunBaseTest(&test); | 743 RunBaseTest(&test); |
745 } | 744 } |
746 | 745 |
747 } // namespace webrtc | 746 } // namespace webrtc |
OLD | NEW |