| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/remoting/remoting_source_impl.h" | 5 #include "media/remoting/remoting_source_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "media/remoting/rpc/proto_utils.h" | 9 #include "media/remoting/rpc/proto_utils.h" |
| 10 | 10 |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 mojo::ScopedDataPipeProducerHandle()); | 203 mojo::ScopedDataPipeProducerHandle()); |
| 204 return; | 204 return; |
| 205 } | 205 } |
| 206 mojom::RemotingDataStreamSenderPtr audio_stream_sender; | 206 mojom::RemotingDataStreamSenderPtr audio_stream_sender; |
| 207 mojom::RemotingDataStreamSenderPtr video_stream_sender; | 207 mojom::RemotingDataStreamSenderPtr video_stream_sender; |
| 208 remoter_->StartDataStreams( | 208 remoter_->StartDataStreams( |
| 209 audio ? std::move(audio_data_pipe->consumer_handle) | 209 audio ? std::move(audio_data_pipe->consumer_handle) |
| 210 : mojo::ScopedDataPipeConsumerHandle(), | 210 : mojo::ScopedDataPipeConsumerHandle(), |
| 211 video ? std::move(video_data_pipe->consumer_handle) | 211 video ? std::move(video_data_pipe->consumer_handle) |
| 212 : mojo::ScopedDataPipeConsumerHandle(), | 212 : mojo::ScopedDataPipeConsumerHandle(), |
| 213 audio ? mojo::GetProxy(&audio_stream_sender) | 213 audio ? mojo::MakeRequest(&audio_stream_sender) |
| 214 : media::mojom::RemotingDataStreamSenderRequest(), | 214 : media::mojom::RemotingDataStreamSenderRequest(), |
| 215 video ? mojo::GetProxy(&video_stream_sender) | 215 video ? mojo::MakeRequest(&video_stream_sender) |
| 216 : media::mojom::RemotingDataStreamSenderRequest()); | 216 : media::mojom::RemotingDataStreamSenderRequest()); |
| 217 done_callback.Run(audio_stream_sender.PassInterface(), | 217 done_callback.Run(audio_stream_sender.PassInterface(), |
| 218 video_stream_sender.PassInterface(), | 218 video_stream_sender.PassInterface(), |
| 219 audio ? std::move(audio_data_pipe->producer_handle) | 219 audio ? std::move(audio_data_pipe->producer_handle) |
| 220 : mojo::ScopedDataPipeProducerHandle(), | 220 : mojo::ScopedDataPipeProducerHandle(), |
| 221 video ? std::move(video_data_pipe->producer_handle) | 221 video ? std::move(video_data_pipe->producer_handle) |
| 222 : mojo::ScopedDataPipeProducerHandle()); | 222 : mojo::ScopedDataPipeProducerHandle()); |
| 223 } | 223 } |
| 224 | 224 |
| 225 remoting::RpcBroker* RemotingSourceImpl::GetRpcBroker() const { | 225 remoting::RpcBroker* RemotingSourceImpl::GetRpcBroker() const { |
| 226 DCHECK(thread_checker_.CalledOnValidThread()); | 226 DCHECK(thread_checker_.CalledOnValidThread()); |
| 227 // TODO(xjz): Fix the const-correctness. | 227 // TODO(xjz): Fix the const-correctness. |
| 228 return const_cast<remoting::RpcBroker*>(&rpc_broker_); | 228 return const_cast<remoting::RpcBroker*>(&rpc_broker_); |
| 229 } | 229 } |
| 230 | 230 |
| 231 void RemotingSourceImpl::SendMessageToSink( | 231 void RemotingSourceImpl::SendMessageToSink( |
| 232 std::unique_ptr<std::vector<uint8_t>> message) { | 232 std::unique_ptr<std::vector<uint8_t>> message) { |
| 233 DCHECK(thread_checker_.CalledOnValidThread()); | 233 DCHECK(thread_checker_.CalledOnValidThread()); |
| 234 remoter_->SendMessageToSink(*message); | 234 remoter_->SendMessageToSink(*message); |
| 235 } | 235 } |
| 236 | 236 |
| 237 } // namespace media | 237 } // namespace media |
| OLD | NEW |