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 MEDIA_RENDERERS_VIDEO_RENDERER_IMPL_H_ | 5 #ifndef MEDIA_RENDERERS_VIDEO_RENDERER_IMPL_H_ |
6 #define MEDIA_RENDERERS_VIDEO_RENDERER_IMPL_H_ | 6 #define MEDIA_RENDERERS_VIDEO_RENDERER_IMPL_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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 128 |
129 // Runs |statistics_cb_| with |frames_decoded_| and |frames_dropped_|, resets | 129 // Runs |statistics_cb_| with |frames_decoded_| and |frames_dropped_|, resets |
130 // them to 0, and then waits on |frame_available_| for up to the | 130 // them to 0, and then waits on |frame_available_| for up to the |
131 // |wait_duration|. | 131 // |wait_duration|. |
132 void UpdateStatsAndWait_Locked(base::TimeDelta wait_duration); | 132 void UpdateStatsAndWait_Locked(base::TimeDelta wait_duration); |
133 | 133 |
134 // Called after we've painted the first frame. If |time_progressing_| is | 134 // Called after we've painted the first frame. If |time_progressing_| is |
135 // false it Stop() on |sink_|. | 135 // false it Stop() on |sink_|. |
136 void MaybeStopSinkAfterFirstPaint(); | 136 void MaybeStopSinkAfterFirstPaint(); |
137 | 137 |
138 // Returns true if there is no more room for additional buffered frames. The | 138 // Returns true if there is no more room for additional buffered frames. |
139 // overloaded method is the same, but allows skipping an internal call to | |
140 // EffectiveFramesQueued() if that value is already known. | |
141 bool HaveReachedBufferingCap(); | 139 bool HaveReachedBufferingCap(); |
142 bool HaveReachedBufferingCap(size_t effective_frames); | |
143 | 140 |
144 // Starts or stops |sink_| respectively. Do not call while |lock_| is held. | 141 // Starts or stops |sink_| respectively. Do not call while |lock_| is held. |
145 void StartSink(); | 142 void StartSink(); |
146 void StopSink(); | 143 void StopSink(); |
147 | 144 |
148 // Fires |ended_cb_| if there are no remaining usable frames and | 145 // Fires |ended_cb_| if there are no remaining usable frames and |
149 // |received_end_of_stream_| is true. Sets |rendered_end_of_stream_| if it | 146 // |received_end_of_stream_| is true. Sets |rendered_end_of_stream_| if it |
150 // does so. Returns algorithm_->EffectiveFramesQueued(). | 147 // does so. Returns algorithm_->EffectiveFramesQueued(). |
151 size_t MaybeFireEndedCallback(); | 148 size_t MaybeFireEndedCallback(); |
152 | 149 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 | 273 |
277 // NOTE: Weak pointers must be invalidated before all other member variables. | 274 // NOTE: Weak pointers must be invalidated before all other member variables. |
278 base::WeakPtrFactory<VideoRendererImpl> weak_factory_; | 275 base::WeakPtrFactory<VideoRendererImpl> weak_factory_; |
279 | 276 |
280 DISALLOW_COPY_AND_ASSIGN(VideoRendererImpl); | 277 DISALLOW_COPY_AND_ASSIGN(VideoRendererImpl); |
281 }; | 278 }; |
282 | 279 |
283 } // namespace media | 280 } // namespace media |
284 | 281 |
285 #endif // MEDIA_RENDERERS_VIDEO_RENDERER_IMPL_H_ | 282 #endif // MEDIA_RENDERERS_VIDEO_RENDERER_IMPL_H_ |
OLD | NEW |