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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
183 needs_bitstream_conversion_ = (config.codec() == kCodecH264); | 183 needs_bitstream_conversion_ = (config.codec() == kCodecH264); |
184 | 184 |
185 if (previously_initialized) { | 185 if (previously_initialized) { |
186 // Reinitialization with a different config (but same codec and profile). | 186 // Reinitialization with a different config (but same codec and profile). |
187 // VDA should handle it by detecting this in-stream by itself, | 187 // VDA should handle it by detecting this in-stream by itself, |
188 // no need to notify it. | 188 // no need to notify it. |
189 status_cb.Run(PIPELINE_OK); | 189 status_cb.Run(PIPELINE_OK); |
190 return; | 190 return; |
191 } | 191 } |
192 | 192 |
193 vda_ = | 193 vda_ = factories_->CreateVideoDecodeAccelerator(config.profile()).Pass(); |
194 factories_->CreateVideoDecodeAccelerator(config.profile(), this).Pass(); | 194 if (!vda_ || !vda_->Initialize(this, config.profile())) { |
Ami GONE FROM CHROMIUM
2014/02/25 00:01:35
I love this formulation because it crystallizes so
sheu
2014/02/25 00:37:16
I don't think that's innately a failure -- it's mo
Ami GONE FROM CHROMIUM
2014/02/25 00:50:51
<MadTV>Lowered expectaaations...</MadTV>
| |
195 if (!vda_) { | |
196 status_cb.Run(DECODER_ERROR_NOT_SUPPORTED); | 195 status_cb.Run(DECODER_ERROR_NOT_SUPPORTED); |
197 return; | 196 return; |
198 } | 197 } |
199 | 198 |
200 DVLOG(3) << "GpuVideoDecoder::Initialize() succeeded."; | 199 DVLOG(3) << "GpuVideoDecoder::Initialize() succeeded."; |
201 media_log_->SetStringProperty("video_decoder", "gpu"); | 200 media_log_->SetStringProperty("video_decoder", "gpu"); |
202 status_cb.Run(PIPELINE_OK); | 201 status_cb.Run(PIPELINE_OK); |
203 } | 202 } |
204 | 203 |
205 void GpuVideoDecoder::DestroyPictureBuffers(PictureBufferMap* buffers) { | 204 void GpuVideoDecoder::DestroyPictureBuffers(PictureBufferMap* buffers) { |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
646 return; | 645 return; |
647 } | 646 } |
648 } | 647 } |
649 | 648 |
650 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() | 649 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() |
651 const { | 650 const { |
652 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); | 651 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); |
653 } | 652 } |
654 | 653 |
655 } // namespace media | 654 } // namespace media |
OLD | NEW |