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