| 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 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 } | 738 } |
| 739 | 739 |
| 740 return false; | 740 return false; |
| 741 } | 741 } |
| 742 | 742 |
| 743 void RTCVideoDecoder::CreateVDA(media::VideoCodecProfile profile, | 743 void RTCVideoDecoder::CreateVDA(media::VideoCodecProfile profile, |
| 744 base::WaitableEvent* waiter) { | 744 base::WaitableEvent* waiter) { |
| 745 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); | 745 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); |
| 746 | 746 |
| 747 if (!IsProfileSupported(profile)) { | 747 if (!IsProfileSupported(profile)) { |
| 748 DVLOG(1) << "Unsupported profile " << GetProfileName(profile); | 748 LOG(ERROR) << "Unsupported profile " << GetProfileName(profile); |
| 749 } else { | 749 } else { |
| 750 vda_ = factories_->CreateVideoDecodeAccelerator(); | 750 vda_ = factories_->CreateVideoDecodeAccelerator(); |
| 751 | 751 |
| 752 media::VideoDecodeAccelerator::Config config(profile); | 752 media::VideoDecodeAccelerator::Config config(profile); |
| 753 if (vda_ && !vda_->Initialize(config, this)) | 753 if (vda_ && !vda_->Initialize(config, this)) |
| 754 vda_.release()->Destroy(); | 754 vda_.release()->Destroy(); |
| 755 vda_codec_profile_ = profile; | 755 vda_codec_profile_ = profile; |
| 756 LOG(ERROR) << "Unsupported profile " << GetProfileName(profile); |
| 756 } | 757 } |
| 757 | 758 |
| 758 if (waiter) | 759 if (waiter) |
| 759 waiter->Signal(); | 760 waiter->Signal(); |
| 760 } | 761 } |
| 761 | 762 |
| 762 void RTCVideoDecoder::DestroyTextures() { | 763 void RTCVideoDecoder::DestroyTextures() { |
| 763 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); | 764 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); |
| 764 | 765 |
| 765 // Not destroying PictureBuffers in |picture_buffers_at_display_| yet, since | 766 // Not destroying PictureBuffers in |picture_buffers_at_display_| yet, since |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 } | 894 } |
| 894 | 895 |
| 895 void RTCVideoDecoder::ClearPendingBuffers() { | 896 void RTCVideoDecoder::ClearPendingBuffers() { |
| 896 // Delete WebRTC input buffers. | 897 // Delete WebRTC input buffers. |
| 897 for (const auto& pending_buffer : pending_buffers_) | 898 for (const auto& pending_buffer : pending_buffers_) |
| 898 delete[] pending_buffer.first._buffer; | 899 delete[] pending_buffer.first._buffer; |
| 899 pending_buffers_.clear(); | 900 pending_buffers_.clear(); |
| 900 } | 901 } |
| 901 | 902 |
| 902 } // namespace content | 903 } // namespace content |
| OLD | NEW |