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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 .Run(kOk, ready_video_frames_.front()); | 504 .Run(kOk, ready_video_frames_.front()); |
505 ready_video_frames_.pop_front(); | 505 ready_video_frames_.pop_front(); |
506 } | 506 } |
507 | 507 |
508 // static | 508 // static |
509 void GpuVideoDecoder::ReleaseMailbox( | 509 void GpuVideoDecoder::ReleaseMailbox( |
510 base::WeakPtr<GpuVideoDecoder> decoder, | 510 base::WeakPtr<GpuVideoDecoder> decoder, |
511 const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories, | 511 const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories, |
512 int64 picture_buffer_id, | 512 int64 picture_buffer_id, |
513 uint32 texture_id, | 513 uint32 texture_id, |
514 scoped_ptr<gpu::MailboxHolder> mailbox_holder) { | 514 const std::vector<uint32>& release_sync_points) { |
515 DCHECK(factories->GetTaskRunner()->BelongsToCurrentThread()); | 515 DCHECK(factories->GetTaskRunner()->BelongsToCurrentThread()); |
516 factories->WaitSyncPoint(mailbox_holder->sync_point); | 516 |
| 517 for (size_t i = 0; i < release_sync_points.size(); i++) |
| 518 factories->WaitSyncPoint(release_sync_points[i]); |
517 | 519 |
518 if (decoder) { | 520 if (decoder) { |
519 decoder->ReusePictureBuffer(picture_buffer_id); | 521 decoder->ReusePictureBuffer(picture_buffer_id); |
520 return; | 522 return; |
521 } | 523 } |
522 // It's the last chance to delete the texture after display, | 524 // It's the last chance to delete the texture after display, |
523 // because GpuVideoDecoder was destructed. | 525 // because GpuVideoDecoder was destructed. |
524 factories->DeleteTexture(texture_id); | 526 factories->DeleteTexture(texture_id); |
525 } | 527 } |
526 | 528 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 return; | 649 return; |
648 } | 650 } |
649 } | 651 } |
650 | 652 |
651 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() | 653 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() |
652 const { | 654 const { |
653 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); | 655 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); |
654 } | 656 } |
655 | 657 |
656 } // namespace media | 658 } // namespace media |
OLD | NEW |