| 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/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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 demuxer_stream_provider_->GetStream(DemuxerStream::VIDEO); | 61 demuxer_stream_provider_->GetStream(DemuxerStream::VIDEO); |
| 62 | 62 |
| 63 interfaces::DemuxerStreamPtr audio_stream; | 63 interfaces::DemuxerStreamPtr audio_stream; |
| 64 if (audio) | 64 if (audio) |
| 65 new MojoDemuxerStreamImpl(audio, GetProxy(&audio_stream)); | 65 new MojoDemuxerStreamImpl(audio, GetProxy(&audio_stream)); |
| 66 | 66 |
| 67 interfaces::DemuxerStreamPtr video_stream; | 67 interfaces::DemuxerStreamPtr video_stream; |
| 68 if (video) | 68 if (video) |
| 69 new MojoDemuxerStreamImpl(video, GetProxy(&video_stream)); | 69 new MojoDemuxerStreamImpl(video, GetProxy(&video_stream)); |
| 70 | 70 |
| 71 interfaces::RendererClientPtr client_ptr; | |
| 72 binding_.Bind(GetProxy(&client_ptr)); | |
| 73 remote_renderer_->Initialize( | 71 remote_renderer_->Initialize( |
| 74 std::move(client_ptr), std::move(audio_stream), std::move(video_stream), | 72 binding_.CreateInterfacePtrAndBind(), std::move(audio_stream), |
| 73 std::move(video_stream), |
| 75 BindToCurrentLoop(base::Bind(&MojoRendererImpl::OnInitialized, | 74 BindToCurrentLoop(base::Bind(&MojoRendererImpl::OnInitialized, |
| 76 weak_factory_.GetWeakPtr()))); | 75 weak_factory_.GetWeakPtr()))); |
| 77 } | 76 } |
| 78 | 77 |
| 79 void MojoRendererImpl::SetCdm(CdmContext* cdm_context, | 78 void MojoRendererImpl::SetCdm(CdmContext* cdm_context, |
| 80 const CdmAttachedCB& cdm_attached_cb) { | 79 const CdmAttachedCB& cdm_attached_cb) { |
| 81 DVLOG(1) << __FUNCTION__; | 80 DVLOG(1) << __FUNCTION__; |
| 82 DCHECK(task_runner_->BelongsToCurrentThread()); | 81 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 83 | 82 |
| 84 int32_t cdm_id = cdm_context->GetCdmId(); | 83 int32_t cdm_id = cdm_context->GetCdmId(); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 void MojoRendererImpl::OnInitialized(bool success) { | 204 void MojoRendererImpl::OnInitialized(bool success) { |
| 206 DVLOG(1) << __FUNCTION__; | 205 DVLOG(1) << __FUNCTION__; |
| 207 DCHECK(task_runner_->BelongsToCurrentThread()); | 206 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 208 DCHECK(!init_cb_.is_null()); | 207 DCHECK(!init_cb_.is_null()); |
| 209 | 208 |
| 210 base::ResetAndReturn(&init_cb_) | 209 base::ResetAndReturn(&init_cb_) |
| 211 .Run(success ? PIPELINE_OK : PIPELINE_ERROR_INITIALIZATION_FAILED); | 210 .Run(success ? PIPELINE_OK : PIPELINE_ERROR_INITIALIZATION_FAILED); |
| 212 } | 211 } |
| 213 | 212 |
| 214 } // namespace media | 213 } // namespace media |
| OLD | NEW |