| 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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 .Run(kOk, ready_video_frames_.front()); | 509 .Run(kOk, ready_video_frames_.front()); |
| 510 ready_video_frames_.pop_front(); | 510 ready_video_frames_.pop_front(); |
| 511 } | 511 } |
| 512 | 512 |
| 513 // static | 513 // static |
| 514 void GpuVideoDecoder::ReleaseMailbox( | 514 void GpuVideoDecoder::ReleaseMailbox( |
| 515 base::WeakPtr<GpuVideoDecoder> decoder, | 515 base::WeakPtr<GpuVideoDecoder> decoder, |
| 516 const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories, | 516 const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories, |
| 517 int64 picture_buffer_id, | 517 int64 picture_buffer_id, |
| 518 uint32 texture_id, | 518 uint32 texture_id, |
| 519 const std::vector<uint32>& release_sync_points) { | 519 const std::map<uintptr_t, uint32>& release_sync_points) { |
| 520 DCHECK(factories->GetTaskRunner()->BelongsToCurrentThread()); | 520 DCHECK(factories->GetTaskRunner()->BelongsToCurrentThread()); |
| 521 | 521 |
| 522 for (size_t i = 0; i < release_sync_points.size(); i++) | 522 for (std::map<uintptr_t, uint32>::const_iterator iter = |
| 523 factories->WaitSyncPoint(release_sync_points[i]); | 523 release_sync_points.begin(); |
| 524 iter != release_sync_points.end(); |
| 525 iter++) { |
| 526 factories->WaitSyncPoint(iter->second); |
| 527 } |
| 524 | 528 |
| 525 if (decoder) { | 529 if (decoder) { |
| 526 decoder->ReusePictureBuffer(picture_buffer_id); | 530 decoder->ReusePictureBuffer(picture_buffer_id); |
| 527 return; | 531 return; |
| 528 } | 532 } |
| 529 // It's the last chance to delete the texture after display, | 533 // It's the last chance to delete the texture after display, |
| 530 // because GpuVideoDecoder was destructed. | 534 // because GpuVideoDecoder was destructed. |
| 531 factories->DeleteTexture(texture_id); | 535 factories->DeleteTexture(texture_id); |
| 532 } | 536 } |
| 533 | 537 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 return; | 658 return; |
| 655 } | 659 } |
| 656 } | 660 } |
| 657 | 661 |
| 658 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() | 662 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() |
| 659 const { | 663 const { |
| 660 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); | 664 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); |
| 661 } | 665 } |
| 662 | 666 |
| 663 } // namespace media | 667 } // namespace media |
| OLD | NEW |