| 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 "content/renderer/media/webmediaplayer_ms.h" | 5 #include "content/renderer/media/webmediaplayer_ms.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 // Always notify to ensure client has the latest value. | 432 // Always notify to ensure client has the latest value. |
| 433 get_client()->networkStateChanged(); | 433 get_client()->networkStateChanged(); |
| 434 } | 434 } |
| 435 | 435 |
| 436 void WebMediaPlayerMS::SetReadyState(WebMediaPlayer::ReadyState state) { | 436 void WebMediaPlayerMS::SetReadyState(WebMediaPlayer::ReadyState state) { |
| 437 DCHECK(thread_checker_.CalledOnValidThread()); | 437 DCHECK(thread_checker_.CalledOnValidThread()); |
| 438 ready_state_ = state; | 438 ready_state_ = state; |
| 439 // Always notify to ensure client has the latest value. | 439 // Always notify to ensure client has the latest value. |
| 440 get_client()->readyStateChanged(); | 440 get_client()->readyStateChanged(); |
| 441 } | 441 } |
| 442 |
| 443 cc::VideoFrameProvider* WebMediaPlayerMS::LoadForTesting( |
| 444 bool algorithm_enabled) { |
| 445 compositor_.reset(new WebMediaPlayerMSCompositor(compositor_task_runner_, |
| 446 algorithm_enabled)); |
| 447 |
| 448 SetNetworkState(WebMediaPlayer::NetworkStateLoading); |
| 449 SetReadyState(WebMediaPlayer::ReadyStateHaveNothing); |
| 450 |
| 451 media_log_->AddEvent(media_log_->CreateLoadEvent("LoadForTest")); |
| 452 |
| 453 video_frame_provider_ = renderer_factory_->GetVideoFrameProvider( |
| 454 blink::WebURL(), |
| 455 base::Bind(&WebMediaPlayerMS::OnSourceError, AsWeakPtr()), |
| 456 base::Bind(&WebMediaPlayerMS::OnFrameAvailable, AsWeakPtr()), |
| 457 media_task_runner_, worker_task_runner_, gpu_factories_); |
| 458 |
| 459 audio_renderer_ = nullptr; |
| 460 |
| 461 if (video_frame_provider_) |
| 462 video_frame_provider_->Start(); |
| 463 |
| 464 return compositor_.get(); |
| 465 } |
| 442 } // namespace content | 466 } // namespace content |
| OLD | NEW |