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

Side by Side Diff: media/base/video_frame_unittest.cc

Issue 383893002: Zero initialize the first allocation of a VideoFrame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « media/base/video_frame.cc ('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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/base/video_frame.h" 5 #include "media/base/video_frame.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/memory/aligned_memory.h" 10 #include "base/memory/aligned_memory.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 EXPECT_EQ(sync_point, mailbox_holder->sync_point); 301 EXPECT_EQ(sync_point, mailbox_holder->sync_point);
302 302
303 frame->AppendReleaseSyncPoint(release_sync_points[0]); 303 frame->AppendReleaseSyncPoint(release_sync_points[0]);
304 frame->AppendReleaseSyncPoint(release_sync_points[1]); 304 frame->AppendReleaseSyncPoint(release_sync_points[1]);
305 frame->AppendReleaseSyncPoint(release_sync_points[2]); 305 frame->AppendReleaseSyncPoint(release_sync_points[2]);
306 EXPECT_EQ(sync_point, mailbox_holder->sync_point); 306 EXPECT_EQ(sync_point, mailbox_holder->sync_point);
307 } 307 }
308 EXPECT_EQ(release_sync_points, called_sync_points); 308 EXPECT_EQ(release_sync_points, called_sync_points);
309 } 309 }
310 310
311 TEST(VideoFrame, ZeroInitialized) {
312 const int kWidth = 64;
313 const int kHeight = 48;
314 const base::TimeDelta kTimestamp = base::TimeDelta::FromMicroseconds(1337);
315
316 gfx::Size size(kWidth, kHeight);
317 scoped_refptr<media::VideoFrame> frame = VideoFrame::CreateFrame(
318 media::VideoFrame::YV12, size, gfx::Rect(size), size, kTimestamp);
319
320 for (size_t i = 0; i < VideoFrame::NumPlanes(frame->format()); ++i)
321 EXPECT_EQ(0, frame->data(i)[0]);
322 }
323
311 } // namespace media 324 } // namespace media
OLDNEW
« no previous file with comments | « media/base/video_frame.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698