OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 std::unique_ptr<VideoFrame> frame_; | 123 std::unique_ptr<VideoFrame> frame_; |
124 std::unique_ptr<SimulcastRateAllocator> rate_allocator_; | 124 std::unique_ptr<SimulcastRateAllocator> rate_allocator_; |
125 }; | 125 }; |
126 | 126 |
127 void VideoEncoderSoftwareFallbackWrapperTest::EncodeFrame() { | 127 void VideoEncoderSoftwareFallbackWrapperTest::EncodeFrame() { |
128 rtc::scoped_refptr<I420Buffer> buffer = I420Buffer::Create( | 128 rtc::scoped_refptr<I420Buffer> buffer = I420Buffer::Create( |
129 kWidth, kHeight, kWidth, (kWidth + 1) / 2, (kWidth + 1) / 2); | 129 kWidth, kHeight, kWidth, (kWidth + 1) / 2, (kWidth + 1) / 2); |
130 I420Buffer::SetBlack(buffer); | 130 I420Buffer::SetBlack(buffer); |
131 std::vector<FrameType> types(1, kVideoFrameKey); | 131 std::vector<FrameType> types(1, kVideoFrameKey); |
132 | 132 |
133 frame_.reset(new VideoFrame(buffer, 0, 0, webrtc::kVideoRotation_0)); | 133 frame_.reset(new VideoFrame(buffer, 0, 0, webrtc::kVideoRotation_0, |
| 134 webrtc::VideoContentType::kDefault)); |
134 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, | 135 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, |
135 fallback_wrapper_.Encode(*frame_, nullptr, &types)); | 136 fallback_wrapper_.Encode(*frame_, nullptr, &types)); |
136 } | 137 } |
137 | 138 |
138 void VideoEncoderSoftwareFallbackWrapperTest::UtilizeFallbackEncoder() { | 139 void VideoEncoderSoftwareFallbackWrapperTest::UtilizeFallbackEncoder() { |
139 fallback_wrapper_.RegisterEncodeCompleteCallback(&callback_); | 140 fallback_wrapper_.RegisterEncodeCompleteCallback(&callback_); |
140 EXPECT_EQ(&callback_, fake_encoder_.encode_complete_callback_); | 141 EXPECT_EQ(&callback_, fake_encoder_.encode_complete_callback_); |
141 | 142 |
142 // Register with failing fake encoder. Should succeed with VP8 fallback. | 143 // Register with failing fake encoder. Should succeed with VP8 fallback. |
143 codec_.codecType = kVideoCodecVP8; | 144 codec_.codecType = kVideoCodecVP8; |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 293 |
293 TEST_F(VideoEncoderSoftwareFallbackWrapperTest, | 294 TEST_F(VideoEncoderSoftwareFallbackWrapperTest, |
294 ReportsFallbackImplementationName) { | 295 ReportsFallbackImplementationName) { |
295 UtilizeFallbackEncoder(); | 296 UtilizeFallbackEncoder(); |
296 // Hard coded expected value since libvpx is the software implementation name | 297 // Hard coded expected value since libvpx is the software implementation name |
297 // for VP8. Change accordingly if the underlying implementation does. | 298 // for VP8. Change accordingly if the underlying implementation does. |
298 CheckLastEncoderName("libvpx"); | 299 CheckLastEncoderName("libvpx"); |
299 } | 300 } |
300 | 301 |
301 } // namespace webrtc | 302 } // namespace webrtc |
OLD | NEW |