Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: webrtc/common_video/i420_video_frame_unittest.cc

Issue 2574123002: Revert of Delete VideoFrame default constructor, and IsZeroSize method. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/common_video/libyuv/webrtc_libyuv.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 EXPECT_EQ(colors[i].y, rotated.DataY()[x + y * rotated.StrideY()]); 104 EXPECT_EQ(colors[i].y, rotated.DataY()[x + y * rotated.StrideY()]);
105 EXPECT_EQ(colors[i].u, 105 EXPECT_EQ(colors[i].u,
106 rotated.DataU()[(x / 2) + (y / 2) * rotated.StrideU()]); 106 rotated.DataU()[(x / 2) + (y / 2) * rotated.StrideU()]);
107 EXPECT_EQ(colors[i].v, 107 EXPECT_EQ(colors[i].v,
108 rotated.DataV()[(x / 2) + (y / 2) * rotated.StrideV()]); 108 rotated.DataV()[(x / 2) + (y / 2) * rotated.StrideV()]);
109 } 109 }
110 } 110 }
111 111
112 } // namespace 112 } // namespace
113 113
114 TEST(TestVideoFrame, InitialValues) {
115 VideoFrame frame;
116 EXPECT_TRUE(frame.IsZeroSize());
117 EXPECT_EQ(kVideoRotation_0, frame.rotation());
118 }
119
114 TEST(TestVideoFrame, WidthHeightValues) { 120 TEST(TestVideoFrame, WidthHeightValues) {
115 VideoFrame frame(I420Buffer::Create(10, 10, 10, 14, 90), 121 VideoFrame frame(I420Buffer::Create(10, 10, 10, 14, 90),
116 webrtc::kVideoRotation_0, 122 webrtc::kVideoRotation_0,
117 789 * rtc::kNumMicrosecsPerMillisec); 123 789 * rtc::kNumMicrosecsPerMillisec);
118 const int valid_value = 10; 124 const int valid_value = 10;
119 EXPECT_EQ(valid_value, frame.width()); 125 EXPECT_EQ(valid_value, frame.width());
120 EXPECT_EQ(valid_value, frame.height()); 126 EXPECT_EQ(valid_value, frame.height());
121 frame.set_timestamp(123u); 127 frame.set_timestamp(123u);
122 EXPECT_EQ(123u, frame.timestamp()); 128 EXPECT_EQ(123u, frame.timestamp());
123 frame.set_ntp_time_ms(456); 129 frame.set_ntp_time_ms(456);
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 CheckRotate(640, 480, GetParam(), *rotated_buffer); 290 CheckRotate(640, 480, GetParam(), *rotated_buffer);
285 } 291 }
286 292
287 INSTANTIATE_TEST_CASE_P(Rotate, TestI420BufferRotate, 293 INSTANTIATE_TEST_CASE_P(Rotate, TestI420BufferRotate,
288 ::testing::Values(kVideoRotation_0, 294 ::testing::Values(kVideoRotation_0,
289 kVideoRotation_90, 295 kVideoRotation_90,
290 kVideoRotation_180, 296 kVideoRotation_180,
291 kVideoRotation_270)); 297 kVideoRotation_270));
292 298
293 } // namespace webrtc 299 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/common_video/libyuv/webrtc_libyuv.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698