| 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_FILTERS_VIDEO_RENDERER_IMPL_H_ | 5 #ifndef MEDIA_FILTERS_VIDEO_RENDERER_IMPL_H_ |
| 6 #define MEDIA_FILTERS_VIDEO_RENDERER_IMPL_H_ | 6 #define MEDIA_FILTERS_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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 // A read is scheduled to replace the frame. | 122 // A read is scheduled to replace the frame. |
| 123 void PaintNextReadyFrame_Locked(); | 123 void PaintNextReadyFrame_Locked(); |
| 124 | 124 |
| 125 // Drops the next frame from |ready_frames_| and runs |statistics_cb_|. | 125 // Drops the next frame from |ready_frames_| and runs |statistics_cb_|. |
| 126 // | 126 // |
| 127 // A read is scheduled to replace the frame. | 127 // A read is scheduled to replace the frame. |
| 128 void DropNextReadyFrame_Locked(); | 128 void DropNextReadyFrame_Locked(); |
| 129 | 129 |
| 130 void TransitionToPrerolled_Locked(); | 130 void TransitionToPrerolled_Locked(); |
| 131 | 131 |
| 132 // Returns true of all conditions have been met to transition from |
| 133 // kPrerolling to kPrerolled. |
| 134 bool ShouldTransitionToPrerolled_Locked(); |
| 135 |
| 132 // Runs |statistics_cb_| with |frames_decoded_| and |frames_dropped_|, resets | 136 // Runs |statistics_cb_| with |frames_decoded_| and |frames_dropped_|, resets |
| 133 // them to 0, and then waits on |frame_available_| for up to the | 137 // them to 0, and then waits on |frame_available_| for up to the |
| 134 // |wait_duration|. | 138 // |wait_duration|. |
| 135 void UpdateStatsAndWait_Locked(base::TimeDelta wait_duration); | 139 void UpdateStatsAndWait_Locked(base::TimeDelta wait_duration); |
| 136 | 140 |
| 137 scoped_refptr<base::MessageLoopProxy> message_loop_; | 141 scoped_refptr<base::MessageLoopProxy> message_loop_; |
| 138 base::WeakPtrFactory<VideoRendererImpl> weak_factory_; | 142 base::WeakPtrFactory<VideoRendererImpl> weak_factory_; |
| 139 base::WeakPtr<VideoRendererImpl> weak_this_; | 143 base::WeakPtr<VideoRendererImpl> weak_this_; |
| 140 | 144 |
| 141 // Used for accessing data members. | 145 // Used for accessing data members. |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 // last call to |statistics_cb_|. These must be accessed under lock. | 249 // last call to |statistics_cb_|. These must be accessed under lock. |
| 246 int frames_decoded_; | 250 int frames_decoded_; |
| 247 int frames_dropped_; | 251 int frames_dropped_; |
| 248 | 252 |
| 249 DISALLOW_COPY_AND_ASSIGN(VideoRendererImpl); | 253 DISALLOW_COPY_AND_ASSIGN(VideoRendererImpl); |
| 250 }; | 254 }; |
| 251 | 255 |
| 252 } // namespace media | 256 } // namespace media |
| 253 | 257 |
| 254 #endif // MEDIA_FILTERS_VIDEO_RENDERER_IMPL_H_ | 258 #endif // MEDIA_FILTERS_VIDEO_RENDERER_IMPL_H_ |
| OLD | NEW |