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

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: 50e826de Rebase. Created 6 years, 9 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(); 194 if (!vda_ || !vda_->Initialize(config.profile(), this)) {
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
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
OLDNEW
« no previous file with comments | « media/filters/gpu_video_accelerator_factories.h ('k') | media/filters/mock_gpu_video_accelerator_factories.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698