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

Unified Diff: media/filters/video_renderer_algorithm.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 html viewer. 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
« no previous file with comments | « media/filters/video_renderer_algorithm.h ('k') | media/filters/video_renderer_algorithm_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/video_renderer_algorithm.cc
diff --git a/media/filters/video_renderer_algorithm.cc b/media/filters/video_renderer_algorithm.cc
index bbb48648767b8f5b6da7fb4cda321b0b7c42647e..56e30b4a15fb63932ee14d49f5c6ffbc76f91f99 100644
--- a/media/filters/video_renderer_algorithm.cc
+++ b/media/filters/video_renderer_algorithm.cc
@@ -350,6 +350,15 @@ size_t VideoRendererAlgorithm::EffectiveFramesQueued() const {
return renderable_frame_count;
}
+int64_t VideoRendererAlgorithm::GetMemoryUsage() const {
+ int64_t allocation_size = 0;
+ for (const auto& ready_frame : frame_queue_) {
+ allocation_size += VideoFrame::AllocationSize(
+ ready_frame.frame->format(), ready_frame.frame->coded_size());
+ }
+ return allocation_size;
+}
+
void VideoRendererAlgorithm::EnqueueFrame(
const scoped_refptr<VideoFrame>& frame) {
DCHECK(frame);
« no previous file with comments | « media/filters/video_renderer_algorithm.h ('k') | media/filters/video_renderer_algorithm_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698