| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/base64.h" | 5 #include "base/base64.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/environment.h" | 7 #include "base/environment.h" |
| 8 #include "base/files/file.h" | 8 #include "base/files/file.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 converter_command.AppendSwitchPath("--output_file", | 171 converter_command.AppendSwitchPath("--output_file", |
| 172 captured_video_filename); | 172 captured_video_filename); |
| 173 converter_command.AppendSwitchASCII("--width", | 173 converter_command.AppendSwitchASCII("--width", |
| 174 base::StringPrintf("%d", width)); | 174 base::StringPrintf("%d", width)); |
| 175 converter_command.AppendSwitchASCII("--height", | 175 converter_command.AppendSwitchASCII("--height", |
| 176 base::StringPrintf("%d", height)); | 176 base::StringPrintf("%d", height)); |
| 177 converter_command.AppendSwitchASCII("--delete_frames", "true"); | 177 converter_command.AppendSwitchASCII("--delete_frames", "true"); |
| 178 | 178 |
| 179 // We produce an output file that will later be used as an input to the | 179 // We produce an output file that will later be used as an input to the |
| 180 // barcode decoder and frame analyzer tools. | 180 // barcode decoder and frame analyzer tools. |
| 181 VLOG(0) << "Running " << converter_command.GetCommandLineString(); | 181 DVLOG(0) << "Running " << converter_command.GetCommandLineString(); |
| 182 std::string result; | 182 std::string result; |
| 183 bool ok = base::GetAppOutput(converter_command, &result); | 183 bool ok = base::GetAppOutput(converter_command, &result); |
| 184 VLOG(0) << "Output was:\n\n" << result; | 184 DVLOG(0) << "Output was:\n\n" << result; |
| 185 return ok; | 185 return ok; |
| 186 } | 186 } |
| 187 | 187 |
| 188 // Compares the |captured_video_filename| with the |reference_video_filename|. | 188 // Compares the |captured_video_filename| with the |reference_video_filename|. |
| 189 // | 189 // |
| 190 // The barcode decoder decodes the captured video containing barcodes overlaid | 190 // The barcode decoder decodes the captured video containing barcodes overlaid |
| 191 // into every frame of the video (produced by rgba_to_i420_converter). It | 191 // into every frame of the video (produced by rgba_to_i420_converter). It |
| 192 // produces a set of PNG images and a |stats_file| that maps each captured | 192 // produces a set of PNG images and a |stats_file| that maps each captured |
| 193 // frame to a frame in the reference video. The frames should be of size | 193 // frame to a frame in the reference video. The frames should be of size |
| 194 // |width| x |height|. | 194 // |width| x |height|. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 compare_command.AppendArgPath(captured_video_filename); | 230 compare_command.AppendArgPath(captured_video_filename); |
| 231 compare_command.AppendArg("--frame_analyzer"); | 231 compare_command.AppendArg("--frame_analyzer"); |
| 232 compare_command.AppendArgPath(path_to_analyzer); | 232 compare_command.AppendArgPath(path_to_analyzer); |
| 233 compare_command.AppendArg("--yuv_frame_width"); | 233 compare_command.AppendArg("--yuv_frame_width"); |
| 234 compare_command.AppendArg(base::StringPrintf("%d", width)); | 234 compare_command.AppendArg(base::StringPrintf("%d", width)); |
| 235 compare_command.AppendArg("--yuv_frame_height"); | 235 compare_command.AppendArg("--yuv_frame_height"); |
| 236 compare_command.AppendArg(base::StringPrintf("%d", height)); | 236 compare_command.AppendArg(base::StringPrintf("%d", height)); |
| 237 compare_command.AppendArg("--stats_file"); | 237 compare_command.AppendArg("--stats_file"); |
| 238 compare_command.AppendArgPath(stats_file); | 238 compare_command.AppendArgPath(stats_file); |
| 239 | 239 |
| 240 VLOG(0) << "Running " << compare_command.GetCommandLineString(); | 240 DVLOG(0) << "Running " << compare_command.GetCommandLineString(); |
| 241 std::string output; | 241 std::string output; |
| 242 bool ok = base::GetAppOutput(compare_command, &output); | 242 bool ok = base::GetAppOutput(compare_command, &output); |
| 243 // Print to stdout to ensure the perf numbers are parsed properly by the | 243 // Print to stdout to ensure the perf numbers are parsed properly by the |
| 244 // buildbot step. | 244 // buildbot step. |
| 245 printf("Output was:\n\n%s\n", output.c_str()); | 245 printf("Output was:\n\n%s\n", output.c_str()); |
| 246 return ok; | 246 return ok; |
| 247 } | 247 } |
| 248 | 248 |
| 249 protected: | 249 protected: |
| 250 VideoQualityTestConfig test_config_; | 250 VideoQualityTestConfig test_config_; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 ASSERT_TRUE(CompareVideosAndPrintResult( | 325 ASSERT_TRUE(CompareVideosAndPrintResult( |
| 326 test_config_.test_name, | 326 test_config_.test_name, |
| 327 test_config_.width, | 327 test_config_.width, |
| 328 test_config_.height, | 328 test_config_.height, |
| 329 GetWorkingDir().Append(kCapturedYuvFileName), | 329 GetWorkingDir().Append(kCapturedYuvFileName), |
| 330 test::GetReferenceFilesDir() | 330 test::GetReferenceFilesDir() |
| 331 .Append(test_config_.reference_video) | 331 .Append(test_config_.reference_video) |
| 332 .AddExtension(test::kYuvFileExtension), | 332 .AddExtension(test::kYuvFileExtension), |
| 333 GetWorkingDir().Append(kStatsFileName))); | 333 GetWorkingDir().Append(kStatsFileName))); |
| 334 } | 334 } |
| OLD | NEW |