| 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/pp_content_decryptor.h" | 
| 9 #include "ppapi/c/private/ppb_content_decryptor_private.h" | 9 #include "ppapi/c/private/ppb_content_decryptor_private.h" | 
| 10 #include "ppapi/c/private/ppp_content_decryptor_private.h" | 10 #include "ppapi/c/private/ppp_content_decryptor_private.h" | 
| (...skipping 13 matching lines...) Expand all  Loading... | 
| 24 class ContentDecryptor_Private { | 24 class ContentDecryptor_Private { | 
| 25  public: | 25  public: | 
| 26   explicit ContentDecryptor_Private(Instance* instance); | 26   explicit ContentDecryptor_Private(Instance* instance); | 
| 27   virtual ~ContentDecryptor_Private(); | 27   virtual ~ContentDecryptor_Private(); | 
| 28 | 28 | 
| 29   // PPP_ContentDecryptor_Private functions exposed as virtual functions | 29   // PPP_ContentDecryptor_Private functions exposed as virtual functions | 
| 30   // for you to override. | 30   // for you to override. | 
| 31   // TODO(tomfinegan): This could be optimized to pass pp::Var instead of | 31   // TODO(tomfinegan): This could be optimized to pass pp::Var instead of | 
| 32   // strings. The change would allow the CDM wrapper to reuse vars when | 32   // strings. The change would allow the CDM wrapper to reuse vars when | 
| 33   // replying to the browser. | 33   // replying to the browser. | 
| 34   virtual void GenerateKeyRequest(const std::string& key_system, | 34   virtual void Initialize(const std::string& key_system, | 
| 35                                   const std::string& type, | 35                           const PP_KeySystemFlags& key_system_flags) = 0; | 
|  | 36   virtual void GenerateKeyRequest(const std::string& type, | 
| 36                                   pp::VarArrayBuffer init_data) = 0; | 37                                   pp::VarArrayBuffer init_data) = 0; | 
| 37   virtual void AddKey(const std::string& session_id, | 38   virtual void AddKey(const std::string& session_id, | 
| 38                       pp::VarArrayBuffer key, | 39                       pp::VarArrayBuffer key, | 
| 39                       pp::VarArrayBuffer init_data) = 0; | 40                       pp::VarArrayBuffer init_data) = 0; | 
| 40   virtual void CancelKeyRequest(const std::string& session_id) = 0; | 41   virtual void CancelKeyRequest(const std::string& session_id) = 0; | 
| 41   virtual void Decrypt(pp::Buffer_Dev encrypted_buffer, | 42   virtual void Decrypt(pp::Buffer_Dev encrypted_buffer, | 
| 42                        const PP_EncryptedBlockInfo& encrypted_block_info) = 0; | 43                        const PP_EncryptedBlockInfo& encrypted_block_info) = 0; | 
| 43   virtual void InitializeAudioDecoder( | 44   virtual void InitializeAudioDecoder( | 
| 44       const PP_AudioDecoderConfig& decoder_config, | 45       const PP_AudioDecoderConfig& decoder_config, | 
| 45       pp::Buffer_Dev extra_data_resource) = 0; | 46       pp::Buffer_Dev extra_data_resource) = 0; | 
| 46   virtual void InitializeVideoDecoder( | 47   virtual void InitializeVideoDecoder( | 
| 47       const PP_VideoDecoderConfig& decoder_config, | 48       const PP_VideoDecoderConfig& decoder_config, | 
| 48       pp::Buffer_Dev extra_data_resource) = 0; | 49       pp::Buffer_Dev extra_data_resource) = 0; | 
| 49   virtual void DeinitializeDecoder(PP_DecryptorStreamType decoder_type, | 50   virtual void DeinitializeDecoder(PP_DecryptorStreamType decoder_type, | 
| 50                                    uint32_t request_id) = 0; | 51                                    uint32_t request_id) = 0; | 
| 51   virtual void ResetDecoder(PP_DecryptorStreamType decoder_type, | 52   virtual void ResetDecoder(PP_DecryptorStreamType decoder_type, | 
| 52                             uint32_t request_id) = 0; | 53                             uint32_t request_id) = 0; | 
| 53   // Null |encrypted_frame| means end-of-stream buffer. | 54   // Null |encrypted_frame| means end-of-stream buffer. | 
| 54   virtual void DecryptAndDecode( | 55   virtual void DecryptAndDecode( | 
| 55       PP_DecryptorStreamType decoder_type, | 56       PP_DecryptorStreamType decoder_type, | 
| 56       pp::Buffer_Dev encrypted_buffer, | 57       pp::Buffer_Dev encrypted_buffer, | 
| 57       const PP_EncryptedBlockInfo& encrypted_block_info) = 0; | 58       const PP_EncryptedBlockInfo& encrypted_block_info) = 0; | 
| 58 | 59 | 
| 59   // PPB_ContentDecryptor_Private methods for passing data from the decryptor | 60   // PPB_ContentDecryptor_Private methods for passing data from the decryptor | 
| 60   // to the browser. | 61   // to the browser. | 
| 61   void NeedKey(const std::string& key_system, |  | 
| 62                const std::string& session_id, |  | 
| 63                pp::VarArrayBuffer init_data); |  | 
| 64   void KeyAdded(const std::string& key_system, | 62   void KeyAdded(const std::string& key_system, | 
| 65                 const std::string& session_id); | 63                 const std::string& session_id); | 
| 66   void KeyMessage(const std::string& key_system, | 64   void KeyMessage(const std::string& key_system, | 
| 67                   const std::string& session_id, | 65                   const std::string& session_id, | 
| 68                   pp::VarArrayBuffer message, | 66                   pp::VarArrayBuffer message, | 
| 69                   const std::string& default_url); | 67                   const std::string& default_url); | 
| 70   void KeyError(const std::string& key_system, | 68   void KeyError(const std::string& key_system, | 
| 71                 const std::string& session_id, | 69                 const std::string& session_id, | 
| 72                 int32_t media_error, | 70                 int32_t media_error, | 
| 73                 int32_t system_code); | 71                 int32_t system_code); | 
| (...skipping 24 matching lines...) Expand all  Loading... | 
| 98   void DeliverSamples(pp::Buffer_Dev audio_frames, | 96   void DeliverSamples(pp::Buffer_Dev audio_frames, | 
| 99                       const PP_DecryptedBlockInfo& decrypted_block_info); | 97                       const PP_DecryptedBlockInfo& decrypted_block_info); | 
| 100 | 98 | 
| 101  private: | 99  private: | 
| 102   InstanceHandle associated_instance_; | 100   InstanceHandle associated_instance_; | 
| 103 }; | 101 }; | 
| 104 | 102 | 
| 105 }  // namespace pp | 103 }  // namespace pp | 
| 106 | 104 | 
| 107 #endif  // PPAPI_CPP_PRIVATE_CONTENT_DECRYPTOR_PRIVATE_H_ | 105 #endif  // PPAPI_CPP_PRIVATE_CONTENT_DECRYPTOR_PRIVATE_H_ | 
| OLD | NEW | 
|---|