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 16 matching lines...) Expand all Loading... |
39 const uint8* init_data, | 43 const uint8* init_data, |
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. | |
50 void DataReady(const DecryptCB& decrypt_cb, const uint8* data, int data_size); | |
51 | |
52 // TODO(xhwang): Need to figure out how the CDM plugin fires key events | |
53 // (e.g. KeyMessage). | |
54 media::DecryptorClient* client_; | 53 media::DecryptorClient* client_; |
55 scoped_refptr<webkit::ppapi::PluginInstance> cdm_plugin_; | 54 scoped_refptr<webkit::ppapi::PluginInstance> cdm_plugin_; |
| 55 scoped_refptr<base::MessageLoopProxy> render_loop_proxy_; |
56 | 56 |
57 DISALLOW_COPY_AND_ASSIGN(PpapiDecryptor); | 57 DISALLOW_COPY_AND_ASSIGN(PpapiDecryptor); |
58 }; | 58 }; |
59 | 59 |
60 } // namespace webkit_media | 60 } // namespace webkit_media |
61 | 61 |
62 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ | 62 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ |
OLD | NEW |