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

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

Issue 2398293002: Small fixes for WevRTC protocol in host (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 | « remoting/codec/webrtc_video_encoder_vpx.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_transport.h" 5 #include "remoting/protocol/webrtc_transport.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 #if !defined(NDEBUG) 329 #if !defined(NDEBUG)
330 ignore_error = base::CommandLine::ForCurrentProcess()->HasSwitch( 330 ignore_error = base::CommandLine::ForCurrentProcess()->HasSwitch(
331 kDisableAuthenticationSwitchName); 331 kDisableAuthenticationSwitchName);
332 #endif 332 #endif
333 if (!ignore_error) { 333 if (!ignore_error) {
334 Close(AUTHENTICATION_FAILED); 334 Close(AUTHENTICATION_FAILED);
335 return true; 335 return true;
336 } 336 }
337 } 337 }
338 338
339 // Set bitrate range to 1-20 Mbps. 339 // Set bitrate range to 1-100 Mbps.
Irfan 2016/10/07 14:59:12 Does this provide any actual gains ?
340 // - Setting min bitrate here enables padding. 340 // - Setting min bitrate here enables padding.
341 // - The default max bitrate is 600 kbps. Setting it to 20 Mbps allows to 341 // - The default max bitrate is 600 kbps. Setting it to 100 Mbps allows to
342 // use higher bandwidth when it's available. 342 // use higher bandwidth when it's available.
343 // 343 //
344 // TODO(sergeyu): Padding needs to be enabled to workaround BW estimator not 344 // TODO(sergeyu): Padding needs to be enabled to workaround BW estimator not
345 // handling spiky traffic patterns well. This won't be necessary with a 345 // handling spiky traffic patterns well. This won't be necessary with a
346 // better bandwidth estimator. 346 // better bandwidth estimator.
347 // TODO(isheriff): The need for this should go away once we have a proper 347 // TODO(isheriff): The need for this should go away once we have a proper
348 // API to provide max bitrate for the case of handing over encoded 348 // API to provide max bitrate for the case of handing over encoded
349 // frames to webrtc. 349 // frames to webrtc.
350 std::string vp8line = "a=rtpmap:100 VP8/90000\n"; 350 std::string vp8line = "a=rtpmap:100 VP8/90000\n";
351 std::string vp8line_with_bitrate = 351 std::string vp8line_with_bitrate =
352 vp8line + 352 vp8line +
353 "a=fmtp:100 x-google-min-bitrate=1000\n" 353 "a=fmtp:100 x-google-min-bitrate=1000\n"
354 "a=fmtp:100 x-google-max-bitrate=20000\n"; 354 "a=fmtp:100 x-google-max-bitrate=100000\n";
355 base::ReplaceSubstringsAfterOffset(&sdp, 0, vp8line, vp8line_with_bitrate); 355 base::ReplaceSubstringsAfterOffset(&sdp, 0, vp8line, vp8line_with_bitrate);
356 356
357 webrtc::SdpParseError error; 357 webrtc::SdpParseError error;
358 std::unique_ptr<webrtc::SessionDescriptionInterface> session_description( 358 std::unique_ptr<webrtc::SessionDescriptionInterface> session_description(
359 webrtc::CreateSessionDescription(type, sdp, &error)); 359 webrtc::CreateSessionDescription(type, sdp, &error));
360 if (!session_description) { 360 if (!session_description) {
361 LOG(ERROR) << "Failed to parse the session description: " 361 LOG(ERROR) << "Failed to parse the session description: "
362 << error.description << " line: " << error.line; 362 << error.description << " line: " << error.line;
363 return false; 363 return false;
364 } 364 }
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 // the stack and so it must be destroyed later. 663 // the stack and so it must be destroyed later.
664 base::ThreadTaskRunnerHandle::Get()->DeleteSoon( 664 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(
665 FROM_HERE, peer_connection_wrapper_.release()); 665 FROM_HERE, peer_connection_wrapper_.release());
666 666
667 if (error != OK) 667 if (error != OK)
668 event_handler_->OnWebrtcTransportError(error); 668 event_handler_->OnWebrtcTransportError(error);
669 } 669 }
670 670
671 } // namespace protocol 671 } // namespace protocol
672 } // namespace remoting 672 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/codec/webrtc_video_encoder_vpx.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698