| 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 1668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1679 for (size_t i = 0; i < std::min(frames1.size(), frames2.size()); ++i) | 1679 for (size_t i = 0; i < std::min(frames1.size(), frames2.size()); ++i) |
| 1680 // Compare frame buffers, since we don't care about differing timestamps. | 1680 // Compare frame buffers, since we don't care about differing timestamps. |
| 1681 EXPECT_TRUE(test::FrameBufsEqual(frames1[i].video_frame_buffer(), | 1681 EXPECT_TRUE(test::FrameBufsEqual(frames1[i].video_frame_buffer(), |
| 1682 frames2[i].video_frame_buffer())); | 1682 frames2[i].video_frame_buffer())); |
| 1683 } | 1683 } |
| 1684 | 1684 |
| 1685 VideoFrame CreateVideoFrame(int width, int height, uint8_t data) { | 1685 VideoFrame CreateVideoFrame(int width, int height, uint8_t data) { |
| 1686 const int kSizeY = width * height * 2; | 1686 const int kSizeY = width * height * 2; |
| 1687 std::unique_ptr<uint8_t[]> buffer(new uint8_t[kSizeY]); | 1687 std::unique_ptr<uint8_t[]> buffer(new uint8_t[kSizeY]); |
| 1688 memset(buffer.get(), data, kSizeY); | 1688 memset(buffer.get(), data, kSizeY); |
| 1689 VideoFrame frame; | 1689 VideoFrame frame( |
| 1690 frame.CreateFrame(buffer.get(), buffer.get(), buffer.get(), width, height, | 1690 I420Buffer::Create(width, height, width, width / 2, width / 2), |
| 1691 width, width / 2, width / 2, kVideoRotation_0); | 1691 kVideoRotation_0, data); |
| 1692 frame.set_timestamp(data); | 1692 frame.set_timestamp(data); |
| 1693 frame.set_render_time_ms(data); | 1693 frame.set_render_time_ms(data); |
| 1694 return frame; | 1694 return frame; |
| 1695 } | 1695 } |
| 1696 | 1696 |
| 1697 TEST_F(VideoSendStreamTest, EncoderIsProperlyInitializedAndDestroyed) { | 1697 TEST_F(VideoSendStreamTest, EncoderIsProperlyInitializedAndDestroyed) { |
| 1698 class EncoderStateObserver : public test::SendTest, public VideoEncoder { | 1698 class EncoderStateObserver : public test::SendTest, public VideoEncoder { |
| 1699 public: | 1699 public: |
| 1700 EncoderStateObserver() | 1700 EncoderStateObserver() |
| 1701 : SendTest(kDefaultTimeoutMs), | 1701 : SendTest(kDefaultTimeoutMs), |
| (...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2888 observation_complete_.Set(); | 2888 observation_complete_.Set(); |
| 2889 } | 2889 } |
| 2890 } | 2890 } |
| 2891 } test; | 2891 } test; |
| 2892 | 2892 |
| 2893 RunBaseTest(&test); | 2893 RunBaseTest(&test); |
| 2894 } | 2894 } |
| 2895 #endif // !defined(RTC_DISABLE_VP9) | 2895 #endif // !defined(RTC_DISABLE_VP9) |
| 2896 | 2896 |
| 2897 } // namespace webrtc | 2897 } // namespace webrtc |
| OLD | NEW |