| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 <memory> |
| 11 #include <vector> | 12 #include <vector> |
| 12 | 13 |
| 13 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
| 14 #include "webrtc/modules/video_coding/include/video_codec_interface.h" | 15 #include "webrtc/modules/video_coding/include/video_codec_interface.h" |
| 15 #include "webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h" | 16 #include "webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h" |
| 16 #include "webrtc/modules/video_coding/codecs/vp8/simulcast_unittest.h" | 17 #include "webrtc/modules/video_coding/codecs/vp8/simulcast_unittest.h" |
| 17 | 18 |
| 18 namespace webrtc { | 19 namespace webrtc { |
| 19 namespace testing { | 20 namespace testing { |
| 20 | 21 |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 // stream 2, the biggest resolution stream. | 334 // stream 2, the biggest resolution stream. |
| 334 InitRefCodec(2, &ref_codec); | 335 InitRefCodec(2, &ref_codec); |
| 335 // We don't have enough bits to send this, so the adapter should have | 336 // We don't have enough bits to send this, so the adapter should have |
| 336 // configured it to use the min bitrate for this layer (600kbit) but turn | 337 // configured it to use the min bitrate for this layer (600kbit) but turn |
| 337 // off sending. | 338 // off sending. |
| 338 ref_codec.startBitrate = 600; | 339 ref_codec.startBitrate = 600; |
| 339 VerifyCodec(ref_codec, 2); | 340 VerifyCodec(ref_codec, 2); |
| 340 } | 341 } |
| 341 | 342 |
| 342 protected: | 343 protected: |
| 343 rtc::scoped_ptr<TestSimulcastEncoderAdapterFakeHelper> helper_; | 344 std::unique_ptr<TestSimulcastEncoderAdapterFakeHelper> helper_; |
| 344 rtc::scoped_ptr<VP8Encoder> adapter_; | 345 std::unique_ptr<VP8Encoder> adapter_; |
| 345 VideoCodec codec_; | 346 VideoCodec codec_; |
| 346 int last_encoded_image_width_; | 347 int last_encoded_image_width_; |
| 347 int last_encoded_image_height_; | 348 int last_encoded_image_height_; |
| 348 int last_encoded_image_simulcast_index_; | 349 int last_encoded_image_simulcast_index_; |
| 349 }; | 350 }; |
| 350 | 351 |
| 351 TEST_F(TestSimulcastEncoderAdapterFake, InitEncode) { | 352 TEST_F(TestSimulcastEncoderAdapterFake, InitEncode) { |
| 352 SetupCodec(); | 353 SetupCodec(); |
| 353 VerifyCodecSettings(); | 354 VerifyCodecSettings(); |
| 354 } | 355 } |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 EXPECT_EQ(0, adapter_->InitEncode(&codec_, 1, 1200)); | 433 EXPECT_EQ(0, adapter_->InitEncode(&codec_, 1, 1200)); |
| 433 adapter_->RegisterEncodeCompleteCallback(this); | 434 adapter_->RegisterEncodeCompleteCallback(this); |
| 434 ASSERT_EQ(3u, helper_->factory()->encoders().size()); | 435 ASSERT_EQ(3u, helper_->factory()->encoders().size()); |
| 435 for (MockVideoEncoder* encoder : helper_->factory()->encoders()) | 436 for (MockVideoEncoder* encoder : helper_->factory()->encoders()) |
| 436 encoder->set_supports_native_handle(true); | 437 encoder->set_supports_native_handle(true); |
| 437 EXPECT_FALSE(adapter_->SupportsNativeHandle()); | 438 EXPECT_FALSE(adapter_->SupportsNativeHandle()); |
| 438 } | 439 } |
| 439 | 440 |
| 440 } // namespace testing | 441 } // namespace testing |
| 441 } // namespace webrtc | 442 } // namespace webrtc |
| OLD | NEW |