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 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1402 } | 1403 } |
1403 AddLine(os.str(), message); | 1404 AddLine(os.str(), message); |
1404 | 1405 |
1405 // RFC 5761 | 1406 // RFC 5761 |
1406 // a=rtcp-mux | 1407 // a=rtcp-mux |
1407 if (media_desc->rtcp_mux()) { | 1408 if (media_desc->rtcp_mux()) { |
1408 InitAttrLine(kAttributeRtcpMux, &os); | 1409 InitAttrLine(kAttributeRtcpMux, &os); |
1409 AddLine(os.str(), message); | 1410 AddLine(os.str(), message); |
1410 } | 1411 } |
1411 | 1412 |
| 1413 // RFC 5506 |
| 1414 // a=rtcp-rsize |
| 1415 if (media_desc->rtcp_reduced_size()) { |
| 1416 InitAttrLine(kAttributeRtcpReducedSize, &os); |
| 1417 AddLine(os.str(), message); |
| 1418 } |
| 1419 |
1412 // RFC 4568 | 1420 // RFC 4568 |
1413 // a=crypto:<tag> <crypto-suite> <key-params> [<session-params>] | 1421 // a=crypto:<tag> <crypto-suite> <key-params> [<session-params>] |
1414 for (std::vector<CryptoParams>::const_iterator it = | 1422 for (std::vector<CryptoParams>::const_iterator it = |
1415 media_desc->cryptos().begin(); | 1423 media_desc->cryptos().begin(); |
1416 it != media_desc->cryptos().end(); ++it) { | 1424 it != media_desc->cryptos().end(); ++it) { |
1417 InitAttrLine(kAttributeCrypto, &os); | 1425 InitAttrLine(kAttributeCrypto, &os); |
1418 os << kSdpDelimiterColon << it->tag << " " << it->cipher_suite << " " | 1426 os << kSdpDelimiterColon << it->tag << " " << it->cipher_suite << " " |
1419 << it->key_params; | 1427 << it->key_params; |
1420 if (!it->session_params.empty()) { | 1428 if (!it->session_params.empty()) { |
1421 os << " " << it->session_params; | 1429 os << " " << it->session_params; |
(...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2562 if (!AddSctpDataCodec(static_cast<DataContentDescription*>(media_desc), | 2570 if (!AddSctpDataCodec(static_cast<DataContentDescription*>(media_desc), |
2563 sctp_port)) { | 2571 sctp_port)) { |
2564 return false; | 2572 return false; |
2565 } | 2573 } |
2566 } else if (IsRtp(protocol)) { | 2574 } else if (IsRtp(protocol)) { |
2567 // | 2575 // |
2568 // RTP specific attrubtes | 2576 // RTP specific attrubtes |
2569 // | 2577 // |
2570 if (HasAttribute(line, kAttributeRtcpMux)) { | 2578 if (HasAttribute(line, kAttributeRtcpMux)) { |
2571 media_desc->set_rtcp_mux(true); | 2579 media_desc->set_rtcp_mux(true); |
| 2580 } else if (HasAttribute(line, kAttributeRtcpReducedSize)) { |
| 2581 media_desc->set_rtcp_reduced_size(true); |
2572 } else if (HasAttribute(line, kAttributeSsrcGroup)) { | 2582 } else if (HasAttribute(line, kAttributeSsrcGroup)) { |
2573 if (!ParseSsrcGroupAttribute(line, &ssrc_groups, error)) { | 2583 if (!ParseSsrcGroupAttribute(line, &ssrc_groups, error)) { |
2574 return false; | 2584 return false; |
2575 } | 2585 } |
2576 } else if (HasAttribute(line, kAttributeSsrc)) { | 2586 } else if (HasAttribute(line, kAttributeSsrc)) { |
2577 if (!ParseSsrcAttribute(line, &ssrc_infos, error)) { | 2587 if (!ParseSsrcAttribute(line, &ssrc_infos, error)) { |
2578 return false; | 2588 return false; |
2579 } | 2589 } |
2580 } else if (HasAttribute(line, kAttributeCrypto)) { | 2590 } else if (HasAttribute(line, kAttributeCrypto)) { |
2581 if (!ParseCryptoAttribute(line, media_desc, error)) { | 2591 if (!ParseCryptoAttribute(line, media_desc, error)) { |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3073 UpdateCodec<AudioContentDescription, cricket::AudioCodec>( | 3083 UpdateCodec<AudioContentDescription, cricket::AudioCodec>( |
3074 media_desc, payload_type, feedback_param); | 3084 media_desc, payload_type, feedback_param); |
3075 } else if (media_type == cricket::MEDIA_TYPE_VIDEO) { | 3085 } else if (media_type == cricket::MEDIA_TYPE_VIDEO) { |
3076 UpdateCodec<VideoContentDescription, cricket::VideoCodec>( | 3086 UpdateCodec<VideoContentDescription, cricket::VideoCodec>( |
3077 media_desc, payload_type, feedback_param); | 3087 media_desc, payload_type, feedback_param); |
3078 } | 3088 } |
3079 return true; | 3089 return true; |
3080 } | 3090 } |
3081 | 3091 |
3082 } // namespace webrtc | 3092 } // namespace webrtc |
OLD | NEW |