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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 { | 481 { |
482 Vp8StreamInfo expected = {{7.5, 15.0, 30.0}, {low_b, mid_b, high_b}}; | 482 Vp8StreamInfo expected = {{7.5, 15.0, 30.0}, {low_b, mid_b, high_b}}; |
483 EXPECT_THAT(SimulateWithFramerate(30.0), MatchesVp8StreamInfo(expected)); | 483 EXPECT_THAT(SimulateWithFramerate(30.0), MatchesVp8StreamInfo(expected)); |
484 } | 484 } |
485 { | 485 { |
486 Vp8StreamInfo expected = {{3.75, 7.5, 15.0}, {low_b, mid_b, high_b}}; | 486 Vp8StreamInfo expected = {{3.75, 7.5, 15.0}, {low_b, mid_b, high_b}}; |
487 EXPECT_THAT(SimulateWithFramerate(15.0), MatchesVp8StreamInfo(expected)); | 487 EXPECT_THAT(SimulateWithFramerate(15.0), MatchesVp8StreamInfo(expected)); |
488 } | 488 } |
489 } | 489 } |
490 | 490 |
491 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) | |
492 #define MAYBE_RealTimeTemporalLayersStrategy \ | |
493 DISABLED_RealTimeTemporalLayersStrategy | |
494 #else | |
495 #define MAYBE_RealTimeTemporalLayersStrategy RealTimeTemporalLayersStrategy | |
496 #endif | |
497 TEST_F(TestVideoSenderWithVp8, MAYBE_RealTimeTemporalLayersStrategy) { | |
498 VideoCodec codec = MakeVp8VideoCodec(352, 288, 3); | |
499 codec.minBitrate = 10; | |
500 codec.startBitrate = codec_bitrate_kbps_; | |
501 codec.maxBitrate = codec_bitrate_kbps_; | |
502 | |
503 TemporalLayersFactory* tl_factory = new RealTimeTemporalLayersFactory(); | |
504 rate_allocator_.reset(new SimulcastRateAllocator( | |
505 codec, std::unique_ptr<TemporalLayersFactory>(tl_factory))); | |
506 codec.VP8()->tl_factory = tl_factory; | |
507 | |
508 EXPECT_EQ(0, sender_->RegisterSendCodec(&codec, 1, 1200)); | |
509 | |
510 const int low_b = codec_bitrate_kbps_ * 0.4; | |
511 const int mid_b = codec_bitrate_kbps_ * 0.6; | |
512 const int high_b = codec_bitrate_kbps_; | |
513 | |
514 { | |
515 Vp8StreamInfo expected = {{7.5, 15.0, 30.0}, {low_b, mid_b, high_b}}; | |
516 EXPECT_THAT(SimulateWithFramerate(30.0), MatchesVp8StreamInfo(expected)); | |
517 } | |
518 { | |
519 Vp8StreamInfo expected = {{5.0, 10.0, 20.0}, {low_b, mid_b, high_b}}; | |
520 EXPECT_THAT(SimulateWithFramerate(20.0), MatchesVp8StreamInfo(expected)); | |
521 } | |
522 { | |
523 Vp8StreamInfo expected = {{7.5, 15.0, 15.0}, {mid_b, high_b, high_b}}; | |
524 EXPECT_THAT(SimulateWithFramerate(15.0), MatchesVp8StreamInfo(expected)); | |
525 } | |
526 { | |
527 Vp8StreamInfo expected = {{5.0, 10.0, 10.0}, {mid_b, high_b, high_b}}; | |
528 EXPECT_THAT(SimulateWithFramerate(10.0), MatchesVp8StreamInfo(expected)); | |
529 } | |
530 { | |
531 // TODO(andresp): Find out why this fails with framerate = 7.5 | |
532 Vp8StreamInfo expected = {{7.0, 7.0, 7.0}, {high_b, high_b, high_b}}; | |
533 EXPECT_THAT(SimulateWithFramerate(7.0), MatchesVp8StreamInfo(expected)); | |
534 } | |
535 } | |
536 } // namespace | 491 } // namespace |
537 } // namespace vcm | 492 } // namespace vcm |
538 } // namespace webrtc | 493 } // namespace webrtc |
OLD | NEW |