OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 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 1790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1801 u, kWidth / 2, | 1801 u, kWidth / 2, |
1802 v, kWidth / 2, | 1802 v, kWidth / 2, |
1803 kWidth, kHeight)); | 1803 kWidth, kHeight)); |
1804 } | 1804 } |
1805 EXPECT_TRUE(frame2.Init(cricket::FOURCC_I422, kWidth, kHeight, kWidth, | 1805 EXPECT_TRUE(frame2.Init(cricket::FOURCC_I422, kWidth, kHeight, kWidth, |
1806 kHeight, y, out_size, 1, 1, 0, | 1806 kHeight, y, out_size, 1, 1, 0, |
1807 webrtc::kVideoRotation_0)); | 1807 webrtc::kVideoRotation_0)); |
1808 EXPECT_TRUE(IsEqual(frame1, frame2, 1)); | 1808 EXPECT_TRUE(IsEqual(frame1, frame2, 1)); |
1809 } | 1809 } |
1810 | 1810 |
1811 /////////////////// | |
1812 // General tests // | |
1813 /////////////////// | |
1814 | |
1815 void Copy() { | |
1816 std::unique_ptr<T> source(new T); | |
1817 std::unique_ptr<cricket::VideoFrame> target; | |
1818 ASSERT_TRUE(LoadFrameNoRepeat(source.get())); | |
1819 target.reset(source->Copy()); | |
1820 EXPECT_TRUE(IsEqual(*source, *target, 0)); | |
1821 source.reset(); | |
1822 ASSERT_TRUE(target->video_frame_buffer() != NULL); | |
1823 EXPECT_TRUE(target->video_frame_buffer()->DataY() != NULL); | |
1824 } | |
1825 | |
1826 void CopyIsRef() { | |
1827 std::unique_ptr<T> source(new T); | |
1828 std::unique_ptr<const cricket::VideoFrame> target; | |
1829 ASSERT_TRUE(LoadFrameNoRepeat(source.get())); | |
1830 target.reset(source->Copy()); | |
1831 EXPECT_TRUE(IsEqual(*source, *target, 0)); | |
1832 const T* const_source = source.get(); | |
1833 EXPECT_EQ(const_source->video_frame_buffer(), target->video_frame_buffer()); | |
1834 } | |
1835 | |
1836 int repeat_; | 1811 int repeat_; |
1837 }; | 1812 }; |
1838 | 1813 |
1839 #endif // WEBRTC_MEDIA_BASE_VIDEOFRAME_UNITTEST_H_ | 1814 #endif // WEBRTC_MEDIA_BASE_VIDEOFRAME_UNITTEST_H_ |
OLD | NEW |