OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_H_ | 5 #ifndef CC_LAYERS_VIDEO_FRAME_PROVIDER_H_ |
6 #define CC_LAYERS_VIDEO_FRAME_PROVIDER_H_ | 6 #define CC_LAYERS_VIDEO_FRAME_PROVIDER_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 // Called by the client on a regular interval. Returns true if a new frame | 61 // Called by the client on a regular interval. Returns true if a new frame |
62 // will be available via GetCurrentFrame() which should be displayed within | 62 // will be available via GetCurrentFrame() which should be displayed within |
63 // the presentation interval [|deadline_min|, |deadline_max|]. | 63 // the presentation interval [|deadline_min|, |deadline_max|]. |
64 // | 64 // |
65 // Implementations may use this to drive frame acquisition from underlying | 65 // Implementations may use this to drive frame acquisition from underlying |
66 // sources, so it must be called by clients before calling GetCurrentFrame(). | 66 // sources, so it must be called by clients before calling GetCurrentFrame(). |
67 virtual bool UpdateCurrentFrame(base::TimeTicks deadline_min, | 67 virtual bool UpdateCurrentFrame(base::TimeTicks deadline_min, |
68 base::TimeTicks deadline_max) = 0; | 68 base::TimeTicks deadline_max) = 0; |
69 | 69 |
| 70 // Returns true if GetCurrentFrame() will return a non-null frame and false |
| 71 // otherwise. Aside from thread locks, the state won't change. |
| 72 virtual bool HasCurrentFrame() = 0; |
| 73 |
70 // Returns the current frame, which may have been updated by a recent call to | 74 // Returns the current frame, which may have been updated by a recent call to |
71 // UpdateCurrentFrame(). A call to this method does not ensure that the frame | 75 // UpdateCurrentFrame(). A call to this method does not ensure that the frame |
72 // will be rendered. A subsequent call to PutCurrentFrame() must be made if | 76 // will be rendered. A subsequent call to PutCurrentFrame() must be made if |
73 // the frame is expected to be rendered. | 77 // the frame is expected to be rendered. |
74 // | 78 // |
75 // Clients should call this in response to UpdateCurrentFrame() returning true | 79 // Clients should call this in response to UpdateCurrentFrame() returning true |
76 // or in response to a DidReceiveFrame() call. | 80 // or in response to a DidReceiveFrame() call. |
77 // | 81 // |
78 // TODO(dalecurtis): Remove text about DidReceiveFrame() once the old path | 82 // TODO(dalecurtis): Remove text about DidReceiveFrame() once the old path |
79 // has been removed. http://crbug.com/439548 | 83 // has been removed. http://crbug.com/439548 |
80 virtual scoped_refptr<media::VideoFrame> GetCurrentFrame() = 0; | 84 virtual scoped_refptr<media::VideoFrame> GetCurrentFrame() = 0; |
81 | 85 |
82 // Indicates that the last frame returned via GetCurrentFrame() is expected to | 86 // Indicates that the last frame returned via GetCurrentFrame() is expected to |
83 // be rendered. Must only occur after a previous call to GetCurrentFrame(). | 87 // be rendered. Must only occur after a previous call to GetCurrentFrame(). |
84 virtual void PutCurrentFrame() = 0; | 88 virtual void PutCurrentFrame() = 0; |
85 | 89 |
86 protected: | 90 protected: |
87 virtual ~VideoFrameProvider() {} | 91 virtual ~VideoFrameProvider() {} |
88 }; | 92 }; |
89 | 93 |
90 } // namespace cc | 94 } // namespace cc |
91 | 95 |
92 #endif // CC_LAYERS_VIDEO_FRAME_PROVIDER_H_ | 96 #endif // CC_LAYERS_VIDEO_FRAME_PROVIDER_H_ |
OLD | NEW |