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

Side by Side Diff: remoting/host/chromoting_host.cc

Issue 2392963003: Add Audio support in Chromoting host when using WebRTC. (Closed)
Patch Set: . 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
« no previous file with comments | « no previous file | remoting/protocol/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/host/chromoting_host.h" 5 #include "remoting/host/chromoting_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 261
262 HOST_LOG << "Client connected: " << session->jid(); 262 HOST_LOG << "Client connected: " << session->jid();
263 263
264 // Create either IceConnectionToClient or WebrtcConnectionToClient. 264 // Create either IceConnectionToClient or WebrtcConnectionToClient.
265 // TODO(sergeyu): Move this logic to the protocol layer. 265 // TODO(sergeyu): Move this logic to the protocol layer.
266 std::unique_ptr<protocol::ConnectionToClient> connection; 266 std::unique_ptr<protocol::ConnectionToClient> connection;
267 if (session->config().protocol() == 267 if (session->config().protocol() ==
268 protocol::SessionConfig::Protocol::WEBRTC) { 268 protocol::SessionConfig::Protocol::WEBRTC) {
269 connection.reset(new protocol::WebrtcConnectionToClient( 269 connection.reset(new protocol::WebrtcConnectionToClient(
270 base::WrapUnique(session), transport_context_, 270 base::WrapUnique(session), transport_context_,
271 video_encode_task_runner_)); 271 video_encode_task_runner_, audio_task_runner_));
272 } else { 272 } else {
273 connection.reset(new protocol::IceConnectionToClient( 273 connection.reset(new protocol::IceConnectionToClient(
274 base::WrapUnique(session), transport_context_, 274 base::WrapUnique(session), transport_context_,
275 video_encode_task_runner_, audio_task_runner_)); 275 video_encode_task_runner_, audio_task_runner_));
276 } 276 }
277 277
278 // Create a ClientSession object. 278 // Create a ClientSession object.
279 ClientSession* client = new ClientSession( 279 ClientSession* client = new ClientSession(
280 this, std::move(connection), desktop_environment_factory_, 280 this, std::move(connection), desktop_environment_factory_,
281 max_session_duration_, pairing_registry_, extensions_.get()); 281 max_session_duration_, pairing_registry_, extensions_.get());
282 282
283 clients_.push_back(client); 283 clients_.push_back(client);
284 } 284 }
285 285
286 void ChromotingHost::DisconnectAllClients() { 286 void ChromotingHost::DisconnectAllClients() {
287 DCHECK(CalledOnValidThread()); 287 DCHECK(CalledOnValidThread());
288 288
289 while (!clients_.empty()) { 289 while (!clients_.empty()) {
290 size_t size = clients_.size(); 290 size_t size = clients_.size();
291 clients_.front()->DisconnectSession(protocol::OK); 291 clients_.front()->DisconnectSession(protocol::OK);
292 CHECK_EQ(clients_.size(), size - 1); 292 CHECK_EQ(clients_.size(), size - 1);
293 } 293 }
294 } 294 }
295 295
296 } // namespace remoting 296 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | remoting/protocol/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698