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 "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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 void PpapiDecryptor::DecryptAndDecodeAudio( | 186 void PpapiDecryptor::DecryptAndDecodeAudio( |
187 const scoped_refptr<media::DecoderBuffer>& encrypted, | 187 const scoped_refptr<media::DecoderBuffer>& encrypted, |
188 const AudioDecodeCB& audio_decode_cb) { | 188 const AudioDecodeCB& audio_decode_cb) { |
189 if (!render_loop_proxy_->BelongsToCurrentThread()) { | 189 if (!render_loop_proxy_->BelongsToCurrentThread()) { |
190 render_loop_proxy_->PostTask(FROM_HERE, base::Bind( | 190 render_loop_proxy_->PostTask(FROM_HERE, base::Bind( |
191 &PpapiDecryptor::DecryptAndDecodeAudio, weak_this_, | 191 &PpapiDecryptor::DecryptAndDecodeAudio, weak_this_, |
192 encrypted, audio_decode_cb)); | 192 encrypted, audio_decode_cb)); |
193 return; | 193 return; |
194 } | 194 } |
195 | 195 |
196 DVLOG(1) << "DecryptAndDecodeAudio()"; | 196 DVLOG(3) << "DecryptAndDecodeAudio()"; |
197 if (!plugin_cdm_delegate_->DecryptAndDecodeAudio(encrypted, audio_decode_cb)) | 197 if (!plugin_cdm_delegate_->DecryptAndDecodeAudio(encrypted, audio_decode_cb)) |
198 audio_decode_cb.Run(kError, AudioBuffers()); | 198 audio_decode_cb.Run(kError, AudioBuffers()); |
199 } | 199 } |
200 | 200 |
201 void PpapiDecryptor::DecryptAndDecodeVideo( | 201 void PpapiDecryptor::DecryptAndDecodeVideo( |
202 const scoped_refptr<media::DecoderBuffer>& encrypted, | 202 const scoped_refptr<media::DecoderBuffer>& encrypted, |
203 const VideoDecodeCB& video_decode_cb) { | 203 const VideoDecodeCB& video_decode_cb) { |
204 if (!render_loop_proxy_->BelongsToCurrentThread()) { | 204 if (!render_loop_proxy_->BelongsToCurrentThread()) { |
205 render_loop_proxy_->PostTask(FROM_HERE, base::Bind( | 205 render_loop_proxy_->PostTask(FROM_HERE, base::Bind( |
206 &PpapiDecryptor::DecryptAndDecodeVideo, weak_this_, | 206 &PpapiDecryptor::DecryptAndDecodeVideo, weak_this_, |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 const std::string& session_id, | 283 const std::string& session_id, |
284 const std::string& type, | 284 const std::string& type, |
285 scoped_array<uint8> init_data, | 285 scoped_array<uint8> init_data, |
286 int init_data_size) { | 286 int init_data_size) { |
287 DCHECK(render_loop_proxy_->BelongsToCurrentThread()); | 287 DCHECK(render_loop_proxy_->BelongsToCurrentThread()); |
288 need_key_cb_.Run(key_system, session_id, type, | 288 need_key_cb_.Run(key_system, session_id, type, |
289 init_data.Pass(), init_data_size); | 289 init_data.Pass(), init_data_size); |
290 } | 290 } |
291 | 291 |
292 } // namespace webkit_media | 292 } // namespace webkit_media |
OLD | NEW |