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 #include <algorithm> // max | 10 #include <algorithm> // max |
(...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1233 for (size_t i = 0; i < std::min(frames1.size(), frames2.size()); ++i) | 1233 for (size_t i = 0; i < std::min(frames1.size(), frames2.size()); ++i) |
1234 ExpectEqualFrames(frames1[i], frames2[i]); | 1234 ExpectEqualFrames(frames1[i], frames2[i]); |
1235 } | 1235 } |
1236 | 1236 |
1237 VideoFrame CreateVideoFrame(int width, int height, uint8_t data) { | 1237 VideoFrame CreateVideoFrame(int width, int height, uint8_t data) { |
1238 const int kSizeY = width * height * 2; | 1238 const int kSizeY = width * height * 2; |
1239 rtc::scoped_ptr<uint8_t[]> buffer(new uint8_t[kSizeY]); | 1239 rtc::scoped_ptr<uint8_t[]> buffer(new uint8_t[kSizeY]); |
1240 memset(buffer.get(), data, kSizeY); | 1240 memset(buffer.get(), data, kSizeY); |
1241 VideoFrame frame; | 1241 VideoFrame frame; |
1242 frame.CreateFrame(buffer.get(), buffer.get(), buffer.get(), width, height, | 1242 frame.CreateFrame(buffer.get(), buffer.get(), buffer.get(), width, height, |
1243 width, width / 2, width / 2); | 1243 width, width / 2, width / 2, kVideoRotation_0); |
1244 frame.set_timestamp(data); | 1244 frame.set_timestamp(data); |
1245 frame.set_render_time_ms(data); | 1245 frame.set_render_time_ms(data); |
1246 return frame; | 1246 return frame; |
1247 } | 1247 } |
1248 | 1248 |
1249 TEST_F(VideoSendStreamTest, EncoderIsProperlyInitializedAndDestroyed) { | 1249 TEST_F(VideoSendStreamTest, EncoderIsProperlyInitializedAndDestroyed) { |
1250 class EncoderStateObserver : public test::SendTest, public VideoEncoder { | 1250 class EncoderStateObserver : public test::SendTest, public VideoEncoder { |
1251 public: | 1251 public: |
1252 EncoderStateObserver() | 1252 EncoderStateObserver() |
1253 : SendTest(kDefaultTimeoutMs), | 1253 : SendTest(kDefaultTimeoutMs), |
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2257 observation_complete_.Set(); | 2257 observation_complete_.Set(); |
2258 } | 2258 } |
2259 } | 2259 } |
2260 } test; | 2260 } test; |
2261 | 2261 |
2262 RunBaseTest(&test); | 2262 RunBaseTest(&test); |
2263 } | 2263 } |
2264 #endif | 2264 #endif |
2265 | 2265 |
2266 } // namespace webrtc | 2266 } // namespace webrtc |
OLD | NEW |