Chromium Code Reviews| 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 "cc/layers/video_frame_provider_client_impl.h" | 5 #include "cc/layers/video_frame_provider_client_impl.h" |
| 6 | 6 |
| 7 #include "base/trace_event/trace_event.h" | 7 #include "base/trace_event/trace_event.h" |
| 8 #include "cc/base/math_util.h" | 8 #include "cc/base/math_util.h" |
| 9 #include "cc/layers/video_layer_impl.h" | 9 #include "cc/layers/video_layer_impl.h" |
| 10 #include "media/base/video_frame.h" | 10 #include "media/base/video_frame.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 provider_lock_.AssertAcquired(); | 91 provider_lock_.AssertAcquired(); |
| 92 provider_->PutCurrentFrame(); | 92 provider_->PutCurrentFrame(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void VideoFrameProviderClientImpl::ReleaseLock() { | 95 void VideoFrameProviderClientImpl::ReleaseLock() { |
| 96 DCHECK(thread_checker_.CalledOnValidThread()); | 96 DCHECK(thread_checker_.CalledOnValidThread()); |
| 97 provider_lock_.AssertAcquired(); | 97 provider_lock_.AssertAcquired(); |
| 98 provider_lock_.Release(); | 98 provider_lock_.Release(); |
| 99 } | 99 } |
| 100 | 100 |
| 101 bool VideoFrameProviderClientImpl::HasCurrentFrame() { | |
| 102 base::AutoLock locker(provider_lock_); | |
| 103 return provider_ && provider_->GetCurrentFrame(); | |
|
danakj
2015/05/18 17:19:52
You need to match calls to GetCurrentFrame() with
hendrikw
2015/05/18 17:46:58
That's an weird requirement. WebMediaPlayerMS::Ge
| |
| 104 } | |
| 105 | |
| 101 const gfx::Transform& VideoFrameProviderClientImpl::StreamTextureMatrix() | 106 const gfx::Transform& VideoFrameProviderClientImpl::StreamTextureMatrix() |
| 102 const { | 107 const { |
| 103 DCHECK(thread_checker_.CalledOnValidThread()); | 108 DCHECK(thread_checker_.CalledOnValidThread()); |
| 104 return stream_texture_matrix_; | 109 return stream_texture_matrix_; |
| 105 } | 110 } |
| 106 | 111 |
| 107 void VideoFrameProviderClientImpl::StopUsingProvider() { | 112 void VideoFrameProviderClientImpl::StopUsingProvider() { |
| 108 // Block the provider from shutting down until this client is done | 113 // Block the provider from shutting down until this client is done |
| 109 // using the frame. | 114 // using the frame. |
| 110 base::AutoLock locker(provider_lock_); | 115 base::AutoLock locker(provider_lock_); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 165 if (!provider_ || | 170 if (!provider_ || |
| 166 !provider_->UpdateCurrentFrame(args.frame_time + args.interval, | 171 !provider_->UpdateCurrentFrame(args.frame_time + args.interval, |
| 167 args.frame_time + 2 * args.interval)) { | 172 args.frame_time + 2 * args.interval)) { |
| 168 return; | 173 return; |
| 169 } | 174 } |
| 170 | 175 |
| 171 DidReceiveFrame(); | 176 DidReceiveFrame(); |
| 172 } | 177 } |
| 173 | 178 |
| 174 } // namespace cc | 179 } // namespace cc |
| OLD | NEW |