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

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

Issue 18580008: Rename VideoDecoder::HasOutputFrameAvailable() to CanReadWithoutStalling(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: name change and drop disabled (invalid) test Created 7 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
« no previous file with comments | « media/filters/video_frame_stream.cc ('k') | media/filters/video_renderer_base_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) 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 #include "media/filters/video_renderer_base.h" 5 #include "media/filters/video_renderer_base.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 389
390 // Maintain the latest frame decoded so the correct frame is displayed after 390 // Maintain the latest frame decoded so the correct frame is displayed after
391 // prerolling has completed. 391 // prerolling has completed.
392 if (state_ == kPrerolling && frame->GetTimestamp() <= preroll_timestamp_) { 392 if (state_ == kPrerolling && frame->GetTimestamp() <= preroll_timestamp_) {
393 ready_frames_.clear(); 393 ready_frames_.clear();
394 } 394 }
395 395
396 AddReadyFrame_Locked(frame); 396 AddReadyFrame_Locked(frame);
397 397
398 if (state_ == kPrerolling) { 398 if (state_ == kPrerolling) {
399 if (!video_frame_stream_.HasOutputFrameAvailable() || 399 if (!video_frame_stream_.CanReadWithoutStalling() ||
400 ready_frames_.size() >= static_cast<size_t>(limits::kMaxVideoFrames)) { 400 ready_frames_.size() >= static_cast<size_t>(limits::kMaxVideoFrames)) {
401 TransitionToPrerolled_Locked(); 401 TransitionToPrerolled_Locked();
402 } 402 }
403 } else { 403 } else {
404 // We only count frames decoded during normal playback. 404 // We only count frames decoded during normal playback.
405 PipelineStatistics statistics; 405 PipelineStatistics statistics;
406 statistics.video_frames_decoded = 1; 406 statistics.video_frames_decoded = 1;
407 statistics_cb_.Run(statistics); 407 statistics_cb_.Run(statistics);
408 } 408 }
409 409
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 // Because we might remain in the prerolled state for an undetermined amount 530 // Because we might remain in the prerolled state for an undetermined amount
531 // of time (e.g., we seeked while paused), we'll paint the first prerolled 531 // of time (e.g., we seeked while paused), we'll paint the first prerolled
532 // frame. 532 // frame.
533 if (!ready_frames_.empty()) 533 if (!ready_frames_.empty())
534 PaintNextReadyFrame_Locked(); 534 PaintNextReadyFrame_Locked();
535 535
536 base::ResetAndReturn(&preroll_cb_).Run(PIPELINE_OK); 536 base::ResetAndReturn(&preroll_cb_).Run(PIPELINE_OK);
537 } 537 }
538 538
539 } // namespace media 539 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/video_frame_stream.cc ('k') | media/filters/video_renderer_base_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698