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 "content/renderer/pepper/content_decryptor_delegate.h" | 5 #include "content/renderer/pepper/content_decryptor_delegate.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "base/safe_numerics.h" | 10 #include "base/safe_numerics.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 99 |
100 DCHECK(encrypted_buffer->data_size()) | 100 DCHECK(encrypted_buffer->data_size()) |
101 << "DecryptConfig is set on an empty buffer"; | 101 << "DecryptConfig is set on an empty buffer"; |
102 | 102 |
103 block_info->tracking_info.timestamp = | 103 block_info->tracking_info.timestamp = |
104 encrypted_buffer->timestamp().InMicroseconds(); | 104 encrypted_buffer->timestamp().InMicroseconds(); |
105 block_info->data_size = encrypted_buffer->data_size(); | 105 block_info->data_size = encrypted_buffer->data_size(); |
106 | 106 |
107 const media::DecryptConfig* decrypt_config = | 107 const media::DecryptConfig* decrypt_config = |
108 encrypted_buffer->decrypt_config(); | 108 encrypted_buffer->decrypt_config(); |
109 // TODO(xhwang): Drop |data_offset| in PP_EncryptedBlockInfo. | |
110 block_info->data_offset = 0; | |
111 | 109 |
112 if (!CopyStringToArray(decrypt_config->key_id(), block_info->key_id) || | 110 if (!CopyStringToArray(decrypt_config->key_id(), block_info->key_id) || |
113 !CopyStringToArray(decrypt_config->iv(), block_info->iv)) | 111 !CopyStringToArray(decrypt_config->iv(), block_info->iv)) |
114 return false; | 112 return false; |
115 | 113 |
116 block_info->key_id_size = decrypt_config->key_id().size(); | 114 block_info->key_id_size = decrypt_config->key_id().size(); |
117 block_info->iv_size = decrypt_config->iv().size(); | 115 block_info->iv_size = decrypt_config->iv().size(); |
118 | 116 |
119 if (decrypt_config->subsamples().size() > arraysize(block_info->subsamples)) | 117 if (decrypt_config->subsamples().size() > arraysize(block_info->subsamples)) |
120 return false; | 118 return false; |
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1016 frames->push_back(frame); | 1014 frames->push_back(frame); |
1017 | 1015 |
1018 cur += frame_size; | 1016 cur += frame_size; |
1019 bytes_left -= frame_size; | 1017 bytes_left -= frame_size; |
1020 } while (bytes_left > 0); | 1018 } while (bytes_left > 0); |
1021 | 1019 |
1022 return true; | 1020 return true; |
1023 } | 1021 } |
1024 | 1022 |
1025 } // namespace content | 1023 } // namespace content |
OLD | NEW |