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

Side by Side Diff: webkit/media/crypto/ppapi_decryptor.cc

Issue 12638030: Make AudioDecoderConfig copyable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 9 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 | « webkit/media/crypto/ppapi_decryptor.h ('k') | no next file » | 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 "webkit/media/crypto/ppapi_decryptor.h" 5 #include "webkit/media/crypto/ppapi_decryptor.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 if (!plugin_cdm_delegate_->Decrypt(stream_type, encrypted, decrypt_cb)) 134 if (!plugin_cdm_delegate_->Decrypt(stream_type, encrypted, decrypt_cb))
135 decrypt_cb.Run(kError, NULL); 135 decrypt_cb.Run(kError, NULL);
136 } 136 }
137 137
138 void PpapiDecryptor::CancelDecrypt(StreamType stream_type) { 138 void PpapiDecryptor::CancelDecrypt(StreamType stream_type) {
139 DVLOG(1) << "CancelDecrypt() - stream_type: " << stream_type; 139 DVLOG(1) << "CancelDecrypt() - stream_type: " << stream_type;
140 plugin_cdm_delegate_->CancelDecrypt(stream_type); 140 plugin_cdm_delegate_->CancelDecrypt(stream_type);
141 } 141 }
142 142
143 void PpapiDecryptor::InitializeAudioDecoder( 143 void PpapiDecryptor::InitializeAudioDecoder(
144 scoped_ptr<media::AudioDecoderConfig> config, 144 const media::AudioDecoderConfig& config,
145 const DecoderInitCB& init_cb) { 145 const DecoderInitCB& init_cb) {
146 if (!render_loop_proxy_->BelongsToCurrentThread()) { 146 if (!render_loop_proxy_->BelongsToCurrentThread()) {
147 render_loop_proxy_->PostTask(FROM_HERE, base::Bind( 147 render_loop_proxy_->PostTask(FROM_HERE, base::Bind(
148 &PpapiDecryptor::InitializeAudioDecoder, weak_this_, 148 &PpapiDecryptor::InitializeAudioDecoder, weak_this_, config, init_cb));
149 base::Passed(&config), init_cb));
150 return; 149 return;
151 } 150 }
152 151
153 DVLOG(2) << "InitializeAudioDecoder()"; 152 DVLOG(2) << "InitializeAudioDecoder()";
154 DCHECK(config->is_encrypted()); 153 DCHECK(config.is_encrypted());
155 DCHECK(config->IsValidConfig()); 154 DCHECK(config.IsValidConfig());
156 155
157 audio_decoder_init_cb_ = init_cb; 156 audio_decoder_init_cb_ = init_cb;
158 if (!plugin_cdm_delegate_->InitializeAudioDecoder(*config, base::Bind( 157 if (!plugin_cdm_delegate_->InitializeAudioDecoder(config, base::Bind(
159 &PpapiDecryptor::OnDecoderInitialized, weak_this_, kAudio))) { 158 &PpapiDecryptor::OnDecoderInitialized, weak_this_, kAudio))) {
160 base::ResetAndReturn(&audio_decoder_init_cb_).Run(false); 159 base::ResetAndReturn(&audio_decoder_init_cb_).Run(false);
161 return; 160 return;
162 } 161 }
163 } 162 }
164 163
165 void PpapiDecryptor::InitializeVideoDecoder( 164 void PpapiDecryptor::InitializeVideoDecoder(
166 const media::VideoDecoderConfig& config, 165 const media::VideoDecoderConfig& config,
167 const DecoderInitCB& init_cb) { 166 const DecoderInitCB& init_cb) {
168 if (!render_loop_proxy_->BelongsToCurrentThread()) { 167 if (!render_loop_proxy_->BelongsToCurrentThread()) {
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 const std::string& session_id, 282 const std::string& session_id,
284 const std::string& type, 283 const std::string& type,
285 scoped_array<uint8> init_data, 284 scoped_array<uint8> init_data,
286 int init_data_size) { 285 int init_data_size) {
287 DCHECK(render_loop_proxy_->BelongsToCurrentThread()); 286 DCHECK(render_loop_proxy_->BelongsToCurrentThread());
288 need_key_cb_.Run(key_system, session_id, type, 287 need_key_cb_.Run(key_system, session_id, type,
289 init_data.Pass(), init_data_size); 288 init_data.Pass(), init_data_size);
290 } 289 }
291 290
292 } // namespace webkit_media 291 } // namespace webkit_media
OLDNEW
« no previous file with comments | « webkit/media/crypto/ppapi_decryptor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698