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

Side by Side Diff: media/base/pipeline_impl.cc

Issue 2643103002: [Video] Fix keyframe distance average calculations. (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | media/base/pipeline_status.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/base/pipeline_impl.h" 5 #include "media/base/pipeline_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 DVLOG(3) << __func__; 640 DVLOG(3) << __func__;
641 DCHECK(media_task_runner_->BelongsToCurrentThread()); 641 DCHECK(media_task_runner_->BelongsToCurrentThread());
642 642
643 base::AutoLock auto_lock(shared_state_lock_); 643 base::AutoLock auto_lock(shared_state_lock_);
644 shared_state_.statistics.audio_bytes_decoded += stats.audio_bytes_decoded; 644 shared_state_.statistics.audio_bytes_decoded += stats.audio_bytes_decoded;
645 shared_state_.statistics.video_bytes_decoded += stats.video_bytes_decoded; 645 shared_state_.statistics.video_bytes_decoded += stats.video_bytes_decoded;
646 shared_state_.statistics.video_frames_decoded += stats.video_frames_decoded; 646 shared_state_.statistics.video_frames_decoded += stats.video_frames_decoded;
647 shared_state_.statistics.video_frames_dropped += stats.video_frames_dropped; 647 shared_state_.statistics.video_frames_dropped += stats.video_frames_dropped;
648 shared_state_.statistics.audio_memory_usage += stats.audio_memory_usage; 648 shared_state_.statistics.audio_memory_usage += stats.audio_memory_usage;
649 shared_state_.statistics.video_memory_usage += stats.video_memory_usage; 649 shared_state_.statistics.video_memory_usage += stats.video_memory_usage;
650 shared_state_.statistics.video_keyframe_distance_average = 650
651 stats.video_keyframe_distance_average; 651 if (stats.video_keyframe_distance_average != kNoTimestamp) {
652 shared_state_.statistics.video_keyframe_distance_average =
653 stats.video_keyframe_distance_average;
654 }
652 } 655 }
653 656
654 void PipelineImpl::RendererWrapper::OnBufferingStateChange( 657 void PipelineImpl::RendererWrapper::OnBufferingStateChange(
655 BufferingState state) { 658 BufferingState state) {
656 DCHECK(media_task_runner_->BelongsToCurrentThread()); 659 DCHECK(media_task_runner_->BelongsToCurrentThread());
657 DVLOG(2) << __func__ << "(" << state << ") "; 660 DVLOG(2) << __func__ << "(" << state << ") ";
658 661
659 main_task_runner_->PostTask( 662 main_task_runner_->PostTask(
660 FROM_HERE, 663 FROM_HERE,
661 base::Bind(&PipelineImpl::OnBufferingStateChange, weak_pipeline_, state)); 664 base::Bind(&PipelineImpl::OnBufferingStateChange, weak_pipeline_, state));
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
1335 void PipelineImpl::OnSuspendDone() { 1338 void PipelineImpl::OnSuspendDone() {
1336 DVLOG(3) << __func__; 1339 DVLOG(3) << __func__;
1337 DCHECK(thread_checker_.CalledOnValidThread()); 1340 DCHECK(thread_checker_.CalledOnValidThread());
1338 DCHECK(IsRunning()); 1341 DCHECK(IsRunning());
1339 1342
1340 DCHECK(!suspend_cb_.is_null()); 1343 DCHECK(!suspend_cb_.is_null());
1341 base::ResetAndReturn(&suspend_cb_).Run(PIPELINE_OK); 1344 base::ResetAndReturn(&suspend_cb_).Run(PIPELINE_OK);
1342 } 1345 }
1343 1346
1344 } // namespace media 1347 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/base/pipeline_status.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698