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 PPAPI_CPP_DEV_CONTENT_DECRYPTOR_DEV_H_ | |
6 #define PPAPI_CPP_DEV_CONTENT_DECRYPTOR_DEV_H_ | |
7 | |
8 #include "ppapi/c/dev/ppb_content_decryptor_dev.h" | |
9 #include "ppapi/c/dev/ppp_content_decryptor_dev.h" | |
10 #include "ppapi/cpp/instance_handle.h" | |
11 #include "ppapi/cpp/var.h" | |
12 #include "ppapi/cpp/dev/buffer_dev.h" | |
13 | |
14 namespace pp { | |
15 | |
16 class Instance; | |
17 | |
18 class ContentDecryptor_Dev { | |
19 public: | |
20 explicit ContentDecryptor_Dev(Instance* instance); | |
21 virtual ~ContentDecryptor_Dev(); | |
22 | |
23 // PPP_ContentDecryptor_Dev functions exposed as virtual functions | |
24 // for you to override. | |
25 virtual bool GenerateKeyRequest(PP_Var key_system, // String. | |
dmichael (off chromium)
2012/08/08 22:24:02
As noted before, you should use a C++ version of a
Tom Finegan
2012/08/09 22:45:17
Done.
| |
26 PP_Var init_data) = 0; // ArrayBuffer. | |
27 | |
28 virtual bool AddKey(PP_Var session_id, // String. | |
29 PP_Var key) = 0; // ArrayBuffer. | |
30 | |
31 virtual bool CancelKeyRequest(PP_Var session_id) = 0; // String. | |
32 | |
33 virtual bool Decrypt(PP_Resource encrypted_block, | |
34 uint64_t request_id) = 0; | |
35 | |
36 virtual bool DecryptAndDecode(PP_Resource encrypted_block, | |
37 uint64_t request_id) = 0; | |
38 | |
39 // PPB_ContentDecryptor_Dev methods for passing data from the decryptor to the | |
40 // browser. | |
41 void NeedKey(PP_Var key_system, // String. | |
42 PP_Var session_id, // String. | |
43 PP_Var init_data); // ArrayBuffer. | |
44 | |
45 void KeyAdded(PP_Var key_system, // String. | |
46 PP_Var session_id); // String. | |
47 | |
48 void KeyMessage(PP_Var key_system, // String. | |
49 PP_Var session_id, // String. | |
50 PP_Resource message, | |
51 PP_Var default_url); // String. | |
52 | |
53 void KeyError(PP_Var key_system, // String. | |
54 PP_Var session_id, // String. | |
55 int32_t media_error, | |
56 int32_t system_error); | |
57 | |
58 void DeliverBlock(PP_Resource decrypted_block, // PPB_Buffer. | |
59 uint64_t request_id); | |
60 | |
61 void DeliverFrame(PP_Resource decrypted_frame, // PPB_Buffer. | |
62 uint64_t request_id); | |
63 | |
64 void DeliverSamples(PP_Resource decrypted_samples, // PPB_Buffer. | |
65 uint64_t request_id); | |
66 | |
67 private: | |
68 InstanceHandle associated_instance_; | |
69 }; | |
70 | |
71 } // namespace pp | |
72 | |
73 #endif // PPAPI_CPP_DEV_CONTENT_DECRYPTOR_DEV_H_ | |
OLD | NEW |