| 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 "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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |