| 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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 DVLOG(1) << __FUNCTION__ << "(" << load_type << ", " << url << ", " | 278 DVLOG(1) << __FUNCTION__ << "(" << load_type << ", " << url << ", " |
| 279 << cors_mode << ")"; | 279 << cors_mode << ")"; |
| 280 if (!defer_load_cb_.is_null()) { | 280 if (!defer_load_cb_.is_null()) { |
| 281 defer_load_cb_.Run(base::Bind( | 281 defer_load_cb_.Run(base::Bind( |
| 282 &WebMediaPlayerImpl::DoLoad, AsWeakPtr(), load_type, url, cors_mode)); | 282 &WebMediaPlayerImpl::DoLoad, AsWeakPtr(), load_type, url, cors_mode)); |
| 283 return; | 283 return; |
| 284 } | 284 } |
| 285 DoLoad(load_type, url, cors_mode); | 285 DoLoad(load_type, url, cors_mode); |
| 286 } | 286 } |
| 287 | 287 |
| 288 bool WebMediaPlayerImpl::supportsOverlayFullscreenVideo() { |
| 289 #if defined(OS_ANDROID) |
| 290 return true; |
| 291 #else |
| 292 return false; |
| 293 #endif |
| 294 } |
| 295 |
| 288 void WebMediaPlayerImpl::enteredFullscreen() { | 296 void WebMediaPlayerImpl::enteredFullscreen() { |
| 289 fullscreen_ = true; | 297 fullscreen_ = true; |
| 290 if (decoder_requires_restart_for_fullscreen_) | 298 if (decoder_requires_restart_for_fullscreen_) |
| 291 ScheduleRestart(); | 299 ScheduleRestart(); |
| 292 } | 300 } |
| 293 | 301 |
| 294 void WebMediaPlayerImpl::exitedFullscreen() { | 302 void WebMediaPlayerImpl::exitedFullscreen() { |
| 295 fullscreen_ = false; | 303 fullscreen_ = false; |
| 296 if (decoder_requires_restart_for_fullscreen_) | 304 if (decoder_requires_restart_for_fullscreen_) |
| 297 ScheduleRestart(); | 305 ScheduleRestart(); |
| (...skipping 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1596 << ", Video: " << stats.video_memory_usage << ", DataSource: " | 1604 << ", Video: " << stats.video_memory_usage << ", DataSource: " |
| 1597 << (data_source_ ? data_source_->GetMemoryUsage() : 0) | 1605 << (data_source_ ? data_source_->GetMemoryUsage() : 0) |
| 1598 << ", Demuxer: " << demuxer_memory_usage; | 1606 << ", Demuxer: " << demuxer_memory_usage; |
| 1599 | 1607 |
| 1600 const int64_t delta = current_memory_usage - last_reported_memory_usage_; | 1608 const int64_t delta = current_memory_usage - last_reported_memory_usage_; |
| 1601 last_reported_memory_usage_ = current_memory_usage; | 1609 last_reported_memory_usage_ = current_memory_usage; |
| 1602 adjust_allocated_memory_cb_.Run(delta); | 1610 adjust_allocated_memory_cb_.Run(delta); |
| 1603 } | 1611 } |
| 1604 | 1612 |
| 1605 } // namespace media | 1613 } // namespace media |
| OLD | NEW |