| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ | 5 #ifndef MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ |
| 6 #define MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ | 6 #define MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 class CdmVideoDecoder; | 33 class CdmVideoDecoder; |
| 34 class DecoderBuffer; | 34 class DecoderBuffer; |
| 35 class FFmpegCdmAudioDecoder; | 35 class FFmpegCdmAudioDecoder; |
| 36 | 36 |
| 37 // Clear key implementation of the cdm::ContentDecryptionModule interface. | 37 // Clear key implementation of the cdm::ContentDecryptionModule interface. |
| 38 class ClearKeyCdm : public ClearKeyCdmInterface { | 38 class ClearKeyCdm : public ClearKeyCdmInterface { |
| 39 public: | 39 public: |
| 40 ClearKeyCdm(Host* host, const std::string& key_system, const GURL& origin); | 40 ClearKeyCdm(Host* host, const std::string& key_system, const GURL& origin); |
| 41 ~ClearKeyCdm() override; | 41 ~ClearKeyCdm() override; |
| 42 | 42 |
| 43 // ContentDecryptionModule implementation. | 43 // ClearKeyCdmInterface implementation. |
| 44 void Initialize(bool allow_distinctive_identifier, | 44 void Initialize(bool allow_distinctive_identifier, |
| 45 bool allow_persistent_state) override; | 45 bool allow_persistent_state) override; |
| 46 void CreateSessionAndGenerateRequest(uint32_t promise_id, | 46 void CreateSessionAndGenerateRequest(uint32_t promise_id, |
| 47 cdm::SessionType session_type, | 47 cdm::SessionType session_type, |
| 48 cdm::InitDataType init_data_type, | 48 cdm::InitDataType init_data_type, |
| 49 const uint8_t* init_data, | 49 const uint8_t* init_data, |
| 50 uint32_t init_data_size) override; | 50 uint32_t init_data_size) override; |
| 51 void LoadSession(uint32_t promise_id, | 51 void LoadSession(uint32_t promise_id, |
| 52 cdm::SessionType session_type, | 52 cdm::SessionType session_type, |
| 53 const char* session_id, | 53 const char* session_id, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 uint32_t output_protection_mask) override; | 87 uint32_t output_protection_mask) override; |
| 88 | 88 |
| 89 private: | 89 private: |
| 90 // Emulates a session stored for |session_id_for_emulated_loadsession_|. This | 90 // Emulates a session stored for |session_id_for_emulated_loadsession_|. This |
| 91 // is necessary since aes_decryptor.cc does not support storing sessions. | 91 // is necessary since aes_decryptor.cc does not support storing sessions. |
| 92 void LoadLoadableSession(); | 92 void LoadLoadableSession(); |
| 93 void OnLoadSessionUpdated(); | 93 void OnLoadSessionUpdated(); |
| 94 | 94 |
| 95 // ContentDecryptionModule callbacks. | 95 // ContentDecryptionModule callbacks. |
| 96 void OnSessionMessage(const std::string& session_id, | 96 void OnSessionMessage(const std::string& session_id, |
| 97 MediaKeys::MessageType message_type, | 97 ContentDecryptionModule::MessageType message_type, |
| 98 const std::vector<uint8_t>& message); | 98 const std::vector<uint8_t>& message); |
| 99 void OnSessionKeysChange(const std::string& session_id, | 99 void OnSessionKeysChange(const std::string& session_id, |
| 100 bool has_additional_usable_key, | 100 bool has_additional_usable_key, |
| 101 CdmKeysInfo keys_info); | 101 CdmKeysInfo keys_info); |
| 102 void OnSessionClosed(const std::string& session_id); | 102 void OnSessionClosed(const std::string& session_id); |
| 103 | 103 |
| 104 // Handle the success/failure of a promise. These methods are responsible for | 104 // Handle the success/failure of a promise. These methods are responsible for |
| 105 // calling |host_| to resolve or reject the promise. | 105 // calling |host_| to resolve or reject the promise. |
| 106 void OnSessionCreated(uint32_t promise_id, const std::string& session_id); | 106 void OnSessionCreated(uint32_t promise_id, const std::string& session_id); |
| 107 void OnSessionLoaded(uint32_t promise_id, const std::string& session_id); | 107 void OnSessionLoaded(uint32_t promise_id, const std::string& session_id); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 | 216 |
| 217 bool is_running_output_protection_test_; | 217 bool is_running_output_protection_test_; |
| 218 bool is_running_platform_verification_test_; | 218 bool is_running_platform_verification_test_; |
| 219 | 219 |
| 220 DISALLOW_COPY_AND_ASSIGN(ClearKeyCdm); | 220 DISALLOW_COPY_AND_ASSIGN(ClearKeyCdm); |
| 221 }; | 221 }; |
| 222 | 222 |
| 223 } // namespace media | 223 } // namespace media |
| 224 | 224 |
| 225 #endif // MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ | 225 #endif // MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ |
| OLD | NEW |