| 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 <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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 profile = media::VP8PROFILE_ANY; | 113 profile = media::VP8PROFILE_ANY; |
| 114 break; | 114 break; |
| 115 case webrtc::kVideoCodecH264: | 115 case webrtc::kVideoCodecH264: |
| 116 profile = media::H264PROFILE_MAIN; | 116 profile = media::H264PROFILE_MAIN; |
| 117 break; | 117 break; |
| 118 default: | 118 default: |
| 119 DVLOG(2) << "Video codec not supported:" << type; | 119 DVLOG(2) << "Video codec not supported:" << type; |
| 120 return decoder; | 120 return decoder; |
| 121 } | 121 } |
| 122 | 122 |
| 123 base::WaitableEvent waiter(true, false); | 123 base::WaitableEvent waiter(base::WaitableEvent::ResetPolicy::MANUAL, |
| 124 base::WaitableEvent::InitialState::NOT_SIGNALED); |
| 124 decoder.reset(new RTCVideoDecoder(type, factories)); | 125 decoder.reset(new RTCVideoDecoder(type, factories)); |
| 125 decoder->factories_->GetTaskRunner()->PostTask( | 126 decoder->factories_->GetTaskRunner()->PostTask( |
| 126 FROM_HERE, | 127 FROM_HERE, |
| 127 base::Bind(&RTCVideoDecoder::CreateVDA, | 128 base::Bind(&RTCVideoDecoder::CreateVDA, |
| 128 base::Unretained(decoder.get()), | 129 base::Unretained(decoder.get()), |
| 129 profile, | 130 profile, |
| 130 &waiter)); | 131 &waiter)); |
| 131 waiter.Wait(); | 132 waiter.Wait(); |
| 132 // |decoder->vda_| is nullptr if the codec is not supported. | 133 // |decoder->vda_| is nullptr if the codec is not supported. |
| 133 if (decoder->vda_) | 134 if (decoder->vda_) |
| (...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 | 887 |
| 887 void RTCVideoDecoder::TryResetVDAErrorCounter_Locked() { | 888 void RTCVideoDecoder::TryResetVDAErrorCounter_Locked() { |
| 888 lock_.AssertAcquired(); | 889 lock_.AssertAcquired(); |
| 889 | 890 |
| 890 if (vda_error_counter_ == 0) | 891 if (vda_error_counter_ == 0) |
| 891 return; | 892 return; |
| 892 vda_error_counter_ = 0; | 893 vda_error_counter_ = 0; |
| 893 } | 894 } |
| 894 | 895 |
| 895 } // namespace content | 896 } // namespace content |
| OLD | NEW |