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/blink/webmediaplayer_impl.h" | 5 #include "media/blink/webmediaplayer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <limits> | 9 #include <limits> |
10 #include <string> | 10 #include <string> |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 suppress_destruction_errors_(false), | 227 suppress_destruction_errors_(false), |
228 can_suspend_state_(CanSuspendState::UNKNOWN), | 228 can_suspend_state_(CanSuspendState::UNKNOWN), |
229 is_encrypted_(false) { | 229 is_encrypted_(false) { |
230 DCHECK(!adjust_allocated_memory_cb_.is_null()); | 230 DCHECK(!adjust_allocated_memory_cb_.is_null()); |
231 DCHECK(renderer_factory_); | 231 DCHECK(renderer_factory_); |
232 DCHECK(client_); | 232 DCHECK(client_); |
233 | 233 |
234 force_video_overlays_ = base::CommandLine::ForCurrentProcess()->HasSwitch( | 234 force_video_overlays_ = base::CommandLine::ForCurrentProcess()->HasSwitch( |
235 switches::kForceVideoOverlays); | 235 switches::kForceVideoOverlays); |
236 | 236 |
| 237 disable_fullscreen_video_overlays_ = |
| 238 !base::FeatureList::IsEnabled(media::kOverlayFullscreenVideo); |
| 239 |
237 if (delegate_) | 240 if (delegate_) |
238 delegate_id_ = delegate_->AddObserver(this); | 241 delegate_id_ = delegate_->AddObserver(this); |
239 | 242 |
240 media_log_->AddEvent( | 243 media_log_->AddEvent( |
241 media_log_->CreateEvent(MediaLogEvent::WEBMEDIAPLAYER_CREATED)); | 244 media_log_->CreateEvent(MediaLogEvent::WEBMEDIAPLAYER_CREATED)); |
242 | 245 |
243 if (params.initial_cdm()) { | 246 if (params.initial_cdm()) { |
244 SetCdm(base::Bind(&IgnoreCdmAttached), | 247 SetCdm(base::Bind(&IgnoreCdmAttached), |
245 ToWebContentDecryptionModuleImpl(params.initial_cdm()) | 248 ToWebContentDecryptionModuleImpl(params.initial_cdm()) |
246 ->GetCdmContext()); | 249 ->GetCdmContext()); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 void WebMediaPlayerImpl::DisableOverlay() { | 327 void WebMediaPlayerImpl::DisableOverlay() { |
325 overlay_enabled_ = false; | 328 overlay_enabled_ = false; |
326 surface_created_cb_.Cancel(); | 329 surface_created_cb_.Cancel(); |
327 overlay_surface_id_ = SurfaceManager::kNoSurfaceID; | 330 overlay_surface_id_ = SurfaceManager::kNoSurfaceID; |
328 | 331 |
329 if (decoder_requires_restart_for_overlay_) | 332 if (decoder_requires_restart_for_overlay_) |
330 ScheduleRestart(); | 333 ScheduleRestart(); |
331 } | 334 } |
332 | 335 |
333 void WebMediaPlayerImpl::enteredFullscreen() { | 336 void WebMediaPlayerImpl::enteredFullscreen() { |
334 if (!force_video_overlays_) | 337 if (!force_video_overlays_ && !disable_fullscreen_video_overlays_) |
335 EnableOverlay(); | 338 EnableOverlay(); |
336 } | 339 } |
337 | 340 |
338 void WebMediaPlayerImpl::exitedFullscreen() { | 341 void WebMediaPlayerImpl::exitedFullscreen() { |
339 if (!force_video_overlays_) | 342 if (!force_video_overlays_ && !disable_fullscreen_video_overlays_) |
340 DisableOverlay(); | 343 DisableOverlay(); |
341 } | 344 } |
342 | 345 |
343 void WebMediaPlayerImpl::DoLoad(LoadType load_type, | 346 void WebMediaPlayerImpl::DoLoad(LoadType load_type, |
344 const blink::WebURL& url, | 347 const blink::WebURL& url, |
345 CORSMode cors_mode) { | 348 CORSMode cors_mode) { |
346 DVLOG(1) << __func__; | 349 DVLOG(1) << __func__; |
347 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 350 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
348 | 351 |
349 GURL gurl(url); | 352 GURL gurl(url); |
(...skipping 1442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1792 pipeline_metadata_.natural_size, | 1795 pipeline_metadata_.natural_size, |
1793 base::Bind(&GetCurrentTimeInternal, this))); | 1796 base::Bind(&GetCurrentTimeInternal, this))); |
1794 watch_time_reporter_->OnVolumeChange(volume_); | 1797 watch_time_reporter_->OnVolumeChange(volume_); |
1795 if (delegate_ && delegate_->IsHidden()) | 1798 if (delegate_ && delegate_->IsHidden()) |
1796 watch_time_reporter_->OnHidden(); | 1799 watch_time_reporter_->OnHidden(); |
1797 else | 1800 else |
1798 watch_time_reporter_->OnShown(); | 1801 watch_time_reporter_->OnShown(); |
1799 } | 1802 } |
1800 | 1803 |
1801 } // namespace media | 1804 } // namespace media |
OLD | NEW |