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() |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // | 87 // |
88 // Implementors should avoid doing any sort of heavy work in this method and | 88 // Implementors should avoid doing any sort of heavy work in this method and |
89 // instead post a task to a common/worker thread to handle rendering. Slowing | 89 // instead post a task to a common/worker thread to handle rendering. Slowing |
90 // down the video thread may result in losing synchronization with audio. | 90 // down the video thread may result in losing synchronization with audio. |
91 // | 91 // |
92 // IMPORTANT: This method is called on the video renderer thread, which is | 92 // IMPORTANT: This method is called on the video renderer thread, which is |
93 // different from the thread OnInitialize(), OnStop(), and the rest of the | 93 // different from the thread OnInitialize(), OnStop(), and the rest of the |
94 // class executes on. | 94 // class executes on. |
95 virtual void OnFrameAvailable() = 0; | 95 virtual void OnFrameAvailable() = 0; |
96 | 96 |
97 virtual VideoDecoder* GetDecoder() { | 97 virtual VideoDecoder* GetDecoder(); |
98 return decoder_.get(); | |
99 } | |
100 | 98 |
101 int width() { return width_; } | 99 int width() { return width_; } |
102 int height() { return height_; } | 100 int height() { return height_; } |
103 VideoFrame::Format surface_format() { return surface_format_; } | 101 VideoFrame::Format surface_format() { return surface_format_; } |
104 VideoFrame::SurfaceType surface_type() { return surface_type_; } | 102 VideoFrame::SurfaceType surface_type() { return surface_type_; } |
105 | 103 |
106 void ReadInput(scoped_refptr<VideoFrame> frame); | 104 void ReadInput(scoped_refptr<VideoFrame> frame); |
107 | 105 |
108 private: | 106 private: |
109 // Callback from video decoder to deliver decoded video frames and decrements | 107 // Callback from video decoder to deliver decoded video frames and decrements |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 scoped_ptr<FilterCallback> seek_callback_; | 208 scoped_ptr<FilterCallback> seek_callback_; |
211 | 209 |
212 base::TimeDelta seek_timestamp_; | 210 base::TimeDelta seek_timestamp_; |
213 | 211 |
214 DISALLOW_COPY_AND_ASSIGN(VideoRendererBase); | 212 DISALLOW_COPY_AND_ASSIGN(VideoRendererBase); |
215 }; | 213 }; |
216 | 214 |
217 } // namespace media | 215 } // namespace media |
218 | 216 |
219 #endif // MEDIA_FILTERS_VIDEO_RENDERER_BASE_H_ | 217 #endif // MEDIA_FILTERS_VIDEO_RENDERER_BASE_H_ |
OLD | NEW |