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 |
| 12 namespace pp { |
| 13 |
| 14 class Instance; |
| 15 |
| 16 class ContentDecryptor_Dev { |
| 17 public: |
| 18 explicit ContentDecryptor_Dev(Instance* instance); |
| 19 virtual ~ContentDecryptor_Dev(); |
| 20 |
| 21 // PPP_ContentDecryptor_Dev functions exposed as virtual functions |
| 22 // for you to override. |
| 23 virtual bool GenerateKeyRequest(PP_Var key_system, // String. |
| 24 PP_Resource init_data) = 0; // PPB_Buffer. |
| 25 |
| 26 virtual bool AddKey(PP_Var session_id, // String. |
| 27 PP_Resource key) = 0; // PPB_Buffer. |
| 28 |
| 29 virtual bool CancelKeyRequest(PP_Var session_id) = 0; // String. |
| 30 |
| 31 virtual bool Decrypt(PP_Resource encrypted_block, // PPB_Buffer. |
| 32 PP_CompletionCallback callback) = 0; |
| 33 |
| 34 virtual bool DecryptAndDecode(PP_Resource encrypted_block, // PPB_Buffer. |
| 35 PP_CompletionCallback callback) = 0; |
| 36 |
| 37 // PPB_ContentDecryptor_Dev methods for passing data from the decryptor to the |
| 38 // browser. |
| 39 void NeedKey(PP_Var key_system, // String. |
| 40 PP_Var session_id, // String. |
| 41 PP_Resource init_data); // PPB_Buffer. |
| 42 |
| 43 void KeyAdded(PP_Var key_system, // String. |
| 44 PP_Var session_id); // String. |
| 45 |
| 46 void KeyMessage(PP_Var key_system, // String. |
| 47 PP_Var session_id, // String. |
| 48 PP_Resource message, // PPB_Buffer. |
| 49 PP_Var default_url); // String. |
| 50 |
| 51 void KeyError(PP_Var key_system, // String. |
| 52 PP_Var session_id, // String. |
| 53 uint16_t media_error, |
| 54 uint16_t system_error); |
| 55 |
| 56 void DeliverBlock(PP_Resource decrypted_block, // PPB_Buffer. |
| 57 PP_CompletionCallback callback); |
| 58 |
| 59 void DeliverFrame(PP_Resource decrypted_frame, // PPB_Buffer. |
| 60 PP_CompletionCallback callback); |
| 61 |
| 62 void DeliverSamples(PP_Resource decrypted_samples, // PPB_Buffer. |
| 63 PP_CompletionCallback callback); |
| 64 |
| 65 private: |
| 66 InstanceHandle associated_instance_; |
| 67 }; |
| 68 |
| 69 } // namespace pp |
| 70 |
| 71 #endif // PPAPI_CPP_DEV_CONTENT_DECRYPTOR_DEV_H_ |
OLD | NEW |