OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/blink/webmediaplayer_impl.h" | 5 #include "media/blink/webmediaplayer_impl.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 &web_frame_client_, | 204 &web_frame_client_, |
205 nullptr, | 205 nullptr, |
206 nullptr)), | 206 nullptr)), |
207 audio_parameters_(TestAudioParameters::Normal()) { | 207 audio_parameters_(TestAudioParameters::Normal()) { |
208 web_view_->SetMainFrame(web_local_frame_); | 208 web_view_->SetMainFrame(web_local_frame_); |
209 media_thread_.StartAndWaitForTesting(); | 209 media_thread_.StartAndWaitForTesting(); |
210 } | 210 } |
211 | 211 |
212 void InitializeWebMediaPlayerImpl(bool allow_suspend) { | 212 void InitializeWebMediaPlayerImpl(bool allow_suspend) { |
213 std::unique_ptr<MediaLog> media_log(new MediaLog()); | 213 std::unique_ptr<MediaLog> media_log(new MediaLog()); |
214 std::unique_ptr<RendererFactory> renderer_factory( | 214 |
215 new DefaultRendererFactory( | 215 auto factory_selector = base::MakeUnique<RendererFactorySelector>(); |
| 216 factory_selector->AddFactory( |
| 217 RendererFactorySelector::FactoryType::DEFAULT, |
| 218 base::MakeUnique<DefaultRendererFactory>( |
216 media_log.get(), nullptr, | 219 media_log.get(), nullptr, |
217 DefaultRendererFactory::GetGpuFactoriesCB())); | 220 DefaultRendererFactory::GetGpuFactoriesCB())); |
| 221 factory_selector->SetBaseFactoryType( |
| 222 RendererFactorySelector::FactoryType::DEFAULT); |
218 | 223 |
219 wmpi_ = base::MakeUnique<WebMediaPlayerImpl>( | 224 wmpi_ = base::MakeUnique<WebMediaPlayerImpl>( |
220 web_local_frame_, &client_, nullptr, &delegate_, | 225 web_local_frame_, &client_, nullptr, &delegate_, |
221 std::move(renderer_factory), url_index_, | 226 std::move(factory_selector), url_index_, |
222 base::MakeUnique<WebMediaPlayerParams>( | 227 base::MakeUnique<WebMediaPlayerParams>( |
223 std::move(media_log), WebMediaPlayerParams::DeferLoadCB(), | 228 std::move(media_log), WebMediaPlayerParams::DeferLoadCB(), |
224 scoped_refptr<SwitchableAudioRendererSink>(), | 229 scoped_refptr<SwitchableAudioRendererSink>(), |
225 media_thread_.task_runner(), message_loop_.task_runner(), | 230 media_thread_.task_runner(), message_loop_.task_runner(), |
226 message_loop_.task_runner(), WebMediaPlayerParams::Context3DCB(), | 231 message_loop_.task_runner(), WebMediaPlayerParams::Context3DCB(), |
227 base::Bind(&OnAdjustAllocatedMemory), nullptr, nullptr, nullptr, | 232 base::Bind(&OnAdjustAllocatedMemory), nullptr, nullptr, nullptr, |
228 kMaxKeyframeDistanceToDisableBackgroundVideo, | 233 kMaxKeyframeDistanceToDisableBackgroundVideo, |
229 kMaxKeyframeDistanceToDisableBackgroundVideoMSE, false, | 234 kMaxKeyframeDistanceToDisableBackgroundVideoMSE, false, |
230 allow_suspend, false)); | 235 allow_suspend, false)); |
231 } | 236 } |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
982 WebMediaPlayerImplBackgroundBehaviorTest, | 987 WebMediaPlayerImplBackgroundBehaviorTest, |
983 ::testing::Combine(::testing::Bool(), | 988 ::testing::Combine(::testing::Bool(), |
984 ::testing::Bool(), | 989 ::testing::Bool(), |
985 ::testing::Values(5, 300), | 990 ::testing::Values(5, 300), |
986 ::testing::Values(5, 100), | 991 ::testing::Values(5, 100), |
987 ::testing::Bool(), | 992 ::testing::Bool(), |
988 ::testing::Bool(), | 993 ::testing::Bool(), |
989 ::testing::Bool())); | 994 ::testing::Bool())); |
990 | 995 |
991 } // namespace media | 996 } // namespace media |
OLD | NEW |