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 #include "ppapi/cpp/private/content_decryptor_private.h" | 5 #include "ppapi/cpp/private/content_decryptor_private.h" |
6 | 6 |
7 #include <cstring> // memcpy | 7 #include <cstring> // memcpy |
8 | 8 |
9 #include "ppapi/c/ppb_var.h" | 9 #include "ppapi/c/ppb_var.h" |
10 #include "ppapi/c/private/ppb_content_decryptor_private.h" | 10 #include "ppapi/c/private/ppb_content_decryptor_private.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 | 98 |
99 void Decrypt(PP_Instance instance, | 99 void Decrypt(PP_Instance instance, |
100 PP_Resource encrypted_resource, | 100 PP_Resource encrypted_resource, |
101 const PP_EncryptedBlockInfo* encrypted_block_info) { | 101 const PP_EncryptedBlockInfo* encrypted_block_info) { |
102 void* object = | 102 void* object = |
103 Instance::GetPerInstanceObject(instance, kPPPContentDecryptorInterface); | 103 Instance::GetPerInstanceObject(instance, kPPPContentDecryptorInterface); |
104 if (!object) | 104 if (!object) |
105 return; | 105 return; |
106 | 106 |
107 pp::Buffer_Dev encrypted_block(pp::PassRef(), encrypted_resource); | 107 pp::Buffer_Dev encrypted_block(encrypted_resource); |
108 | 108 |
109 static_cast<ContentDecryptor_Private*>(object)->Decrypt( | 109 static_cast<ContentDecryptor_Private*>(object)->Decrypt( |
110 encrypted_block, | 110 encrypted_block, |
111 *encrypted_block_info); | 111 *encrypted_block_info); |
112 } | 112 } |
113 | 113 |
114 void InitializeAudioDecoder( | 114 void InitializeAudioDecoder( |
115 PP_Instance instance, | 115 PP_Instance instance, |
116 const PP_AudioDecoderConfig* decoder_config, | 116 const PP_AudioDecoderConfig* decoder_config, |
117 PP_Resource extra_data_resource) { | 117 PP_Resource extra_data_resource) { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 168 |
169 void DecryptAndDecode(PP_Instance instance, | 169 void DecryptAndDecode(PP_Instance instance, |
170 PP_DecryptorStreamType decoder_type, | 170 PP_DecryptorStreamType decoder_type, |
171 PP_Resource encrypted_resource, | 171 PP_Resource encrypted_resource, |
172 const PP_EncryptedBlockInfo* encrypted_block_info) { | 172 const PP_EncryptedBlockInfo* encrypted_block_info) { |
173 void* object = | 173 void* object = |
174 Instance::GetPerInstanceObject(instance, kPPPContentDecryptorInterface); | 174 Instance::GetPerInstanceObject(instance, kPPPContentDecryptorInterface); |
175 if (!object) | 175 if (!object) |
176 return; | 176 return; |
177 | 177 |
178 pp::Buffer_Dev encrypted_buffer(pp::PassRef(), encrypted_resource); | 178 pp::Buffer_Dev encrypted_buffer(encrypted_resource); |
179 | 179 |
180 static_cast<ContentDecryptor_Private*>(object)->DecryptAndDecode( | 180 static_cast<ContentDecryptor_Private*>(object)->DecryptAndDecode( |
181 decoder_type, | 181 decoder_type, |
182 encrypted_buffer, | 182 encrypted_buffer, |
183 *encrypted_block_info); | 183 *encrypted_block_info); |
184 } | 184 } |
185 | 185 |
186 const PPP_ContentDecryptor_Private ppp_content_decryptor = { | 186 const PPP_ContentDecryptor_Private ppp_content_decryptor = { |
187 &GenerateKeyRequest, | 187 &GenerateKeyRequest, |
188 &AddKey, | 188 &AddKey, |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 const PP_DecryptedBlockInfo& decrypted_block_info) { | 337 const PP_DecryptedBlockInfo& decrypted_block_info) { |
338 if (has_interface<PPB_ContentDecryptor_Private>()) { | 338 if (has_interface<PPB_ContentDecryptor_Private>()) { |
339 get_interface<PPB_ContentDecryptor_Private>()->DeliverSamples( | 339 get_interface<PPB_ContentDecryptor_Private>()->DeliverSamples( |
340 associated_instance_.pp_instance(), | 340 associated_instance_.pp_instance(), |
341 audio_frames.pp_resource(), | 341 audio_frames.pp_resource(), |
342 &decrypted_block_info); | 342 &decrypted_block_info); |
343 } | 343 } |
344 } | 344 } |
345 | 345 |
346 } // namespace pp | 346 } // namespace pp |
OLD | NEW |