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

Side by Side Diff: media/renderers/video_renderer_impl.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, 1 month 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
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/renderers/video_renderer_impl.h" 5 #include "media/renderers/video_renderer_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 543
544 void VideoRendererImpl::UpdateStats_Locked() { 544 void VideoRendererImpl::UpdateStats_Locked() {
545 lock_.AssertAcquired(); 545 lock_.AssertAcquired();
546 DCHECK_GE(frames_decoded_, 0); 546 DCHECK_GE(frames_decoded_, 0);
547 DCHECK_GE(frames_dropped_, 0); 547 DCHECK_GE(frames_dropped_, 0);
548 548
549 if (frames_decoded_ || frames_dropped_) { 549 if (frames_decoded_ || frames_dropped_) {
550 PipelineStatistics statistics; 550 PipelineStatistics statistics;
551 statistics.video_frames_decoded = frames_decoded_; 551 statistics.video_frames_decoded = frames_decoded_;
552 statistics.video_frames_dropped = frames_dropped_; 552 statistics.video_frames_dropped = frames_dropped_;
553 statistics.video_memory_usage = algorithm_->GetMemoryUsage();
553 task_runner_->PostTask(FROM_HERE, base::Bind(statistics_cb_, statistics)); 554 task_runner_->PostTask(FROM_HERE, base::Bind(statistics_cb_, statistics));
554 555
555 frames_decoded_ = 0; 556 frames_decoded_ = 0;
556 frames_dropped_ = 0; 557 frames_dropped_ = 0;
557 } 558 }
558 } 559 }
559 560
560 void VideoRendererImpl::MaybeStopSinkAfterFirstPaint() { 561 void VideoRendererImpl::MaybeStopSinkAfterFirstPaint() {
561 DCHECK(task_runner_->BelongsToCurrentThread()); 562 DCHECK(task_runner_->BelongsToCurrentThread());
562 563
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 base::TimeTicks VideoRendererImpl::ConvertMediaTimestamp( 626 base::TimeTicks VideoRendererImpl::ConvertMediaTimestamp(
626 base::TimeDelta media_time) { 627 base::TimeDelta media_time) {
627 std::vector<base::TimeDelta> media_times(1, media_time); 628 std::vector<base::TimeDelta> media_times(1, media_time);
628 std::vector<base::TimeTicks> wall_clock_times; 629 std::vector<base::TimeTicks> wall_clock_times;
629 if (!wall_clock_time_cb_.Run(media_times, &wall_clock_times)) 630 if (!wall_clock_time_cb_.Run(media_times, &wall_clock_times))
630 return base::TimeTicks(); 631 return base::TimeTicks();
631 return wall_clock_times[0]; 632 return wall_clock_times[0];
632 } 633 }
633 634
634 } // namespace media 635 } // namespace media
OLDNEW
« media/filters/video_renderer_algorithm.cc ('K') | « media/renderers/audio_renderer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698