| 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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 .Run(kOk, ready_video_frames_.front()); | 494 .Run(kOk, ready_video_frames_.front()); |
| 495 ready_video_frames_.pop_front(); | 495 ready_video_frames_.pop_front(); |
| 496 } | 496 } |
| 497 | 497 |
| 498 // static | 498 // static |
| 499 void GpuVideoDecoder::ReleaseMailbox( | 499 void GpuVideoDecoder::ReleaseMailbox( |
| 500 base::WeakPtr<GpuVideoDecoder> decoder, | 500 base::WeakPtr<GpuVideoDecoder> decoder, |
| 501 const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories, | 501 const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories, |
| 502 int64 picture_buffer_id, | 502 int64 picture_buffer_id, |
| 503 uint32 texture_id, | 503 uint32 texture_id, |
| 504 scoped_ptr<gpu::MailboxHolder> mailbox_holder) { | 504 const std::vector<uint32>& release_sync_points) { |
| 505 DCHECK(factories->GetTaskRunner()->BelongsToCurrentThread()); | 505 DCHECK(factories->GetTaskRunner()->BelongsToCurrentThread()); |
| 506 factories->WaitSyncPoint(mailbox_holder->sync_point); | 506 |
| 507 for (size_t i = 0; i < release_sync_points.size(); i++) |
| 508 factories->WaitSyncPoint(release_sync_points[i]); |
| 507 | 509 |
| 508 if (decoder) { | 510 if (decoder) { |
| 509 decoder->ReusePictureBuffer(picture_buffer_id); | 511 decoder->ReusePictureBuffer(picture_buffer_id); |
| 510 return; | 512 return; |
| 511 } | 513 } |
| 512 // It's the last chance to delete the texture after display, | 514 // It's the last chance to delete the texture after display, |
| 513 // because GpuVideoDecoder was destructed. | 515 // because GpuVideoDecoder was destructed. |
| 514 factories->DeleteTexture(texture_id); | 516 factories->DeleteTexture(texture_id); |
| 515 } | 517 } |
| 516 | 518 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 return; | 639 return; |
| 638 } | 640 } |
| 639 } | 641 } |
| 640 | 642 |
| 641 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() | 643 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() |
| 642 const { | 644 const { |
| 643 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); | 645 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); |
| 644 } | 646 } |
| 645 | 647 |
| 646 } // namespace media | 648 } // namespace media |
| OLD | NEW |