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

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

Issue 170843004: Pass Client pointer in Initialize() for VDA/VEA (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: b0ec4672 Build fixes. Created 6 years, 10 months 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 | Annotate | Revision Log
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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698