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

Side by Side Diff: media/mojo/services/mojo_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/mojo/services/mojo_renderer_impl.h" 5 #include "media/mojo/services/mojo_renderer_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 DCHECK(task_runner_->BelongsToCurrentThread()); 116 DCHECK(task_runner_->BelongsToCurrentThread());
117 117
118 { 118 {
119 base::AutoLock auto_lock(lock_); 119 base::AutoLock auto_lock(lock_);
120 time_ = time; 120 time_ = time;
121 } 121 }
122 122
123 remote_renderer_->StartPlayingFrom(time.InMicroseconds()); 123 remote_renderer_->StartPlayingFrom(time.InMicroseconds());
124 } 124 }
125 125
126 void MojoRendererImpl::RestartStreamPlayback(DemuxerStream* stream,
127 base::TimeDelta time) {
128 DVLOG(2) << __FUNCTION__;
129 DCHECK(task_runner_->BelongsToCurrentThread());
130 bool video_stream = (stream->type() == DemuxerStream::VIDEO);
131 remote_renderer_->RestartStreamPlayback(video_stream, time.InMicroseconds());
132 }
133
126 void MojoRendererImpl::SetPlaybackRate(double playback_rate) { 134 void MojoRendererImpl::SetPlaybackRate(double playback_rate) {
127 DVLOG(2) << __FUNCTION__; 135 DVLOG(2) << __FUNCTION__;
128 DCHECK(task_runner_->BelongsToCurrentThread()); 136 DCHECK(task_runner_->BelongsToCurrentThread());
129 remote_renderer_->SetPlaybackRate(playback_rate); 137 remote_renderer_->SetPlaybackRate(playback_rate);
130 } 138 }
131 139
132 void MojoRendererImpl::SetVolume(float volume) { 140 void MojoRendererImpl::SetVolume(float volume) {
133 DVLOG(2) << __FUNCTION__; 141 DVLOG(2) << __FUNCTION__;
134 DCHECK(task_runner_->BelongsToCurrentThread()); 142 DCHECK(task_runner_->BelongsToCurrentThread());
135 remote_renderer_->SetVolume(volume); 143 remote_renderer_->SetVolume(volume);
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 void MojoRendererImpl::OnInitialized(bool success) { 222 void MojoRendererImpl::OnInitialized(bool success) {
215 DVLOG(1) << __FUNCTION__; 223 DVLOG(1) << __FUNCTION__;
216 DCHECK(task_runner_->BelongsToCurrentThread()); 224 DCHECK(task_runner_->BelongsToCurrentThread());
217 DCHECK(!init_cb_.is_null()); 225 DCHECK(!init_cb_.is_null());
218 226
219 base::ResetAndReturn(&init_cb_) 227 base::ResetAndReturn(&init_cb_)
220 .Run(success ? PIPELINE_OK : PIPELINE_ERROR_INITIALIZATION_FAILED); 228 .Run(success ? PIPELINE_OK : PIPELINE_ERROR_INITIALIZATION_FAILED);
221 } 229 }
222 230
223 } // namespace media 231 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698