Chromium Code Reviews| 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 244 DCHECK(!adjust_allocated_memory_cb_.is_null()); | 244 DCHECK(!adjust_allocated_memory_cb_.is_null()); |
| 245 DCHECK(renderer_factory_); | 245 DCHECK(renderer_factory_); |
| 246 DCHECK(client_); | 246 DCHECK(client_); |
| 247 | 247 |
| 248 tick_clock_.reset(new base::DefaultTickClock()); | 248 tick_clock_.reset(new base::DefaultTickClock()); |
| 249 | 249 |
| 250 force_video_overlays_ = base::CommandLine::ForCurrentProcess()->HasSwitch( | 250 force_video_overlays_ = base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 251 switches::kForceVideoOverlays); | 251 switches::kForceVideoOverlays); |
| 252 | 252 |
| 253 disable_fullscreen_video_overlays_ = | 253 disable_fullscreen_video_overlays_ = |
| 254 !base::FeatureList::IsEnabled(media::kOverlayFullscreenVideo); | 254 !base::FeatureList::IsEnabled(media::kOverlayFullscreenVideo); |
|
ddorwin
2016/12/13 22:54:49
I think it would be better if media/ didn't rely o
amp
2016/12/13 23:40:02
That wouldn't be too hard to do and would maybe al
| |
| 255 | 255 |
| 256 if (delegate_) | 256 if (delegate_) |
| 257 delegate_id_ = delegate_->AddObserver(this); | 257 delegate_id_ = delegate_->AddObserver(this); |
| 258 | 258 |
| 259 media_log_->AddEvent( | 259 media_log_->AddEvent( |
| 260 media_log_->CreateEvent(MediaLogEvent::WEBMEDIAPLAYER_CREATED)); | 260 media_log_->CreateEvent(MediaLogEvent::WEBMEDIAPLAYER_CREATED)); |
| 261 | 261 |
| 262 if (params.initial_cdm()) | 262 if (params.initial_cdm()) |
| 263 SetCdm(params.initial_cdm()); | 263 SetCdm(params.initial_cdm()); |
| 264 | 264 |
| (...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1459 if (!video_weblayer_) | 1459 if (!video_weblayer_) |
| 1460 return pipeline_metadata_.natural_size; | 1460 return pipeline_metadata_.natural_size; |
| 1461 | 1461 |
| 1462 return video_weblayer_->bounds(); | 1462 return video_weblayer_->bounds(); |
| 1463 } | 1463 } |
| 1464 | 1464 |
| 1465 void WebMediaPlayerImpl::SetDeviceScaleFactor(float scale_factor) { | 1465 void WebMediaPlayerImpl::SetDeviceScaleFactor(float scale_factor) { |
| 1466 cast_impl_.SetDeviceScaleFactor(scale_factor); | 1466 cast_impl_.SetDeviceScaleFactor(scale_factor); |
| 1467 } | 1467 } |
| 1468 | 1468 |
| 1469 void WebMediaPlayerImpl::SetDisableFullscreenOverlays(bool disable_overlays) { | |
|
ddorwin
2016/12/13 22:54:49
It's strange to set a disable with a bool. I sugge
amp
2016/12/13 23:40:02
It was hard to follow when I first looked at it so
| |
| 1470 disable_fullscreen_video_overlays_ = disable_overlays; | |
| 1471 } | |
| 1472 | |
| 1469 void WebMediaPlayerImpl::setPoster(const blink::WebURL& poster) { | 1473 void WebMediaPlayerImpl::setPoster(const blink::WebURL& poster) { |
| 1470 cast_impl_.setPoster(poster); | 1474 cast_impl_.setPoster(poster); |
| 1471 } | 1475 } |
| 1472 | 1476 |
| 1473 void WebMediaPlayerImpl::SetUseFallbackPath(bool use_fallback_path) { | 1477 void WebMediaPlayerImpl::SetUseFallbackPath(bool use_fallback_path) { |
| 1474 use_fallback_path_ = use_fallback_path; | 1478 use_fallback_path_ = use_fallback_path; |
| 1475 } | 1479 } |
| 1476 #endif // defined(OS_ANDROID) // WMPI_CAST | 1480 #endif // defined(OS_ANDROID) // WMPI_CAST |
| 1477 | 1481 |
| 1478 void WebMediaPlayerImpl::DataSourceInitialized(bool success) { | 1482 void WebMediaPlayerImpl::DataSourceInitialized(bool success) { |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1979 watch_time_reporter_->OnShown(); | 1983 watch_time_reporter_->OnShown(); |
| 1980 } | 1984 } |
| 1981 | 1985 |
| 1982 bool WebMediaPlayerImpl::IsHidden() const { | 1986 bool WebMediaPlayerImpl::IsHidden() const { |
| 1983 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 1987 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 1984 | 1988 |
| 1985 return delegate_ && delegate_->IsHidden(); | 1989 return delegate_ && delegate_->IsHidden(); |
| 1986 } | 1990 } |
| 1987 | 1991 |
| 1988 } // namespace media | 1992 } // namespace media |
| OLD | NEW |