| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 namespace media { | 25 namespace media { |
| 26 class FileIOTestRunner; | 26 class FileIOTestRunner; |
| 27 class CdmVideoDecoder; | 27 class CdmVideoDecoder; |
| 28 class DecoderBuffer; | 28 class DecoderBuffer; |
| 29 class FFmpegCdmAudioDecoder; | 29 class FFmpegCdmAudioDecoder; |
| 30 | 30 |
| 31 // Clear key implementation of the cdm::ContentDecryptionModule interface. | 31 // Clear key implementation of the cdm::ContentDecryptionModule interface. |
| 32 class ClearKeyCdm : public ClearKeyCdmInterface { | 32 class ClearKeyCdm : public ClearKeyCdmInterface { |
| 33 public: | 33 public: |
| 34 ClearKeyCdm(Host* host, const std::string& key_system); | 34 ClearKeyCdm(Host* host, const std::string& key_system); |
| 35 virtual ~ClearKeyCdm(); | 35 ~ClearKeyCdm() override; |
| 36 | 36 |
| 37 // ContentDecryptionModule implementation. | 37 // ContentDecryptionModule implementation. |
| 38 virtual void CreateSessionAndGenerateRequest(uint32 promise_id, | 38 void Initialize(bool allow_distinctive_identifier, |
| 39 cdm::SessionType session_type, | 39 bool allow_persistent_state) override; |
| 40 const char* init_data_type, | 40 void CreateSessionAndGenerateRequest(uint32 promise_id, |
| 41 uint32 init_data_type_size, | 41 cdm::SessionType session_type, |
| 42 const uint8* init_data, | 42 cdm::InitDataType init_data_type, |
| 43 uint32 init_data_size) override; | 43 const uint8* init_data, |
| 44 virtual void LoadSession(uint32 promise_id, | 44 uint32 init_data_size) override; |
| 45 cdm::SessionType session_type, | 45 void LoadSession(uint32 promise_id, |
| 46 const char* session_id, | 46 cdm::SessionType session_type, |
| 47 uint32_t session_id_length) override; | 47 const char* session_id, |
| 48 virtual void UpdateSession(uint32 promise_id, | 48 uint32_t session_id_length) override; |
| 49 const char* session_id, | 49 void UpdateSession(uint32 promise_id, |
| 50 uint32_t session_id_length, | 50 const char* session_id, |
| 51 const uint8* response, | 51 uint32_t session_id_length, |
| 52 uint32 response_size) override; | 52 const uint8* response, |
| 53 virtual void CloseSession(uint32 promise_id, | 53 uint32 response_size) override; |
| 54 const char* session_id, | 54 void CloseSession(uint32 promise_id, |
| 55 uint32_t session_id_length) override; | 55 const char* session_id, |
| 56 virtual void RemoveSession(uint32 promise_id, | 56 uint32_t session_id_length) override; |
| 57 const char* session_id, | 57 void RemoveSession(uint32 promise_id, |
| 58 uint32_t session_id_length) override; | 58 const char* session_id, |
| 59 virtual void SetServerCertificate( | 59 uint32_t session_id_length) override; |
| 60 uint32 promise_id, | 60 void SetServerCertificate(uint32 promise_id, |
| 61 const uint8_t* server_certificate_data, | 61 const uint8_t* server_certificate_data, |
| 62 uint32_t server_certificate_data_size) override; | 62 uint32_t server_certificate_data_size) override; |
| 63 virtual void TimerExpired(void* context) override; | 63 void TimerExpired(void* context) override; |
| 64 virtual cdm::Status Decrypt(const cdm::InputBuffer& encrypted_buffer, | 64 cdm::Status Decrypt(const cdm::InputBuffer& encrypted_buffer, |
| 65 cdm::DecryptedBlock* decrypted_block) override; | 65 cdm::DecryptedBlock* decrypted_block) override; |
| 66 virtual cdm::Status InitializeAudioDecoder( | 66 cdm::Status InitializeAudioDecoder( |
| 67 const cdm::AudioDecoderConfig& audio_decoder_config) override; | 67 const cdm::AudioDecoderConfig& audio_decoder_config) override; |
| 68 virtual cdm::Status InitializeVideoDecoder( | 68 cdm::Status InitializeVideoDecoder( |
| 69 const cdm::VideoDecoderConfig& video_decoder_config) override; | 69 const cdm::VideoDecoderConfig& video_decoder_config) override; |
| 70 virtual void DeinitializeDecoder(cdm::StreamType decoder_type) override; | 70 void DeinitializeDecoder(cdm::StreamType decoder_type) override; |
| 71 virtual void ResetDecoder(cdm::StreamType decoder_type) override; | 71 void ResetDecoder(cdm::StreamType decoder_type) override; |
| 72 virtual cdm::Status DecryptAndDecodeFrame( | 72 cdm::Status DecryptAndDecodeFrame(const cdm::InputBuffer& encrypted_buffer, |
| 73 const cdm::InputBuffer& encrypted_buffer, | 73 cdm::VideoFrame* video_frame) override; |
| 74 cdm::VideoFrame* video_frame) override; | 74 cdm::Status DecryptAndDecodeSamples(const cdm::InputBuffer& encrypted_buffer, |
| 75 virtual cdm::Status DecryptAndDecodeSamples( | 75 cdm::AudioFrames* audio_frames) override; |
| 76 const cdm::InputBuffer& encrypted_buffer, | 76 void Destroy() override; |
| 77 cdm::AudioFrames* audio_frames) override; | 77 void OnPlatformChallengeResponse( |
| 78 virtual void Destroy() override; | |
| 79 virtual void OnPlatformChallengeResponse( | |
| 80 const cdm::PlatformChallengeResponse& response) override; | 78 const cdm::PlatformChallengeResponse& response) override; |
| 81 virtual void OnQueryOutputProtectionStatus( | 79 void OnQueryOutputProtectionStatus(cdm::QueryResult result, |
| 82 cdm::QueryResult result, | 80 uint32_t link_mask, |
| 83 uint32_t link_mask, | 81 uint32_t output_protection_mask) override; |
| 84 uint32_t output_protection_mask) override; | |
| 85 | 82 |
| 86 private: | 83 private: |
| 87 // Emulates a session stored for |session_id_for_emulated_loadsession_|. This | 84 // Emulates a session stored for |session_id_for_emulated_loadsession_|. This |
| 88 // is necessary since aes_decryptor.cc does not support storing sessions. | 85 // is necessary since aes_decryptor.cc does not support storing sessions. |
| 89 void LoadLoadableSession(); | 86 void LoadLoadableSession(); |
| 90 void OnLoadSessionUpdated(); | 87 void OnLoadSessionUpdated(); |
| 91 | 88 |
| 92 // ContentDecryptionModule callbacks. | 89 // ContentDecryptionModule callbacks. |
| 93 void OnSessionMessage(const std::string& session_id, | 90 void OnSessionMessage(const std::string& session_id, |
| 94 MediaKeys::MessageType message_type, | 91 MediaKeys::MessageType message_type, |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 scoped_ptr<CdmVideoDecoder> video_decoder_; | 203 scoped_ptr<CdmVideoDecoder> video_decoder_; |
| 207 | 204 |
| 208 scoped_ptr<FileIOTestRunner> file_io_test_runner_; | 205 scoped_ptr<FileIOTestRunner> file_io_test_runner_; |
| 209 | 206 |
| 210 DISALLOW_COPY_AND_ASSIGN(ClearKeyCdm); | 207 DISALLOW_COPY_AND_ASSIGN(ClearKeyCdm); |
| 211 }; | 208 }; |
| 212 | 209 |
| 213 } // namespace media | 210 } // namespace media |
| 214 | 211 |
| 215 #endif // MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ | 212 #endif // MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ |
| OLD | NEW |