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 MEDIA_BASE_ANDROID_MEDIA_CLIENT_ANDROID_H_ | 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_DRM_BRIDGE_CLIENT_H_ |
6 #define MEDIA_BASE_ANDROID_MEDIA_CLIENT_ANDROID_H_ | 6 #define MEDIA_BASE_ANDROID_MEDIA_DRM_BRIDGE_CLIENT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <utility> | 11 #include <utility> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/containers/hash_tables.h" | 14 #include "base/containers/hash_tables.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "media/base/media_export.h" | 16 #include "media/base/media_export.h" |
17 | 17 |
18 namespace media { | 18 namespace media { |
19 | 19 |
20 class MediaClientAndroid; | 20 class MediaDrmBridgeClient; |
21 class MediaDrmBridgeDelegate; | 21 class MediaDrmBridgeDelegate; |
22 | 22 |
23 // Setter for MediaClientAndroid. This should be called in all processes where | 23 // Setter for MediaDrmBridgeClient. This should be called in all processes |
24 // we want to run media Android code. Also it should be called before any media | 24 // where we want to run media Android code. Also it should be called before any |
25 // playback could occur. | 25 // media playback could occur. |
26 MEDIA_EXPORT void SetMediaClientAndroid(MediaClientAndroid* media_client); | 26 MEDIA_EXPORT void SetMediaDrmBridgeClient(MediaDrmBridgeClient* media_client); |
27 | 27 |
28 #if defined(MEDIA_IMPLEMENTATION) | 28 #if defined(MEDIA_IMPLEMENTATION) |
29 // Getter for the client. Returns nullptr if no customized client is needed. | 29 // Getter for the client. Returns nullptr if no customized client is needed. |
30 MediaClientAndroid* GetMediaClientAndroid(); | 30 MediaDrmBridgeClient* GetMediaDrmBridgeClient(); |
31 #endif | 31 #endif |
32 | 32 |
33 using UUID = std::vector<uint8_t>; | 33 using UUID = std::vector<uint8_t>; |
34 | 34 |
35 // A client interface for embedders (e.g. content/browser or content/gpu) to | 35 // A client interface for embedders (e.g. content/browser or content/gpu) to |
36 // provide customized additions to Android's media handling. | 36 // provide customized additions to Android's media handling. |
37 class MEDIA_EXPORT MediaClientAndroid { | 37 class MEDIA_EXPORT MediaDrmBridgeClient { |
38 public: | 38 public: |
39 typedef base::hash_map<std::string, UUID> KeySystemUuidMap; | 39 typedef base::hash_map<std::string, UUID> KeySystemUuidMap; |
40 | 40 |
41 MediaClientAndroid(); | 41 MediaDrmBridgeClient(); |
42 virtual ~MediaClientAndroid(); | 42 virtual ~MediaDrmBridgeClient(); |
43 | 43 |
44 // Adds extra mappings from key-system name to Android UUID into |map|. | 44 // Adds extra mappings from key-system name to Android UUID into |map|. |
45 virtual void AddKeySystemUUIDMappings(KeySystemUuidMap* map); | 45 virtual void AddKeySystemUUIDMappings(KeySystemUuidMap* map); |
46 | 46 |
47 // Returns a MediaDrmBridgeDelegate that corresponds to |scheme_uuid|. | 47 // Returns a MediaDrmBridgeDelegate that corresponds to |scheme_uuid|. |
48 // MediaClientAndroid retains ownership. | 48 // MediaDrmBridgeClient retains ownership. |
49 virtual media::MediaDrmBridgeDelegate* GetMediaDrmBridgeDelegate( | 49 virtual media::MediaDrmBridgeDelegate* GetMediaDrmBridgeDelegate( |
50 const UUID& scheme_uuid); | 50 const UUID& scheme_uuid); |
51 | 51 |
52 private: | 52 private: |
53 friend class KeySystemManager; | 53 friend class KeySystemManager; |
54 | 54 |
55 DISALLOW_COPY_AND_ASSIGN(MediaClientAndroid); | 55 DISALLOW_COPY_AND_ASSIGN(MediaDrmBridgeClient); |
56 }; | 56 }; |
57 | 57 |
58 } // namespace media | 58 } // namespace media |
59 | 59 |
60 #endif // MEDIA_BASE_ANDROID_MEDIA_CLIENT_ANDROID_H_ | 60 #endif // MEDIA_BASE_ANDROID_MEDIA_DRM_BRIDGE_CLIENT_H_ |
OLD | NEW |