| 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 const std::vector<uint32>& release_sync_points) { | 642 uint32 release_sync_point) { |
| 643 DCHECK(factories->GetTaskRunner()->BelongsToCurrentThread()); | 643 DCHECK(factories->GetTaskRunner()->BelongsToCurrentThread()); |
| 644 | 644 factories->WaitSyncPoint(release_sync_point); |
| 645 for (size_t i = 0; i < release_sync_points.size(); i++) | |
| 646 factories->WaitSyncPoint(release_sync_points[i]); | |
| 647 | 645 |
| 648 if (decoder) { | 646 if (decoder) { |
| 649 decoder->ReusePictureBuffer(picture_buffer_id); | 647 decoder->ReusePictureBuffer(picture_buffer_id); |
| 650 return; | 648 return; |
| 651 } | 649 } |
| 652 // It's the last chance to delete the texture after display, | 650 // It's the last chance to delete the texture after display, |
| 653 // because RTCVideoDecoder was destructed. | 651 // because RTCVideoDecoder was destructed. |
| 654 factories->DeleteTexture(texture_id); | 652 factories->DeleteTexture(texture_id); |
| 655 } | 653 } |
| 656 | 654 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoDecoderInitDecodeSuccess", sample); | 801 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoDecoderInitDecodeSuccess", sample); |
| 804 return status; | 802 return status; |
| 805 } | 803 } |
| 806 | 804 |
| 807 void RTCVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() | 805 void RTCVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() |
| 808 const { | 806 const { |
| 809 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); | 807 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); |
| 810 } | 808 } |
| 811 | 809 |
| 812 } // namespace content | 810 } // namespace content |
| OLD | NEW |