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 <memory> |
11 #include <vector> | 12 #include <vector> |
12 | 13 |
13 #include "gtest/gtest.h" | 14 #include "gtest/gtest.h" |
14 #include "vpx/vpx_encoder.h" | 15 #include "vpx/vpx_encoder.h" |
15 #include "vpx/vp8cx.h" | 16 #include "vpx/vp8cx.h" |
16 #include "webrtc/base/scoped_ptr.h" | |
17 #include "webrtc/modules/video_coding/include/video_codec_interface.h" | 17 #include "webrtc/modules/video_coding/include/video_codec_interface.h" |
18 #include "webrtc/modules/video_coding/codecs/vp8/screenshare_layers.h" | 18 #include "webrtc/modules/video_coding/codecs/vp8/screenshare_layers.h" |
19 #include "webrtc/modules/video_coding/utility/mock/mock_frame_dropper.h" | 19 #include "webrtc/modules/video_coding/utility/mock/mock_frame_dropper.h" |
20 | 20 |
21 using ::testing::_; | 21 using ::testing::_; |
22 using ::testing::NiceMock; | 22 using ::testing::NiceMock; |
23 using ::testing::Return; | 23 using ::testing::Return; |
24 | 24 |
25 namespace webrtc { | 25 namespace webrtc { |
26 | 26 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 return timestamp; | 98 return timestamp; |
99 } | 99 } |
100 } | 100 } |
101 ADD_FAILURE() << "Did not get a frame of TL" << layer << " in time."; | 101 ADD_FAILURE() << "Did not get a frame of TL" << layer << " in time."; |
102 return 0; | 102 return 0; |
103 } | 103 } |
104 | 104 |
105 int min_qp_; | 105 int min_qp_; |
106 int max_qp_; | 106 int max_qp_; |
107 int frame_size_; | 107 int frame_size_; |
108 rtc::scoped_ptr<ScreenshareLayers> layers_; | 108 std::unique_ptr<ScreenshareLayers> layers_; |
109 }; | 109 }; |
110 | 110 |
111 TEST_F(ScreenshareLayerTest, 1Layer) { | 111 TEST_F(ScreenshareLayerTest, 1Layer) { |
112 layers_.reset(new ScreenshareLayers(1, 0)); | 112 layers_.reset(new ScreenshareLayers(1, 0)); |
113 ConfigureBitrates(); | 113 ConfigureBitrates(); |
114 int flags = 0; | 114 int flags = 0; |
115 uint32_t timestamp = 0; | 115 uint32_t timestamp = 0; |
116 CodecSpecificInfoVP8 vp8_info; | 116 CodecSpecificInfoVP8 vp8_info; |
117 // One layer screenshare should not use the frame dropper as all frames will | 117 // One layer screenshare should not use the frame dropper as all frames will |
118 // belong to the base layer. | 118 // belong to the base layer. |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 | 440 |
441 layers_->EncodeFlags(timestamp); | 441 layers_->EncodeFlags(timestamp); |
442 timestamp += kTimestampDelta5Fps; | 442 timestamp += kTimestampDelta5Fps; |
443 EXPECT_TRUE(layers_->UpdateConfiguration(&cfg)); | 443 EXPECT_TRUE(layers_->UpdateConfiguration(&cfg)); |
444 layers_->PopulateCodecSpecific(false, &vp8_info, timestamp); | 444 layers_->PopulateCodecSpecific(false, &vp8_info, timestamp); |
445 EXPECT_EQ(cfg.rc_max_quantizer, static_cast<unsigned int>(kDefaultQp)); | 445 EXPECT_EQ(cfg.rc_max_quantizer, static_cast<unsigned int>(kDefaultQp)); |
446 layers_->FrameEncoded(frame_size_, timestamp, kDefaultQp); | 446 layers_->FrameEncoded(frame_size_, timestamp, kDefaultQp); |
447 } | 447 } |
448 | 448 |
449 } // namespace webrtc | 449 } // namespace webrtc |
OLD | NEW |