Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(603)

Side by Side Diff: remoting/protocol/webrtc_connection_to_client.cc

Issue 2413553003: Add InputEventTimestampSource interface. (Closed)
Patch Set: msvc compilation Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 77
78 std::unique_ptr<VideoStream> WebrtcConnectionToClient::StartVideoStream( 78 std::unique_ptr<VideoStream> WebrtcConnectionToClient::StartVideoStream(
79 std::unique_ptr<webrtc::DesktopCapturer> desktop_capturer) { 79 std::unique_ptr<webrtc::DesktopCapturer> desktop_capturer) {
80 DCHECK(thread_checker_.CalledOnValidThread()); 80 DCHECK(thread_checker_.CalledOnValidThread());
81 DCHECK(transport_); 81 DCHECK(transport_);
82 82
83 std::unique_ptr<WebrtcVideoStream> stream(new WebrtcVideoStream()); 83 std::unique_ptr<WebrtcVideoStream> stream(new WebrtcVideoStream());
84 stream->Start(std::move(desktop_capturer), transport_.get(), 84 stream->Start(std::move(desktop_capturer), transport_.get(),
85 video_encode_task_runner_); 85 video_encode_task_runner_);
86 stream->SetEventTimestampsSource(
87 event_dispatcher_->event_timestamps_source());
86 return std::move(stream); 88 return std::move(stream);
87 } 89 }
88 90
89 std::unique_ptr<AudioStream> WebrtcConnectionToClient::StartAudioStream( 91 std::unique_ptr<AudioStream> WebrtcConnectionToClient::StartAudioStream(
90 std::unique_ptr<AudioSource> audio_source) { 92 std::unique_ptr<AudioSource> audio_source) {
91 DCHECK(thread_checker_.CalledOnValidThread()); 93 DCHECK(thread_checker_.CalledOnValidThread());
92 DCHECK(transport_); 94 DCHECK(transport_);
93 95
94 std::unique_ptr<WebrtcAudioStream> stream(new WebrtcAudioStream()); 96 std::unique_ptr<WebrtcAudioStream> stream(new WebrtcAudioStream());
95 stream->Start(audio_task_runner_, std::move(audio_source), transport_.get()); 97 stream->Start(audio_task_runner_, std::move(audio_source), transport_.get());
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 DCHECK(thread_checker_.CalledOnValidThread()); 176 DCHECK(thread_checker_.CalledOnValidThread());
175 Disconnect(error); 177 Disconnect(error);
176 } 178 }
177 179
178 void WebrtcConnectionToClient::OnWebrtcTransportIncomingDataChannel( 180 void WebrtcConnectionToClient::OnWebrtcTransportIncomingDataChannel(
179 const std::string& name, 181 const std::string& name,
180 std::unique_ptr<MessagePipe> pipe) { 182 std::unique_ptr<MessagePipe> pipe) {
181 DCHECK(thread_checker_.CalledOnValidThread()); 183 DCHECK(thread_checker_.CalledOnValidThread());
182 if (name == event_dispatcher_->channel_name() && 184 if (name == event_dispatcher_->channel_name() &&
183 !event_dispatcher_->is_connected()) { 185 !event_dispatcher_->is_connected()) {
184 event_dispatcher_->set_on_input_event_callback(
185 base::Bind(&WebrtcConnectionToClient::OnInputEventReceived,
186 base::Unretained(this)));
187 event_dispatcher_->Init(std::move(pipe), this); 186 event_dispatcher_->Init(std::move(pipe), this);
188 } 187 }
189 } 188 }
190 189
191 void WebrtcConnectionToClient::OnWebrtcTransportMediaStreamAdded( 190 void WebrtcConnectionToClient::OnWebrtcTransportMediaStreamAdded(
192 scoped_refptr<webrtc::MediaStreamInterface> stream) { 191 scoped_refptr<webrtc::MediaStreamInterface> stream) {
193 DCHECK(thread_checker_.CalledOnValidThread()); 192 DCHECK(thread_checker_.CalledOnValidThread());
194 LOG(WARNING) << "The client created an unexpected media stream."; 193 LOG(WARNING) << "The client created an unexpected media stream.";
195 } 194 }
196 195
(...skipping 14 matching lines...) Expand all
211 210
212 void WebrtcConnectionToClient::OnChannelClosed( 211 void WebrtcConnectionToClient::OnChannelClosed(
213 ChannelDispatcherBase* channel_dispatcher) { 212 ChannelDispatcherBase* channel_dispatcher) {
214 DCHECK(thread_checker_.CalledOnValidThread()); 213 DCHECK(thread_checker_.CalledOnValidThread());
215 214
216 LOG(ERROR) << "Channel " << channel_dispatcher->channel_name() 215 LOG(ERROR) << "Channel " << channel_dispatcher->channel_name()
217 << " was closed unexpectedly."; 216 << " was closed unexpectedly.";
218 Disconnect(INCOMPATIBLE_PROTOCOL); 217 Disconnect(INCOMPATIBLE_PROTOCOL);
219 } 218 }
220 219
221 void WebrtcConnectionToClient::OnInputEventReceived(int64_t timestamp) {
222 DCHECK(thread_checker_.CalledOnValidThread());
223 event_handler_->OnInputEventReceived(timestamp);
224 }
225
226 } // namespace protocol 220 } // namespace protocol
227 } // namespace remoting 221 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/webrtc_connection_to_client.h ('k') | remoting/protocol/webrtc_video_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698