roll skia to 4057
[chromium-blink-merge.git] / media / base / media.h
blob2c8b76517fec01e3ed183b7f37f2e2c11c18449d
1 // Copyright (c) 2011 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.
5 // Contains code that should be used for initializing, or querying the state
6 // of the media library as a whole.
8 #ifndef MEDIA_BASE_MEDIA_H_
9 #define MEDIA_BASE_MEDIA_H_
11 #include "media/base/media_export.h"
13 class FilePath;
15 namespace media {
17 // Attempts to initialize the media library (loading DLLs, DSOs, etc.).
19 // If |module_dir| is the emptry string, then the system default library paths
20 // are searched for the dynamic libraries. If a |module_dir| is provided, then
21 // only the specified |module_dir| will be searched for the dynamic libraries.
23 // If multiple initializations are attempted with different |module_dir|s
24 // specified then the first one to succeed remains effective for the lifetime
25 // of the process.
27 // Returns true if everything was successfully initialized, false otherwise.
28 MEDIA_EXPORT bool InitializeMediaLibrary(const FilePath& module_dir);
30 // Helper function for unit tests to avoid boiler plate code everywhere. This
31 // function will crash if it fails to load the media library. This ensures tests
32 // fail if the media library is not available.
33 MEDIA_EXPORT void InitializeMediaLibraryForTesting();
35 // Use this if you need to check whether the media library is initialized
36 // for the this process, without actually trying to initialize it.
37 MEDIA_EXPORT bool IsMediaLibraryInitialized();
39 // Attempts to initialize OpenMAX library.
41 // Returns true if OpenMAX was successfully initialized and loaded.
42 bool InitializeOpenMaxLibrary(const FilePath& module_dir);
44 } // namespace media
46 #endif // MEDIA_BASE_MEDIA_H_