| 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 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 | 474 |
| 475 output_cb_.Run(frame); | 475 output_cb_.Run(frame); |
| 476 } | 476 } |
| 477 | 477 |
| 478 // static | 478 // static |
| 479 void GpuVideoDecoder::ReleaseMailbox( | 479 void GpuVideoDecoder::ReleaseMailbox( |
| 480 base::WeakPtr<GpuVideoDecoder> decoder, | 480 base::WeakPtr<GpuVideoDecoder> decoder, |
| 481 const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories, | 481 const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories, |
| 482 int64 picture_buffer_id, | 482 int64 picture_buffer_id, |
| 483 uint32 texture_id, | 483 uint32 texture_id, |
| 484 const std::vector<uint32>& release_sync_points) { | 484 uint32 release_sync_point) { |
| 485 DCHECK(factories->GetTaskRunner()->BelongsToCurrentThread()); | 485 DCHECK(factories->GetTaskRunner()->BelongsToCurrentThread()); |
| 486 | 486 factories->WaitSyncPoint(release_sync_point); |
| 487 for (size_t i = 0; i < release_sync_points.size(); i++) | |
| 488 factories->WaitSyncPoint(release_sync_points[i]); | |
| 489 | 487 |
| 490 if (decoder) { | 488 if (decoder) { |
| 491 decoder->ReusePictureBuffer(picture_buffer_id); | 489 decoder->ReusePictureBuffer(picture_buffer_id); |
| 492 return; | 490 return; |
| 493 } | 491 } |
| 494 // It's the last chance to delete the texture after display, | 492 // It's the last chance to delete the texture after display, |
| 495 // because GpuVideoDecoder was destructed. | 493 // because GpuVideoDecoder was destructed. |
| 496 factories->DeleteTexture(texture_id); | 494 factories->DeleteTexture(texture_id); |
| 497 } | 495 } |
| 498 | 496 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 DLOG(ERROR) << "VDA Error: " << error; | 606 DLOG(ERROR) << "VDA Error: " << error; |
| 609 DestroyVDA(); | 607 DestroyVDA(); |
| 610 } | 608 } |
| 611 | 609 |
| 612 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() | 610 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() |
| 613 const { | 611 const { |
| 614 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); | 612 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); |
| 615 } | 613 } |
| 616 | 614 |
| 617 } // namespace media | 615 } // namespace media |
| OLD | NEW |