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

Unified Diff: media/base/pipeline.cc

Issue 1409123005: Add methods for telling V8 how much memory audio/video is using. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mock filter. Created 5 years, 2 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
Index: media/base/pipeline.cc
diff --git a/media/base/pipeline.cc b/media/base/pipeline.cc
index 387470aec070dd242e5486419f9efb15d859a2fa..90a090b4fccf140ff8753a4dbd9eb9bc8d78143d 100644
--- a/media/base/pipeline.cc
+++ b/media/base/pipeline.cc
@@ -46,6 +46,11 @@ Pipeline::Pipeline(
pending_cdm_context_(nullptr),
weak_factory_(this) {
media_log_->AddEvent(media_log_->CreatePipelineStateChangedEvent(kCreated));
+
+ // By default these values are initialized to -1 to indicate no data, but
+ // Pipeline clients should always see a zero value in these cases.
xhwang 2015/10/25 17:01:56 In this case, why do we need the concept of "no da
DaleCurtis 2015/10/27 23:14:20 Removed in favor of returning delta stats from ren
+ statistics_.audio_memory_usage = 0;
+ statistics_.video_memory_usage = 0;
}
Pipeline::~Pipeline() {
@@ -472,6 +477,11 @@ void Pipeline::OnUpdateStatistics(const PipelineStatistics& stats) {
statistics_.video_bytes_decoded += stats.video_bytes_decoded;
statistics_.video_frames_decoded += stats.video_frames_decoded;
statistics_.video_frames_dropped += stats.video_frames_dropped;
+
+ if (stats.audio_memory_usage >= 0)
+ statistics_.audio_memory_usage = stats.audio_memory_usage;
+ if (stats.video_memory_usage >= 0)
+ statistics_.video_memory_usage = stats.video_memory_usage;
}
void Pipeline::StartTask() {

Powered by Google App Engine
This is Rietveld 408576698