| 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_DECRYPTOR_H_ | 5 #ifndef WEBKIT_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ |
| 6 #define WEBKIT_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ | 6 #define WEBKIT_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 virtual void AddKey(const std::string& key_system, | 36 virtual void AddKey(const std::string& key_system, |
| 37 const uint8* key, | 37 const uint8* key, |
| 38 int key_length, | 38 int key_length, |
| 39 const uint8* init_data, | 39 const uint8* init_data, |
| 40 int init_data_length, | 40 int init_data_length, |
| 41 const std::string& session_id) OVERRIDE; | 41 const std::string& session_id) OVERRIDE; |
| 42 virtual void CancelKeyRequest(const std::string& key_system, | 42 virtual void CancelKeyRequest(const std::string& key_system, |
| 43 const std::string& session_id) OVERRIDE; | 43 const std::string& session_id) OVERRIDE; |
| 44 virtual void Decrypt(const scoped_refptr<media::DecoderBuffer>& encrypted, | 44 virtual void Decrypt(const scoped_refptr<media::DecoderBuffer>& encrypted, |
| 45 const DecryptCB& decrypt_cb) OVERRIDE; | 45 const DecryptCB& decrypt_cb) OVERRIDE; |
| 46 virtual void Stop() OVERRIDE; |
| 46 | 47 |
| 47 private: | 48 private: |
| 48 // Callback for the plugin to hand back the decrypted data. | 49 // Callback for the plugin to hand back the decrypted data. |
| 49 void DataReady(const DecryptCB& decrypt_cb, const uint8* data, int data_size); | 50 void DataReady(const DecryptCB& decrypt_cb, const uint8* data, int data_size); |
| 50 | 51 |
| 51 // TODO(xhwang): Need to figure out how the CDM plugin fires key events | 52 // TODO(xhwang): Need to figure out how the CDM plugin fires key events |
| 52 // (e.g. KeyMessage). | 53 // (e.g. KeyMessage). |
| 53 media::DecryptorClient* client_; | 54 media::DecryptorClient* client_; |
| 54 scoped_refptr<webkit::ppapi::PluginInstance> cdm_plugin_; | 55 scoped_refptr<webkit::ppapi::PluginInstance> cdm_plugin_; |
| 55 | 56 |
| 56 DISALLOW_COPY_AND_ASSIGN(PpapiDecryptor); | 57 DISALLOW_COPY_AND_ASSIGN(PpapiDecryptor); |
| 57 }; | 58 }; |
| 58 | 59 |
| 59 } // namespace webkit_media | 60 } // namespace webkit_media |
| 60 | 61 |
| 61 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ | 62 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ |
| OLD | NEW |