| 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" |
| 11 #include "media/base/decryptor.h" | 11 #include "media/base/decryptor.h" |
| 12 | 12 |
| 13 namespace base { |
| 14 class MessageLoopProxy; |
| 15 } |
| 16 |
| 13 namespace media { | 17 namespace media { |
| 14 class DecryptorClient; | 18 class DecryptorClient; |
| 15 } | 19 } |
| 16 | 20 |
| 17 namespace webkit { | 21 namespace webkit { |
| 18 namespace ppapi { | 22 namespace ppapi { |
| 19 class PluginInstance; | 23 class PluginInstance; |
| 20 } | 24 } |
| 21 } | 25 } |
| 22 | 26 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 40 int init_data_length, | 44 int init_data_length, |
| 41 const std::string& session_id) OVERRIDE; | 45 const std::string& session_id) OVERRIDE; |
| 42 virtual void CancelKeyRequest(const std::string& key_system, | 46 virtual void CancelKeyRequest(const std::string& key_system, |
| 43 const std::string& session_id) OVERRIDE; | 47 const std::string& session_id) OVERRIDE; |
| 44 virtual void Decrypt(const scoped_refptr<media::DecoderBuffer>& encrypted, | 48 virtual void Decrypt(const scoped_refptr<media::DecoderBuffer>& encrypted, |
| 45 const DecryptCB& decrypt_cb) OVERRIDE; | 49 const DecryptCB& decrypt_cb) OVERRIDE; |
| 46 virtual void Stop() OVERRIDE; | 50 virtual void Stop() OVERRIDE; |
| 47 | 51 |
| 48 private: | 52 private: |
| 49 // Callback for the plugin to hand back the decrypted data. | 53 // Callback for the plugin to hand back the decrypted data. |
| 50 void DataReady(const DecryptCB& decrypt_cb, const uint8* data, int data_size); | 54 void DataReady(const DecryptCB& decrypt_cb, void* data, int data_size); |
| 51 | 55 |
| 52 // TODO(xhwang): Need to figure out how the CDM plugin fires key events | 56 // TODO(xhwang): Need to figure out how the CDM plugin fires key events |
| 53 // (e.g. KeyMessage). | 57 // (e.g. KeyMessage). |
| 54 media::DecryptorClient* client_; | 58 media::DecryptorClient* client_; |
| 55 scoped_refptr<webkit::ppapi::PluginInstance> cdm_plugin_; | 59 scoped_refptr<webkit::ppapi::PluginInstance> cdm_plugin_; |
| 60 scoped_refptr<base::MessageLoopProxy> render_loop_proxy_; |
| 56 | 61 |
| 57 DISALLOW_COPY_AND_ASSIGN(PpapiDecryptor); | 62 DISALLOW_COPY_AND_ASSIGN(PpapiDecryptor); |
| 58 }; | 63 }; |
| 59 | 64 |
| 60 } // namespace webkit_media | 65 } // namespace webkit_media |
| 61 | 66 |
| 62 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ | 67 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ |
| OLD | NEW |