OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "remoting/protocol/webrtc_connection_to_client.h" | 5 #include "remoting/protocol/webrtc_connection_to_client.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
11 #include "jingle/glue/thread_wrapper.h" | 11 #include "jingle/glue/thread_wrapper.h" |
12 #include "net/base/io_buffer.h" | 12 #include "net/base/io_buffer.h" |
13 #include "remoting/codec/video_encoder.h" | 13 #include "remoting/codec/video_encoder.h" |
14 #include "remoting/codec/webrtc_video_encoder_vpx.h" | |
15 #include "remoting/protocol/audio_writer.h" | 14 #include "remoting/protocol/audio_writer.h" |
16 #include "remoting/protocol/clipboard_stub.h" | 15 #include "remoting/protocol/clipboard_stub.h" |
17 #include "remoting/protocol/host_control_dispatcher.h" | 16 #include "remoting/protocol/host_control_dispatcher.h" |
18 #include "remoting/protocol/host_event_dispatcher.h" | 17 #include "remoting/protocol/host_event_dispatcher.h" |
19 #include "remoting/protocol/host_stub.h" | 18 #include "remoting/protocol/host_stub.h" |
20 #include "remoting/protocol/input_stub.h" | 19 #include "remoting/protocol/input_stub.h" |
21 #include "remoting/protocol/message_pipe.h" | 20 #include "remoting/protocol/message_pipe.h" |
22 #include "remoting/protocol/transport_context.h" | 21 #include "remoting/protocol/transport_context.h" |
23 #include "remoting/protocol/webrtc_transport.h" | 22 #include "remoting/protocol/webrtc_transport.h" |
24 #include "remoting/protocol/webrtc_video_stream.h" | 23 #include "remoting/protocol/webrtc_video_stream.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
71 session_->Close(error); | 70 session_->Close(error); |
72 } | 71 } |
73 | 72 |
74 void WebrtcConnectionToClient::OnInputEventReceived(int64_t timestamp) { | 73 void WebrtcConnectionToClient::OnInputEventReceived(int64_t timestamp) { |
75 DCHECK(thread_checker_.CalledOnValidThread()); | 74 DCHECK(thread_checker_.CalledOnValidThread()); |
76 event_handler_->OnInputEventReceived(this, timestamp); | 75 event_handler_->OnInputEventReceived(this, timestamp); |
77 } | 76 } |
78 | 77 |
79 std::unique_ptr<VideoStream> WebrtcConnectionToClient::StartVideoStream( | 78 std::unique_ptr<VideoStream> WebrtcConnectionToClient::StartVideoStream( |
80 std::unique_ptr<webrtc::DesktopCapturer> desktop_capturer) { | 79 std::unique_ptr<webrtc::DesktopCapturer> desktop_capturer) { |
81 // TODO(isheriff): make this codec independent | 80 // TODO(isheriff): make this codec independent |
Irfan
2016/09/12 21:34:24
comment goes away ?
Sergey Ulanov
2016/09/12 22:50:02
Moved to WebrtcVideoStream::Start().
| |
82 std::unique_ptr<VideoEncoder> video_encoder = | |
83 WebrtcVideoEncoderVpx::CreateForVP8(); | |
84 std::unique_ptr<WebrtcVideoStream> stream(new WebrtcVideoStream()); | 81 std::unique_ptr<WebrtcVideoStream> stream(new WebrtcVideoStream()); |
85 if (!stream->Start(std::move(desktop_capturer), transport_.get(), | 82 if (!stream->Start(std::move(desktop_capturer), transport_.get(), |
86 video_encode_task_runner_, std::move(video_encoder))) { | 83 video_encode_task_runner_)) { |
87 return nullptr; | 84 return nullptr; |
88 } | 85 } |
89 return std::move(stream); | 86 return std::move(stream); |
90 } | 87 } |
91 | 88 |
92 AudioStub* WebrtcConnectionToClient::audio_stub() { | 89 AudioStub* WebrtcConnectionToClient::audio_stub() { |
93 DCHECK(thread_checker_.CalledOnValidThread()); | 90 DCHECK(thread_checker_.CalledOnValidThread()); |
94 return nullptr; | 91 return nullptr; |
95 } | 92 } |
96 | 93 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
204 ChannelDispatcherBase* channel_dispatcher) { | 201 ChannelDispatcherBase* channel_dispatcher) { |
205 DCHECK(thread_checker_.CalledOnValidThread()); | 202 DCHECK(thread_checker_.CalledOnValidThread()); |
206 | 203 |
207 LOG(ERROR) << "Channel " << channel_dispatcher->channel_name() | 204 LOG(ERROR) << "Channel " << channel_dispatcher->channel_name() |
208 << " was closed unexpectedly."; | 205 << " was closed unexpectedly."; |
209 Disconnect(INCOMPATIBLE_PROTOCOL); | 206 Disconnect(INCOMPATIBLE_PROTOCOL); |
210 } | 207 } |
211 | 208 |
212 } // namespace protocol | 209 } // namespace protocol |
213 } // namespace remoting | 210 } // namespace remoting |
OLD | NEW |