Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1023)

Side by Side Diff: content/renderer/pepper/content_decryptor_delegate.cc

Issue 122683002: Drop data offset in PP_EncryptedBlockInfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | media/cdm/ppapi/cdm_adapter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | media/cdm/ppapi/cdm_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698