| 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 #ifndef CC_LAYERS_VIDEO_FRAME_PROVIDER_CLIENT_IMPL_H_ | 5 #ifndef CC_LAYERS_VIDEO_FRAME_PROVIDER_CLIENT_IMPL_H_ |
| 6 #define CC_LAYERS_VIDEO_FRAME_PROVIDER_CLIENT_IMPL_H_ | 6 #define CC_LAYERS_VIDEO_FRAME_PROVIDER_CLIENT_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 bool Stopped() const; | 39 bool Stopped() const; |
| 40 // Must be called on the impl thread while the main thread is blocked. | 40 // Must be called on the impl thread while the main thread is blocked. |
| 41 void Stop(); | 41 void Stop(); |
| 42 | 42 |
| 43 scoped_refptr<media::VideoFrame> AcquireLockAndCurrentFrame(); | 43 scoped_refptr<media::VideoFrame> AcquireLockAndCurrentFrame(); |
| 44 void PutCurrentFrame(); | 44 void PutCurrentFrame(); |
| 45 void ReleaseLock(); | 45 void ReleaseLock(); |
| 46 bool HasCurrentFrame(); | 46 bool HasCurrentFrame(); |
| 47 | 47 |
| 48 const gfx::Transform& StreamTextureMatrix() const; |
| 49 |
| 48 // VideoFrameController implementation. | 50 // VideoFrameController implementation. |
| 49 void OnBeginFrame(const BeginFrameArgs& args) override; | 51 void OnBeginFrame(const BeginFrameArgs& args) override; |
| 50 void DidDrawFrame() override; | 52 void DidDrawFrame() override; |
| 51 | 53 |
| 52 // VideoFrameProvider::Client implementation. | 54 // VideoFrameProvider::Client implementation. |
| 53 // Called on the main thread. | 55 // Called on the main thread. |
| 54 void StopUsingProvider() override; | 56 void StopUsingProvider() override; |
| 55 // Called on the impl thread. | 57 // Called on the impl thread. |
| 56 void StartRendering() override; | 58 void StartRendering() override; |
| 57 void StopRendering() override; | 59 void StopRendering() override; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 75 bool rendering_; | 77 bool rendering_; |
| 76 bool needs_put_current_frame_; | 78 bool needs_put_current_frame_; |
| 77 | 79 |
| 78 // Since the provider lives on another thread, it can be destroyed while the | 80 // Since the provider lives on another thread, it can be destroyed while the |
| 79 // frame controller are accessing its frame. Before being destroyed the | 81 // frame controller are accessing its frame. Before being destroyed the |
| 80 // provider calls StopUsingProvider. provider_lock_ blocks StopUsingProvider | 82 // provider calls StopUsingProvider. provider_lock_ blocks StopUsingProvider |
| 81 // from returning until the frame controller is done using the frame. | 83 // from returning until the frame controller is done using the frame. |
| 82 base::Lock provider_lock_; | 84 base::Lock provider_lock_; |
| 83 base::ThreadChecker thread_checker_; | 85 base::ThreadChecker thread_checker_; |
| 84 | 86 |
| 87 gfx::Transform stream_texture_matrix_; |
| 88 |
| 85 DISALLOW_COPY_AND_ASSIGN(VideoFrameProviderClientImpl); | 89 DISALLOW_COPY_AND_ASSIGN(VideoFrameProviderClientImpl); |
| 86 }; | 90 }; |
| 87 | 91 |
| 88 } // namespace cc | 92 } // namespace cc |
| 89 | 93 |
| 90 #endif // CC_LAYERS_VIDEO_FRAME_PROVIDER_CLIENT_IMPL_H_ | 94 #endif // CC_LAYERS_VIDEO_FRAME_PROVIDER_CLIENT_IMPL_H_ |
| OLD | NEW |