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 <cstring> // For memcpy. | 5 #include <cstring> // For memcpy. |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/compiler_specific.h" // For OVERRIDE. | 8 #include "base/compiler_specific.h" // For OVERRIDE. |
9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
10 #include "ppapi/c/pp_stdint.h" | 10 #include "ppapi/c/pp_stdint.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 198 |
199 // TODO(xhwang): Simplify the following data conversion. | 199 // TODO(xhwang): Simplify the following data conversion. |
200 cdm::InputBuffer input_buffer; | 200 cdm::InputBuffer input_buffer; |
201 input_buffer.data = reinterpret_cast<uint8_t*>(encrypted_buffer.data()); | 201 input_buffer.data = reinterpret_cast<uint8_t*>(encrypted_buffer.data()); |
202 input_buffer.data_size = encrypted_buffer.size(); | 202 input_buffer.data_size = encrypted_buffer.size(); |
203 input_buffer.data_offset = encrypted_block_info.data_offset; | 203 input_buffer.data_offset = encrypted_block_info.data_offset; |
204 input_buffer.key_id = encrypted_block_info.key_id; | 204 input_buffer.key_id = encrypted_block_info.key_id; |
205 input_buffer.key_id_size = encrypted_block_info.key_id_size; | 205 input_buffer.key_id_size = encrypted_block_info.key_id_size; |
206 input_buffer.iv = encrypted_block_info.iv; | 206 input_buffer.iv = encrypted_block_info.iv; |
207 input_buffer.iv_size = encrypted_block_info.iv_size; | 207 input_buffer.iv_size = encrypted_block_info.iv_size; |
208 input_buffer.checksum = encrypted_block_info.checksum; | |
209 input_buffer.checksum_size = encrypted_block_info.checksum_size; | |
210 input_buffer.num_subsamples = encrypted_block_info.num_subsamples; | 208 input_buffer.num_subsamples = encrypted_block_info.num_subsamples; |
211 std::vector<cdm::SubsampleEntry> subsamples; | 209 std::vector<cdm::SubsampleEntry> subsamples; |
212 for (uint32_t i = 0; i < encrypted_block_info.num_subsamples; ++i) { | 210 for (uint32_t i = 0; i < encrypted_block_info.num_subsamples; ++i) { |
213 subsamples.push_back(cdm::SubsampleEntry( | 211 subsamples.push_back(cdm::SubsampleEntry( |
214 encrypted_block_info.subsamples[i].clear_bytes, | 212 encrypted_block_info.subsamples[i].clear_bytes, |
215 encrypted_block_info.subsamples[i].cipher_bytes)); | 213 encrypted_block_info.subsamples[i].cipher_bytes)); |
216 } | 214 } |
217 input_buffer.subsamples = &subsamples[0]; | 215 input_buffer.subsamples = &subsamples[0]; |
218 input_buffer.timestamp = encrypted_block_info.tracking_info.timestamp; | 216 input_buffer.timestamp = encrypted_block_info.tracking_info.timestamp; |
219 | 217 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 } // namespace webkit_media | 321 } // namespace webkit_media |
324 | 322 |
325 namespace pp { | 323 namespace pp { |
326 | 324 |
327 // Factory function for your specialization of the Module object. | 325 // Factory function for your specialization of the Module object. |
328 Module* CreateModule() { | 326 Module* CreateModule() { |
329 return new webkit_media::MyModule(); | 327 return new webkit_media::MyModule(); |
330 } | 328 } |
331 | 329 |
332 } // namespace pp | 330 } // namespace pp |
OLD | NEW |