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

Side by Side Diff: media/filters/gpu_video_decoder.cc

Issue 1485043002: Passed is_encrypted parameter to the VDA initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 5 years 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
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 "media/filters/gpu_video_decoder.h" 5 #include "media/filters/gpu_video_decoder.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 167
168 if (previously_initialized) { 168 if (previously_initialized) {
169 // Reinitialization with a different config (but same codec and profile). 169 // Reinitialization with a different config (but same codec and profile).
170 // VDA should handle it by detecting this in-stream by itself, 170 // VDA should handle it by detecting this in-stream by itself,
171 // no need to notify it. 171 // no need to notify it.
172 bound_init_cb.Run(true); 172 bound_init_cb.Run(true);
173 return; 173 return;
174 } 174 }
175 175
176 vda_ = factories_->CreateVideoDecodeAccelerator().Pass(); 176 vda_ = factories_->CreateVideoDecodeAccelerator().Pass();
177 if (!vda_ || !vda_->Initialize(config.profile(), this)) { 177
178 VideoDecodeAccelerator::Config vda_config(config);
179
180 if (!vda_ || !vda_->Initialize(vda_config, this)) {
178 DVLOG(1) << "VDA initialization failed."; 181 DVLOG(1) << "VDA initialization failed.";
179 bound_init_cb.Run(false); 182 bound_init_cb.Run(false);
180 return; 183 return;
181 } 184 }
182 185
183 if (config.is_encrypted()) { 186 if (config.is_encrypted()) {
184 init_cb_ = bound_init_cb; 187 init_cb_ = bound_init_cb;
185 set_cdm_ready_cb_ = set_cdm_ready_cb; 188 set_cdm_ready_cb_ = set_cdm_ready_cb;
186 set_cdm_ready_cb_.Run(BindToCurrentLoop( 189 set_cdm_ready_cb_.Run(BindToCurrentLoop(
187 base::Bind(&GpuVideoDecoder::SetCdm, weak_factory_.GetWeakPtr()))); 190 base::Bind(&GpuVideoDecoder::SetCdm, weak_factory_.GetWeakPtr())));
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 } 657 }
655 return false; 658 return false;
656 } 659 }
657 660
658 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() 661 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent()
659 const { 662 const {
660 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); 663 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread());
661 } 664 }
662 665
663 } // namespace media 666 } // namespace media
OLDNEW
« no previous file with comments | « content/renderer/pepper/video_decoder_shim.cc ('k') | media/video/mock_video_decode_accelerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698