OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CHROMECAST_PUBLIC_CAST_MEDIA_SHLIB_H_ | 5 #ifndef CHROMECAST_PUBLIC_CAST_MEDIA_SHLIB_H_ |
6 #define CHROMECAST_PUBLIC_CAST_MEDIA_SHLIB_H_ | 6 #define CHROMECAST_PUBLIC_CAST_MEDIA_SHLIB_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "chromecast_export.h" | 11 #include "chromecast_export.h" |
12 | 12 |
13 namespace chromecast { | 13 namespace chromecast { |
14 namespace media { | 14 namespace media { |
15 | 15 |
| 16 // Provides access to platform-specific media systems and hardware resources. |
| 17 // In cast_shell, all usage is from the browser process. An implementation is |
| 18 // assumed to be in an uninitialized state initially. When uninitialized, no |
| 19 // API calls will be made except for Initialize, which brings the implementation |
| 20 // into an initialized state. A call to Finalize returns the implementation to |
| 21 // its uninitialized state. The implementation must support multiple |
| 22 // transitions between these states, to support resource grant/revoke events and |
| 23 // also to allow multiple unit tests to bring up the media systems in isolation |
| 24 // from other tests. |
16 class CHROMECAST_EXPORT CastMediaShlib { | 25 class CHROMECAST_EXPORT CastMediaShlib { |
17 public: | 26 public: |
18 // Performs platform-specific one-time initialization for media systems and | 27 // Initializes platform-specific media systems. Only called when in an |
19 // hardware resources. Called at startup in browser process before main | 28 // uninitialized state. |
20 // message loop begins. | |
21 static void Initialize(const std::vector<std::string>& argv); | 29 static void Initialize(const std::vector<std::string>& argv); |
22 | 30 |
23 // Performs platform-specific one-time teardown of media systems and hardware | 31 // Tears down platform-specific media systems and returns to the uninitialized |
24 // resources. Called at browser process exit. | 32 // state. The implementation must release all media-related hardware |
| 33 // resources. |
25 static void Finalize(); | 34 static void Finalize(); |
26 }; | 35 }; |
27 | 36 |
28 } // namespace media | 37 } // namespace media |
29 } // namespace chromecast | 38 } // namespace chromecast |
30 | 39 |
31 #endif // CHROMECAST_PUBLIC_CAST_MEDIA_SHLIB_H_ | 40 #endif // CHROMECAST_PUBLIC_CAST_MEDIA_SHLIB_H_ |
OLD | NEW |