Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MEDIA_BASE_MEDIA_FILE_CHECKER_H_ | |
| 6 #define MEDIA_BASE_MEDIA_FILE_CHECKER_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/files/scoped_platform_file_closer.h" | |
| 10 #include "base/platform_file.h" | |
| 11 #include "media/base/media_export.h" | |
| 12 | |
| 13 namespace base { | |
| 14 class TimeDelta; | |
| 15 } | |
| 16 | |
| 17 namespace media { | |
| 18 | |
| 19 // Open and read |file| to determine if it appears to be a valid media file. | |
|
DaleCurtis
2013/08/08 21:04:33
Sounds like this comment should go with the constr
vandebo (ex-Chrome)
2013/08/08 23:04:18
Rephrased comment.
| |
| 20 // The entire file is not decoded so a positive result from this class does | |
| 21 // not make the file safe to use in the browser process. | |
| 22 class MEDIA_EXPORT MediaFileChecker { | |
| 23 public: | |
| 24 explicit MediaFileChecker(base::PlatformFile file); | |
|
DaleCurtis
2013/08/08 21:04:33
Should this be const&?
vandebo (ex-Chrome)
2013/08/08 23:04:18
Done.
| |
| 25 ~MediaFileChecker(); | |
| 26 | |
| 27 // After opening |file|, up to |check_time| amount of wall-clock time is spent | |
| 28 // decoding the file. The amount of audio/video data decoded will depend on | |
| 29 // the bitrate of the file and the speed of the CPU. | |
| 30 bool Start(const base::TimeDelta& check_time); | |
|
DaleCurtis
2013/08/08 21:04:33
Time structs are just int64s in the end, so it's n
vandebo (ex-Chrome)
2013/08/08 23:04:18
Done.
| |
| 31 | |
| 32 private: | |
| 33 base::PlatformFile file_; | |
| 34 base::ScopedPlatformFileCloser file_closer_; | |
| 35 | |
| 36 DISALLOW_COPY_AND_ASSIGN(MediaFileChecker); | |
| 37 }; | |
| 38 | |
| 39 } // namespace media | |
| 40 | |
| 41 #endif // MEDIA_BASE_MEDIA_FILE_CHECKER_H_ | |
| OLD | NEW |