Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(480)

Unified Diff: media/base/android/media_client_android.h

Issue 962793005: Adds MediaClientAndroid to support embedder/MediaDrmBridge interaction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/base/android/media_client_android.h
diff --git a/media/base/android/media_client_android.h b/media/base/android/media_client_android.h
new file mode 100644
index 0000000000000000000000000000000000000000..393332b5f357cabebfc3885c8d7566d7b585737e
--- /dev/null
+++ b/media/base/android/media_client_android.h
@@ -0,0 +1,58 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_BASE_ANDROID_MEDIA_CLIENT_ANDROID_H_
+#define MEDIA_BASE_ANDROID_MEDIA_CLIENT_ANDROID_H_
+
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "base/containers/hash_tables.h"
+#include "base/macros.h"
+#include "media/base/media_export.h"
+
+namespace media {
+
+class MediaClientAndroid;
+class MediaDrmBridgeDelegate;
+
+// Setter for MediaClientAndroid. This should be called early in embedder
+// lifecycle, before any media playback could occur.
+MEDIA_EXPORT void SetMediaClientAndroid(MediaClientAndroid* media_client);
+
+#if defined(MEDIA_IMPLEMENTATION)
+// Getter for the client. Returns nullptr if no customized client is needed.
+MediaClientAndroid* GetMediaClientAndroid();
+#endif
+
+using UUID = std::vector<uint8_t>;
+
+// A client interface for embedders (e.g. content/browser) to provide customized
+// additions to Android's browser-side media handling.
+class MEDIA_EXPORT MediaClientAndroid {
+ public:
+ MediaClientAndroid();
+ virtual ~MediaClientAndroid();
+
+ // Returns extra mappings from key-system name to Android UUID.
+ const base::hash_map<std::string, UUID>& GetKeySystemUUIDMappings() const;
+
+ // 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.
+ virtual media::MediaDrmBridgeDelegate* GetMediaDrmBridgeDelegate(
+ const UUID& scheme_uuid) const;
+
+ protected:
+ void AddKeySystemUUIDMapping(const std::string& key_system,
+ const UUID& scheme_uuid);
+
+ private:
+ 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
+
+ DISALLOW_COPY_AND_ASSIGN(MediaClientAndroid);
+};
+
+} // namespace media
+
+#endif // MEDIA_BASE_ANDROID_MEDIA_CLIENT_ANDROID_H_

Powered by Google App Engine
This is Rietveld 408576698