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

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

Issue 568113003: Switch back to using VideoRenderer::StartPlayingFrom(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 // VideoRenderer implementation. 61 // VideoRenderer implementation.
62 virtual void Initialize(DemuxerStream* stream, 62 virtual void Initialize(DemuxerStream* stream,
63 bool low_delay, 63 bool low_delay,
64 const PipelineStatusCB& init_cb, 64 const PipelineStatusCB& init_cb,
65 const StatisticsCB& statistics_cb, 65 const StatisticsCB& statistics_cb,
66 const BufferingStateCB& buffering_state_cb, 66 const BufferingStateCB& buffering_state_cb,
67 const base::Closure& ended_cb, 67 const base::Closure& ended_cb,
68 const PipelineStatusCB& error_cb, 68 const PipelineStatusCB& error_cb,
69 const TimeDeltaCB& get_time_cb) OVERRIDE; 69 const TimeDeltaCB& get_time_cb) OVERRIDE;
70 virtual void Flush(const base::Closure& callback) OVERRIDE; 70 virtual void Flush(const base::Closure& callback) OVERRIDE;
71 virtual void StartPlaying() OVERRIDE; 71 virtual void StartPlayingFrom(base::TimeDelta timestamp) OVERRIDE;
72 72
73 // PlatformThread::Delegate implementation. 73 // PlatformThread::Delegate implementation.
74 virtual void ThreadMain() OVERRIDE; 74 virtual void ThreadMain() OVERRIDE;
75 75
76 private: 76 private:
77 // Callback for |video_frame_stream_| initialization. 77 // Callback for |video_frame_stream_| initialization.
78 void OnVideoFrameStreamInitialized(bool success); 78 void OnVideoFrameStreamInitialized(bool success);
79 79
80 // Callback for |video_frame_stream_| to deliver decoded video frames and 80 // Callback for |video_frame_stream_| to deliver decoded video frames and
81 // report video decoding status. 81 // report video decoding status.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 // rendering. 133 // rendering.
134 bool received_end_of_stream_; 134 bool received_end_of_stream_;
135 bool rendered_end_of_stream_; 135 bool rendered_end_of_stream_;
136 136
137 // Used to signal |thread_| as frames are added to |frames_|. Rule of thumb: 137 // Used to signal |thread_| as frames are added to |frames_|. Rule of thumb:
138 // always check |state_| to see if it was set to STOPPED after waking up! 138 // always check |state_| to see if it was set to STOPPED after waking up!
139 base::ConditionVariable frame_available_; 139 base::ConditionVariable frame_available_;
140 140
141 // Important detail: being in kPlaying doesn't imply that video is being 141 // Important detail: being in kPlaying doesn't imply that video is being
142 // rendered. Rather, it means that the renderer is ready to go. The actual 142 // rendered. Rather, it means that the renderer is ready to go. The actual
143 // rendering of video is controlled by time advancing via |time_cb_|. 143 // rendering of video is controlled by time advancing via |time_cb_|.
wolenetz 2014/09/16 00:36:03 nit: what is |time_cb_|? It seems this comment may
scherkus (not reviewing) 2014/09/16 00:49:44 fixed to use |get_time_cb_|
144 // 144 //
145 // kUninitialized 145 // kUninitialized
146 // | Initialize() 146 // | Initialize()
147 // | 147 // |
148 // V 148 // V
149 // kInitializing 149 // kInitializing
150 // | Decoders initialized 150 // | Decoders initialized
151 // | 151 // |
152 // V Decoders reset 152 // V Decoders reset
153 // kFlushed <------------------ kFlushing 153 // kFlushed <------------------ kFlushing
154 // | StartPlaying() ^ 154 // | StartPlaying() ^
wolenetz 2014/09/16 00:36:03 nit: /g()/gFrom()/
scherkus (not reviewing) 2014/09/16 00:49:44 Done.
155 // | | 155 // | |
156 // | | Flush() 156 // | | Flush()
157 // `---------> kPlaying --------' 157 // `---------> kPlaying --------'
158 enum State { 158 enum State {
159 kUninitialized, 159 kUninitialized,
160 kInitializing, 160 kInitializing,
161 kFlushing, 161 kFlushing,
162 kFlushed, 162 kFlushed,
163 kPlaying 163 kPlaying
164 }; 164 };
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 209
210 // NOTE: Weak pointers must be invalidated before all other member variables. 210 // NOTE: Weak pointers must be invalidated before all other member variables.
211 base::WeakPtrFactory<VideoRendererImpl> weak_factory_; 211 base::WeakPtrFactory<VideoRendererImpl> weak_factory_;
212 212
213 DISALLOW_COPY_AND_ASSIGN(VideoRendererImpl); 213 DISALLOW_COPY_AND_ASSIGN(VideoRendererImpl);
214 }; 214 };
215 215
216 } // namespace media 216 } // namespace media
217 217
218 #endif // MEDIA_FILTERS_VIDEO_RENDERER_IMPL_H_ 218 #endif // MEDIA_FILTERS_VIDEO_RENDERER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698