| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ | 5 #ifndef WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ |
| 6 #define WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ | 6 #define WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // Clear key implementation of the cdm::ContentDecryptionModule interface. | 24 // Clear key implementation of the cdm::ContentDecryptionModule interface. |
| 25 class ClearKeyCdm : public cdm::ContentDecryptionModule { | 25 class ClearKeyCdm : public cdm::ContentDecryptionModule { |
| 26 public: | 26 public: |
| 27 ClearKeyCdm(); | 27 ClearKeyCdm(); |
| 28 virtual ~ClearKeyCdm(); | 28 virtual ~ClearKeyCdm(); |
| 29 | 29 |
| 30 // ContentDecryptionModule implementation. | 30 // ContentDecryptionModule implementation. |
| 31 virtual cdm::Status GenerateKeyRequest(const uint8_t* init_data, | 31 virtual cdm::Status GenerateKeyRequest(const uint8_t* init_data, |
| 32 int init_data_size, | 32 int init_data_size, |
| 33 cdm::KeyMessage* key_request) OVERRIDE; | 33 cdm::KeyMessage* key_request) OVERRIDE; |
| 34 | |
| 35 virtual cdm::Status AddKey(const char* session_id, | 34 virtual cdm::Status AddKey(const char* session_id, |
| 36 int session_id_size, | 35 int session_id_size, |
| 37 const uint8_t* key, | 36 const uint8_t* key, |
| 38 int key_size, | 37 int key_size, |
| 39 const uint8_t* key_id, | 38 const uint8_t* key_id, |
| 40 int key_id_size) OVERRIDE; | 39 int key_id_size) OVERRIDE; |
| 41 | |
| 42 virtual cdm::Status CancelKeyRequest(const char* session_id, | 40 virtual cdm::Status CancelKeyRequest(const char* session_id, |
| 43 int session_id_size) OVERRIDE; | 41 int session_id_size) OVERRIDE; |
| 44 | |
| 45 virtual cdm::Status Decrypt(const cdm::InputBuffer& encrypted_buffer, | 42 virtual cdm::Status Decrypt(const cdm::InputBuffer& encrypted_buffer, |
| 46 cdm::OutputBuffer* decrypted_buffer) OVERRIDE; | 43 cdm::OutputBuffer* decrypted_buffer) OVERRIDE; |
| 44 virtual cdm::Status InitializeVideoDecoder( |
| 45 const cdm::VideoDecoderConfig& video_decoder_config) OVERRIDE; |
| 46 virtual cdm::Status DecryptAndDecodeVideo( |
| 47 const cdm::InputBuffer& encrypted_buffer, |
| 48 cdm::VideoFrame* video_frame) OVERRIDE; |
| 49 virtual void ResetVideoDecoder() OVERRIDE; |
| 50 virtual void StopVideoDecoder() OVERRIDE; |
| 47 | 51 |
| 48 private: | 52 private: |
| 49 class Client : public media::DecryptorClient { | 53 class Client : public media::DecryptorClient { |
| 50 public: | 54 public: |
| 51 enum Status { | 55 enum Status { |
| 52 kKeyAdded, | 56 kKeyAdded, |
| 53 kKeyError, | 57 kKeyError, |
| 54 kKeyMessage, | 58 kKeyMessage, |
| 55 kNeedKey | 59 kNeedKey |
| 56 }; | 60 }; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 Client client_; | 99 Client client_; |
| 96 media::AesDecryptor decryptor_; | 100 media::AesDecryptor decryptor_; |
| 97 // Protects the |client_| from being accessed by the |decryptor_| | 101 // Protects the |client_| from being accessed by the |decryptor_| |
| 98 // simultaneously. | 102 // simultaneously. |
| 99 base::Lock client_lock_; | 103 base::Lock client_lock_; |
| 100 }; | 104 }; |
| 101 | 105 |
| 102 } // namespace webkit_media | 106 } // namespace webkit_media |
| 103 | 107 |
| 104 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ | 108 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ |
| OLD | NEW |