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_CLIENT_ANDROID_H_ |
6 #define MEDIA_BASE_ANDROID_MEDIA_CLIENT_ANDROID_H_ | 6 #define MEDIA_BASE_ANDROID_MEDIA_CLIENT_ANDROID_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/scoped_ptr.h" | |
14 #include "media/base/media_export.h" | 15 #include "media/base/media_export.h" |
15 | 16 |
16 namespace media { | 17 namespace media { |
17 | 18 |
18 class MediaClientAndroid; | 19 class MediaClientAndroid; |
19 class MediaDrmBridgeDelegate; | 20 class MediaDrmBridgeDelegate; |
21 class ProvisionFetcher; | |
20 | 22 |
21 // Setter for MediaClientAndroid. This should be called early in embedder | 23 // Setter for MediaClientAndroid. This should be called early in embedder |
22 // lifecycle, before any media playback could occur. | 24 // lifecycle, before any media playback could occur. |
23 MEDIA_EXPORT void SetMediaClientAndroid(MediaClientAndroid* media_client); | 25 MEDIA_EXPORT void SetMediaClientAndroid(MediaClientAndroid* media_client); |
24 | 26 |
25 #if defined(MEDIA_IMPLEMENTATION) | 27 #if defined(MEDIA_IMPLEMENTATION) |
26 // Getter for the client. Returns nullptr if no customized client is needed. | 28 // Getter for the client. Returns nullptr if no customized client is needed. |
27 MediaClientAndroid* GetMediaClientAndroid(); | 29 MediaClientAndroid* GetMediaClientAndroid(); |
28 #endif | 30 #endif |
29 | 31 |
30 using UUID = std::vector<uint8_t>; | 32 using UUID = std::vector<uint8_t>; |
31 | 33 |
32 // A client interface for embedders (e.g. content/browser) to provide customized | 34 // A client interface for embedders (e.g. content/browser) to provide customized |
33 // additions to Android's browser-side media handling. | 35 // additions to Android's browser-side media handling. |
34 class MEDIA_EXPORT MediaClientAndroid { | 36 class MEDIA_EXPORT MediaClientAndroid { |
35 public: | 37 public: |
36 typedef base::hash_map<std::string, UUID> KeySystemUuidMap; | 38 typedef base::hash_map<std::string, UUID> KeySystemUuidMap; |
37 | 39 |
38 MediaClientAndroid(); | 40 MediaClientAndroid(); |
39 virtual ~MediaClientAndroid(); | 41 virtual ~MediaClientAndroid(); |
40 | 42 |
43 // Create ProvisionFetcher object that obtains provisioning data over HTTP. | |
44 // Gets the URL context corresponding to the default user profile. | |
45 virtual scoped_ptr<ProvisionFetcher> CreateDefaultFetcher() const; | |
xhwang
2015/11/06 23:08:19
See comment above. If we move the ResetCredentialM
Tima Vaisburd
2015/11/11 03:03:34
Removed this stuff from MediaClientAndroid and sub
| |
46 | |
41 // Adds extra mappings from key-system name to Android UUID into |map|. | 47 // Adds extra mappings from key-system name to Android UUID into |map|. |
42 virtual void AddKeySystemUUIDMappings(KeySystemUuidMap* map); | 48 virtual void AddKeySystemUUIDMappings(KeySystemUuidMap* map); |
43 | 49 |
44 // Returns a MediaDrmBridgeDelegate that corresponds to |scheme_uuid|. | 50 // Returns a MediaDrmBridgeDelegate that corresponds to |scheme_uuid|. |
45 // MediaClientAndroid retains ownership. | 51 // MediaClientAndroid retains ownership. |
46 virtual media::MediaDrmBridgeDelegate* GetMediaDrmBridgeDelegate( | 52 virtual media::MediaDrmBridgeDelegate* GetMediaDrmBridgeDelegate( |
47 const UUID& scheme_uuid); | 53 const UUID& scheme_uuid); |
48 | 54 |
49 private: | 55 private: |
50 friend class KeySystemManager; | 56 friend class KeySystemManager; |
51 | 57 |
52 base::hash_map<std::string, UUID> key_system_uuid_map_; | 58 base::hash_map<std::string, UUID> key_system_uuid_map_; |
53 | 59 |
54 DISALLOW_COPY_AND_ASSIGN(MediaClientAndroid); | 60 DISALLOW_COPY_AND_ASSIGN(MediaClientAndroid); |
55 }; | 61 }; |
56 | 62 |
57 } // namespace media | 63 } // namespace media |
58 | 64 |
59 #endif // MEDIA_BASE_ANDROID_MEDIA_CLIENT_ANDROID_H_ | 65 #endif // MEDIA_BASE_ANDROID_MEDIA_CLIENT_ANDROID_H_ |
OLD | NEW |