| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 CompleteInitialization(cdm_id, SurfaceManager::kNoSurfaceID); | 244 CompleteInitialization(cdm_id, SurfaceManager::kNoSurfaceID); |
| 245 } | 245 } |
| 246 | 246 |
| 247 void GpuVideoDecoder::CompleteInitialization(int cdm_id, int surface_id) { | 247 void GpuVideoDecoder::CompleteInitialization(int cdm_id, int surface_id) { |
| 248 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); | 248 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); |
| 249 DCHECK(!init_cb_.is_null()); | 249 DCHECK(!init_cb_.is_null()); |
| 250 | 250 |
| 251 VideoDecodeAccelerator::Config vda_config(config_); | 251 VideoDecodeAccelerator::Config vda_config(config_); |
| 252 vda_config.surface_id = surface_id; | 252 vda_config.surface_id = surface_id; |
| 253 vda_config.is_deferred_initialization_allowed = true; | 253 vda_config.is_deferred_initialization_allowed = true; |
| 254 vda_config.initial_expected_coded_size = config_.coded_size(); |
| 254 if (!vda_->Initialize(vda_config, this)) { | 255 if (!vda_->Initialize(vda_config, this)) { |
| 255 DVLOG(1) << "VDA::Initialize failed."; | 256 DVLOG(1) << "VDA::Initialize failed."; |
| 256 base::ResetAndReturn(&init_cb_).Run(false); | 257 base::ResetAndReturn(&init_cb_).Run(false); |
| 257 return; | 258 return; |
| 258 } | 259 } |
| 259 | 260 |
| 260 // The VDA is now initialized, but if the stream is encrypted we need to | 261 // The VDA is now initialized, but if the stream is encrypted we need to |
| 261 // attach the CDM before completing GVD's initialization. | 262 // attach the CDM before completing GVD's initialization. |
| 262 if (config_.is_encrypted()) { | 263 if (config_.is_encrypted()) { |
| 263 // TODO(watk,timav): Pass this in the VDA::Config. | 264 // TODO(watk,timav): Pass this in the VDA::Config. |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 } | 761 } |
| 761 return false; | 762 return false; |
| 762 } | 763 } |
| 763 | 764 |
| 764 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() | 765 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() |
| 765 const { | 766 const { |
| 766 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); | 767 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); |
| 767 } | 768 } |
| 768 | 769 |
| 769 } // namespace media | 770 } // namespace media |
| OLD | NEW |