OLD | NEW |
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 Loading... |
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 Loading... |
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_ |
OLD | NEW |