| 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 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 gfx::Size WebMediaPlayerImpl::GetCanvasSize() const { | 1207 gfx::Size WebMediaPlayerImpl::GetCanvasSize() const { |
| 1208 if (!video_weblayer_) | 1208 if (!video_weblayer_) |
| 1209 return pipeline_metadata_.natural_size; | 1209 return pipeline_metadata_.natural_size; |
| 1210 | 1210 |
| 1211 return video_weblayer_->bounds(); | 1211 return video_weblayer_->bounds(); |
| 1212 } | 1212 } |
| 1213 | 1213 |
| 1214 void WebMediaPlayerImpl::SetDeviceScaleFactor(float scale_factor) { | 1214 void WebMediaPlayerImpl::SetDeviceScaleFactor(float scale_factor) { |
| 1215 cast_impl_.SetDeviceScaleFactor(scale_factor); | 1215 cast_impl_.SetDeviceScaleFactor(scale_factor); |
| 1216 } | 1216 } |
| 1217 |
| 1218 void WebMediaPlayerImpl::setPoster(const blink::WebURL& poster) { |
| 1219 cast_impl_.setPoster(poster); |
| 1220 } |
| 1217 #endif // defined(OS_ANDROID) // WMPI_CAST | 1221 #endif // defined(OS_ANDROID) // WMPI_CAST |
| 1218 | 1222 |
| 1219 void WebMediaPlayerImpl::DataSourceInitialized(bool success) { | 1223 void WebMediaPlayerImpl::DataSourceInitialized(bool success) { |
| 1220 DVLOG(1) << __FUNCTION__; | 1224 DVLOG(1) << __FUNCTION__; |
| 1221 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 1225 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 1222 | 1226 |
| 1223 if (!success) { | 1227 if (!success) { |
| 1224 SetNetworkState(WebMediaPlayer::NetworkStateFormatError); | 1228 SetNetworkState(WebMediaPlayer::NetworkStateFormatError); |
| 1225 | 1229 |
| 1226 // Not really necessary, since the pipeline was never started, but it at | 1230 // Not really necessary, since the pipeline was never started, but it at |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1605 << ", Video: " << stats.video_memory_usage << ", DataSource: " | 1609 << ", Video: " << stats.video_memory_usage << ", DataSource: " |
| 1606 << (data_source_ ? data_source_->GetMemoryUsage() : 0) | 1610 << (data_source_ ? data_source_->GetMemoryUsage() : 0) |
| 1607 << ", Demuxer: " << demuxer_memory_usage; | 1611 << ", Demuxer: " << demuxer_memory_usage; |
| 1608 | 1612 |
| 1609 const int64_t delta = current_memory_usage - last_reported_memory_usage_; | 1613 const int64_t delta = current_memory_usage - last_reported_memory_usage_; |
| 1610 last_reported_memory_usage_ = current_memory_usage; | 1614 last_reported_memory_usage_ = current_memory_usage; |
| 1611 adjust_allocated_memory_cb_.Run(delta); | 1615 adjust_allocated_memory_cb_.Run(delta); |
| 1612 } | 1616 } |
| 1613 | 1617 |
| 1614 } // namespace media | 1618 } // namespace media |
| OLD | NEW |