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 MEDIA_FILTERS_VIDEO_RENDERER_BASE_H_ | 5 #ifndef MEDIA_FILTERS_VIDEO_RENDERER_BASE_H_ |
6 #define MEDIA_FILTERS_VIDEO_RENDERER_BASE_H_ | 6 #define MEDIA_FILTERS_VIDEO_RENDERER_BASE_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 void AttemptFlush_Locked(); | 100 void AttemptFlush_Locked(); |
101 | 101 |
102 // Calculates the duration to sleep for based on |current_frame_|'s timestamp, | 102 // Calculates the duration to sleep for based on |current_frame_|'s timestamp, |
103 // the next frame timestamp (may be NULL), and the provided playback rate. | 103 // the next frame timestamp (may be NULL), and the provided playback rate. |
104 // | 104 // |
105 // We don't use |playback_rate_| to avoid locking. | 105 // We don't use |playback_rate_| to avoid locking. |
106 base::TimeDelta CalculateSleepDuration( | 106 base::TimeDelta CalculateSleepDuration( |
107 const scoped_refptr<VideoFrame>& next_frame, | 107 const scoped_refptr<VideoFrame>& next_frame, |
108 float playback_rate); | 108 float playback_rate); |
109 | 109 |
110 // Safely handles entering to an error state. | |
111 void EnterErrorState_Locked(PipelineStatus status); | |
112 | |
113 // Helper function that flushes the buffers when a Stop() or error occurs. | 110 // Helper function that flushes the buffers when a Stop() or error occurs. |
114 void DoStopOrError_Locked(); | 111 void DoStopOrError_Locked(); |
115 | 112 |
116 // Return the number of frames currently held by this class. | 113 // Return the number of frames currently held by this class. |
117 int NumFrames_Locked() const; | 114 int NumFrames_Locked() const; |
118 | 115 |
119 // Updates |current_frame_| to the next frame on |ready_frames_| and calls | 116 // Updates |current_frame_| to the next frame on |ready_frames_| and calls |
120 // |size_changed_cb_| if the natural size changes. | 117 // |size_changed_cb_| if the natural size changes. |
121 void SetCurrentFrameToNextReadyFrame(); | 118 void SetCurrentFrameToNextReadyFrame(); |
122 | 119 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 | 231 |
235 // The last natural size |size_changed_cb_| was called with. | 232 // The last natural size |size_changed_cb_| was called with. |
236 gfx::Size last_natural_size_; | 233 gfx::Size last_natural_size_; |
237 | 234 |
238 DISALLOW_COPY_AND_ASSIGN(VideoRendererBase); | 235 DISALLOW_COPY_AND_ASSIGN(VideoRendererBase); |
239 }; | 236 }; |
240 | 237 |
241 } // namespace media | 238 } // namespace media |
242 | 239 |
243 #endif // MEDIA_FILTERS_VIDEO_RENDERER_BASE_H_ | 240 #endif // MEDIA_FILTERS_VIDEO_RENDERER_BASE_H_ |
OLD | NEW |