| OLD | NEW |
| 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 #include "media/renderers/video_renderer_impl.h" | 5 #include "media/renderers/video_renderer_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 // prerolling frames before the actual start time that will be dropped. | 415 // prerolling frames before the actual start time that will be dropped. |
| 416 if (algorithm_->frames_queued() > 1 || received_end_of_stream_ || | 416 if (algorithm_->frames_queued() > 1 || received_end_of_stream_ || |
| 417 frame->timestamp() >= start_timestamp_ || low_delay_ || | 417 frame->timestamp() >= start_timestamp_ || low_delay_ || |
| 418 !video_frame_stream_->CanReadWithoutStalling()) { | 418 !video_frame_stream_->CanReadWithoutStalling()) { |
| 419 scoped_refptr<VideoFrame> first_frame = | 419 scoped_refptr<VideoFrame> first_frame = |
| 420 algorithm_->Render(base::TimeTicks(), base::TimeTicks(), nullptr); | 420 algorithm_->Render(base::TimeTicks(), base::TimeTicks(), nullptr); |
| 421 CheckForMetadataChanges(first_frame->format(), | 421 CheckForMetadataChanges(first_frame->format(), |
| 422 first_frame->natural_size()); | 422 first_frame->natural_size()); |
| 423 sink_->PaintSingleFrame(first_frame); | 423 sink_->PaintSingleFrame(first_frame); |
| 424 painted_first_frame_ = true; | 424 painted_first_frame_ = true; |
| 425 client_->OnFirstFrameRender(); |
| 425 } | 426 } |
| 426 } | 427 } |
| 427 | 428 |
| 428 // Signal buffering state if we've met our conditions. | 429 // Signal buffering state if we've met our conditions. |
| 429 if (buffering_state_ == BUFFERING_HAVE_NOTHING && HaveEnoughData_Locked()) | 430 if (buffering_state_ == BUFFERING_HAVE_NOTHING && HaveEnoughData_Locked()) |
| 430 TransitionToHaveEnough_Locked(); | 431 TransitionToHaveEnough_Locked(); |
| 431 | 432 |
| 432 // Always request more decoded video if we have capacity. | 433 // Always request more decoded video if we have capacity. |
| 433 AttemptRead_Locked(); | 434 AttemptRead_Locked(); |
| 434 } | 435 } |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 | 711 |
| 711 void VideoRendererImpl::AttemptReadAndCheckForMetadataChanges( | 712 void VideoRendererImpl::AttemptReadAndCheckForMetadataChanges( |
| 712 VideoPixelFormat pixel_format, | 713 VideoPixelFormat pixel_format, |
| 713 const gfx::Size& natural_size) { | 714 const gfx::Size& natural_size) { |
| 714 base::AutoLock auto_lock(lock_); | 715 base::AutoLock auto_lock(lock_); |
| 715 CheckForMetadataChanges(pixel_format, natural_size); | 716 CheckForMetadataChanges(pixel_format, natural_size); |
| 716 AttemptRead_Locked(); | 717 AttemptRead_Locked(); |
| 717 } | 718 } |
| 718 | 719 |
| 719 } // namespace media | 720 } // namespace media |
| OLD | NEW |