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(); | |
195 if (!vda_) { | 194 if (!vda_) { |
196 status_cb.Run(DECODER_ERROR_NOT_SUPPORTED); | 195 status_cb.Run(DECODER_ERROR_NOT_SUPPORTED); |
197 return; | 196 return; |
198 } | 197 } |
198 vda_->Initialize(this, config.profile()); | |
Ami GONE FROM CHROMIUM
2014/02/24 23:12:40
this can return false according to vda.h, but not
sheu
2014/02/24 23:48:20
I'm going to fold it into the previous check. I'd
| |
199 | 199 |
200 DVLOG(3) << "GpuVideoDecoder::Initialize() succeeded."; | 200 DVLOG(3) << "GpuVideoDecoder::Initialize() succeeded."; |
201 media_log_->SetStringProperty("video_decoder", "gpu"); | 201 media_log_->SetStringProperty("video_decoder", "gpu"); |
202 status_cb.Run(PIPELINE_OK); | 202 status_cb.Run(PIPELINE_OK); |
203 } | 203 } |
204 | 204 |
205 void GpuVideoDecoder::DestroyPictureBuffers(PictureBufferMap* buffers) { | 205 void GpuVideoDecoder::DestroyPictureBuffers(PictureBufferMap* buffers) { |
206 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); | 206 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); |
207 for (PictureBufferMap::iterator it = buffers->begin(); it != buffers->end(); | 207 for (PictureBufferMap::iterator it = buffers->begin(); it != buffers->end(); |
208 ++it) { | 208 ++it) { |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
646 return; | 646 return; |
647 } | 647 } |
648 } | 648 } |
649 | 649 |
650 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() | 650 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() |
651 const { | 651 const { |
652 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); | 652 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); |
653 } | 653 } |
654 | 654 |
655 } // namespace media | 655 } // namespace media |
OLD | NEW |