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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 109 |
110 // Safely handles entering to an error state. | 110 // Safely handles entering to an error state. |
111 void EnterErrorState_Locked(PipelineStatus status); | 111 void EnterErrorState_Locked(PipelineStatus status); |
112 | 112 |
113 // Helper function that flushes the buffers when a Stop() or error occurs. | 113 // Helper function that flushes the buffers when a Stop() or error occurs. |
114 void DoStopOrError_Locked(); | 114 void DoStopOrError_Locked(); |
115 | 115 |
116 // Return the number of frames currently held by this class. | 116 // Return the number of frames currently held by this class. |
117 int NumFrames_Locked() const; | 117 int NumFrames_Locked() const; |
118 | 118 |
| 119 // Updates |current_frame_| to the next frame on |ready_frames_| and calls |
| 120 // |size_changed_cb_| if the natural size changes. |
| 121 void SetCurrentFrameToNextReadyFrame(); |
| 122 |
119 // Used for accessing data members. | 123 // Used for accessing data members. |
120 base::Lock lock_; | 124 base::Lock lock_; |
121 | 125 |
122 scoped_refptr<VideoDecoder> decoder_; | 126 scoped_refptr<VideoDecoder> decoder_; |
123 | 127 |
124 // Queue of incoming frames as well as the current frame since the last time | 128 // Queue of incoming frames as well as the current frame since the last time |
125 // OnFrameAvailable() was called. | 129 // OnFrameAvailable() was called. |
126 typedef std::deque<scoped_refptr<VideoFrame> > VideoFrameQueue; | 130 typedef std::deque<scoped_refptr<VideoFrame> > VideoFrameQueue; |
127 VideoFrameQueue ready_frames_; | 131 VideoFrameQueue ready_frames_; |
128 | 132 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 // |preroll_timestamp_| is between this frame and the next one. | 225 // |preroll_timestamp_| is between this frame and the next one. |
222 scoped_refptr<VideoFrame> prerolling_delayed_frame_; | 226 scoped_refptr<VideoFrame> prerolling_delayed_frame_; |
223 | 227 |
224 // Embedder callback for notifying a new frame is available for painting. | 228 // Embedder callback for notifying a new frame is available for painting. |
225 base::Closure paint_cb_; | 229 base::Closure paint_cb_; |
226 | 230 |
227 // Callback to execute to inform the player if the video decoder's output is | 231 // Callback to execute to inform the player if the video decoder's output is |
228 // opaque. | 232 // opaque. |
229 SetOpaqueCB set_opaque_cb_; | 233 SetOpaqueCB set_opaque_cb_; |
230 | 234 |
| 235 // The last natural size |size_changed_cb_| was called with. |
| 236 gfx::Size last_natural_size_; |
| 237 |
231 DISALLOW_COPY_AND_ASSIGN(VideoRendererBase); | 238 DISALLOW_COPY_AND_ASSIGN(VideoRendererBase); |
232 }; | 239 }; |
233 | 240 |
234 } // namespace media | 241 } // namespace media |
235 | 242 |
236 #endif // MEDIA_FILTERS_VIDEO_RENDERER_BASE_H_ | 243 #endif // MEDIA_FILTERS_VIDEO_RENDERER_BASE_H_ |
OLD | NEW |