Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: media/filters/video_renderer_impl.h

Issue 379343005: Introduce media::TimeSource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 const SetDecryptorReadyCB& set_decryptor_ready_cb, 53 const SetDecryptorReadyCB& set_decryptor_ready_cb,
54 const PaintCB& paint_cb, 54 const PaintCB& paint_cb,
55 bool drop_frames); 55 bool drop_frames);
56 virtual ~VideoRendererImpl(); 56 virtual ~VideoRendererImpl();
57 57
58 // VideoRenderer implementation. 58 // VideoRenderer implementation.
59 virtual void Initialize(DemuxerStream* stream, 59 virtual void Initialize(DemuxerStream* stream,
60 bool low_delay, 60 bool low_delay,
61 const PipelineStatusCB& init_cb, 61 const PipelineStatusCB& init_cb,
62 const StatisticsCB& statistics_cb, 62 const StatisticsCB& statistics_cb,
63 const TimeCB& max_time_cb,
64 const BufferingStateCB& buffering_state_cb, 63 const BufferingStateCB& buffering_state_cb,
65 const base::Closure& ended_cb, 64 const base::Closure& ended_cb,
66 const PipelineStatusCB& error_cb, 65 const PipelineStatusCB& error_cb,
67 const TimeDeltaCB& get_time_cb, 66 const TimeDeltaCB& get_time_cb,
68 const TimeDeltaCB& get_duration_cb) OVERRIDE; 67 const TimeDeltaCB& get_duration_cb) OVERRIDE;
69 virtual void Flush(const base::Closure& callback) OVERRIDE; 68 virtual void Flush(const base::Closure& callback) OVERRIDE;
70 virtual void StartPlayingFrom(base::TimeDelta timestamp) OVERRIDE; 69 virtual void StartPlaying() OVERRIDE;
71 virtual void Stop(const base::Closure& callback) OVERRIDE; 70 virtual void Stop(const base::Closure& callback) OVERRIDE;
72 71
73 // PlatformThread::Delegate implementation. 72 // PlatformThread::Delegate implementation.
74 virtual void ThreadMain() OVERRIDE; 73 virtual void ThreadMain() OVERRIDE;
75 74
76 private: 75 private:
77 // Callback for |video_frame_stream_| initialization. 76 // Callback for |video_frame_stream_| initialization.
78 void OnVideoFrameStreamInitialized(bool success); 77 void OnVideoFrameStreamInitialized(bool success);
79 78
80 // Callback for |video_frame_stream_| to deliver decoded video frames and 79 // Callback for |video_frame_stream_| to deliver decoded video frames and
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 // 146 //
148 // kUninitialized 147 // kUninitialized
149 // | Initialize() 148 // | Initialize()
150 // | 149 // |
151 // V 150 // V
152 // kInitializing 151 // kInitializing
153 // | Decoders initialized 152 // | Decoders initialized
154 // | 153 // |
155 // V Decoders reset 154 // V Decoders reset
156 // kFlushed <------------------ kFlushing 155 // kFlushed <------------------ kFlushing
157 // | StartPlayingFrom() ^ 156 // | StartPlaying() ^
158 // | | 157 // | |
159 // | | Flush() 158 // | | Flush()
160 // `---------> kPlaying --------' 159 // `---------> kPlaying --------'
161 enum State { 160 enum State {
162 kUninitialized, 161 kUninitialized,
163 kInitializing, 162 kInitializing,
164 kFlushing, 163 kFlushing,
165 kFlushed, 164 kFlushed,
166 kPlaying, 165 kPlaying,
167 kStopped, 166 kStopped,
(...skipping 10 matching lines...) Expand all
178 bool drop_frames_; 177 bool drop_frames_;
179 178
180 BufferingState buffering_state_; 179 BufferingState buffering_state_;
181 180
182 // Playback operation callbacks. 181 // Playback operation callbacks.
183 base::Closure flush_cb_; 182 base::Closure flush_cb_;
184 183
185 // Event callbacks. 184 // Event callbacks.
186 PipelineStatusCB init_cb_; 185 PipelineStatusCB init_cb_;
187 StatisticsCB statistics_cb_; 186 StatisticsCB statistics_cb_;
188 TimeCB max_time_cb_;
189 BufferingStateCB buffering_state_cb_; 187 BufferingStateCB buffering_state_cb_;
190 base::Closure ended_cb_; 188 base::Closure ended_cb_;
191 PipelineStatusCB error_cb_; 189 PipelineStatusCB error_cb_;
192 TimeDeltaCB get_time_cb_; 190 TimeDeltaCB get_time_cb_;
193 TimeDeltaCB get_duration_cb_; 191 TimeDeltaCB get_duration_cb_;
194 192
195 base::TimeDelta start_timestamp_; 193 base::TimeDelta start_timestamp_;
196 194
197 // Embedder callback for notifying a new frame is available for painting. 195 // Embedder callback for notifying a new frame is available for painting.
198 PaintCB paint_cb_; 196 PaintCB paint_cb_;
(...skipping 10 matching lines...) Expand all
209 207
210 // NOTE: Weak pointers must be invalidated before all other member variables. 208 // NOTE: Weak pointers must be invalidated before all other member variables.
211 base::WeakPtrFactory<VideoRendererImpl> weak_factory_; 209 base::WeakPtrFactory<VideoRendererImpl> weak_factory_;
212 210
213 DISALLOW_COPY_AND_ASSIGN(VideoRendererImpl); 211 DISALLOW_COPY_AND_ASSIGN(VideoRendererImpl);
214 }; 212 };
215 213
216 } // namespace media 214 } // namespace media
217 215
218 #endif // MEDIA_FILTERS_VIDEO_RENDERER_IMPL_H_ 216 #endif // MEDIA_FILTERS_VIDEO_RENDERER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698