OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WEBKIT_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ |
| 6 #define WEBKIT_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ |
| 7 |
| 8 #include "base/memory/ref_counted.h" |
| 9 #include "media/base/decryptor.h" |
| 10 #include "webkit/media/crypto/key_systems.h" |
| 11 |
| 12 namespace media { |
| 13 class DecryptorClient; |
| 14 } |
| 15 |
| 16 namespace webkit { |
| 17 namespace ppapi { |
| 18 class PluginInstance; |
| 19 } |
| 20 } |
| 21 |
| 22 namespace webkit_media { |
| 23 |
| 24 class PpapiDecryptor : public media::Decryptor { |
| 25 public: |
| 26 PpapiDecryptor(media::DecryptorClient* client, |
| 27 const CreatePluginCB& create_plugin_cb); |
| 28 virtual ~PpapiDecryptor(); |
| 29 |
| 30 // media::Decryptor implementation. |
| 31 virtual void GenerateKeyRequest(const std::string& key_system, |
| 32 const uint8* init_data, |
| 33 int init_data_length) OVERRIDE; |
| 34 virtual void AddKey(const std::string& key_system, |
| 35 const uint8* key, |
| 36 int key_length, |
| 37 const uint8* init_data, |
| 38 int init_data_length, |
| 39 const std::string& session_id) OVERRIDE; |
| 40 virtual void CancelKeyRequest(const std::string& key_system, |
| 41 const std::string& session_id) OVERRIDE; |
| 42 virtual void Decrypt(const scoped_refptr<media::DecoderBuffer>& encrypted, |
| 43 const DecryptCB& decrypt_cb) OVERRIDE; |
| 44 |
| 45 private: |
| 46 void DataReady(const DecryptCB& decrypt_cb, const uint8* data, int data_size); |
| 47 |
| 48 media::DecryptorClient* client_; |
| 49 CreatePluginCB create_plugin_cb_; |
| 50 scoped_refptr<webkit::ppapi::PluginInstance> cdm_plugin_; |
| 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(PpapiDecryptor); |
| 53 }; |
| 54 |
| 55 } // namespace webkit_media |
| 56 |
| 57 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ |
OLD | NEW |