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

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

Issue 113611: Handle end of stream for media... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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 (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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 174
175 void VideoRendererBase::ReadComplete(VideoFrame* video_frame) { 175 void VideoRendererBase::ReadComplete(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 if (video_frame->IsDiscontinuous()) { 181 if (video_frame->IsDiscontinuous()) {
182 DiscardAllFrames(); 182 DiscardAllFrames();
183 } 183 }
184 if (UpdateQueue(host_->GetPipelineStatus()->GetInterpolatedTime(), 184 // If this is not an end of stream frame, update the queue with it.
185 // An end of stream of frame has no data.
186 if (!video_frame->IsEndOfStream() &&
187 UpdateQueue(host_->GetPipelineStatus()->GetInterpolatedTime(),
185 video_frame)) { 188 video_frame)) {
186 request_repaint = preroll_complete_; 189 request_repaint = preroll_complete_;
187 } 190 }
188 if (!preroll_complete_ && (queue_.size() == number_of_frames_ || 191 if (!preroll_complete_ && (queue_.size() == number_of_frames_ ||
189 video_frame->IsEndOfStream())) { 192 video_frame->IsEndOfStream())) {
190 preroll_complete_ = true; 193 preroll_complete_ = true;
191 call_initialized = true; 194 call_initialized = true;
192 request_repaint = true; 195 request_repaint = true;
193 } 196 }
194 } 197 }
(...skipping 24 matching lines...) Expand all
219 (*frame_out)->GetDuration(); 222 (*frame_out)->GetDuration();
220 } else { 223 } else {
221 time_next_frame = queue_[1]->GetTimestamp(); 224 time_next_frame = queue_[1]->GetTimestamp();
222 } 225 }
223 } 226 }
224 host_->ScheduleTimeUpdateCallback(time_next_frame); 227 host_->ScheduleTimeUpdateCallback(time_next_frame);
225 } 228 }
226 } 229 }
227 230
228 } // namespace 231 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698