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

Side by Side Diff: media/mojo/services/mojo_renderer_service.cc

Issue 2101043003: Plumb callbacks from mojo media service to client. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: 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
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"
11 #include "media/base/renderer.h" 11 #include "media/base/renderer.h"
12 #include "media/mojo/common/media_type_converters.h"
12 #include "media/mojo/services/demuxer_stream_provider_shim.h" 13 #include "media/mojo/services/demuxer_stream_provider_shim.h"
13 #include "media/mojo/services/mojo_cdm_service_context.h" 14 #include "media/mojo/services/mojo_cdm_service_context.h"
14 15
15 namespace media { 16 namespace media {
16 17
17 // Time interval to update media time. 18 // Time interval to update media time.
18 const int kTimeUpdateIntervalMs = 50; 19 const int kTimeUpdateIntervalMs = 50;
19 20
20 MojoRendererService::MojoRendererService( 21 MojoRendererService::MojoRendererService(
21 base::WeakPtr<MojoCdmServiceContext> mojo_cdm_service_context, 22 base::WeakPtr<MojoCdmServiceContext> mojo_cdm_service_context,
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 client_->OnError(); 109 client_->OnError();
109 } 110 }
110 111
111 void MojoRendererService::OnEnded() { 112 void MojoRendererService::OnEnded() {
112 DVLOG(1) << __FUNCTION__; 113 DVLOG(1) << __FUNCTION__;
113 CancelPeriodicMediaTimeUpdates(); 114 CancelPeriodicMediaTimeUpdates();
114 client_->OnEnded(); 115 client_->OnEnded();
115 } 116 }
116 117
117 void MojoRendererService::OnStatisticsUpdate(const PipelineStatistics& stats) { 118 void MojoRendererService::OnStatisticsUpdate(const PipelineStatistics& stats) {
118 // TODO(alokp): Plumb the event to mojom::RendererClient. crbug/585287 119 DVLOG(2) << __FUNCTION__;
alokp 2016/06/27 21:50:49 make the log levels consistent with MojoRenderer.
slan 2016/06/27 22:19:39 Done.
120 client_->OnStatisticsUpdate(mojom::PipelineStatistics::From(stats));
119 } 121 }
120 122
121 void MojoRendererService::OnBufferingStateChange(BufferingState state) { 123 void MojoRendererService::OnBufferingStateChange(BufferingState state) {
122 DVLOG(2) << __FUNCTION__ << "(" << state << ")"; 124 DVLOG(2) << __FUNCTION__ << "(" << state << ")";
123 client_->OnBufferingStateChange(static_cast<mojom::BufferingState>(state)); 125 client_->OnBufferingStateChange(static_cast<mojom::BufferingState>(state));
124 } 126 }
125 127
126 void MojoRendererService::OnWaitingForDecryptionKey() { 128 void MojoRendererService::OnWaitingForDecryptionKey() {
127 // TODO(alokp): Plumb the event to mojom::RendererClient. crbug/585287 129 DVLOG(2) << __FUNCTION__;
130 client_->OnWaitingForDecryptionKey();
128 } 131 }
129 132
130 void MojoRendererService::OnVideoNaturalSizeChange(const gfx::Size& size) { 133 void MojoRendererService::OnVideoNaturalSizeChange(const gfx::Size& size) {
131 DVLOG(2) << __FUNCTION__ << "(" << size.ToString() << ")"; 134 DVLOG(2) << __FUNCTION__ << "(" << size.ToString() << ")";
132 client_->OnVideoNaturalSizeChange(size); 135 client_->OnVideoNaturalSizeChange(size);
133 } 136 }
134 137
135 void MojoRendererService::OnVideoOpacityChange(bool opaque) { 138 void MojoRendererService::OnVideoOpacityChange(bool opaque) {
136 DVLOG(2) << __FUNCTION__ << "(" << opaque << ")"; 139 DVLOG(2) << __FUNCTION__ << "(" << opaque << ")";
137 client_->OnVideoOpacityChange(opaque); 140 client_->OnVideoOpacityChange(opaque);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 bool success) { 203 bool success) {
201 DVLOG(1) << __FUNCTION__ << "(" << success << ")"; 204 DVLOG(1) << __FUNCTION__ << "(" << success << ")";
202 205
203 if (success) 206 if (success)
204 cdm_ = cdm; 207 cdm_ = cdm;
205 208
206 callback.Run(success); 209 callback.Run(success);
207 } 210 }
208 211
209 } // namespace media 212 } // namespace media
OLDNEW
« media/mojo/interfaces/renderer.mojom ('K') | « media/mojo/interfaces/renderer.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698