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