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