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 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1017 video_weblayer_.reset(new cc_blink::WebLayerImpl(layer)); | 1017 video_weblayer_.reset(new cc_blink::WebLayerImpl(layer)); |
1018 video_weblayer_->layer()->SetContentsOpaque(opaque_); | 1018 video_weblayer_->layer()->SetContentsOpaque(opaque_); |
1019 video_weblayer_->SetContentsOpaqueIsFixed(true); | 1019 video_weblayer_->SetContentsOpaqueIsFixed(true); |
1020 client_->setWebLayer(video_weblayer_.get()); | 1020 client_->setWebLayer(video_weblayer_.get()); |
1021 | 1021 |
1022 // If there is video and the frame is hidden, then it may be time to suspend | 1022 // If there is video and the frame is hidden, then it may be time to suspend |
1023 // playback. | 1023 // playback. |
1024 if (delegate_ && delegate_->IsHidden()) | 1024 if (delegate_ && delegate_->IsHidden()) |
1025 OnHidden(false); | 1025 OnHidden(false); |
1026 } | 1026 } |
| 1027 |
| 1028 // Tell the delegate we can now be safely suspended due to inactivity if a |
| 1029 // subsequent play event does not occur. |
| 1030 if (paused_) |
| 1031 NotifyPlaybackPaused(); |
1027 } | 1032 } |
1028 | 1033 |
1029 void WebMediaPlayerImpl::OnPipelineBufferingStateChanged( | 1034 void WebMediaPlayerImpl::OnPipelineBufferingStateChanged( |
1030 BufferingState buffering_state) { | 1035 BufferingState buffering_state) { |
1031 DVLOG(1) << __FUNCTION__ << "(" << buffering_state << ")"; | 1036 DVLOG(1) << __FUNCTION__ << "(" << buffering_state << ")"; |
1032 | 1037 |
1033 // Ignore buffering state changes until we've completed all outstanding seeks. | 1038 // Ignore buffering state changes until we've completed all outstanding seeks. |
1034 if (seeking_ || pending_seek_) | 1039 if (seeking_ || pending_seek_) |
1035 return; | 1040 return; |
1036 | 1041 |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1601 << ", Video: " << stats.video_memory_usage << ", DataSource: " | 1606 << ", Video: " << stats.video_memory_usage << ", DataSource: " |
1602 << (data_source_ ? data_source_->GetMemoryUsage() : 0) | 1607 << (data_source_ ? data_source_->GetMemoryUsage() : 0) |
1603 << ", Demuxer: " << demuxer_memory_usage; | 1608 << ", Demuxer: " << demuxer_memory_usage; |
1604 | 1609 |
1605 const int64_t delta = current_memory_usage - last_reported_memory_usage_; | 1610 const int64_t delta = current_memory_usage - last_reported_memory_usage_; |
1606 last_reported_memory_usage_ = current_memory_usage; | 1611 last_reported_memory_usage_ = current_memory_usage; |
1607 adjust_allocated_memory_cb_.Run(delta); | 1612 adjust_allocated_memory_cb_.Run(delta); |
1608 } | 1613 } |
1609 | 1614 |
1610 } // namespace media | 1615 } // namespace media |
OLD | NEW |