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

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

Issue 1766783003: Expand suspension of idle media players to all platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@notify_pause
Patch Set: Cleanup. Created 4 years, 9 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
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 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 text_renderer_->StartPlaying(); 378 text_renderer_->StartPlaying();
379 379
380 base::ResetAndReturn(&seek_cb_).Run(PIPELINE_OK); 380 base::ResetAndReturn(&seek_cb_).Run(PIPELINE_OK);
381 381
382 PlaybackRateChangedTask(GetPlaybackRate()); 382 PlaybackRateChangedTask(GetPlaybackRate());
383 VolumeChangedTask(GetVolume()); 383 VolumeChangedTask(GetVolume());
384 return; 384 return;
385 385
386 case kSuspended: 386 case kSuspended:
387 renderer_.reset(); 387 renderer_.reset();
388 statistics_.audio_memory_usage = 0;
389 statistics_.video_memory_usage = 0;
390 base::ResetAndReturn(&suspend_cb_).Run(PIPELINE_OK); 388 base::ResetAndReturn(&suspend_cb_).Run(PIPELINE_OK);
391 return; 389 return;
392 390
393 case kStopping: 391 case kStopping:
394 case kStopped: 392 case kStopped:
395 case kCreated: 393 case kCreated:
396 case kSeeking: 394 case kSeeking:
397 case kSuspending: 395 case kSuspending:
398 case kResuming: 396 case kResuming:
399 NOTREACHED() << "State has no transition: " << state_; 397 NOTREACHED() << "State has no transition: " << state_;
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 metadata_cb_.Run(metadata); 865 metadata_cb_.Run(metadata);
868 } 866 }
869 867
870 void PipelineImpl::BufferingStateChanged(BufferingState new_buffering_state) { 868 void PipelineImpl::BufferingStateChanged(BufferingState new_buffering_state) {
871 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") "; 869 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") ";
872 DCHECK(task_runner_->BelongsToCurrentThread()); 870 DCHECK(task_runner_->BelongsToCurrentThread());
873 buffering_state_cb_.Run(new_buffering_state); 871 buffering_state_cb_.Run(new_buffering_state);
874 } 872 }
875 873
876 } // namespace media 874 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698