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

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: rebase Created 4 years, 5 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 | « media/mojo/services/mojo_demuxer_stream_adapter.cc ('k') | media/renderers/renderer_impl.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/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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 DoFlush_Locked(); 292 DoFlush_Locked();
293 } 293 }
294 294
295 void AudioRendererImpl::DoFlush_Locked() { 295 void AudioRendererImpl::DoFlush_Locked() {
296 DCHECK(task_runner_->BelongsToCurrentThread()); 296 DCHECK(task_runner_->BelongsToCurrentThread());
297 lock_.AssertAcquired(); 297 lock_.AssertAcquired();
298 298
299 DCHECK(!pending_read_); 299 DCHECK(!pending_read_);
300 DCHECK_EQ(state_, kFlushed); 300 DCHECK_EQ(state_, kFlushed);
301 301
302 ended_timestamp_ = kInfiniteDuration();
302 audio_buffer_stream_->Reset(base::Bind(&AudioRendererImpl::ResetDecoderDone, 303 audio_buffer_stream_->Reset(base::Bind(&AudioRendererImpl::ResetDecoderDone,
303 weak_factory_.GetWeakPtr())); 304 weak_factory_.GetWeakPtr()));
304 } 305 }
305 306
306 void AudioRendererImpl::ResetDecoderDone() { 307 void AudioRendererImpl::ResetDecoderDone() {
307 DCHECK(task_runner_->BelongsToCurrentThread()); 308 DCHECK(task_runner_->BelongsToCurrentThread());
308 { 309 {
309 base::AutoLock auto_lock(lock_); 310 base::AutoLock auto_lock(lock_);
310 311
311 DCHECK_EQ(state_, kFlushed); 312 DCHECK_EQ(state_, kFlushed);
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 DCHECK_NE(buffering_state_, buffering_state); 968 DCHECK_NE(buffering_state_, buffering_state);
968 lock_.AssertAcquired(); 969 lock_.AssertAcquired();
969 buffering_state_ = buffering_state; 970 buffering_state_ = buffering_state;
970 971
971 task_runner_->PostTask( 972 task_runner_->PostTask(
972 FROM_HERE, base::Bind(&AudioRendererImpl::OnBufferingStateChange, 973 FROM_HERE, base::Bind(&AudioRendererImpl::OnBufferingStateChange,
973 weak_factory_.GetWeakPtr(), buffering_state_)); 974 weak_factory_.GetWeakPtr(), buffering_state_));
974 } 975 }
975 976
976 } // namespace media 977 } // namespace media
OLDNEW
« no previous file with comments | « media/mojo/services/mojo_demuxer_stream_adapter.cc ('k') | media/renderers/renderer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698