OLD | NEW |
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/clients/mojo_renderer.h" | 5 #include "media/mojo/clients/mojo_renderer.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" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
13 #include "media/base/demuxer_stream_provider.h" | 13 #include "media/base/demuxer_stream_provider.h" |
| 14 #include "media/base/pipeline_status.h" |
14 #include "media/base/renderer_client.h" | 15 #include "media/base/renderer_client.h" |
15 #include "media/base/video_renderer_sink.h" | 16 #include "media/base/video_renderer_sink.h" |
16 #include "media/mojo/clients/mojo_demuxer_stream_impl.h" | 17 #include "media/mojo/clients/mojo_demuxer_stream_impl.h" |
17 #include "media/renderers/video_overlay_factory.h" | 18 #include "media/renderers/video_overlay_factory.h" |
18 | 19 |
19 namespace media { | 20 namespace media { |
20 | 21 |
21 MojoRenderer::MojoRenderer( | 22 MojoRenderer::MojoRenderer( |
22 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 23 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
23 std::unique_ptr<VideoOverlayFactory> video_overlay_factory, | 24 std::unique_ptr<VideoOverlayFactory> video_overlay_factory, |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 video_overlay_factory_->CreateFrame(size)); | 233 video_overlay_factory_->CreateFrame(size)); |
233 client_->OnVideoNaturalSizeChange(size); | 234 client_->OnVideoNaturalSizeChange(size); |
234 } | 235 } |
235 | 236 |
236 void MojoRenderer::OnVideoOpacityChange(bool opaque) { | 237 void MojoRenderer::OnVideoOpacityChange(bool opaque) { |
237 DVLOG(2) << __FUNCTION__ << ": " << opaque; | 238 DVLOG(2) << __FUNCTION__ << ": " << opaque; |
238 DCHECK(task_runner_->BelongsToCurrentThread()); | 239 DCHECK(task_runner_->BelongsToCurrentThread()); |
239 client_->OnVideoOpacityChange(opaque); | 240 client_->OnVideoOpacityChange(opaque); |
240 } | 241 } |
241 | 242 |
| 243 void MojoRenderer::OnStatisticsUpdate(const PipelineStatistics& stats) { |
| 244 DVLOG(3) << __FUNCTION__; |
| 245 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 246 client_->OnStatisticsUpdate(stats); |
| 247 } |
| 248 |
| 249 void MojoRenderer::OnWaitingForDecryptionKey() { |
| 250 DVLOG(1) << __FUNCTION__; |
| 251 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 252 client_->OnWaitingForDecryptionKey(); |
| 253 } |
| 254 |
242 void MojoRenderer::OnConnectionError() { | 255 void MojoRenderer::OnConnectionError() { |
243 DVLOG(1) << __FUNCTION__; | 256 DVLOG(1) << __FUNCTION__; |
244 DCHECK(task_runner_->BelongsToCurrentThread()); | 257 DCHECK(task_runner_->BelongsToCurrentThread()); |
245 | 258 |
246 encountered_error_ = true; | 259 encountered_error_ = true; |
247 CancelPendingCallbacks(); | 260 CancelPendingCallbacks(); |
248 | 261 |
249 if (client_) | 262 if (client_) |
250 client_->OnError(PIPELINE_ERROR_DECODE); | 263 client_->OnError(PIPELINE_ERROR_DECODE); |
251 } | 264 } |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 base::ResetAndReturn(&init_cb_).Run(PIPELINE_ERROR_INITIALIZATION_FAILED); | 335 base::ResetAndReturn(&init_cb_).Run(PIPELINE_ERROR_INITIALIZATION_FAILED); |
323 | 336 |
324 if (!flush_cb_.is_null()) | 337 if (!flush_cb_.is_null()) |
325 base::ResetAndReturn(&flush_cb_).Run(); | 338 base::ResetAndReturn(&flush_cb_).Run(); |
326 | 339 |
327 if (!cdm_attached_cb_.is_null()) | 340 if (!cdm_attached_cb_.is_null()) |
328 base::ResetAndReturn(&cdm_attached_cb_).Run(false); | 341 base::ResetAndReturn(&cdm_attached_cb_).Run(false); |
329 } | 342 } |
330 | 343 |
331 } // namespace media | 344 } // namespace media |
OLD | NEW |