| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/renderer/media/webmediaplayer_ms_compositor.h" | 5 #include "content/renderer/media/webmediaplayer_ms_compositor.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 | 404 |
| 405 if (!current_frame_used_by_compositor_) | 405 if (!current_frame_used_by_compositor_) |
| 406 ++dropped_frame_count_; | 406 ++dropped_frame_count_; |
| 407 current_frame_used_by_compositor_ = false; | 407 current_frame_used_by_compositor_ = false; |
| 408 | 408 |
| 409 const bool size_changed = | 409 const bool size_changed = |
| 410 !current_frame_ || | 410 !current_frame_ || |
| 411 current_frame_->natural_size() != frame->natural_size(); | 411 current_frame_->natural_size() != frame->natural_size(); |
| 412 current_frame_ = frame; | 412 current_frame_ = frame; |
| 413 if (size_changed) { | 413 if (size_changed) { |
| 414 main_message_loop_->PostTask( | 414 main_message_loop_->task_runner()->PostTask( |
| 415 FROM_HERE, base::Bind(&WebMediaPlayerMS::TriggerResize, player_)); | 415 FROM_HERE, base::Bind(&WebMediaPlayerMS::TriggerResize, player_)); |
| 416 } | 416 } |
| 417 main_message_loop_->PostTask( | 417 main_message_loop_->task_runner()->PostTask( |
| 418 FROM_HERE, base::Bind(&WebMediaPlayerMS::ResetCanvasCache, player_)); | 418 FROM_HERE, base::Bind(&WebMediaPlayerMS::ResetCanvasCache, player_)); |
| 419 } | 419 } |
| 420 | 420 |
| 421 void WebMediaPlayerMSCompositor::SetAlgorithmEnabledForTesting( | 421 void WebMediaPlayerMSCompositor::SetAlgorithmEnabledForTesting( |
| 422 bool algorithm_enabled) { | 422 bool algorithm_enabled) { |
| 423 if (!algorithm_enabled) { | 423 if (!algorithm_enabled) { |
| 424 rendering_frame_buffer_.reset(); | 424 rendering_frame_buffer_.reset(); |
| 425 return; | 425 return; |
| 426 } | 426 } |
| 427 | 427 |
| 428 if (!rendering_frame_buffer_) { | 428 if (!rendering_frame_buffer_) { |
| 429 rendering_frame_buffer_.reset(new media::VideoRendererAlgorithm( | 429 rendering_frame_buffer_.reset(new media::VideoRendererAlgorithm( |
| 430 base::Bind(&WebMediaPlayerMSCompositor::MapTimestampsToRenderTimeTicks, | 430 base::Bind(&WebMediaPlayerMSCompositor::MapTimestampsToRenderTimeTicks, |
| 431 base::Unretained(this)))); | 431 base::Unretained(this)))); |
| 432 } | 432 } |
| 433 } | 433 } |
| 434 | 434 |
| 435 } // namespace content | 435 } // namespace content |
| OLD | NEW |