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 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 const media::Decryptor::AudioBuffers empty_frames; | 1047 const media::Decryptor::AudioBuffers empty_frames; |
1050 audio_decode_cb_.ResetAndReturn().Run(media::Decryptor::kError, | 1048 audio_decode_cb_.ResetAndReturn().Run(media::Decryptor::kError, |
1051 empty_frames); | 1049 empty_frames); |
1052 } | 1050 } |
1053 | 1051 |
1054 if (!video_decode_cb_.is_null()) | 1052 if (!video_decode_cb_.is_null()) |
1055 video_decode_cb_.ResetAndReturn().Run(media::Decryptor::kError, NULL); | 1053 video_decode_cb_.ResetAndReturn().Run(media::Decryptor::kError, NULL); |
1056 } | 1054 } |
1057 | 1055 |
1058 } // namespace content | 1056 } // namespace content |
OLD | NEW |