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

Side by Side Diff: talk/app/webrtc/peerconnection.cc

Issue 1361263002: Revert of Adding PeerConnectionInterface::SetConfiguration method. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 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 | « talk/app/webrtc/peerconnection.h ('k') | talk/app/webrtc/peerconnectioninterface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 SetSessionDescriptionMsg* msg = new SetSessionDescriptionMsg(observer); 647 SetSessionDescriptionMsg* msg = new SetSessionDescriptionMsg(observer);
648 msg->error = error; 648 msg->error = error;
649 signaling_thread()->Post(this, MSG_SET_SESSIONDESCRIPTION_FAILED, msg); 649 signaling_thread()->Post(this, MSG_SET_SESSIONDESCRIPTION_FAILED, msg);
650 } 650 }
651 651
652 bool PeerConnection::UpdateIce(const IceServers& configuration, 652 bool PeerConnection::UpdateIce(const IceServers& configuration,
653 const MediaConstraintsInterface* constraints) { 653 const MediaConstraintsInterface* constraints) {
654 return false; 654 return false;
655 } 655 }
656 656
657 bool PeerConnection::SetConfiguration(const RTCConfiguration& config) { 657 bool PeerConnection::UpdateIce(const RTCConfiguration& config) {
658 if (port_allocator_) { 658 if (port_allocator_) {
659 std::vector<PortAllocatorFactoryInterface::StunConfiguration> stuns; 659 std::vector<PortAllocatorFactoryInterface::StunConfiguration> stuns;
660 std::vector<PortAllocatorFactoryInterface::TurnConfiguration> turns; 660 std::vector<PortAllocatorFactoryInterface::TurnConfiguration> turns;
661 if (!ParseIceServers(config.servers, &stuns, &turns)) { 661 if (!ParseIceServers(config.servers, &stuns, &turns)) {
662 return false; 662 return false;
663 } 663 }
664 664
665 std::vector<rtc::SocketAddress> stun_hosts; 665 std::vector<rtc::SocketAddress> stun_hosts;
666 typedef std::vector<StunConfiguration>::const_iterator StunIt; 666 typedef std::vector<StunConfiguration>::const_iterator StunIt;
667 for (StunIt stun_it = stuns.begin(); stun_it != stuns.end(); ++stun_it) { 667 for (StunIt stun_it = stuns.begin(); stun_it != stuns.end(); ++stun_it) {
668 stun_hosts.push_back(stun_it->server); 668 stun_hosts.push_back(stun_it->server);
669 } 669 }
670 670
671 rtc::SocketAddress stun_addr; 671 rtc::SocketAddress stun_addr;
672 if (!stun_hosts.empty()) { 672 if (!stun_hosts.empty()) {
673 stun_addr = stun_hosts.front(); 673 stun_addr = stun_hosts.front();
674 LOG(LS_INFO) << "SetConfiguration: StunServer Address: " 674 LOG(LS_INFO) << "UpdateIce: StunServer Address: " << stun_addr.ToString();
675 << stun_addr.ToString();
676 } 675 }
677 676
678 for (size_t i = 0; i < turns.size(); ++i) { 677 for (size_t i = 0; i < turns.size(); ++i) {
679 cricket::RelayCredentials credentials(turns[i].username, 678 cricket::RelayCredentials credentials(turns[i].username,
680 turns[i].password); 679 turns[i].password);
681 cricket::RelayServerConfig relay_server(cricket::RELAY_TURN); 680 cricket::RelayServerConfig relay_server(cricket::RELAY_TURN);
682 cricket::ProtocolType protocol; 681 cricket::ProtocolType protocol;
683 if (cricket::StringToProto(turns[i].transport_type.c_str(), &protocol)) { 682 if (cricket::StringToProto(turns[i].transport_type.c_str(), &protocol)) {
684 relay_server.ports.push_back(cricket::ProtocolAddress( 683 relay_server.ports.push_back(cricket::ProtocolAddress(
685 turns[i].server, protocol, turns[i].secure)); 684 turns[i].server, protocol, turns[i].secure));
686 relay_server.credentials = credentials; 685 relay_server.credentials = credentials;
687 LOG(LS_INFO) << "SetConfiguration: TurnServer Address: " 686 LOG(LS_INFO) << "UpdateIce: TurnServer Address: "
688 << turns[i].server.ToString(); 687 << turns[i].server.ToString();
689 } else { 688 } else {
690 LOG(LS_WARNING) << "Ignoring TURN server " << turns[i].server << ". " 689 LOG(LS_WARNING) << "Ignoring TURN server " << turns[i].server << ". "
691 << "Reason= Incorrect " << turns[i].transport_type 690 << "Reason= Incorrect " << turns[i].transport_type
692 << " transport parameter."; 691 << " transport parameter.";
693 } 692 }
694 } 693 }
695 } 694 }
696 session_->SetIceConnectionReceivingTimeout( 695 session_->SetIceConnectionReceivingTimeout(
697 config.ice_connection_receiving_timeout); 696 config.ice_connection_receiving_timeout);
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 if (ice_gathering_state_ != kIceGatheringComplete) { 902 if (ice_gathering_state_ != kIceGatheringComplete) {
904 ice_gathering_state_ = kIceGatheringComplete; 903 ice_gathering_state_ = kIceGatheringComplete;
905 observer_->OnIceGatheringChange(ice_gathering_state_); 904 observer_->OnIceGatheringChange(ice_gathering_state_);
906 } 905 }
907 } 906 }
908 observer_->OnSignalingChange(signaling_state_); 907 observer_->OnSignalingChange(signaling_state_);
909 observer_->OnStateChange(PeerConnectionObserver::kSignalingState); 908 observer_->OnStateChange(PeerConnectionObserver::kSignalingState);
910 } 909 }
911 910
912 } // namespace webrtc 911 } // namespace webrtc
OLDNEW
« no previous file with comments | « talk/app/webrtc/peerconnection.h ('k') | talk/app/webrtc/peerconnectioninterface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698