OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #ifndef MEDIA_BASE_BROWSER_CDM_FACTORY_H_ | |
6 #define MEDIA_BASE_BROWSER_CDM_FACTORY_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/macros.h" | |
11 #include "base/memory/ref_counted.h" | |
12 #include "media/base/media_export.h" | |
13 #include "media/base/media_keys.h" | |
14 | |
15 namespace media { | |
16 | |
17 // TODO(xhwang): Merge this with media::CdmFactory. | |
18 class MEDIA_EXPORT BrowserCdmFactory { | |
19 public: | |
20 BrowserCdmFactory() {} | |
21 virtual ~BrowserCdmFactory() {} | |
22 | |
23 virtual scoped_refptr<MediaKeys> CreateBrowserCdm( | |
24 const std::string& key_system, | |
25 bool use_hw_secure_codecs, | |
26 const SessionMessageCB& session_message_cb, | |
27 const SessionClosedCB& session_closed_cb, | |
28 const LegacySessionErrorCB& legacy_session_error_cb, | |
29 const SessionKeysChangeCB& session_keys_change_cb, | |
30 const SessionExpirationUpdateCB& session_expiration_update_cb) = 0; | |
31 | |
32 private: | |
33 DISALLOW_COPY_AND_ASSIGN(BrowserCdmFactory); | |
34 }; | |
35 | |
36 // Provides a factory for creating BrowserCdm instances. There is only one | |
37 // BrowserCdmFactory per process. | |
38 void SetBrowserCdmFactory(BrowserCdmFactory* factory); | |
39 | |
40 // Creates a MediaKeys for |key_system|. Returns NULL if the CDM cannot be | |
41 // created. | |
42 // |use_hw_secure_codecs| indicates that the CDM should be configured to use | |
43 // hardware-secure codecs (for platforms that support it). | |
44 // TODO(xhwang): Add ifdef for IPC based CDM. | |
45 scoped_refptr<MediaKeys> MEDIA_EXPORT | |
46 CreateBrowserCdm(const std::string& key_system, | |
47 bool use_hw_secure_codecs, | |
48 const SessionMessageCB& session_message_cb, | |
49 const SessionClosedCB& session_closed_cb, | |
50 const LegacySessionErrorCB& legacy_session_error_cb, | |
51 const SessionKeysChangeCB& session_keys_change_cb, | |
52 const SessionExpirationUpdateCB& session_expiration_update_cb); | |
53 | |
54 } // namespace media | |
55 | |
56 #endif // MEDIA_BASE_BROWSER_CDM_FACTORY_H_ | |
OLD | NEW |