OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/media/rtc_video_decoder.h" | 5 #include "content/renderer/media/rtc_video_decoder.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 if (vda_) | 632 if (vda_) |
633 vda_->Reset(); | 633 vda_->Reset(); |
634 } | 634 } |
635 | 635 |
636 // static | 636 // static |
637 void RTCVideoDecoder::ReleaseMailbox( | 637 void RTCVideoDecoder::ReleaseMailbox( |
638 base::WeakPtr<RTCVideoDecoder> decoder, | 638 base::WeakPtr<RTCVideoDecoder> decoder, |
639 const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories, | 639 const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories, |
640 int64 picture_buffer_id, | 640 int64 picture_buffer_id, |
641 uint32 texture_id, | 641 uint32 texture_id, |
642 scoped_ptr<gpu::MailboxHolder> mailbox_holder) { | 642 const std::vector<uint32>& release_sync_points) { |
643 DCHECK(factories->GetTaskRunner()->BelongsToCurrentThread()); | 643 DCHECK(factories->GetTaskRunner()->BelongsToCurrentThread()); |
644 factories->WaitSyncPoint(mailbox_holder->sync_point); | 644 |
| 645 for (size_t i = 0; i < release_sync_points.size(); i++) |
| 646 factories->WaitSyncPoint(release_sync_points[i]); |
645 | 647 |
646 if (decoder) { | 648 if (decoder) { |
647 decoder->ReusePictureBuffer(picture_buffer_id); | 649 decoder->ReusePictureBuffer(picture_buffer_id); |
648 return; | 650 return; |
649 } | 651 } |
650 // It's the last chance to delete the texture after display, | 652 // It's the last chance to delete the texture after display, |
651 // because RTCVideoDecoder was destructed. | 653 // because RTCVideoDecoder was destructed. |
652 factories->DeleteTexture(texture_id); | 654 factories->DeleteTexture(texture_id); |
653 } | 655 } |
654 | 656 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoDecoderInitDecodeSuccess", sample); | 803 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoDecoderInitDecodeSuccess", sample); |
802 return status; | 804 return status; |
803 } | 805 } |
804 | 806 |
805 void RTCVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() | 807 void RTCVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() |
806 const { | 808 const { |
807 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); | 809 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); |
808 } | 810 } |
809 | 811 |
810 } // namespace content | 812 } // namespace content |
OLD | NEW |