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

Side by Side Diff: media/filters/video_renderer_base.cc

Issue 27120: Added IsEndOfStream and IsDiscontiguous flags to buffers. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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
« no previous file with comments | « media/filters/test_video_renderer.h ('k') | media/filters/video_renderer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #include "media/base/buffers.h" 5 #include "media/base/buffers.h"
6 #include "media/base/filter_host.h" 6 #include "media/base/filter_host.h"
7 #include "media/base/pipeline.h" 7 #include "media/base/pipeline.h"
8 #include "media/filters/video_renderer_base.h" 8 #include "media/filters/video_renderer_base.h"
9 9
10 namespace media { 10 namespace media {
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 OnPaintNeeded(); 171 OnPaintNeeded();
172 } 172 }
173 } 173 }
174 174
175 void VideoRendererBase::OnAssignment(VideoFrame* video_frame) { 175 void VideoRendererBase::OnAssignment(VideoFrame* video_frame) {
176 bool call_initialized = false; 176 bool call_initialized = false;
177 bool request_repaint = false; 177 bool request_repaint = false;
178 { 178 {
179 AutoLock auto_lock(lock_); 179 AutoLock auto_lock(lock_);
180 if (IsRunning()) { 180 if (IsRunning()) {
181 // TODO(ralphl): if (!preroll_complete_ && EndOfStream) call_init = true 181 if (video_frame->IsDiscontinuous()) {
182 // and preroll_complete_ = true.
183 // TODO(ralphl): If(Seek()) then discard but we don't have SeekFrame().
184 if (false) {
185 // TODO(ralphl): this is the seek() logic.
186 DiscardAllFrames(); 182 DiscardAllFrames();
187 ++number_of_reads_needed_; 183 }
188 PostSubmitReadsTask(); 184 if (UpdateQueue(host_->GetPipelineStatus()->GetInterpolatedTime(),
189 } else { 185 video_frame)) {
190 if (UpdateQueue(host_->GetPipelineStatus()->GetInterpolatedTime(), 186 request_repaint = preroll_complete_;
191 video_frame)) { 187 }
192 request_repaint = preroll_complete_; 188 if (!preroll_complete_ && (queue_.size() == number_of_frames_ ||
193 } 189 video_frame->IsEndOfStream())) {
194 if (!preroll_complete_ && queue_.size() == number_of_frames_) { 190 preroll_complete_ = true;
195 preroll_complete_ = true; 191 call_initialized = true;
196 call_initialized = true; 192 request_repaint = true;
197 request_repaint = true;
198 }
199 } 193 }
200 } 194 }
201 } 195 }
202 // |lock_| no longer held. Call the pipeline if we've just entered a 196 // |lock_| no longer held. Call the pipeline if we've just entered a
203 // completed preroll state. 197 // completed preroll state.
204 if (call_initialized) { 198 if (call_initialized) {
205 host_->InitializationComplete(); 199 host_->InitializationComplete();
206 } 200 }
207 if (request_repaint) { 201 if (request_repaint) {
208 OnPaintNeeded(); 202 OnPaintNeeded();
(...skipping 16 matching lines...) Expand all
225 (*frame_out)->GetDuration(); 219 (*frame_out)->GetDuration();
226 } else { 220 } else {
227 time_next_frame = queue_[1]->GetTimestamp(); 221 time_next_frame = queue_[1]->GetTimestamp();
228 } 222 }
229 } 223 }
230 host_->ScheduleTimeUpdateCallback(time_next_frame); 224 host_->ScheduleTimeUpdateCallback(time_next_frame);
231 } 225 }
232 } 226 }
233 227
234 } // namespace 228 } // namespace
OLDNEW
« no previous file with comments | « media/filters/test_video_renderer.h ('k') | media/filters/video_renderer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698