| 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 | 632 |
| 633 void RTCVideoDecoder::ResetInternal() { | 633 void RTCVideoDecoder::ResetInternal() { |
| 634 DCHECK(vda_task_runner_->BelongsToCurrentThread()); | 634 DCHECK(vda_task_runner_->BelongsToCurrentThread()); |
| 635 DVLOG(2) << "ResetInternal"; | 635 DVLOG(2) << "ResetInternal"; |
| 636 if (vda_) | 636 if (vda_) |
| 637 vda_->Reset(); | 637 vda_->Reset(); |
| 638 } | 638 } |
| 639 | 639 |
| 640 void RTCVideoDecoder::ReusePictureBuffer( | 640 void RTCVideoDecoder::ReusePictureBuffer( |
| 641 int64 picture_buffer_id, | 641 int64 picture_buffer_id, |
| 642 scoped_ptr<gpu::MailboxHolder> mailbox_holder) { | 642 const std::vector<uint32>& release_sync_points) { |
| 643 DCHECK(vda_task_runner_->BelongsToCurrentThread()); | 643 DCHECK(vda_task_runner_->BelongsToCurrentThread()); |
| 644 DVLOG(3) << "ReusePictureBuffer. id=" << picture_buffer_id; | 644 DVLOG(3) << "ReusePictureBuffer. id=" << picture_buffer_id; |
| 645 | 645 |
| 646 if (!vda_) | 646 if (!vda_) |
| 647 return; | 647 return; |
| 648 | 648 |
| 649 CHECK(!picture_buffers_at_display_.empty()); | 649 CHECK(!picture_buffers_at_display_.empty()); |
| 650 | 650 |
| 651 size_t num_erased = picture_buffers_at_display_.erase(picture_buffer_id); | 651 size_t num_erased = picture_buffers_at_display_.erase(picture_buffer_id); |
| 652 DCHECK(num_erased); | 652 DCHECK(num_erased); |
| 653 | 653 |
| 654 factories_->WaitSyncPoint(mailbox_holder->sync_point); | 654 for (size_t i = 0; i < release_sync_points.size(); i++) |
| 655 factories_->WaitSyncPoint(release_sync_points[i]); |
| 655 | 656 |
| 656 std::map<int32, media::PictureBuffer>::iterator it = | 657 std::map<int32, media::PictureBuffer>::iterator it = |
| 657 assigned_picture_buffers_.find(picture_buffer_id); | 658 assigned_picture_buffers_.find(picture_buffer_id); |
| 658 | 659 |
| 659 if (it == assigned_picture_buffers_.end()) { | 660 if (it == assigned_picture_buffers_.end()) { |
| 660 // This picture was dismissed while in display, so we postponed deletion. | 661 // This picture was dismissed while in display, so we postponed deletion. |
| 661 it = dismissed_picture_buffers_.find(picture_buffer_id); | 662 it = dismissed_picture_buffers_.find(picture_buffer_id); |
| 662 DCHECK(it != dismissed_picture_buffers_.end()); | 663 DCHECK(it != dismissed_picture_buffers_.end()); |
| 663 factories_->DeleteTexture(it->second.texture_id()); | 664 factories_->DeleteTexture(it->second.texture_id()); |
| 664 dismissed_picture_buffers_.erase(it); | 665 dismissed_picture_buffers_.erase(it); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 | 788 |
| 788 int32_t RTCVideoDecoder::RecordInitDecodeUMA(int32_t status) { | 789 int32_t RTCVideoDecoder::RecordInitDecodeUMA(int32_t status) { |
| 789 // Logging boolean is enough to know if HW decoding has been used. Also, | 790 // Logging boolean is enough to know if HW decoding has been used. Also, |
| 790 // InitDecode is less likely to return an error so enum is not used here. | 791 // InitDecode is less likely to return an error so enum is not used here. |
| 791 bool sample = (status == WEBRTC_VIDEO_CODEC_OK) ? true : false; | 792 bool sample = (status == WEBRTC_VIDEO_CODEC_OK) ? true : false; |
| 792 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoDecoderInitDecodeSuccess", sample); | 793 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoDecoderInitDecodeSuccess", sample); |
| 793 return status; | 794 return status; |
| 794 } | 795 } |
| 795 | 796 |
| 796 } // namespace content | 797 } // namespace content |
| OLD | NEW |