Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: media/test/ffmpeg_tests/ffmpeg_tests.cc

Issue 12321062: base: Move MemoryMappedFile out of file_util.h and into its own header file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix chrome_frame again Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/filters/file_data_source.h ('k') | media/tools/media_bench/media_bench.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // 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>
11 #include <string> 11 #include <string>
12 12
13 #include "base/at_exit.h" 13 #include "base/at_exit.h"
14 #include "base/basictypes.h" 14 #include "base/basictypes.h"
15 #include "base/command_line.h" 15 #include "base/command_line.h"
16 #include "base/file_util.h" 16 #include "base/file_util.h"
17 #include "base/files/file_path.h" 17 #include "base/files/file_path.h"
18 #include "base/files/memory_mapped_file.h"
18 #include "base/logging.h" 19 #include "base/logging.h"
19 #include "base/md5.h" 20 #include "base/md5.h"
20 #include "base/path_service.h" 21 #include "base/path_service.h"
21 #include "base/string_util.h" 22 #include "base/string_util.h"
22 #include "base/time.h" 23 #include "base/time.h"
23 #include "base/utf_string_conversions.h" 24 #include "base/utf_string_conversions.h"
24 #include "media/base/djb2.h" 25 #include "media/base/djb2.h"
25 #include "media/base/media.h" 26 #include "media/base/media.h"
26 #include "media/ffmpeg/ffmpeg_common.h" 27 #include "media/ffmpeg/ffmpeg_common.h"
27 #include "media/filters/ffmpeg_glue.h" 28 #include "media/filters/ffmpeg_glue.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 base::MD5Context ctx; // Intermediate MD5 data: do not use 109 base::MD5Context ctx; // Intermediate MD5 data: do not use
109 base::MD5Init(&ctx); 110 base::MD5Init(&ctx);
110 bool hash_md5 = false; 111 bool hash_md5 = false;
111 112
112 std::ostream* log_out = &std::cout; 113 std::ostream* log_out = &std::cout;
113 #if defined(ENABLE_WINDOWS_EXCEPTIONS) 114 #if defined(ENABLE_WINDOWS_EXCEPTIONS)
114 // Catch exceptions so this tool can be used in automated testing. 115 // Catch exceptions so this tool can be used in automated testing.
115 __try { 116 __try {
116 #endif 117 #endif
117 118
118 file_util::MemoryMappedFile file_data; 119 base::MemoryMappedFile file_data;
119 file_data.Initialize(in_path); 120 file_data.Initialize(in_path);
120 media::InMemoryUrlProtocol protocol( 121 media::InMemoryUrlProtocol protocol(
121 file_data.data(), file_data.length(), false); 122 file_data.data(), file_data.length(), false);
122 123
123 // Register FFmpeg and attempt to open file. 124 // Register FFmpeg and attempt to open file.
124 media::FFmpegGlue glue(&protocol); 125 media::FFmpegGlue glue(&protocol);
125 if (!glue.OpenContext()) { 126 if (!glue.OpenContext()) {
126 std::cerr << "Error: Could not open input for " 127 std::cerr << "Error: Could not open input for "
127 << in_path.value() << std::endl; 128 << in_path.value() << std::endl;
128 return 1; 129 return 1;
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 #if defined(ENABLE_WINDOWS_EXCEPTIONS) 491 #if defined(ENABLE_WINDOWS_EXCEPTIONS)
491 } __except(EXCEPTION_EXECUTE_HANDLER) { 492 } __except(EXCEPTION_EXECUTE_HANDLER) {
492 *log_out << " Exception:" << std::setw(11) << GetExceptionCode() 493 *log_out << " Exception:" << std::setw(11) << GetExceptionCode()
493 << " " << in_path.value() << std::endl; 494 << " " << in_path.value() << std::endl;
494 return 1; 495 return 1;
495 } 496 }
496 #endif 497 #endif
497 CommandLine::Reset(); 498 CommandLine::Reset();
498 return 0; 499 return 0;
499 } 500 }
OLDNEW
« no previous file with comments | « media/filters/file_data_source.h ('k') | media/tools/media_bench/media_bench.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698