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 PPAPI_CPP_PRIVATE_CONTENT_DECRYPTOR_PRIVATE_H_ | 5 #ifndef PPAPI_CPP_PRIVATE_CONTENT_DECRYPTOR_PRIVATE_H_ |
6 #define PPAPI_CPP_PRIVATE_CONTENT_DECRYPTOR_PRIVATE_H_ | 6 #define PPAPI_CPP_PRIVATE_CONTENT_DECRYPTOR_PRIVATE_H_ |
7 | 7 |
8 #include "ppapi/c/private/pp_content_decryptor.h" | |
8 #include "ppapi/c/private/ppb_content_decryptor_private.h" | 9 #include "ppapi/c/private/ppb_content_decryptor_private.h" |
9 #include "ppapi/c/private/ppp_content_decryptor_private.h" | 10 #include "ppapi/c/private/ppp_content_decryptor_private.h" |
10 | 11 |
11 #include "ppapi/cpp/dev/buffer_dev.h" | 12 #include "ppapi/cpp/dev/buffer_dev.h" |
12 #include "ppapi/cpp/instance_handle.h" | 13 #include "ppapi/cpp/instance_handle.h" |
13 #include "ppapi/cpp/var.h" | 14 #include "ppapi/cpp/var.h" |
14 #include "ppapi/cpp/var_array_buffer.h" | 15 #include "ppapi/cpp/var_array_buffer.h" |
15 | 16 |
16 namespace pp { | 17 namespace pp { |
17 | 18 |
18 class Instance; | 19 class Instance; |
19 | 20 |
20 class ContentDecryptor_Private { | 21 class ContentDecryptor_Private { |
21 public: | 22 public: |
22 explicit ContentDecryptor_Private(Instance* instance); | 23 explicit ContentDecryptor_Private(Instance* instance); |
23 virtual ~ContentDecryptor_Private(); | 24 virtual ~ContentDecryptor_Private(); |
24 | 25 |
25 // PPP_ContentDecryptor_Private functions exposed as virtual functions | 26 // PPP_ContentDecryptor_Private functions exposed as virtual functions |
26 // for you to override. | 27 // for you to override. |
27 // TODO(tomfinegan): This could be optimized to pass pp::Var instead of | 28 // TODO(tomfinegan): This could be optimized to pass pp::Var instead of |
28 // strings. The change would allow the CDM wrapper to reuse vars when | 29 // strings. The change would allow the CDM wrapper to reuse vars when |
29 // replying to the browser. | 30 // replying to the browser. |
30 virtual bool GenerateKeyRequest(const std::string& key_system, | 31 virtual bool GenerateKeyRequest(const std::string& key_system, |
31 pp::VarArrayBuffer init_data) = 0; | 32 pp::VarArrayBuffer init_data) = 0; |
32 virtual bool AddKey(const std::string& session_id, | 33 virtual bool AddKey(const std::string& session_id, |
33 pp::VarArrayBuffer key) = 0; | 34 pp::VarArrayBuffer key, |
35 pp::VarArrayBuffer init_data) = 0; | |
34 virtual bool CancelKeyRequest(const std::string& session_id) = 0; | 36 virtual bool CancelKeyRequest(const std::string& session_id) = 0; |
35 virtual bool Decrypt(pp::Buffer_Dev encrypted_buffer, | 37 virtual bool Decrypt(pp::Buffer_Dev encrypted_buffer, |
36 int32_t request_id) = 0; | 38 const PP_EncryptedBlockInfo* encrypted_block_info) = 0; |
dmichael (off chromium)
2012/08/21 17:37:08
You should pass by const&, not const* here. The co
Tom Finegan
2012/08/21 22:57:38
Done.
| |
37 virtual bool DecryptAndDecode(pp::Buffer_Dev encrypted_buffer, | 39 virtual bool DecryptAndDecode( |
38 int32_t request_id) = 0; | 40 pp::Buffer_Dev encrypted_buffer, |
41 const PP_EncryptedBlockInfo* encrypted_block_info) = 0; | |
39 | 42 |
40 // PPB_ContentDecryptor_Private methods for passing data from the decryptor | 43 // PPB_ContentDecryptor_Private methods for passing data from the decryptor |
41 // to the browser. | 44 // to the browser. |
42 void NeedKey(const std::string& key_system, | 45 void NeedKey(const std::string& key_system, |
43 const std::string& session_id, | 46 const std::string& session_id, |
44 pp::VarArrayBuffer init_data); | 47 pp::VarArrayBuffer init_data); |
45 void KeyAdded(const std::string& key_system, | 48 void KeyAdded(const std::string& key_system, |
46 const std::string& session_id); | 49 const std::string& session_id); |
47 void KeyMessage(const std::string& key_system, | 50 void KeyMessage(const std::string& key_system, |
48 const std::string& session_id, | 51 const std::string& session_id, |
49 pp::Buffer_Dev message, | 52 pp::Buffer_Dev message, |
50 const std::string& default_url); | 53 const std::string& default_url); |
51 void KeyError(const std::string& key_system, | 54 void KeyError(const std::string& key_system, |
52 const std::string& session_id, | 55 const std::string& session_id, |
53 int32_t media_error, | 56 int32_t media_error, |
54 int32_t system_code); | 57 int32_t system_code); |
55 void DeliverBlock(pp::Buffer_Dev decrypted_block, | 58 void DeliverBlock(pp::Buffer_Dev decrypted_block, |
56 int32_t request_id); | 59 const PP_DecryptedBlockInfo* decrypted_block_info); |
57 void DeliverFrame(pp::Buffer_Dev decrypted_frame, | 60 void DeliverFrame(pp::Buffer_Dev decrypted_frame, |
58 int32_t request_id); | 61 const PP_DecryptedBlockInfo* decrypted_block_info); |
59 void DeliverSamples(pp::Buffer_Dev decrypted_samples, | 62 void DeliverSamples(pp::Buffer_Dev decrypted_samples, |
60 int32_t request_id); | 63 const PP_DecryptedBlockInfo* decrypted_block_info); |
61 | 64 |
62 private: | 65 private: |
63 InstanceHandle associated_instance_; | 66 InstanceHandle associated_instance_; |
64 }; | 67 }; |
65 | 68 |
66 } // namespace pp | 69 } // namespace pp |
67 | 70 |
68 #endif // PPAPI_CPP_PRIVATE_CONTENT_DECRYPTOR_PRIVATE_H_ | 71 #endif // PPAPI_CPP_PRIVATE_CONTENT_DECRYPTOR_PRIVATE_H_ |
OLD | NEW |