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 buffering_state_cb_ = buffering_state_cb; | 54 buffering_state_cb_ = buffering_state_cb; |
55 | 55 |
56 // Create audio and video mojo::DemuxerStream and bind its lifetime to the | 56 // Create audio and video mojo::DemuxerStream and bind its lifetime to the |
57 // pipe. | 57 // pipe. |
58 DemuxerStream* const audio = | 58 DemuxerStream* const audio = |
59 demuxer_stream_provider_->GetStream(DemuxerStream::AUDIO); | 59 demuxer_stream_provider_->GetStream(DemuxerStream::AUDIO); |
60 DemuxerStream* const video = | 60 DemuxerStream* const video = |
61 demuxer_stream_provider_->GetStream(DemuxerStream::VIDEO); | 61 demuxer_stream_provider_->GetStream(DemuxerStream::VIDEO); |
62 | 62 |
63 mojo::DemuxerStreamPtr audio_stream; | 63 mojo::DemuxerStreamPtr audio_stream; |
64 if (audio) | 64 if (audio) { |
65 mojo::BindToProxy(new MojoDemuxerStreamImpl(audio), &audio_stream); | 65 mojo::BindToProxy(new MojoDemuxerStreamImpl(audio), &audio_stream) |
| 66 ->DidConnect(); |
| 67 } |
66 | 68 |
67 mojo::DemuxerStreamPtr video_stream; | 69 mojo::DemuxerStreamPtr video_stream; |
68 if (video) | 70 if (video) { |
69 mojo::BindToProxy(new MojoDemuxerStreamImpl(video), &video_stream); | 71 mojo::BindToProxy(new MojoDemuxerStreamImpl(video), &video_stream) |
| 72 ->DidConnect(); |
| 73 } |
70 | 74 |
71 remote_audio_renderer_->Initialize( | 75 remote_audio_renderer_->Initialize( |
72 audio_stream.Pass(), | 76 audio_stream.Pass(), |
73 video_stream.Pass(), | 77 video_stream.Pass(), |
74 BindToCurrentLoop(base::Bind(&MojoRendererImpl::OnInitialized, | 78 BindToCurrentLoop(base::Bind(&MojoRendererImpl::OnInitialized, |
75 weak_factory_.GetWeakPtr()))); | 79 weak_factory_.GetWeakPtr()))); |
76 } | 80 } |
77 | 81 |
78 void MojoRendererImpl::Flush(const base::Closure& flush_cb) { | 82 void MojoRendererImpl::Flush(const base::Closure& flush_cb) { |
79 DVLOG(2) << __FUNCTION__; | 83 DVLOG(2) << __FUNCTION__; |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 | 198 |
195 void MojoRendererImpl::OnInitialized() { | 199 void MojoRendererImpl::OnInitialized() { |
196 DVLOG(1) << __FUNCTION__; | 200 DVLOG(1) << __FUNCTION__; |
197 DCHECK(task_runner_->BelongsToCurrentThread()); | 201 DCHECK(task_runner_->BelongsToCurrentThread()); |
198 DCHECK(!init_cb_.is_null()); | 202 DCHECK(!init_cb_.is_null()); |
199 | 203 |
200 base::ResetAndReturn(&init_cb_).Run(); | 204 base::ResetAndReturn(&init_cb_).Run(); |
201 } | 205 } |
202 | 206 |
203 } // namespace media | 207 } // namespace media |
OLD | NEW |