OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // VideoRendererBase creates its own thread for the sole purpose of timing frame | 5 // VideoRendererBase creates its own thread for the sole purpose of timing frame |
6 // presentation. It handles reading from the decoder and stores the results in | 6 // presentation. It handles reading from the decoder and stores the results in |
7 // a queue of decoded frames, calling OnFrameAvailable() on subclasses to notify | 7 // a queue of decoded frames, calling OnFrameAvailable() on subclasses to notify |
8 // when a frame is ready to display. | 8 // when a frame is ready to display. |
9 // | 9 // |
10 // The media filter methods Initialize(), Stop(), SetPlaybackRate() and Seek() | 10 // The media filter methods Initialize(), Stop(), SetPlaybackRate() and Seek() |
11 // should be serialized, which they commonly are the pipeline thread. | 11 // should be serialized, which they commonly are the pipeline thread. |
12 // As long as VideoRendererBase is initialized, GetCurrentFrame() is safe to | 12 // As long as VideoRendererBase is initialized, GetCurrentFrame() is safe to |
13 // call from any thread, at any time, including inside of OnFrameAvailable(). | 13 // call from any thread, at any time, including inside of OnFrameAvailable(). |
14 | 14 |
15 #ifndef MEDIA_FILTERS_VIDEO_RENDERER_BASE_H_ | 15 #ifndef MEDIA_FILTERS_VIDEO_RENDERER_BASE_H_ |
16 #define MEDIA_FILTERS_VIDEO_RENDERER_BASE_H_ | 16 #define MEDIA_FILTERS_VIDEO_RENDERER_BASE_H_ |
17 | 17 |
18 #include <deque> | 18 #include <deque> |
19 | 19 |
20 #include "base/condition_variable.h" | 20 #include "base/condition_variable.h" |
21 #include "base/lock.h" | 21 #include "base/lock.h" |
| 22 #include "base/scoped_ptr.h" |
22 #include "media/base/filters.h" | 23 #include "media/base/filters.h" |
23 #include "media/base/video_frame.h" | 24 #include "media/base/video_frame.h" |
24 | 25 |
25 namespace media { | 26 namespace media { |
26 | 27 |
27 // TODO(scherkus): to avoid subclasses, consider using a peer/delegate interface | 28 // TODO(scherkus): to avoid subclasses, consider using a peer/delegate interface |
28 // and pass in a reference to the constructor. | 29 // and pass in a reference to the constructor. |
29 class VideoRendererBase : public VideoRenderer, | 30 class VideoRendererBase : public VideoRenderer, |
30 public PlatformThread::Delegate { | 31 public PlatformThread::Delegate { |
31 public: | 32 public: |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 // Filter callbacks. | 169 // Filter callbacks. |
169 scoped_ptr<FilterCallback> pause_callback_; | 170 scoped_ptr<FilterCallback> pause_callback_; |
170 scoped_ptr<FilterCallback> seek_callback_; | 171 scoped_ptr<FilterCallback> seek_callback_; |
171 | 172 |
172 DISALLOW_COPY_AND_ASSIGN(VideoRendererBase); | 173 DISALLOW_COPY_AND_ASSIGN(VideoRendererBase); |
173 }; | 174 }; |
174 | 175 |
175 } // namespace media | 176 } // namespace media |
176 | 177 |
177 #endif // MEDIA_FILTERS_VIDEO_RENDERER_BASE_H_ | 178 #endif // MEDIA_FILTERS_VIDEO_RENDERER_BASE_H_ |
OLD | NEW |