OLD | NEW |
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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 static const char kLineTypeTimeZone = 'z'; | 114 static const char kLineTypeTimeZone = 'z'; |
115 static const char kLineTypeEncryptionKey = 'k'; | 115 static const char kLineTypeEncryptionKey = 'k'; |
116 static const char kLineTypeMedia = 'm'; | 116 static const char kLineTypeMedia = 'm'; |
117 static const char kLineTypeConnection = 'c'; | 117 static const char kLineTypeConnection = 'c'; |
118 static const char kLineTypeAttributes = 'a'; | 118 static const char kLineTypeAttributes = 'a'; |
119 | 119 |
120 // Attributes | 120 // Attributes |
121 static const char kAttributeGroup[] = "group"; | 121 static const char kAttributeGroup[] = "group"; |
122 static const char kAttributeMid[] = "mid"; | 122 static const char kAttributeMid[] = "mid"; |
123 static const char kAttributeRtcpMux[] = "rtcp-mux"; | 123 static const char kAttributeRtcpMux[] = "rtcp-mux"; |
| 124 static const char kAttributeRtcpReducedSize[] = "rtcp-rsize"; |
124 static const char kAttributeSsrc[] = "ssrc"; | 125 static const char kAttributeSsrc[] = "ssrc"; |
125 static const char kSsrcAttributeCname[] = "cname"; | 126 static const char kSsrcAttributeCname[] = "cname"; |
126 static const char kAttributeExtmap[] = "extmap"; | 127 static const char kAttributeExtmap[] = "extmap"; |
127 // draft-alvestrand-mmusic-msid-01 | 128 // draft-alvestrand-mmusic-msid-01 |
128 // a=msid-semantic: WMS | 129 // a=msid-semantic: WMS |
129 static const char kAttributeMsidSemantics[] = "msid-semantic"; | 130 static const char kAttributeMsidSemantics[] = "msid-semantic"; |
130 static const char kMediaStreamSemantic[] = "WMS"; | 131 static const char kMediaStreamSemantic[] = "WMS"; |
131 static const char kSsrcAttributeMsid[] = "msid"; | 132 static const char kSsrcAttributeMsid[] = "msid"; |
132 static const char kDefaultMsid[] = "default"; | 133 static const char kDefaultMsid[] = "default"; |
133 static const char kSsrcAttributeMslabel[] = "mslabel"; | 134 static const char kSsrcAttributeMslabel[] = "mslabel"; |
(...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1392 } | 1393 } |
1393 AddLine(os.str(), message); | 1394 AddLine(os.str(), message); |
1394 | 1395 |
1395 // RFC 5761 | 1396 // RFC 5761 |
1396 // a=rtcp-mux | 1397 // a=rtcp-mux |
1397 if (media_desc->rtcp_mux()) { | 1398 if (media_desc->rtcp_mux()) { |
1398 InitAttrLine(kAttributeRtcpMux, &os); | 1399 InitAttrLine(kAttributeRtcpMux, &os); |
1399 AddLine(os.str(), message); | 1400 AddLine(os.str(), message); |
1400 } | 1401 } |
1401 | 1402 |
| 1403 // RFC 5506 |
| 1404 // a=rtcp-rsize |
| 1405 if (media_desc->rtcp_reduced_size()) { |
| 1406 InitAttrLine(kAttributeRtcpReducedSize, &os); |
| 1407 AddLine(os.str(), message); |
| 1408 } |
| 1409 |
1402 // RFC 4568 | 1410 // RFC 4568 |
1403 // a=crypto:<tag> <crypto-suite> <key-params> [<session-params>] | 1411 // a=crypto:<tag> <crypto-suite> <key-params> [<session-params>] |
1404 for (std::vector<CryptoParams>::const_iterator it = | 1412 for (std::vector<CryptoParams>::const_iterator it = |
1405 media_desc->cryptos().begin(); | 1413 media_desc->cryptos().begin(); |
1406 it != media_desc->cryptos().end(); ++it) { | 1414 it != media_desc->cryptos().end(); ++it) { |
1407 InitAttrLine(kAttributeCrypto, &os); | 1415 InitAttrLine(kAttributeCrypto, &os); |
1408 os << kSdpDelimiterColon << it->tag << " " << it->cipher_suite << " " | 1416 os << kSdpDelimiterColon << it->tag << " " << it->cipher_suite << " " |
1409 << it->key_params; | 1417 << it->key_params; |
1410 if (!it->session_params.empty()) { | 1418 if (!it->session_params.empty()) { |
1411 os << " " << it->session_params; | 1419 os << " " << it->session_params; |
(...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2545 if (!AddSctpDataCodec(static_cast<DataContentDescription*>(media_desc), | 2553 if (!AddSctpDataCodec(static_cast<DataContentDescription*>(media_desc), |
2546 sctp_port)) { | 2554 sctp_port)) { |
2547 return false; | 2555 return false; |
2548 } | 2556 } |
2549 } else if (IsRtp(protocol)) { | 2557 } else if (IsRtp(protocol)) { |
2550 // | 2558 // |
2551 // RTP specific attrubtes | 2559 // RTP specific attrubtes |
2552 // | 2560 // |
2553 if (HasAttribute(line, kAttributeRtcpMux)) { | 2561 if (HasAttribute(line, kAttributeRtcpMux)) { |
2554 media_desc->set_rtcp_mux(true); | 2562 media_desc->set_rtcp_mux(true); |
| 2563 } else if (HasAttribute(line, kAttributeRtcpReducedSize)) { |
| 2564 media_desc->set_rtcp_reduced_size(true); |
2555 } else if (HasAttribute(line, kAttributeSsrcGroup)) { | 2565 } else if (HasAttribute(line, kAttributeSsrcGroup)) { |
2556 if (!ParseSsrcGroupAttribute(line, &ssrc_groups, error)) { | 2566 if (!ParseSsrcGroupAttribute(line, &ssrc_groups, error)) { |
2557 return false; | 2567 return false; |
2558 } | 2568 } |
2559 } else if (HasAttribute(line, kAttributeSsrc)) { | 2569 } else if (HasAttribute(line, kAttributeSsrc)) { |
2560 if (!ParseSsrcAttribute(line, &ssrc_infos, error)) { | 2570 if (!ParseSsrcAttribute(line, &ssrc_infos, error)) { |
2561 return false; | 2571 return false; |
2562 } | 2572 } |
2563 } else if (HasAttribute(line, kAttributeCrypto)) { | 2573 } else if (HasAttribute(line, kAttributeCrypto)) { |
2564 if (!ParseCryptoAttribute(line, media_desc, error)) { | 2574 if (!ParseCryptoAttribute(line, media_desc, error)) { |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3056 UpdateCodec<AudioContentDescription, cricket::AudioCodec>( | 3066 UpdateCodec<AudioContentDescription, cricket::AudioCodec>( |
3057 media_desc, payload_type, feedback_param); | 3067 media_desc, payload_type, feedback_param); |
3058 } else if (media_type == cricket::MEDIA_TYPE_VIDEO) { | 3068 } else if (media_type == cricket::MEDIA_TYPE_VIDEO) { |
3059 UpdateCodec<VideoContentDescription, cricket::VideoCodec>( | 3069 UpdateCodec<VideoContentDescription, cricket::VideoCodec>( |
3060 media_desc, payload_type, feedback_param); | 3070 media_desc, payload_type, feedback_param); |
3061 } | 3071 } |
3062 return true; | 3072 return true; |
3063 } | 3073 } |
3064 | 3074 |
3065 } // namespace webrtc | 3075 } // namespace webrtc |
OLD | NEW |