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/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 } | 684 } |
685 | 685 |
686 void RTCVideoDecoder::CreateVDA(media::VideoCodecProfile profile, | 686 void RTCVideoDecoder::CreateVDA(media::VideoCodecProfile profile, |
687 base::WaitableEvent* waiter) { | 687 base::WaitableEvent* waiter) { |
688 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); | 688 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); |
689 | 689 |
690 if (!IsProfileSupported(profile)) { | 690 if (!IsProfileSupported(profile)) { |
691 DVLOG(1) << "Unsupported profile " << profile; | 691 DVLOG(1) << "Unsupported profile " << profile; |
692 } else { | 692 } else { |
693 vda_ = factories_->CreateVideoDecodeAccelerator(); | 693 vda_ = factories_->CreateVideoDecodeAccelerator(); |
694 if (vda_ && !vda_->Initialize(profile, this)) | 694 if (vda_ && !vda_->Initialize(profile, 0, this)) |
695 vda_.release()->Destroy(); | 695 vda_.release()->Destroy(); |
696 } | 696 } |
697 | 697 |
698 waiter->Signal(); | 698 waiter->Signal(); |
699 } | 699 } |
700 | 700 |
701 void RTCVideoDecoder::DestroyTextures() { | 701 void RTCVideoDecoder::DestroyTextures() { |
702 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); | 702 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); |
703 | 703 |
704 // Not destroying PictureBuffers in |picture_buffers_at_display_| yet, since | 704 // Not destroying PictureBuffers in |picture_buffers_at_display_| yet, since |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoDecoderInitDecodeSuccess", sample); | 812 UMA_HISTOGRAM_BOOLEAN("Media.RTCVideoDecoderInitDecodeSuccess", sample); |
813 return status; | 813 return status; |
814 } | 814 } |
815 | 815 |
816 void RTCVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() | 816 void RTCVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() |
817 const { | 817 const { |
818 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); | 818 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); |
819 } | 819 } |
820 | 820 |
821 } // namespace content | 821 } // namespace content |
OLD | NEW |