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

Side by Side Diff: webrtc/media/base/videoframe_unittest.h

Issue 1831523004: Move InitToBlack and Reset methods from cricket::VideoFrame to its subclass cricket::WebRtcVideoFra… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 months 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 | « webrtc/media/base/videoframe.h ('k') | webrtc/media/engine/webrtcvideoframe.h » ('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) 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 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after
1365 EXPECT_TRUE(ConvertRgb(ms.get(), cricket::FOURCC_ARGB, 1365 EXPECT_TRUE(ConvertRgb(ms.get(), cricket::FOURCC_ARGB,
1366 kOddWidth + i, kOddHeight + j, 1366 kOddWidth + i, kOddHeight + j,
1367 &frame1)); 1367 &frame1));
1368 EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_ARGB, 1368 EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_ARGB,
1369 kOddWidth + i, kOddHeight + j, &frame2)); 1369 kOddWidth + i, kOddHeight + j, &frame2));
1370 EXPECT_TRUE(IsEqual(frame1, frame2, 64)); 1370 EXPECT_TRUE(IsEqual(frame1, frame2, 64));
1371 } 1371 }
1372 } 1372 }
1373 } 1373 }
1374 1374
1375 // TODO(nisse): Reset is no longer a public method, and not
perkj_webrtc 2016/03/24 09:53:00 Take a look and advice please. You can probably m
nisse-webrtc 2016/03/24 10:03:14 Only problem is that the Init-method to test takes
1376 // available here. It is used by the two Init methods. Do we have
1377 // adequate tests form WebRtcVideoFrame::Init?
1378 #if 0
1375 // Tests re-initing an existing image. 1379 // Tests re-initing an existing image.
1376 void Reset(webrtc::VideoRotation rotation, bool apply_rotation) { 1380 void Reset(webrtc::VideoRotation rotation, bool apply_rotation) {
1377 T frame1, frame2; 1381 T frame1, frame2;
1378 std::unique_ptr<rtc::MemoryStream> ms( 1382 std::unique_ptr<rtc::MemoryStream> ms(
1379 LoadSample(kImageFilename)); 1383 LoadSample(kImageFilename));
1380 ASSERT_TRUE(ms.get() != NULL); 1384 ASSERT_TRUE(ms.get() != NULL);
1381 size_t data_size; 1385 size_t data_size;
1382 ms->GetSize(&data_size); 1386 ms->GetSize(&data_size);
1383 EXPECT_TRUE(frame1.InitToBlack(kWidth, kHeight, 0)); 1387 EXPECT_TRUE(frame1.InitToBlack(kWidth, kHeight, 0));
1384 EXPECT_TRUE(frame2.InitToBlack(kWidth, kHeight, 0)); 1388 EXPECT_TRUE(frame2.InitToBlack(kWidth, kHeight, 0));
(...skipping 21 matching lines...) Expand all
1406 EXPECT_FALSE(IsEqual(frame1, frame2, 0)); 1410 EXPECT_FALSE(IsEqual(frame1, frame2, 0));
1407 } 1411 }
1408 1412
1409 void ResetAndApplyRotation() { 1413 void ResetAndApplyRotation() {
1410 Reset(webrtc::kVideoRotation_90, true); 1414 Reset(webrtc::kVideoRotation_90, true);
1411 } 1415 }
1412 1416
1413 void ResetAndDontApplyRotation() { 1417 void ResetAndDontApplyRotation() {
1414 Reset(webrtc::kVideoRotation_90, false); 1418 Reset(webrtc::kVideoRotation_90, false);
1415 } 1419 }
1420 #endif
1416 1421
1417 ////////////////////// 1422 //////////////////////
1418 // Conversion tests // 1423 // Conversion tests //
1419 ////////////////////// 1424 //////////////////////
1420 1425
1421 enum ToFrom { TO, FROM }; 1426 enum ToFrom { TO, FROM };
1422 1427
1423 // Helper function for test converting from I420 to packed formats. 1428 // Helper function for test converting from I420 to packed formats.
1424 inline void ConvertToBuffer(int bpp, 1429 inline void ConvertToBuffer(int bpp,
1425 int rowpad, 1430 int rowpad,
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
1858 ASSERT_TRUE(LoadFrameNoRepeat(&target2)); 1863 ASSERT_TRUE(LoadFrameNoRepeat(&target2));
1859 source.StretchToFrame(&target2, true, true); 1864 source.StretchToFrame(&target2, true, true);
1860 EXPECT_TRUE(IsBlack(target2)); 1865 EXPECT_TRUE(IsBlack(target2));
1861 EXPECT_EQ(source.GetTimeStamp(), target2.GetTimeStamp()); 1866 EXPECT_EQ(source.GetTimeStamp(), target2.GetTimeStamp());
1862 } 1867 }
1863 1868
1864 int repeat_; 1869 int repeat_;
1865 }; 1870 };
1866 1871
1867 #endif // WEBRTC_MEDIA_BASE_VIDEOFRAME_UNITTEST_H_ 1872 #endif // WEBRTC_MEDIA_BASE_VIDEOFRAME_UNITTEST_H_
OLDNEW
« no previous file with comments | « webrtc/media/base/videoframe.h ('k') | webrtc/media/engine/webrtcvideoframe.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698