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