1 // Copyright 2014 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.
5 #ifndef MEDIA_BASE_BROWSER_CDM_FACTORY_H_
6 #define MEDIA_BASE_BROWSER_CDM_FACTORY_H_
10 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "media/base/browser_cdm.h"
13 #include "media/base/media_export.h"
17 class MEDIA_EXPORT BrowserCdmFactory
{
19 BrowserCdmFactory() {}
20 virtual ~BrowserCdmFactory() {}
22 virtual scoped_ptr
<BrowserCdm
> CreateBrowserCdm(
23 const std::string
& key_system
,
24 const SessionMessageCB
& session_message_cb
,
25 const SessionClosedCB
& session_closed_cb
,
26 const SessionErrorCB
& session_error_cb
,
27 const SessionKeysChangeCB
& session_keys_change_cb
,
28 const SessionExpirationUpdateCB
& session_expiration_update_cb
) = 0;
31 DISALLOW_COPY_AND_ASSIGN(BrowserCdmFactory
);
34 // Provides a factory for creating BrowserCdm instances. There is only one
35 // BrowserCdmFactory per process.
36 void SetBrowserCdmFactory(BrowserCdmFactory
* factory
);
38 // Creates a BrowserCdm for |key_system|. Returns NULL if the CDM cannot be
40 // TODO(xhwang): Add ifdef for IPC based CDM.
41 scoped_ptr
<BrowserCdm
> MEDIA_EXPORT
42 CreateBrowserCdm(const std::string
& key_system
,
43 const SessionMessageCB
& session_message_cb
,
44 const SessionClosedCB
& session_closed_cb
,
45 const SessionErrorCB
& session_error_cb
,
46 const SessionKeysChangeCB
& session_keys_change_cb
,
47 const SessionExpirationUpdateCB
& session_expiration_update_cb
);
51 #endif // MEDIA_BASE_BROWSER_CDM_FACTORY_H_