| 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 observer_(params.media_observer()) { | 246 observer_(params.media_observer()) { |
| 247 DCHECK(!adjust_allocated_memory_cb_.is_null()); | 247 DCHECK(!adjust_allocated_memory_cb_.is_null()); |
| 248 DCHECK(renderer_factory_); | 248 DCHECK(renderer_factory_); |
| 249 DCHECK(client_); | 249 DCHECK(client_); |
| 250 | 250 |
| 251 tick_clock_.reset(new base::DefaultTickClock()); | 251 tick_clock_.reset(new base::DefaultTickClock()); |
| 252 | 252 |
| 253 force_video_overlays_ = base::CommandLine::ForCurrentProcess()->HasSwitch( | 253 force_video_overlays_ = base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 254 switches::kForceVideoOverlays); | 254 switches::kForceVideoOverlays); |
| 255 | 255 |
| 256 enable_fullscreen_video_overlays_ = |
| 257 base::FeatureList::IsEnabled(media::kOverlayFullscreenVideo); |
| 258 |
| 256 if (delegate_) { | 259 if (delegate_) { |
| 257 delegate_id_ = delegate_->AddObserver(this); | 260 delegate_id_ = delegate_->AddObserver(this); |
| 258 delegate_->SetIdle(delegate_id_, true); | 261 delegate_->SetIdle(delegate_id_, true); |
| 259 } | 262 } |
| 260 | 263 |
| 261 media_log_->AddEvent( | 264 media_log_->AddEvent( |
| 262 media_log_->CreateEvent(MediaLogEvent::WEBMEDIAPLAYER_CREATED)); | 265 media_log_->CreateEvent(MediaLogEvent::WEBMEDIAPLAYER_CREATED)); |
| 263 | 266 |
| 264 if (params.initial_cdm()) | 267 if (params.initial_cdm()) |
| 265 SetCdm(params.initial_cdm()); | 268 SetCdm(params.initial_cdm()); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 DVLOG(1) << __func__ << "(" << load_type << ", " << url << ", " << cors_mode | 310 DVLOG(1) << __func__ << "(" << load_type << ", " << url << ", " << cors_mode |
| 308 << ")"; | 311 << ")"; |
| 309 if (!defer_load_cb_.is_null()) { | 312 if (!defer_load_cb_.is_null()) { |
| 310 defer_load_cb_.Run(base::Bind( | 313 defer_load_cb_.Run(base::Bind( |
| 311 &WebMediaPlayerImpl::DoLoad, AsWeakPtr(), load_type, url, cors_mode)); | 314 &WebMediaPlayerImpl::DoLoad, AsWeakPtr(), load_type, url, cors_mode)); |
| 312 return; | 315 return; |
| 313 } | 316 } |
| 314 DoLoad(load_type, url, cors_mode); | 317 DoLoad(load_type, url, cors_mode); |
| 315 } | 318 } |
| 316 | 319 |
| 317 void WebMediaPlayerImpl::SetEnableFullscreenOverlays(bool enable_overlays) { | |
| 318 enable_fullscreen_video_overlays_ = enable_overlays; | |
| 319 } | |
| 320 | |
| 321 bool WebMediaPlayerImpl::supportsOverlayFullscreenVideo() { | 320 bool WebMediaPlayerImpl::supportsOverlayFullscreenVideo() { |
| 322 #if defined(OS_ANDROID) | 321 #if defined(OS_ANDROID) |
| 323 return true; | 322 return true; |
| 324 #else | 323 #else |
| 325 return false; | 324 return false; |
| 326 #endif | 325 #endif |
| 327 } | 326 } |
| 328 | 327 |
| 329 void WebMediaPlayerImpl::EnableOverlay() { | 328 void WebMediaPlayerImpl::EnableOverlay() { |
| 330 overlay_enabled_ = true; | 329 overlay_enabled_ = true; |
| (...skipping 1854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2185 pipeline_statistics_for_test_ = base::make_optional(stats); | 2184 pipeline_statistics_for_test_ = base::make_optional(stats); |
| 2186 } | 2185 } |
| 2187 | 2186 |
| 2188 PipelineStatistics WebMediaPlayerImpl::GetPipelineStatistics() const { | 2187 PipelineStatistics WebMediaPlayerImpl::GetPipelineStatistics() const { |
| 2189 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 2188 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 2190 | 2189 |
| 2191 return pipeline_statistics_for_test_.value_or(pipeline_.GetStatistics()); | 2190 return pipeline_statistics_for_test_.value_or(pipeline_.GetStatistics()); |
| 2192 } | 2191 } |
| 2193 | 2192 |
| 2194 } // namespace media | 2193 } // namespace media |
| OLD | NEW |