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 10 matching lines...) Expand all Loading... |
21 // VideoRendererBase creates its own thread for the sole purpose of timing frame | 21 // VideoRendererBase creates its own thread for the sole purpose of timing frame |
22 // presentation. It handles reading from the decoder and stores the results in | 22 // presentation. It handles reading from the decoder and stores the results in |
23 // a queue of decoded frames and executing a callback when a frame is ready for | 23 // a queue of decoded frames and executing a callback when a frame is ready for |
24 // rendering. | 24 // rendering. |
25 class MEDIA_EXPORT VideoRendererBase | 25 class MEDIA_EXPORT VideoRendererBase |
26 : public VideoRenderer, | 26 : public VideoRenderer, |
27 public base::PlatformThread::Delegate { | 27 public base::PlatformThread::Delegate { |
28 public: | 28 public: |
29 typedef base::Callback<void(bool)> SetOpaqueCB; | 29 typedef base::Callback<void(bool)> SetOpaqueCB; |
30 | 30 |
| 31 // Maximum duration of the last frame. |
| 32 static base::TimeDelta kMaxLastFrameDuration(); |
| 33 |
31 // |paint_cb| is executed on the video frame timing thread whenever a new | 34 // |paint_cb| is executed on the video frame timing thread whenever a new |
32 // frame is available for painting via GetCurrentFrame(). | 35 // frame is available for painting via GetCurrentFrame(). |
33 // | 36 // |
34 // |set_opaque_cb| is executed when the renderer is initialized to inform | 37 // |set_opaque_cb| is executed when the renderer is initialized to inform |
35 // the player whether the decoder's output will be opaque or not. | 38 // the player whether the decoder's output will be opaque or not. |
36 // | 39 // |
37 // Implementors should avoid doing any sort of heavy work in this method and | 40 // Implementors should avoid doing any sort of heavy work in this method and |
38 // instead post a task to a common/worker thread to handle rendering. Slowing | 41 // instead post a task to a common/worker thread to handle rendering. Slowing |
39 // down the video thread may result in losing synchronization with audio. | 42 // down the video thread may result in losing synchronization with audio. |
40 // | 43 // |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 | 234 |
232 // The last natural size |size_changed_cb_| was called with. | 235 // The last natural size |size_changed_cb_| was called with. |
233 gfx::Size last_natural_size_; | 236 gfx::Size last_natural_size_; |
234 | 237 |
235 DISALLOW_COPY_AND_ASSIGN(VideoRendererBase); | 238 DISALLOW_COPY_AND_ASSIGN(VideoRendererBase); |
236 }; | 239 }; |
237 | 240 |
238 } // namespace media | 241 } // namespace media |
239 | 242 |
240 #endif // MEDIA_FILTERS_VIDEO_RENDERER_BASE_H_ | 243 #endif // MEDIA_FILTERS_VIDEO_RENDERER_BASE_H_ |
OLD | NEW |