| 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 |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #include "webrtc/base/scoped_ptr.h" | 14 #include "webrtc/base/scoped_ptr.h" |
| 15 #include "webrtc/common.h" | |
| 16 #include "webrtc/modules/video_coding/include/mock/mock_video_codec_interface.h" | 15 #include "webrtc/modules/video_coding/include/mock/mock_video_codec_interface.h" |
| 17 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h" | 16 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h" |
| 18 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8_common_types.h" | 17 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8_common_types.h" |
| 19 #include "webrtc/modules/video_coding/codecs/vp8/temporal_layers.h" | 18 #include "webrtc/modules/video_coding/codecs/vp8/temporal_layers.h" |
| 20 #include "webrtc/modules/video_coding/include/mock/mock_vcm_callbacks.h" | 19 #include "webrtc/modules/video_coding/include/mock/mock_vcm_callbacks.h" |
| 21 #include "webrtc/modules/video_coding/include/video_coding.h" | 20 #include "webrtc/modules/video_coding/include/video_coding.h" |
| 22 #include "webrtc/modules/video_coding/video_coding_impl.h" | 21 #include "webrtc/modules/video_coding/video_coding_impl.h" |
| 23 #include "webrtc/modules/video_coding/test/test_util.h" | 22 #include "webrtc/modules/video_coding/test/test_util.h" |
| 24 #include "webrtc/system_wrappers/include/clock.h" | 23 #include "webrtc/system_wrappers/include/clock.h" |
| 25 #include "webrtc/test/frame_generator.h" | 24 #include "webrtc/test/frame_generator.h" |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 } | 453 } |
| 455 } | 454 } |
| 456 | 455 |
| 457 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) | 456 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) |
| 458 #define MAYBE_RealTimeTemporalLayersStrategy \ | 457 #define MAYBE_RealTimeTemporalLayersStrategy \ |
| 459 DISABLED_RealTimeTemporalLayersStrategy | 458 DISABLED_RealTimeTemporalLayersStrategy |
| 460 #else | 459 #else |
| 461 #define MAYBE_RealTimeTemporalLayersStrategy RealTimeTemporalLayersStrategy | 460 #define MAYBE_RealTimeTemporalLayersStrategy RealTimeTemporalLayersStrategy |
| 462 #endif | 461 #endif |
| 463 TEST_F(TestVideoSenderWithVp8, MAYBE_RealTimeTemporalLayersStrategy) { | 462 TEST_F(TestVideoSenderWithVp8, MAYBE_RealTimeTemporalLayersStrategy) { |
| 464 Config extra_options; | |
| 465 extra_options.Set<TemporalLayers::Factory>( | |
| 466 new RealTimeTemporalLayersFactory()); | |
| 467 VideoCodec codec = MakeVp8VideoCodec(352, 288, 3); | 463 VideoCodec codec = MakeVp8VideoCodec(352, 288, 3); |
| 468 codec.extra_options = &extra_options; | 464 RealTimeTemporalLayersFactory realtime_tl_factory; |
| 465 codec.codecSpecific.VP8.tl_factory = &realtime_tl_factory; |
| 469 codec.minBitrate = 10; | 466 codec.minBitrate = 10; |
| 470 codec.startBitrate = codec_bitrate_kbps_; | 467 codec.startBitrate = codec_bitrate_kbps_; |
| 471 codec.maxBitrate = codec_bitrate_kbps_; | 468 codec.maxBitrate = codec_bitrate_kbps_; |
| 472 EXPECT_EQ(0, sender_->RegisterSendCodec(&codec, 1, 1200)); | 469 EXPECT_EQ(0, sender_->RegisterSendCodec(&codec, 1, 1200)); |
| 473 | 470 |
| 474 const int low_b = codec_bitrate_kbps_ * 0.4; | 471 const int low_b = codec_bitrate_kbps_ * 0.4; |
| 475 const int mid_b = codec_bitrate_kbps_ * 0.6; | 472 const int mid_b = codec_bitrate_kbps_ * 0.6; |
| 476 const int high_b = codec_bitrate_kbps_; | 473 const int high_b = codec_bitrate_kbps_; |
| 477 | 474 |
| 478 { | 475 { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 493 } | 490 } |
| 494 { | 491 { |
| 495 // TODO(andresp): Find out why this fails with framerate = 7.5 | 492 // TODO(andresp): Find out why this fails with framerate = 7.5 |
| 496 Vp8StreamInfo expected = {{7.0, 7.0, 7.0}, {high_b, high_b, high_b}}; | 493 Vp8StreamInfo expected = {{7.0, 7.0, 7.0}, {high_b, high_b, high_b}}; |
| 497 EXPECT_THAT(SimulateWithFramerate(7.0), MatchesVp8StreamInfo(expected)); | 494 EXPECT_THAT(SimulateWithFramerate(7.0), MatchesVp8StreamInfo(expected)); |
| 498 } | 495 } |
| 499 } | 496 } |
| 500 } // namespace | 497 } // namespace |
| 501 } // namespace vcm | 498 } // namespace vcm |
| 502 } // namespace webrtc | 499 } // namespace webrtc |
| OLD | NEW |