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

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

Issue 1498993002: Add ufrag to the ICE candidate signaling. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years 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 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 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 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after
1078 std::string username; 1078 std::string username;
1079 std::string password; 1079 std::string password;
1080 uint32_t generation = 0; 1080 uint32_t generation = 0;
1081 for (size_t i = current_position; i + 1 < fields.size(); ++i) { 1081 for (size_t i = current_position; i + 1 < fields.size(); ++i) {
1082 // RFC 5245 1082 // RFC 5245
1083 // *(SP extension-att-name SP extension-att-value) 1083 // *(SP extension-att-name SP extension-att-value)
1084 if (fields[i] == kAttributeCandidateGeneration) { 1084 if (fields[i] == kAttributeCandidateGeneration) {
1085 if (!GetValueFromString(first_line, fields[++i], &generation, error)) { 1085 if (!GetValueFromString(first_line, fields[++i], &generation, error)) {
1086 return false; 1086 return false;
1087 } 1087 }
1088 } else if (fields[i] == kAttributeCandidateUsername) { 1088 } else if (fields[i] == kAttributeCandidateUsername) {
pthatcher1 2015/12/04 20:43:49 I think we should change this to check for kAttrib
honghaiz3 2015/12/09 23:57:54 Done.
1089 username = fields[++i]; 1089 username = fields[++i];
1090 } else if (fields[i] == kAttributeCandidatePassword) { 1090 } else if (fields[i] == kAttributeCandidatePassword) {
1091 password = fields[++i]; 1091 password = fields[++i];
1092 } else { 1092 } else {
1093 // Skip the unknown extension. 1093 // Skip the unknown extension.
1094 ++i; 1094 ++i;
1095 } 1095 }
1096 } 1096 }
1097 1097
1098 *candidate = Candidate(component_id, cricket::ProtoToString(protocol), 1098 *candidate = Candidate(component_id, cricket::ProtoToString(protocol),
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
1751 << kAttributeCandidateRport << " " 1751 << kAttributeCandidateRport << " "
1752 << it->related_address().PortAsString() << " "; 1752 << it->related_address().PortAsString() << " ";
1753 } 1753 }
1754 1754
1755 if (it->protocol() == cricket::TCP_PROTOCOL_NAME) { 1755 if (it->protocol() == cricket::TCP_PROTOCOL_NAME) {
1756 os << kTcpCandidateType << " " << it->tcptype() << " "; 1756 os << kTcpCandidateType << " " << it->tcptype() << " ";
1757 } 1757 }
1758 1758
1759 // Extensions 1759 // Extensions
1760 os << kAttributeCandidateGeneration << " " << it->generation(); 1760 os << kAttributeCandidateGeneration << " " << it->generation();
1761 if (!it->username().empty()) {
1762 os << " " << kAttributeCandidateUsername << " " << it->username();
pthatcher1 2015/12/04 20:43:49 This would make it "username", but it's not really
honghaiz3 2015/12/09 23:57:54 I just used the one kAttributeUfrag which is "ice-
1763 }
1761 1764
1762 AddLine(os.str(), message); 1765 AddLine(os.str(), message);
1763 } 1766 }
1764 } 1767 }
1765 1768
1766 void BuildIceOptions(const std::vector<std::string>& transport_options, 1769 void BuildIceOptions(const std::vector<std::string>& transport_options,
1767 std::string* message) { 1770 std::string* message) {
1768 if (!transport_options.empty()) { 1771 if (!transport_options.empty()) {
1769 std::ostringstream os; 1772 std::ostringstream os;
1770 InitAttrLine(kAttributeIceOption, &os); 1773 InitAttrLine(kAttributeIceOption, &os);
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after
2659 // Verify video codec ensures that no video codec has been populated with 2662 // Verify video codec ensures that no video codec has been populated with
2660 // only rtcp-fb. 2663 // only rtcp-fb.
2661 if (!VerifyVideoCodecs(video_desc)) { 2664 if (!VerifyVideoCodecs(video_desc)) {
2662 return ParseFailed("Failed to parse video codecs correctly.", error); 2665 return ParseFailed("Failed to parse video codecs correctly.", error);
2663 } 2666 }
2664 } 2667 }
2665 2668
2666 // RFC 5245 2669 // RFC 5245
2667 // Update the candidates with the media level "ice-pwd" and "ice-ufrag". 2670 // Update the candidates with the media level "ice-pwd" and "ice-ufrag".
2668 for (Candidates::iterator it = candidates_orig.begin(); 2671 for (Candidates::iterator it = candidates_orig.begin();
2669 it != candidates_orig.end(); ++it) { 2672 it != candidates_orig.end(); ++it) {
pthatcher1 2015/12/04 20:43:49 Since this is parsing candidates in the SDP (not t
honghaiz3 2015/12/09 23:57:54 Yes. Thanks.
2670 ASSERT((*it).username().empty());
2671 (*it).set_username(transport->ice_ufrag); 2673 (*it).set_username(transport->ice_ufrag);
2672 ASSERT((*it).password().empty()); 2674 ASSERT((*it).password().empty());
2673 (*it).set_password(transport->ice_pwd); 2675 (*it).set_password(transport->ice_pwd);
2674 candidates->push_back( 2676 candidates->push_back(
2675 new JsepIceCandidate(mline_id, mline_index, *it)); 2677 new JsepIceCandidate(mline_id, mline_index, *it));
2676 } 2678 }
2677 return true; 2679 return true;
2678 } 2680 }
2679 2681
2680 bool ParseSsrcAttribute(const std::string& line, SsrcInfoVec* ssrc_infos, 2682 bool ParseSsrcAttribute(const std::string& line, SsrcInfoVec* ssrc_infos,
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
3057 UpdateCodec<AudioContentDescription, cricket::AudioCodec>( 3059 UpdateCodec<AudioContentDescription, cricket::AudioCodec>(
3058 media_desc, payload_type, feedback_param); 3060 media_desc, payload_type, feedback_param);
3059 } else if (media_type == cricket::MEDIA_TYPE_VIDEO) { 3061 } else if (media_type == cricket::MEDIA_TYPE_VIDEO) {
3060 UpdateCodec<VideoContentDescription, cricket::VideoCodec>( 3062 UpdateCodec<VideoContentDescription, cricket::VideoCodec>(
3061 media_desc, payload_type, feedback_param); 3063 media_desc, payload_type, feedback_param);
3062 } 3064 }
3063 return true; 3065 return true;
3064 } 3066 }
3065 3067
3066 } // namespace webrtc 3068 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | talk/app/webrtc/webrtcsdp_unittest.cc » ('j') | webrtc/p2p/base/p2ptransportchannel.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698