| 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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 if (!success) { | 243 if (!success) { |
| 244 state_ = kUninitialized; | 244 state_ = kUninitialized; |
| 245 base::ResetAndReturn(&init_cb_).Run(DECODER_ERROR_NOT_SUPPORTED); | 245 base::ResetAndReturn(&init_cb_).Run(DECODER_ERROR_NOT_SUPPORTED); |
| 246 return; | 246 return; |
| 247 } | 247 } |
| 248 | 248 |
| 249 // We're all good! Consider ourselves flushed because we have not read any | 249 // We're all good! Consider ourselves flushed because we have not read any |
| 250 // frames yet. | 250 // frames yet. |
| 251 state_ = kFlushed; | 251 state_ = kFlushed; |
| 252 | 252 |
| 253 algorithm_.reset(new VideoRendererAlgorithm(wall_clock_time_cb_)); | 253 algorithm_.reset(new VideoRendererAlgorithm(wall_clock_time_cb_, media_log_)); |
| 254 if (!drop_frames_) | 254 if (!drop_frames_) |
| 255 algorithm_->disable_frame_dropping(); | 255 algorithm_->disable_frame_dropping(); |
| 256 | 256 |
| 257 base::ResetAndReturn(&init_cb_).Run(PIPELINE_OK); | 257 base::ResetAndReturn(&init_cb_).Run(PIPELINE_OK); |
| 258 } | 258 } |
| 259 | 259 |
| 260 void VideoRendererImpl::OnPlaybackError(PipelineStatus error) { | 260 void VideoRendererImpl::OnPlaybackError(PipelineStatus error) { |
| 261 DCHECK(task_runner_->BelongsToCurrentThread()); | 261 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 262 client_->OnError(error); | 262 client_->OnError(error); |
| 263 } | 263 } |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 | 725 |
| 726 void VideoRendererImpl::AttemptReadAndCheckForMetadataChanges( | 726 void VideoRendererImpl::AttemptReadAndCheckForMetadataChanges( |
| 727 VideoPixelFormat pixel_format, | 727 VideoPixelFormat pixel_format, |
| 728 const gfx::Size& natural_size) { | 728 const gfx::Size& natural_size) { |
| 729 base::AutoLock auto_lock(lock_); | 729 base::AutoLock auto_lock(lock_); |
| 730 CheckForMetadataChanges(pixel_format, natural_size); | 730 CheckForMetadataChanges(pixel_format, natural_size); |
| 731 AttemptRead_Locked(); | 731 AttemptRead_Locked(); |
| 732 } | 732 } |
| 733 | 733 |
| 734 } // namespace media | 734 } // namespace media |
| OLD | NEW |