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/gpu/rtc_video_decoder.h" | 5 #include "content/renderer/media/gpu/rtc_video_decoder.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 } | 665 } |
666 | 666 |
667 void RTCVideoDecoder::ResetInternal() { | 667 void RTCVideoDecoder::ResetInternal() { |
668 DVLOG(2) << __func__; | 668 DVLOG(2) << __func__; |
669 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); | 669 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); |
670 | 670 |
671 if (vda_) { | 671 if (vda_) { |
672 vda_->Reset(); | 672 vda_->Reset(); |
673 } else { | 673 } else { |
674 CreateVDA(vda_codec_profile_, nullptr); | 674 CreateVDA(vda_codec_profile_, nullptr); |
675 if (vda_) | 675 if (vda_) { |
| 676 base::AutoLock auto_lock(lock_); |
676 state_ = INITIALIZED; | 677 state_ = INITIALIZED; |
| 678 } |
677 } | 679 } |
678 } | 680 } |
679 | 681 |
680 // static | 682 // static |
681 void RTCVideoDecoder::ReleaseMailbox( | 683 void RTCVideoDecoder::ReleaseMailbox( |
682 base::WeakPtr<RTCVideoDecoder> decoder, | 684 base::WeakPtr<RTCVideoDecoder> decoder, |
683 media::GpuVideoAcceleratorFactories* factories, | 685 media::GpuVideoAcceleratorFactories* factories, |
684 int64_t picture_buffer_id, | 686 int64_t picture_buffer_id, |
685 uint32_t texture_id, | 687 uint32_t texture_id, |
686 const gpu::SyncToken& release_sync_token) { | 688 const gpu::SyncToken& release_sync_token) { |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 } | 888 } |
887 | 889 |
888 void RTCVideoDecoder::ClearPendingBuffers() { | 890 void RTCVideoDecoder::ClearPendingBuffers() { |
889 // Delete WebRTC input buffers. | 891 // Delete WebRTC input buffers. |
890 for (const auto& pending_buffer : pending_buffers_) | 892 for (const auto& pending_buffer : pending_buffers_) |
891 delete[] pending_buffer.first._buffer; | 893 delete[] pending_buffer.first._buffer; |
892 pending_buffers_.clear(); | 894 pending_buffers_.clear(); |
893 } | 895 } |
894 | 896 |
895 } // namespace content | 897 } // namespace content |
OLD | NEW |