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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 std::ostream* log_out = &std::cout; | 108 std::ostream* log_out = &std::cout; |
109 #if defined(ENABLE_WINDOWS_EXCEPTIONS) | 109 #if defined(ENABLE_WINDOWS_EXCEPTIONS) |
110 // Catch exceptions so this tool can be used in automated testing. | 110 // Catch exceptions so this tool can be used in automated testing. |
111 __try { | 111 __try { |
112 #endif | 112 #endif |
113 | 113 |
114 // Register FFmpeg and attempt to open file. | 114 // Register FFmpeg and attempt to open file. |
115 avcodec_init(); | 115 avcodec_init(); |
116 av_log_set_level(verbose_level); | 116 av_log_set_level(verbose_level); |
117 av_register_all(); | 117 av_register_all(); |
118 av_register_protocol(&kFFmpegFileProtocol); | 118 av_register_protocol2(&kFFmpegFileProtocol, sizeof(kFFmpegFileProtocol)); |
119 AVFormatContext* format_context = NULL; | 119 AVFormatContext* format_context = NULL; |
120 // av_open_input_file wants a char*, which can't work with wide paths. | 120 // av_open_input_file wants a char*, which can't work with wide paths. |
121 // So we assume ASCII on Windows. On other platforms we can pass the | 121 // So we assume ASCII on Windows. On other platforms we can pass the |
122 // path bytes through verbatim. | 122 // path bytes through verbatim. |
123 #if defined(OS_WIN) | 123 #if defined(OS_WIN) |
124 std::string string_path = WideToASCII(in_path.value()); | 124 std::string string_path = WideToASCII(in_path.value()); |
125 #else | 125 #else |
126 const std::string& string_path = in_path.value(); | 126 const std::string& string_path = in_path.value(); |
127 #endif | 127 #endif |
128 int result = av_open_input_file(&format_context, string_path.c_str(), | 128 int result = av_open_input_file(&format_context, string_path.c_str(), |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 } __except(EXCEPTION_EXECUTE_HANDLER) { | 493 } __except(EXCEPTION_EXECUTE_HANDLER) { |
494 *log_out << " Exception:" << std::setw(11) << GetExceptionCode() | 494 *log_out << " Exception:" << std::setw(11) << GetExceptionCode() |
495 << " " << in_path.value() << std::endl; | 495 << " " << in_path.value() << std::endl; |
496 return 1; | 496 return 1; |
497 } | 497 } |
498 #endif | 498 #endif |
499 CommandLine::Reset(); | 499 CommandLine::Reset(); |
500 return 0; | 500 return 0; |
501 } | 501 } |
502 | 502 |
OLD | NEW |