Chromium Code Reviews| 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 <string> | |
| 9 #include <utility> | |
| 10 #include <vector> | |
| 11 | |
| 12 #include "base/containers/hash_tables.h" | |
| 13 #include "base/macros.h" | |
| 14 #include "media/base/media_export.h" | |
| 15 | |
| 16 namespace media { | |
| 17 | |
| 18 class MediaClientAndroid; | |
| 19 class MediaDrmBridgeDelegate; | |
| 20 | |
| 21 // Setter for MediaClientAndroid. This should be called early in embedder | |
| 22 // lifecycle, before any media playback could occur. | |
| 23 MEDIA_EXPORT void SetMediaClientAndroid(MediaClientAndroid* media_client); | |
| 24 | |
| 25 #if defined(MEDIA_IMPLEMENTATION) | |
| 26 // Getter for the client. Returns nullptr if no customized client is needed. | |
| 27 MediaClientAndroid* GetMediaClientAndroid(); | |
| 28 #endif | |
| 29 | |
| 30 using UUID = std::vector<uint8_t>; | |
| 31 | |
| 32 // A client interface for embedders (e.g. content/browser) to provide customized | |
| 33 // additions to Android's browser-side media handling. | |
| 34 class MEDIA_EXPORT MediaClientAndroid { | |
| 35 public: | |
| 36 MediaClientAndroid(); | |
| 37 virtual ~MediaClientAndroid(); | |
| 38 | |
| 39 // Returns extra mappings from key-system name to Android UUID. | |
| 40 const base::hash_map<std::string, UUID>& GetKeySystemUUIDMappings() const; | |
| 41 | |
| 42 // Returns a MediaDrmBridgeDelegate that corresponds to |scheme_uuid|. | |
|
xhwang
2015/04/28 05:25:11
Document about the ownership of the returned objec
gunsch
2015/04/28 18:50:51
Done.
| |
| 43 virtual media::MediaDrmBridgeDelegate* GetMediaDrmBridgeDelegate( | |
| 44 const UUID& scheme_uuid) const; | |
| 45 | |
| 46 protected: | |
| 47 void AddKeySystemUUIDMapping(const std::string& key_system, | |
| 48 const UUID& scheme_uuid); | |
| 49 | |
| 50 private: | |
| 51 base::hash_map<std::string, UUID> key_system_uuid_map_; | |
|
xhwang
2015/04/28 05:25:11
In MediaDrmBridge we have [1]:
typedef base::hash
| |
| 52 | |
| 53 DISALLOW_COPY_AND_ASSIGN(MediaClientAndroid); | |
| 54 }; | |
| 55 | |
| 56 } // namespace media | |
| 57 | |
| 58 #endif // MEDIA_BASE_ANDROID_MEDIA_CLIENT_ANDROID_H_ | |
| OLD | NEW |