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