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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 // use config information instead. | 443 // use config information instead. |
444 gfx::Rect visible_rect; | 444 gfx::Rect visible_rect; |
445 gfx::Size natural_size; | 445 gfx::Size natural_size; |
446 GetBufferData(picture.bitstream_buffer_id(), ×tamp, &visible_rect, | 446 GetBufferData(picture.bitstream_buffer_id(), ×tamp, &visible_rect, |
447 &natural_size); | 447 &natural_size); |
448 DCHECK(decoder_texture_target_); | 448 DCHECK(decoder_texture_target_); |
449 | 449 |
450 scoped_refptr<VideoFrame> frame(VideoFrame::WrapNativeTexture( | 450 scoped_refptr<VideoFrame> frame(VideoFrame::WrapNativeTexture( |
451 make_scoped_ptr(new gpu::MailboxHolder( | 451 make_scoped_ptr(new gpu::MailboxHolder( |
452 pb.texture_mailbox(), decoder_texture_target_, 0 /* sync_point */)), | 452 pb.texture_mailbox(), decoder_texture_target_, 0 /* sync_point */)), |
453 BindToCurrentLoop(base::Bind(&GpuVideoDecoder::ReleaseMailbox, | 453 BindToCurrentLoop(base::Bind( |
454 weak_factory_.GetWeakPtr(), | 454 &GpuVideoDecoder::ReleaseMailbox, weak_factory_.GetWeakPtr(), |
455 factories_, | 455 factories_, picture.picture_buffer_id(), pb.texture_id())), |
456 picture.picture_buffer_id(), | 456 pb.size(), visible_rect, natural_size, timestamp, |
457 pb.texture_id())), | 457 base::Bind(&ReadPixelsSync, factories_, pb.texture_id(), visible_rect), |
458 pb.size(), | 458 picture.allow_overlay())); |
459 visible_rect, | |
460 natural_size, | |
461 timestamp, | |
462 base::Bind(&ReadPixelsSync, factories_, pb.texture_id(), visible_rect))); | |
463 CHECK_GT(available_pictures_, 0); | 459 CHECK_GT(available_pictures_, 0); |
464 --available_pictures_; | 460 --available_pictures_; |
465 bool inserted = | 461 bool inserted = |
466 picture_buffers_at_display_.insert(std::make_pair( | 462 picture_buffers_at_display_.insert(std::make_pair( |
467 picture.picture_buffer_id(), | 463 picture.picture_buffer_id(), |
468 pb.texture_id())).second; | 464 pb.texture_id())).second; |
469 DCHECK(inserted); | 465 DCHECK(inserted); |
470 | 466 |
471 DeliverFrame(frame); | 467 DeliverFrame(frame); |
472 } | 468 } |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 DLOG(ERROR) << "VDA Error: " << error; | 618 DLOG(ERROR) << "VDA Error: " << error; |
623 DestroyVDA(); | 619 DestroyVDA(); |
624 } | 620 } |
625 | 621 |
626 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() | 622 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() |
627 const { | 623 const { |
628 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); | 624 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); |
629 } | 625 } |
630 | 626 |
631 } // namespace media | 627 } // namespace media |
OLD | NEW |