1 // Copyright 2013 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MEDIA_FILTERS_MEDIA_FILE_CHECKER_H_
6 #define MEDIA_FILTERS_MEDIA_FILE_CHECKER_H_
8 #include "base/files/file.h"
9 #include "media/base/media_export.h"
17 // This class tries to determine if a file is a valid media file. The entire
18 // file is not decoded so a positive result from this class does not make the
19 // file safe to use in the browser process.
20 class MEDIA_EXPORT MediaFileChecker {
22 explicit MediaFileChecker(base::File file);
24 MediaFileChecker(const MediaFileChecker&) = delete;
25 MediaFileChecker& operator=(const MediaFileChecker&) = delete;
29 // After opening |file|, up to |check_time| amount of wall-clock time is spent
30 // decoding the file. The amount of audio/video data decoded will depend on
31 // the bitrate of the file and the speed of the CPU.
32 bool Start(base::TimeDelta check_time);
40 #endif // MEDIA_FILTERS_MEDIA_FILE_CHECKER_H_