OLD | NEW |
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 Loading... |
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::UpdateIce(const RTCConfiguration& config) { | 657 bool PeerConnection::SetConfiguration(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) << "UpdateIce: StunServer Address: " << stun_addr.ToString(); | 674 LOG(LS_INFO) << "SetConfiguration: StunServer Address: " |
| 675 << stun_addr.ToString(); |
675 } | 676 } |
676 | 677 |
677 for (size_t i = 0; i < turns.size(); ++i) { | 678 for (size_t i = 0; i < turns.size(); ++i) { |
678 cricket::RelayCredentials credentials(turns[i].username, | 679 cricket::RelayCredentials credentials(turns[i].username, |
679 turns[i].password); | 680 turns[i].password); |
680 cricket::RelayServerConfig relay_server(cricket::RELAY_TURN); | 681 cricket::RelayServerConfig relay_server(cricket::RELAY_TURN); |
681 cricket::ProtocolType protocol; | 682 cricket::ProtocolType protocol; |
682 if (cricket::StringToProto(turns[i].transport_type.c_str(), &protocol)) { | 683 if (cricket::StringToProto(turns[i].transport_type.c_str(), &protocol)) { |
683 relay_server.ports.push_back(cricket::ProtocolAddress( | 684 relay_server.ports.push_back(cricket::ProtocolAddress( |
684 turns[i].server, protocol, turns[i].secure)); | 685 turns[i].server, protocol, turns[i].secure)); |
685 relay_server.credentials = credentials; | 686 relay_server.credentials = credentials; |
686 LOG(LS_INFO) << "UpdateIce: TurnServer Address: " | 687 LOG(LS_INFO) << "SetConfiguration: TurnServer Address: " |
687 << turns[i].server.ToString(); | 688 << turns[i].server.ToString(); |
688 } else { | 689 } else { |
689 LOG(LS_WARNING) << "Ignoring TURN server " << turns[i].server << ". " | 690 LOG(LS_WARNING) << "Ignoring TURN server " << turns[i].server << ". " |
690 << "Reason= Incorrect " << turns[i].transport_type | 691 << "Reason= Incorrect " << turns[i].transport_type |
691 << " transport parameter."; | 692 << " transport parameter."; |
692 } | 693 } |
693 } | 694 } |
694 } | 695 } |
695 session_->SetIceConnectionReceivingTimeout( | 696 session_->SetIceConnectionReceivingTimeout( |
696 config.ice_connection_receiving_timeout); | 697 config.ice_connection_receiving_timeout); |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
902 if (ice_gathering_state_ != kIceGatheringComplete) { | 903 if (ice_gathering_state_ != kIceGatheringComplete) { |
903 ice_gathering_state_ = kIceGatheringComplete; | 904 ice_gathering_state_ = kIceGatheringComplete; |
904 observer_->OnIceGatheringChange(ice_gathering_state_); | 905 observer_->OnIceGatheringChange(ice_gathering_state_); |
905 } | 906 } |
906 } | 907 } |
907 observer_->OnSignalingChange(signaling_state_); | 908 observer_->OnSignalingChange(signaling_state_); |
908 observer_->OnStateChange(PeerConnectionObserver::kSignalingState); | 909 observer_->OnStateChange(PeerConnectionObserver::kSignalingState); |
909 } | 910 } |
910 | 911 |
911 } // namespace webrtc | 912 } // namespace webrtc |
OLD | NEW |