| 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 | 209 |
| 212 std::vector<cdm::SubsampleEntry> subsamples; | 210 std::vector<cdm::SubsampleEntry> subsamples; |
| 213 if (encrypted_block_info.num_subsamples > 0) { | 211 if (encrypted_block_info.num_subsamples > 0) { |
| 214 subsamples.reserve(encrypted_block_info.num_subsamples); | 212 subsamples.reserve(encrypted_block_info.num_subsamples); |
| 215 | 213 |
| 216 for (uint32_t i = 0; i < encrypted_block_info.num_subsamples; ++i) { | 214 for (uint32_t i = 0; i < encrypted_block_info.num_subsamples; ++i) { |
| 217 subsamples.push_back(cdm::SubsampleEntry( | 215 subsamples.push_back(cdm::SubsampleEntry( |
| 218 encrypted_block_info.subsamples[i].clear_bytes, | 216 encrypted_block_info.subsamples[i].clear_bytes, |
| 219 encrypted_block_info.subsamples[i].cipher_bytes)); | 217 encrypted_block_info.subsamples[i].cipher_bytes)); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 } // namespace webkit_media | 328 } // namespace webkit_media |
| 331 | 329 |
| 332 namespace pp { | 330 namespace pp { |
| 333 | 331 |
| 334 // Factory function for your specialization of the Module object. | 332 // Factory function for your specialization of the Module object. |
| 335 Module* CreateModule() { | 333 Module* CreateModule() { |
| 336 return new webkit_media::MyModule(); | 334 return new webkit_media::MyModule(); |
| 337 } | 335 } |
| 338 | 336 |
| 339 } // namespace pp | 337 } // namespace pp |
| OLD | NEW |