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

Side by Side Diff: content/renderer/media/cdm/ppapi_decryptor.cc

Issue 2625333003: media: Always provide CdmContext when selecting decoder in DecoderStream (Closed)
Patch Set: rebase only Created 3 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
« no previous file with comments | « content/renderer/media/cdm/ppapi_decryptor.h ('k') | media/filters/decoder_selector.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/media/cdm/ppapi_decryptor.h" 5 #include "content/renderer/media/cdm/ppapi_decryptor.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 } 198 }
199 199
200 CdmDelegate()->RemoveSession(session_id, std::move(promise)); 200 CdmDelegate()->RemoveSession(session_id, std::move(promise));
201 } 201 }
202 202
203 media::CdmContext* PpapiDecryptor::GetCdmContext() { 203 media::CdmContext* PpapiDecryptor::GetCdmContext() {
204 return this; 204 return this;
205 } 205 }
206 206
207 media::Decryptor* PpapiDecryptor::GetDecryptor() { 207 media::Decryptor* PpapiDecryptor::GetDecryptor() {
208 return this; 208 base::AutoLock auto_lock(lock_);
209 return had_fatal_plugin_error_ ? nullptr : this;
209 } 210 }
210 211
211 int PpapiDecryptor::GetCdmId() const { 212 int PpapiDecryptor::GetCdmId() const {
212 return kInvalidCdmId; 213 return kInvalidCdmId;
213 } 214 }
214 215
215 void PpapiDecryptor::RegisterNewKeyCB(StreamType stream_type, 216 void PpapiDecryptor::RegisterNewKeyCB(StreamType stream_type,
216 const NewKeyCB& new_key_cb) { 217 const NewKeyCB& new_key_cb) {
217 if (!render_task_runner_->BelongsToCurrentThread()) { 218 if (!render_task_runner_->BelongsToCurrentThread()) {
218 render_task_runner_->PostTask( 219 render_task_runner_->PostTask(
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 430
430 void PpapiDecryptor::AttemptToResumePlayback() { 431 void PpapiDecryptor::AttemptToResumePlayback() {
431 if (!new_audio_key_cb_.is_null()) 432 if (!new_audio_key_cb_.is_null())
432 new_audio_key_cb_.Run(); 433 new_audio_key_cb_.Run();
433 434
434 if (!new_video_key_cb_.is_null()) 435 if (!new_video_key_cb_.is_null())
435 new_video_key_cb_.Run(); 436 new_video_key_cb_.Run();
436 } 437 }
437 438
438 void PpapiDecryptor::OnFatalPluginError() { 439 void PpapiDecryptor::OnFatalPluginError() {
440 DVLOG(1) << __func__;
439 DCHECK(render_task_runner_->BelongsToCurrentThread()); 441 DCHECK(render_task_runner_->BelongsToCurrentThread());
440 pepper_cdm_wrapper_.reset(); 442 pepper_cdm_wrapper_.reset();
443
444 base::AutoLock auto_lock(lock_);
445 had_fatal_plugin_error_ = true;
441 } 446 }
442 447
443 ContentDecryptorDelegate* PpapiDecryptor::CdmDelegate() { 448 ContentDecryptorDelegate* PpapiDecryptor::CdmDelegate() {
444 DCHECK(render_task_runner_->BelongsToCurrentThread()); 449 DCHECK(render_task_runner_->BelongsToCurrentThread());
445 return (pepper_cdm_wrapper_) ? pepper_cdm_wrapper_->GetCdmDelegate() : NULL; 450 return (pepper_cdm_wrapper_) ? pepper_cdm_wrapper_->GetCdmDelegate() : NULL;
446 } 451 }
447 452
448 } // namespace content 453 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/cdm/ppapi_decryptor.h ('k') | media/filters/decoder_selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698