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

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

Issue 2611333003: [Video] Disable bg optimization if avg keyframe distance is >10s (Closed)
Patch Set: Unittest 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') | media/filters/decoder_stream_traits.cc » ('J')
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 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 DVLOG(3) << __func__; 630 DVLOG(3) << __func__;
631 DCHECK(media_task_runner_->BelongsToCurrentThread()); 631 DCHECK(media_task_runner_->BelongsToCurrentThread());
632 632
633 base::AutoLock auto_lock(shared_state_lock_); 633 base::AutoLock auto_lock(shared_state_lock_);
634 shared_state_.statistics.audio_bytes_decoded += stats.audio_bytes_decoded; 634 shared_state_.statistics.audio_bytes_decoded += stats.audio_bytes_decoded;
635 shared_state_.statistics.video_bytes_decoded += stats.video_bytes_decoded; 635 shared_state_.statistics.video_bytes_decoded += stats.video_bytes_decoded;
636 shared_state_.statistics.video_frames_decoded += stats.video_frames_decoded; 636 shared_state_.statistics.video_frames_decoded += stats.video_frames_decoded;
637 shared_state_.statistics.video_frames_dropped += stats.video_frames_dropped; 637 shared_state_.statistics.video_frames_dropped += stats.video_frames_dropped;
638 shared_state_.statistics.audio_memory_usage += stats.audio_memory_usage; 638 shared_state_.statistics.audio_memory_usage += stats.audio_memory_usage;
639 shared_state_.statistics.video_memory_usage += stats.video_memory_usage; 639 shared_state_.statistics.video_memory_usage += stats.video_memory_usage;
640 shared_state_.statistics.video_keyframe_distance_average =
641 stats.video_keyframe_distance_average;
640 } 642 }
641 643
642 void PipelineImpl::RendererWrapper::OnBufferingStateChange( 644 void PipelineImpl::RendererWrapper::OnBufferingStateChange(
643 BufferingState state) { 645 BufferingState state) {
644 DCHECK(media_task_runner_->BelongsToCurrentThread()); 646 DCHECK(media_task_runner_->BelongsToCurrentThread());
645 DVLOG(2) << __func__ << "(" << state << ") "; 647 DVLOG(2) << __func__ << "(" << state << ") ";
646 648
647 main_task_runner_->PostTask( 649 main_task_runner_->PostTask(
648 FROM_HERE, 650 FROM_HERE,
649 base::Bind(&PipelineImpl::OnBufferingStateChange, weak_pipeline_, state)); 651 base::Bind(&PipelineImpl::OnBufferingStateChange, weak_pipeline_, state));
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
1321 void PipelineImpl::OnSuspendDone() { 1323 void PipelineImpl::OnSuspendDone() {
1322 DVLOG(3) << __func__; 1324 DVLOG(3) << __func__;
1323 DCHECK(thread_checker_.CalledOnValidThread()); 1325 DCHECK(thread_checker_.CalledOnValidThread());
1324 DCHECK(IsRunning()); 1326 DCHECK(IsRunning());
1325 1327
1326 DCHECK(!suspend_cb_.is_null()); 1328 DCHECK(!suspend_cb_.is_null());
1327 base::ResetAndReturn(&suspend_cb_).Run(PIPELINE_OK); 1329 base::ResetAndReturn(&suspend_cb_).Run(PIPELINE_OK);
1328 } 1330 }
1329 1331
1330 } // namespace media 1332 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/base/pipeline_status.h » ('j') | media/filters/decoder_stream_traits.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698