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/bind_to_current_loop.h" |
8 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
9 #include "base/location.h" | 10 #include "base/location.h" |
10 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
11 #include "media/base/bind_to_current_loop.h" | |
12 #include "media/base/demuxer_stream_provider.h" | 12 #include "media/base/demuxer_stream_provider.h" |
13 #include "media/mojo/services/mojo_demuxer_stream_impl.h" | 13 #include "media/mojo/services/mojo_demuxer_stream_impl.h" |
14 #include "third_party/mojo/src/mojo/public/cpp/application/connect.h" | 14 #include "third_party/mojo/src/mojo/public/cpp/application/connect.h" |
15 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_impl.h" | 15 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_impl.h" |
16 #include "third_party/mojo/src/mojo/public/interfaces/application/service_provid
er.mojom.h" | 16 #include "third_party/mojo/src/mojo/public/interfaces/application/service_provid
er.mojom.h" |
17 | 17 |
18 namespace media { | 18 namespace media { |
19 | 19 |
20 MojoRendererImpl::MojoRendererImpl( | 20 MojoRendererImpl::MojoRendererImpl( |
21 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 21 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 mojo::BindToProxy(new MojoDemuxerStreamImpl(video), &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 base::BindToCurrentLoop(base::Bind(&MojoRendererImpl::OnInitialized, |
77 weak_factory_.GetWeakPtr()))); | 77 weak_factory_.GetWeakPtr()))); |
78 } | 78 } |
79 | 79 |
80 void MojoRendererImpl::SetCdm(CdmContext* cdm_context, | 80 void MojoRendererImpl::SetCdm(CdmContext* cdm_context, |
81 const CdmAttachedCB& cdm_attached_cb) { | 81 const CdmAttachedCB& cdm_attached_cb) { |
82 DVLOG(1) << __FUNCTION__; | 82 DVLOG(1) << __FUNCTION__; |
83 DCHECK(task_runner_->BelongsToCurrentThread()); | 83 DCHECK(task_runner_->BelongsToCurrentThread()); |
84 NOTIMPLEMENTED(); | 84 NOTIMPLEMENTED(); |
85 cdm_attached_cb.Run(false); | 85 cdm_attached_cb.Run(false); |
86 } | 86 } |
87 | 87 |
(...skipping 109 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 |