OLD | NEW |
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 <stdio.h> | 5 #include <stdio.h> |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 #include <deque> | 7 #include <deque> |
8 #include <ostream> | 8 #include <ostream> |
9 | 9 |
10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 if (!file_handle) { | 46 if (!file_handle) { |
47 printf("Could not open %s\n", file_name.c_str()); | 47 printf("Could not open %s\n", file_name.c_str()); |
48 exit(1); | 48 exit(1); |
49 } | 49 } |
50 | 50 |
51 long frame_size = CalculateYUVFrameSize(file_handle, num_frames); | 51 long frame_size = CalculateYUVFrameSize(file_handle, num_frames); |
52 | 52 |
53 gfx::Size size(width, height); | 53 gfx::Size size(width, height); |
54 for (int i = 0; i < num_frames; i++) { | 54 for (int i = 0; i < num_frames; i++) { |
55 scoped_refptr<media::VideoFrame> video_frame = | 55 scoped_refptr<media::VideoFrame> video_frame = |
56 media::VideoFrame::CreateFrame(media::VideoFrame::YV12, size, size, | 56 media::VideoFrame::CreateFrame(media::VideoFrame::YV12, size, |
| 57 gfx::Rect(size), size, |
57 base::TimeDelta()); | 58 base::TimeDelta()); |
58 long bytes_read = | 59 long bytes_read = |
59 fread(video_frame->data(0), 1, frame_size, file_handle); | 60 fread(video_frame->data(0), 1, frame_size, file_handle); |
60 | 61 |
61 if (bytes_read != frame_size) { | 62 if (bytes_read != frame_size) { |
62 printf("Could not read %s\n", file_name.c_str()); | 63 printf("Could not read %s\n", file_name.c_str()); |
63 fclose(file_handle); | 64 fclose(file_handle); |
64 exit(1); | 65 exit(1); |
65 } | 66 } |
66 out_frames.push_back(video_frame); | 67 out_frames.push_back(video_frame); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 scoped_ptr<GPUPainter> painter(painters[i].painter); | 154 scoped_ptr<GPUPainter> painter(painters[i].painter); |
154 painter->LoadFrames(&frames); | 155 painter->LoadFrames(&frames); |
155 painter->SetGLContext(surface, context); | 156 painter->SetGLContext(surface, context); |
156 painter->Initialize(width, height); | 157 painter->Initialize(width, height); |
157 printf("Running %s tests...", painters[i].name); | 158 printf("Running %s tests...", painters[i].name); |
158 RunTest(window.get(), painter.get()); | 159 RunTest(window.get(), painter.get()); |
159 } | 160 } |
160 | 161 |
161 return 0; | 162 return 0; |
162 } | 163 } |
OLD | NEW |