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

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

Issue 1660143004: Roll chromium_revision c6076f2..609aa24 (372974:373145) (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Fixed compile warning Created 4 years, 10 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 | « DEPS ('k') | no next file » | 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 * libjingle 2 * libjingle
3 * Copyright 2004 Google Inc. 3 * Copyright 2004 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 rtc::MemoryStream* CreateYuvSample(uint32_t width, 242 rtc::MemoryStream* CreateYuvSample(uint32_t width,
243 uint32_t height, 243 uint32_t height,
244 uint32_t bpp) { 244 uint32_t bpp) {
245 rtc::scoped_ptr<rtc::MemoryStream> ms( 245 rtc::scoped_ptr<rtc::MemoryStream> ms(
246 new rtc::MemoryStream); 246 new rtc::MemoryStream);
247 if (!ms->ReserveSize(width * height * bpp / 8)) { 247 if (!ms->ReserveSize(width * height * bpp / 8)) {
248 return NULL; 248 return NULL;
249 } 249 }
250 250
251 for (uint32_t i = 0; i < width * height * bpp / 8; ++i) { 251 for (uint32_t i = 0; i < width * height * bpp / 8; ++i) {
252 char value = ((i / 63) & 1) ? 192 : 64; 252 uint8_t value = ((i / 63) & 1) ? 192 : 64;
253 ms->Write(&value, sizeof(value), NULL, NULL); 253 ms->Write(&value, sizeof(value), NULL, NULL);
254 } 254 }
255 return ms.release(); 255 return ms.release();
256 } 256 }
257 257
258 rtc::MemoryStream* CreateRgbSample(uint32_t fourcc, 258 rtc::MemoryStream* CreateRgbSample(uint32_t fourcc,
259 uint32_t width, 259 uint32_t width,
260 uint32_t height) { 260 uint32_t height) {
261 int r_pos, g_pos, b_pos, bytes; 261 int r_pos, g_pos, b_pos, bytes;
262 if (!GetRgbPacking(fourcc, &r_pos, &g_pos, &b_pos, &bytes)) { 262 if (!GetRgbPacking(fourcc, &r_pos, &g_pos, &b_pos, &bytes)) {
(...skipping 1677 matching lines...) Expand 10 before | Expand all | Expand 10 after
1940 ASSERT_TRUE(LoadFrameNoRepeat(&target2)); 1940 ASSERT_TRUE(LoadFrameNoRepeat(&target2));
1941 source.StretchToFrame(&target2, true, true); 1941 source.StretchToFrame(&target2, true, true);
1942 EXPECT_TRUE(IsBlack(target2)); 1942 EXPECT_TRUE(IsBlack(target2));
1943 EXPECT_EQ(source.GetTimeStamp(), target2.GetTimeStamp()); 1943 EXPECT_EQ(source.GetTimeStamp(), target2.GetTimeStamp());
1944 } 1944 }
1945 1945
1946 int repeat_; 1946 int repeat_;
1947 }; 1947 };
1948 1948
1949 #endif // TALK_MEDIA_BASE_VIDEOFRAME_UNITTEST_H_ 1949 #endif // TALK_MEDIA_BASE_VIDEOFRAME_UNITTEST_H_
OLDNEW
« no previous file with comments | « DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698