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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 1815883002: Merge M50: "Fix media memory usage reporting after a pipeline suspend." (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/pipeline_impl_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webmediaplayer_impl.cc
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index bd1b822f6929e5cf405197ac86ea40566d955ac4..985ded9d77a023d4934d3d2316432c1497fd5ef8 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -957,8 +957,13 @@ void WebMediaPlayerImpl::OnPipelineSuspended(PipelineStatus status) {
}
#endif
- if (pending_resume_ || pending_suspend_resume_cycle_) {
- pending_resume_ = false;
+ if (delegate_)
+ delegate_->PlayerGone(delegate_id_);
+ memory_usage_reporting_timer_.Stop();
+ ReportMemoryUsage();
+
+ if (pending_suspend_resume_cycle_) {
+ pending_resume_ = false;
pending_suspend_resume_cycle_ = false;
Resume();
return;
@@ -1602,6 +1607,9 @@ void WebMediaPlayerImpl::FinishMemoryUsageReport(int64_t demuxer_memory_usage) {
(data_source_ ? data_source_->GetMemoryUsage() : 0) +
demuxer_memory_usage;
+ // Note, this isn't entirely accurate, there may be VideoFrames held by the
+ // compositor or other resources that we're unaware of.
+
DVLOG(2) << "Memory Usage -- Audio: " << stats.audio_memory_usage
<< ", Video: " << stats.video_memory_usage << ", DataSource: "
<< (data_source_ ? data_source_->GetMemoryUsage() : 0)
« no previous file with comments | « media/base/pipeline_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698