OLD | NEW |
---|---|
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 // Contains code that should be used for initializing, or querying the state | 5 // Contains code that should be used for initializing, or querying the state |
6 // of the media library as a whole. | 6 // of the media library as a whole. |
7 | 7 |
8 #ifndef MEDIA_BASE_MEDIA_H_ | 8 #ifndef MEDIA_BASE_MEDIA_H_ |
9 #define MEDIA_BASE_MEDIA_H_ | 9 #define MEDIA_BASE_MEDIA_H_ |
10 | 10 |
11 #include "media/base/media_export.h" | 11 #include "media/base/media_export.h" |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 class FilePath; | 14 class FilePath; |
15 } | 15 } |
16 | 16 |
17 namespace media { | 17 namespace media { |
18 | 18 |
19 // Attempts to initialize the media library (loading DLLs, DSOs, etc.). | 19 // Initializes media libraries (e.g. ffmpeg) as well as CPU specific media |
20 // | 20 // features. |
21 // If |module_dir| is the empty string, then the system default library paths | 21 // TODO(chcunningham): Remove this method in favor of the zero-argument version. |
DaleCurtis
2015/05/15 00:23:06
Looks like you can delete all these methods within
chcunningham
2015/05/16 04:36:25
I haven't changed places like here yet.
https://co
| |
22 // are searched for the dynamic libraries. If a |module_dir| is provided, then | 22 // Because ffmpeg is now statically linked, path is no longer needed and return |
23 // only the specified |module_dir| will be searched for the dynamic libraries. | 23 // will always be true. |
24 // | |
25 // If multiple initializations are attempted with different |module_dir|s | |
26 // specified then the first one to succeed remains effective for the lifetime | |
27 // of the process. | |
28 // | |
29 // Returns true if everything was successfully initialized, false otherwise. | |
30 MEDIA_EXPORT bool InitializeMediaLibrary(const base::FilePath& module_dir); | 24 MEDIA_EXPORT bool InitializeMediaLibrary(const base::FilePath& module_dir); |
31 | 25 |
26 // Initializes media libraries (e.g. ffmpeg) as well as CPU specific media | |
27 // features. | |
28 MEDIA_EXPORT void InitializeMediaLibrary(); | |
29 | |
32 // Helper function for unit tests to avoid boiler plate code everywhere. This | 30 // Helper function for unit tests to avoid boiler plate code everywhere. This |
33 // function will crash if it fails to load the media library. This ensures tests | 31 // function will crash if it fails to load the media library. This ensures tests |
34 // fail if the media library is not available. | 32 // fail if the media library is not available. |
35 MEDIA_EXPORT void InitializeMediaLibraryForTesting(); | 33 MEDIA_EXPORT void InitializeMediaLibraryForTesting(); |
36 | 34 |
37 // Use this if you need to check whether the media library is initialized | 35 // Use this if you need to check whether the media library is initialized |
38 // for the this process, without actually trying to initialize it. | 36 // for the this process, without actually trying to initialize it. |
37 // TODO(chcunningham): Delete this method. Users should just call Initialize | |
38 // blindly and let it bail if its already been done. | |
39 MEDIA_EXPORT bool IsMediaLibraryInitialized(); | 39 MEDIA_EXPORT bool IsMediaLibraryInitialized(); |
40 | 40 |
41 // Use this if you need to initialize CPU specific features WITHOUT loading | 41 // Use this if you need to initialize CPU specific features WITHOUT loading |
42 // DLLs, DSOs, etc. Only necessary if InitializeMediaLibrary() is not called; | 42 // DLLs, DSOs, etc. Only necessary if InitializeMediaLibrary() is not called; |
43 // does nothing if the media library has already been initialized. | 43 // does nothing if the media library has already been initialized. |
44 MEDIA_EXPORT void InitializeCPUSpecificMediaFeatures(); | 44 MEDIA_EXPORT void InitializeCPUSpecificMediaFeatures(); |
45 | 45 |
46 } // namespace media | 46 } // namespace media |
47 | 47 |
48 #endif // MEDIA_BASE_MEDIA_H_ | 48 #endif // MEDIA_BASE_MEDIA_H_ |
OLD | NEW |