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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 1769743002: Fix media memory usage reporting after a pipeline suspend. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 4b5f7490c7166fcf992506397e24ba65e21765d6..5583574608bfc2487fd82a91244f081cb07fb746 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -859,6 +859,8 @@ void WebMediaPlayerImpl::OnPipelineSuspended() {
if (delegate_)
delegate_->PlayerGone(delegate_id_);
+ memory_usage_reporting_timer_.Stop();
+ ReportMemoryUsage();
if (pending_suspend_resume_cycle_) {
pending_suspend_resume_cycle_ = false;
@@ -1409,6 +1411,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