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

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

Issue 10392141: Plumb texture target to VideoDecodeAccelerator::Client (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 6 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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 return; 304 return;
305 } 305 }
306 shutting_down_ = true; 306 shutting_down_ = true;
307 } 307 }
308 308
309 void GpuVideoDecoder::NotifyInitializeDone() { 309 void GpuVideoDecoder::NotifyInitializeDone() {
310 NOTREACHED() << "GpuVideoDecodeAcceleratorHost::Initialize is synchronous!"; 310 NOTREACHED() << "GpuVideoDecodeAcceleratorHost::Initialize is synchronous!";
311 } 311 }
312 312
313 void GpuVideoDecoder::ProvidePictureBuffers(uint32 count, 313 void GpuVideoDecoder::ProvidePictureBuffers(uint32 count,
314 const gfx::Size& size) { 314 const gfx::Size& size,
315 uint32 texture_target) {
315 if (!gvd_loop_proxy_->BelongsToCurrentThread()) { 316 if (!gvd_loop_proxy_->BelongsToCurrentThread()) {
316 gvd_loop_proxy_->PostTask(FROM_HERE, base::Bind( 317 gvd_loop_proxy_->PostTask(FROM_HERE, base::Bind(
317 &GpuVideoDecoder::ProvidePictureBuffers, this, count, size)); 318 &GpuVideoDecoder::ProvidePictureBuffers, this, count, size,
319 texture_target));
318 return; 320 return;
319 } 321 }
320 322
321 std::vector<uint32> texture_ids; 323 std::vector<uint32> texture_ids;
324 decoder_texture_target_ = texture_target;
322 if (!factories_->CreateTextures( 325 if (!factories_->CreateTextures(
323 count, size, &texture_ids, &decoder_texture_target_)) { 326 count, size, &texture_ids, decoder_texture_target_)) {
324 NotifyError(VideoDecodeAccelerator::PLATFORM_FAILURE); 327 NotifyError(VideoDecodeAccelerator::PLATFORM_FAILURE);
325 return; 328 return;
326 } 329 }
327 330
328 if (!vda_) 331 if (!vda_)
329 return; 332 return;
330 333
331 std::vector<PictureBuffer> picture_buffers; 334 std::vector<PictureBuffer> picture_buffers;
332 for (size_t i = 0; i < texture_ids.size(); ++i) { 335 for (size_t i = 0; i < texture_ids.size(); ++i) {
333 picture_buffers.push_back(PictureBuffer( 336 picture_buffers.push_back(PictureBuffer(
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 531
529 error_occured_ = true; 532 error_occured_ = true;
530 533
531 if (!pending_read_cb_.is_null()) { 534 if (!pending_read_cb_.is_null()) {
532 base::ResetAndReturn(&pending_read_cb_).Run(kDecodeError, NULL); 535 base::ResetAndReturn(&pending_read_cb_).Run(kDecodeError, NULL);
533 return; 536 return;
534 } 537 }
535 } 538 }
536 539
537 } // namespace media 540 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698