summaryrefslogtreecommitdiffstats
path: root/media/base/browser_cdm_factory.h
diff options
context:
space:
mode:
authorxhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-03 11:55:07 +0000
committerxhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-03 11:55:07 +0000
commit9a647fd42ca24401edcdfaa0029faaf16f84189a (patch)
tree0dd47bd1d3694d60f81df00f0830689fd1dfa120 /media/base/browser_cdm_factory.h
parentbf10dc22fe95c6c7c8f58412ed030ec7a277ff8d (diff)
downloadchromium_src-9a647fd42ca24401edcdfaa0029faaf16f84189a.zip
chromium_src-9a647fd42ca24401edcdfaa0029faaf16f84189a.tar.gz
chromium_src-9a647fd42ca24401edcdfaa0029faaf16f84189a.tar.bz2
Add PlayerTracker and BrowserCdm interfaces.
- PlayerTracker interface can be used by any CDM that needs to track media players. It can notify media players of new abailable key (to resume playback) or the destruction of the CDM. - PlayerTrackerImpl is a simple implementation of PlayerTracker that can help any CDM to implement PlayerTracker interface. - BrowserCdm is a common CDM interface for browser side CDMs. - CdmFactory is renamed to BrowserCdmFactory. - Now BrowserMediaPlayer only needs to call SetCdm() on the player and do not need to track CDM <-> player mapping. TBR=damienv@chromium.org BUG=373327 TEST=Existing test pages still work. Review URL: https://codereview.chromium.org/308073004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274470 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/browser_cdm_factory.h')
-rw-r--r--media/base/browser_cdm_factory.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/media/base/browser_cdm_factory.h b/media/base/browser_cdm_factory.h
new file mode 100644
index 0000000..4e86c8b
--- /dev/null
+++ b/media/base/browser_cdm_factory.h
@@ -0,0 +1,31 @@
+// Copyright 2014 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_BROWSER_CDM_FACTORY_H_
+#define MEDIA_BASE_BROWSER_CDM_FACTORY_H_
+
+#include <string>
+
+#include "base/memory/scoped_ptr.h"
+#include "media/base/media_export.h"
+#include "media/base/media_keys.h"
+
+namespace media {
+
+class BrowserCdm;
+
+// Creates a BrowserCdm for |key_system|. Returns NULL if the CDM cannot be
+// created.
+// TODO(xhwang): Add ifdef for IPC based CDM.
+scoped_ptr<BrowserCdm> MEDIA_EXPORT
+ CreateBrowserCdm(const std::string& key_system,
+ const SessionCreatedCB& session_created_cb,
+ const SessionMessageCB& session_message_cb,
+ const SessionReadyCB& session_ready_cb,
+ const SessionClosedCB& session_closed_cb,
+ const SessionErrorCB& session_error_cb);
+
+} // namespace media
+
+#endif // MEDIA_BASE_BROWSER_CDM_FACTORY_H_