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

Side by Side Diff: media/renderers/audio_renderer_impl.cc

Issue 1935873002: Implement disabling and enabling media tracks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@track-control2
Patch Set: Updated comments + dchecks in ffmpeg demux stream Created 4 years, 6 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/renderers/audio_renderer_impl.h" 5 #include "media/renderers/audio_renderer_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 DoFlush_Locked(); 260 DoFlush_Locked();
261 } 261 }
262 262
263 void AudioRendererImpl::DoFlush_Locked() { 263 void AudioRendererImpl::DoFlush_Locked() {
264 DCHECK(task_runner_->BelongsToCurrentThread()); 264 DCHECK(task_runner_->BelongsToCurrentThread());
265 lock_.AssertAcquired(); 265 lock_.AssertAcquired();
266 266
267 DCHECK(!pending_read_); 267 DCHECK(!pending_read_);
268 DCHECK_EQ(state_, kFlushed); 268 DCHECK_EQ(state_, kFlushed);
269 269
270 ended_timestamp_ = kInfiniteDuration();
270 audio_buffer_stream_->Reset(base::Bind(&AudioRendererImpl::ResetDecoderDone, 271 audio_buffer_stream_->Reset(base::Bind(&AudioRendererImpl::ResetDecoderDone,
271 weak_factory_.GetWeakPtr())); 272 weak_factory_.GetWeakPtr()));
272 } 273 }
273 274
274 void AudioRendererImpl::ResetDecoderDone() { 275 void AudioRendererImpl::ResetDecoderDone() {
275 DCHECK(task_runner_->BelongsToCurrentThread()); 276 DCHECK(task_runner_->BelongsToCurrentThread());
276 { 277 {
277 base::AutoLock auto_lock(lock_); 278 base::AutoLock auto_lock(lock_);
278 279
279 DCHECK_EQ(state_, kFlushed); 280 DCHECK_EQ(state_, kFlushed);
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 DCHECK_NE(buffering_state_, buffering_state); 926 DCHECK_NE(buffering_state_, buffering_state);
926 lock_.AssertAcquired(); 927 lock_.AssertAcquired();
927 buffering_state_ = buffering_state; 928 buffering_state_ = buffering_state;
928 929
929 task_runner_->PostTask( 930 task_runner_->PostTask(
930 FROM_HERE, base::Bind(&AudioRendererImpl::OnBufferingStateChange, 931 FROM_HERE, base::Bind(&AudioRendererImpl::OnBufferingStateChange,
931 weak_factory_.GetWeakPtr(), buffering_state_)); 932 weak_factory_.GetWeakPtr(), buffering_state_));
932 } 933 }
933 934
934 } // namespace media 935 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698