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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 // Create audio and video mojo::DemuxerStream and bind its lifetime to the | 55 // Create audio and video mojo::DemuxerStream and bind its lifetime to the |
56 // pipe. | 56 // pipe. |
57 DemuxerStream* const audio = | 57 DemuxerStream* const audio = |
58 demuxer_stream_provider_->GetStream(DemuxerStream::AUDIO); | 58 demuxer_stream_provider_->GetStream(DemuxerStream::AUDIO); |
59 DemuxerStream* const video = | 59 DemuxerStream* const video = |
60 demuxer_stream_provider_->GetStream(DemuxerStream::VIDEO); | 60 demuxer_stream_provider_->GetStream(DemuxerStream::VIDEO); |
61 | 61 |
62 mojo::DemuxerStreamPtr audio_stream; | 62 mojo::DemuxerStreamPtr audio_stream; |
63 if (audio) | 63 if (audio) |
64 mojo::BindToProxy(new MojoDemuxerStreamImpl(audio), &audio_stream); | 64 new MojoDemuxerStreamImpl(audio, GetProxy(&audio_stream)); |
65 | 65 |
66 mojo::DemuxerStreamPtr video_stream; | 66 mojo::DemuxerStreamPtr video_stream; |
67 if (video) | 67 if (video) |
68 mojo::BindToProxy(new MojoDemuxerStreamImpl(video), &video_stream); | 68 new MojoDemuxerStreamImpl(video, GetProxy(&video_stream)); |
69 | 69 |
70 mojo::MediaRendererClientPtr client_ptr; | 70 mojo::MediaRendererClientPtr client_ptr; |
71 binding_.Bind(GetProxy(&client_ptr)); | 71 binding_.Bind(GetProxy(&client_ptr)); |
72 remote_media_renderer_->Initialize( | 72 remote_media_renderer_->Initialize( |
73 client_ptr.Pass(), | 73 client_ptr.Pass(), |
74 audio_stream.Pass(), | 74 audio_stream.Pass(), |
75 video_stream.Pass(), | 75 video_stream.Pass(), |
76 BindToCurrentLoop(base::Bind(&MojoRendererImpl::OnInitialized, | 76 BindToCurrentLoop(base::Bind(&MojoRendererImpl::OnInitialized, |
77 weak_factory_.GetWeakPtr()))); | 77 weak_factory_.GetWeakPtr()))); |
78 } | 78 } |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 } | 197 } |
198 | 198 |
199 void MojoRendererImpl::OnInitialized() { | 199 void MojoRendererImpl::OnInitialized() { |
200 DVLOG(1) << __FUNCTION__; | 200 DVLOG(1) << __FUNCTION__; |
201 DCHECK(task_runner_->BelongsToCurrentThread()); | 201 DCHECK(task_runner_->BelongsToCurrentThread()); |
202 if (!init_cb_.is_null()) | 202 if (!init_cb_.is_null()) |
203 base::ResetAndReturn(&init_cb_).Run(PIPELINE_OK); | 203 base::ResetAndReturn(&init_cb_).Run(PIPELINE_OK); |
204 } | 204 } |
205 | 205 |
206 } // namespace media | 206 } // namespace media |
OLD | NEW |