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

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

Issue 10832087: Remove VideoDecoderConfig.frame_rate_xxx() & VideoFrame:Get/SetDuration() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address more CR comments. Created 8 years, 4 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_unittest.cc ('k') | media/ffmpeg/ffmpeg_common.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 // 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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "media/base/video_frame.h" 6 #include "media/base/video_frame.h"
7 #include "media/base/video_util.h" 7 #include "media/base/video_util.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace media { 10 namespace media {
(...skipping 21 matching lines...) Expand all
32 v_stride_ = v_stride; 32 v_stride_ = v_stride;
33 33
34 y_plane_.reset(new uint8[y_stride * height]); 34 y_plane_.reset(new uint8[y_stride * height]);
35 u_plane_.reset(new uint8[u_stride * height / 2]); 35 u_plane_.reset(new uint8[u_stride * height / 2]);
36 v_plane_.reset(new uint8[v_stride * height / 2]); 36 v_plane_.reset(new uint8[v_stride * height / 2]);
37 } 37 }
38 38
39 void CreateDestinationFrame(int width, int height) { 39 void CreateDestinationFrame(int width, int height) {
40 destination_frame_ = 40 destination_frame_ =
41 VideoFrame::CreateFrame(VideoFrame::YV12, width, height, 41 VideoFrame::CreateFrame(VideoFrame::YV12, width, height,
42 base::TimeDelta(), base::TimeDelta()); 42 base::TimeDelta());
43 } 43 }
44 44
45 void CopyPlanes() { 45 void CopyPlanes() {
46 CopyYPlane(y_plane_.get(), y_stride_, height_, destination_frame_); 46 CopyYPlane(y_plane_.get(), y_stride_, height_, destination_frame_);
47 CopyUPlane(u_plane_.get(), u_stride_, height_ / 2, destination_frame_); 47 CopyUPlane(u_plane_.get(), u_stride_, height_ / 2, destination_frame_);
48 CopyVPlane(v_plane_.get(), v_stride_, height_ / 2, destination_frame_); 48 CopyVPlane(v_plane_.get(), v_stride_, height_ / 2, destination_frame_);
49 } 49 }
50 50
51 private: 51 private:
52 scoped_array<uint8> y_plane_; 52 scoped_array<uint8> y_plane_;
(...skipping 22 matching lines...) Expand all
75 CopyPlanes(); 75 CopyPlanes();
76 } 76 }
77 77
78 TEST_F(VideoUtilTest, CopyPlane_SmallerDestination) { 78 TEST_F(VideoUtilTest, CopyPlane_SmallerDestination) {
79 CreateSourceFrame(16, 16, 16, 8, 8); 79 CreateSourceFrame(16, 16, 16, 8, 8);
80 CreateDestinationFrame(8, 8); 80 CreateDestinationFrame(8, 8);
81 CopyPlanes(); 81 CopyPlanes();
82 } 82 }
83 83
84 } // namespace media 84 } // namespace media
OLDNEW
« no previous file with comments | « media/base/video_frame_unittest.cc ('k') | media/ffmpeg/ffmpeg_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698