| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Software qualification test for FFmpeg. This test is used to certify that | 5 // Software qualification test for FFmpeg. This test is used to certify that |
| 6 // software decoding quality and performance of FFmpeg meets a mimimum | 6 // software decoding quality and performance of FFmpeg meets a mimimum |
| 7 // standard. | 7 // standard. |
| 8 | 8 |
| 9 #include <iomanip> | 9 #include <iomanip> |
| 10 #include <iostream> | 10 #include <iostream> |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 std::ostream* log_out = &std::cout; | 113 std::ostream* log_out = &std::cout; |
| 114 #if defined(ENABLE_WINDOWS_EXCEPTIONS) | 114 #if defined(ENABLE_WINDOWS_EXCEPTIONS) |
| 115 // Catch exceptions so this tool can be used in automated testing. | 115 // Catch exceptions so this tool can be used in automated testing. |
| 116 __try { | 116 __try { |
| 117 #endif | 117 #endif |
| 118 | 118 |
| 119 // Register FFmpeg and attempt to open file. | 119 // Register FFmpeg and attempt to open file. |
| 120 avcodec_init(); | 120 avcodec_init(); |
| 121 av_log_set_level(verbose_level); | 121 av_log_set_level(verbose_level); |
| 122 av_register_all(); | 122 av_register_all(); |
| 123 av_register_protocol(&kFFmpegFileProtocol); | 123 av_register_protocol2(&kFFmpegFileProtocol, sizeof(kFFmpegFileProtocol)); |
| 124 AVFormatContext* format_context = NULL; | 124 AVFormatContext* format_context = NULL; |
| 125 int result = av_open_input_file(&format_context, in_path.c_str(), | 125 int result = av_open_input_file(&format_context, in_path.c_str(), |
| 126 NULL, 0, NULL); | 126 NULL, 0, NULL); |
| 127 if (result < 0) { | 127 if (result < 0) { |
| 128 switch (result) { | 128 switch (result) { |
| 129 case AVERROR_NOFMT: | 129 case AVERROR_NOFMT: |
| 130 std::cerr << "Error: File format not supported " | 130 std::cerr << "Error: File format not supported " |
| 131 << in_path << std::endl; | 131 << in_path << std::endl; |
| 132 break; | 132 break; |
| 133 default: | 133 default: |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 } __except(EXCEPTION_EXECUTE_HANDLER) { | 489 } __except(EXCEPTION_EXECUTE_HANDLER) { |
| 490 *log_out << " Exception:" << std::setw(11) << GetExceptionCode() | 490 *log_out << " Exception:" << std::setw(11) << GetExceptionCode() |
| 491 << " " << in_path << std::endl; | 491 << " " << in_path << std::endl; |
| 492 return 1; | 492 return 1; |
| 493 } | 493 } |
| 494 #endif | 494 #endif |
| 495 CommandLine::Reset(); | 495 CommandLine::Reset(); |
| 496 return 0; | 496 return 0; |
| 497 } | 497 } |
| 498 | 498 |
| OLD | NEW |