Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: media/blink/webmediaplayer_impl.cc

Issue 1808463002: Don't mark a WebMediaPlayer as idle until it has size and first frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/blink/webmediaplayer_delegate.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/blink/webmediaplayer_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698