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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 | 465 |
466 output_cb_.Run(frame); | 466 output_cb_.Run(frame); |
467 } | 467 } |
468 | 468 |
469 // static | 469 // static |
470 void GpuVideoDecoder::ReleaseMailbox( | 470 void GpuVideoDecoder::ReleaseMailbox( |
471 base::WeakPtr<GpuVideoDecoder> decoder, | 471 base::WeakPtr<GpuVideoDecoder> decoder, |
472 const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories, | 472 const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories, |
473 int64 picture_buffer_id, | 473 int64 picture_buffer_id, |
474 uint32 texture_id, | 474 uint32 texture_id, |
475 const std::vector<uint32>& release_sync_points) { | 475 uint32 release_sync_point) { |
476 DCHECK(factories->GetTaskRunner()->BelongsToCurrentThread()); | 476 DCHECK(factories->GetTaskRunner()->BelongsToCurrentThread()); |
477 | 477 factories->WaitSyncPoint(release_sync_point); |
478 for (size_t i = 0; i < release_sync_points.size(); i++) | |
479 factories->WaitSyncPoint(release_sync_points[i]); | |
480 | 478 |
481 if (decoder) { | 479 if (decoder) { |
482 decoder->ReusePictureBuffer(picture_buffer_id); | 480 decoder->ReusePictureBuffer(picture_buffer_id); |
483 return; | 481 return; |
484 } | 482 } |
485 // It's the last chance to delete the texture after display, | 483 // It's the last chance to delete the texture after display, |
486 // because GpuVideoDecoder was destructed. | 484 // because GpuVideoDecoder was destructed. |
487 factories->DeleteTexture(texture_id); | 485 factories->DeleteTexture(texture_id); |
488 } | 486 } |
489 | 487 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 DLOG(ERROR) << "VDA Error: " << error; | 602 DLOG(ERROR) << "VDA Error: " << error; |
605 DestroyVDA(); | 603 DestroyVDA(); |
606 } | 604 } |
607 | 605 |
608 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() | 606 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() |
609 const { | 607 const { |
610 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); | 608 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); |
611 } | 609 } |
612 | 610 |
613 } // namespace media | 611 } // namespace media |
OLD | NEW |