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

Side by Side Diff: media/mojo/services/mojo_renderer_service.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_service.h" 5 #include "media/mojo/services/mojo_renderer_service.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "media/base/media_keys.h" 10 #include "media/base/media_keys.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 base::Bind(&MojoRendererService::OnFlushCompleted, weak_this_, callback)); 60 base::Bind(&MojoRendererService::OnFlushCompleted, weak_this_, callback));
61 } 61 }
62 62
63 void MojoRendererService::StartPlayingFrom(int64_t time_delta_usec) { 63 void MojoRendererService::StartPlayingFrom(int64_t time_delta_usec) {
64 DVLOG(2) << __FUNCTION__ << ": " << time_delta_usec; 64 DVLOG(2) << __FUNCTION__ << ": " << time_delta_usec;
65 renderer_->StartPlayingFrom( 65 renderer_->StartPlayingFrom(
66 base::TimeDelta::FromMicroseconds(time_delta_usec)); 66 base::TimeDelta::FromMicroseconds(time_delta_usec));
67 SchedulePeriodicMediaTimeUpdates(); 67 SchedulePeriodicMediaTimeUpdates();
68 } 68 }
69 69
70 void MojoRendererService::RestartStreamPlayback(bool video_stream,
71 int64_t time_delta_usec) {
72 DemuxerStream* demuxer_stream = nullptr;
73
74 if (video_stream)
75 demuxer_stream = stream_provider_->GetStream(DemuxerStream::VIDEO);
76 else
77 demuxer_stream = stream_provider_->GetStream(DemuxerStream::AUDIO);
78
79 DVLOG(2) << __FUNCTION__ << ": demuxer_stream=" << demuxer_stream
80 << " time=" << time_delta_usec;
81 renderer_->RestartStreamPlayback(
82 demuxer_stream, base::TimeDelta::FromMicroseconds(time_delta_usec));
83 }
84
70 void MojoRendererService::SetPlaybackRate(double playback_rate) { 85 void MojoRendererService::SetPlaybackRate(double playback_rate) {
71 DVLOG(2) << __FUNCTION__ << ": " << playback_rate; 86 DVLOG(2) << __FUNCTION__ << ": " << playback_rate;
72 DCHECK_EQ(state_, STATE_PLAYING); 87 DCHECK_EQ(state_, STATE_PLAYING);
73 renderer_->SetPlaybackRate(playback_rate); 88 renderer_->SetPlaybackRate(playback_rate);
74 } 89 }
75 90
76 void MojoRendererService::SetVolume(float volume) { 91 void MojoRendererService::SetVolume(float volume) {
77 renderer_->SetVolume(volume); 92 renderer_->SetVolume(volume);
78 } 93 }
79 94
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 bool success) { 216 bool success) {
202 DVLOG(1) << __FUNCTION__ << "(" << success << ")"; 217 DVLOG(1) << __FUNCTION__ << "(" << success << ")";
203 218
204 if (success) 219 if (success)
205 cdm_ = cdm; 220 cdm_ = cdm;
206 221
207 callback.Run(success); 222 callback.Run(success);
208 } 223 }
209 224
210 } // namespace media 225 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698