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

Unified Diff: media/base/pipeline_impl.cc

Issue 2688383006: [Media, Video] Update WMPI when the pipeline gets a new average keyframe distance. (Closed)
Patch Set: Created 3 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.h ('k') | media/blink/webmediaplayer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/pipeline_impl.cc
diff --git a/media/base/pipeline_impl.cc b/media/base/pipeline_impl.cc
index 0ec81f9e7ca815c345531ba3f35ce1779b93d393..61c904e4f22c2e68ba0269335649077b70fd0c6d 100644
--- a/media/base/pipeline_impl.cc
+++ b/media/base/pipeline_impl.cc
@@ -648,10 +648,19 @@ void PipelineImpl::RendererWrapper::OnStatisticsUpdate(
shared_state_.statistics.audio_memory_usage += stats.audio_memory_usage;
shared_state_.statistics.video_memory_usage += stats.video_memory_usage;
+ base::TimeDelta old_average =
+ shared_state_.statistics.video_keyframe_distance_average;
if (stats.video_keyframe_distance_average != kNoTimestamp) {
shared_state_.statistics.video_keyframe_distance_average =
stats.video_keyframe_distance_average;
}
+
+ if (shared_state_.statistics.video_keyframe_distance_average != old_average) {
+ main_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&PipelineImpl::OnVideoAverageKeyframeDistanceUpdate,
+ weak_pipeline_));
+ }
}
void PipelineImpl::RendererWrapper::OnBufferingStateChange(
@@ -1324,6 +1333,15 @@ void PipelineImpl::OnVideoOpacityChange(bool opaque) {
client_->OnVideoOpacityChange(opaque);
}
+void PipelineImpl::OnVideoAverageKeyframeDistanceUpdate() {
+ DVLOG(2) << __func__;
+ DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK(IsRunning());
+
+ DCHECK(client_);
+ client_->OnVideoAverageKeyframeDistanceUpdate();
+}
+
void PipelineImpl::OnSeekDone() {
DVLOG(3) << __func__;
DCHECK(thread_checker_.CalledOnValidThread());
« no previous file with comments | « media/base/pipeline_impl.h ('k') | media/blink/webmediaplayer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698