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