| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2011 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1395 | 1395 |
| 1396 // draft-ietf-mmusic-msid-11 | 1396 // draft-ietf-mmusic-msid-11 |
| 1397 // a=msid:<stream id> <track id> | 1397 // a=msid:<stream id> <track id> |
| 1398 if (unified_plan_sdp && !media_desc->streams().empty()) { | 1398 if (unified_plan_sdp && !media_desc->streams().empty()) { |
| 1399 if (media_desc->streams().size() > 1u) { | 1399 if (media_desc->streams().size() > 1u) { |
| 1400 LOG(LS_WARNING) << "Trying to serialize unified plan SDP with more than " | 1400 LOG(LS_WARNING) << "Trying to serialize unified plan SDP with more than " |
| 1401 << "one track in a media section. Omitting 'a=msid'."; | 1401 << "one track in a media section. Omitting 'a=msid'."; |
| 1402 } else { | 1402 } else { |
| 1403 auto track = media_desc->streams().begin(); | 1403 auto track = media_desc->streams().begin(); |
| 1404 const std::string& stream_id = track->sync_label; | 1404 const std::string& stream_id = track->sync_label; |
| 1405 std::ostringstream os; | |
| 1406 InitAttrLine(kAttributeMsid, &os); | 1405 InitAttrLine(kAttributeMsid, &os); |
| 1407 os << kSdpDelimiterColon << stream_id << kSdpDelimiterSpace << track->id; | 1406 os << kSdpDelimiterColon << stream_id << kSdpDelimiterSpace << track->id; |
| 1408 AddLine(os.str(), message); | 1407 AddLine(os.str(), message); |
| 1409 } | 1408 } |
| 1410 } | 1409 } |
| 1411 | 1410 |
| 1412 // RFC 5761 | 1411 // RFC 5761 |
| 1413 // a=rtcp-mux | 1412 // a=rtcp-mux |
| 1414 if (media_desc->rtcp_mux()) { | 1413 if (media_desc->rtcp_mux()) { |
| 1415 InitAttrLine(kAttributeRtcpMux, &os); | 1414 InitAttrLine(kAttributeRtcpMux, &os); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1450 // if no track or media stream have been created. | 1449 // if no track or media stream have been created. |
| 1451 if (track->sync_label.empty()) continue; | 1450 if (track->sync_label.empty()) continue; |
| 1452 | 1451 |
| 1453 // Build the ssrc-group lines. | 1452 // Build the ssrc-group lines. |
| 1454 for (size_t i = 0; i < track->ssrc_groups.size(); ++i) { | 1453 for (size_t i = 0; i < track->ssrc_groups.size(); ++i) { |
| 1455 // RFC 5576 | 1454 // RFC 5576 |
| 1456 // a=ssrc-group:<semantics> <ssrc-id> ... | 1455 // a=ssrc-group:<semantics> <ssrc-id> ... |
| 1457 if (track->ssrc_groups[i].ssrcs.empty()) { | 1456 if (track->ssrc_groups[i].ssrcs.empty()) { |
| 1458 continue; | 1457 continue; |
| 1459 } | 1458 } |
| 1460 std::ostringstream os; | |
| 1461 InitAttrLine(kAttributeSsrcGroup, &os); | 1459 InitAttrLine(kAttributeSsrcGroup, &os); |
| 1462 os << kSdpDelimiterColon << track->ssrc_groups[i].semantics; | 1460 os << kSdpDelimiterColon << track->ssrc_groups[i].semantics; |
| 1463 std::vector<uint32_t>::const_iterator ssrc = | 1461 std::vector<uint32_t>::const_iterator ssrc = |
| 1464 track->ssrc_groups[i].ssrcs.begin(); | 1462 track->ssrc_groups[i].ssrcs.begin(); |
| 1465 for (; ssrc != track->ssrc_groups[i].ssrcs.end(); ++ssrc) { | 1463 for (; ssrc != track->ssrc_groups[i].ssrcs.end(); ++ssrc) { |
| 1466 os << kSdpDelimiterSpace << rtc::ToString<uint32_t>(*ssrc); | 1464 os << kSdpDelimiterSpace << rtc::ToString<uint32_t>(*ssrc); |
| 1467 } | 1465 } |
| 1468 AddLine(os.str(), message); | 1466 AddLine(os.str(), message); |
| 1469 } | 1467 } |
| 1470 // Build the ssrc lines for each ssrc. | 1468 // Build the ssrc lines for each ssrc. |
| 1471 for (size_t i = 0; i < track->ssrcs.size(); ++i) { | 1469 for (size_t i = 0; i < track->ssrcs.size(); ++i) { |
| 1472 uint32_t ssrc = track->ssrcs[i]; | 1470 uint32_t ssrc = track->ssrcs[i]; |
| 1473 // RFC 5576 | 1471 // RFC 5576 |
| 1474 // a=ssrc:<ssrc-id> cname:<value> | 1472 // a=ssrc:<ssrc-id> cname:<value> |
| 1475 AddSsrcLine(ssrc, kSsrcAttributeCname, | 1473 AddSsrcLine(ssrc, kSsrcAttributeCname, |
| 1476 track->cname, message); | 1474 track->cname, message); |
| 1477 | 1475 |
| 1478 // draft-alvestrand-mmusic-msid-00 | 1476 // draft-alvestrand-mmusic-msid-00 |
| 1479 // a=ssrc:<ssrc-id> msid:identifier [appdata] | 1477 // a=ssrc:<ssrc-id> msid:identifier [appdata] |
| 1480 // The appdata consists of the "id" attribute of a MediaStreamTrack, | 1478 // The appdata consists of the "id" attribute of a MediaStreamTrack, |
| 1481 // which corresponds to the "id" attribute of StreamParams. | 1479 // which corresponds to the "id" attribute of StreamParams. |
| 1482 const std::string& stream_id = track->sync_label; | 1480 const std::string& stream_id = track->sync_label; |
| 1483 std::ostringstream os; | |
| 1484 InitAttrLine(kAttributeSsrc, &os); | 1481 InitAttrLine(kAttributeSsrc, &os); |
| 1485 os << kSdpDelimiterColon << ssrc << kSdpDelimiterSpace | 1482 os << kSdpDelimiterColon << ssrc << kSdpDelimiterSpace |
| 1486 << kSsrcAttributeMsid << kSdpDelimiterColon << stream_id | 1483 << kSsrcAttributeMsid << kSdpDelimiterColon << stream_id |
| 1487 << kSdpDelimiterSpace << track->id; | 1484 << kSdpDelimiterSpace << track->id; |
| 1488 AddLine(os.str(), message); | 1485 AddLine(os.str(), message); |
| 1489 | 1486 |
| 1490 // TODO(ronghuawu): Remove below code which is for backward | 1487 // TODO(ronghuawu): Remove below code which is for backward |
| 1491 // compatibility. | 1488 // compatibility. |
| 1492 // draft-alvestrand-rtcweb-mid-01 | 1489 // draft-alvestrand-rtcweb-mid-01 |
| 1493 // a=ssrc:<ssrc-id> mslabel:<value> | 1490 // a=ssrc:<ssrc-id> mslabel:<value> |
| (...skipping 1633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3127 UpdateCodec<AudioContentDescription, cricket::AudioCodec>( | 3124 UpdateCodec<AudioContentDescription, cricket::AudioCodec>( |
| 3128 media_desc, payload_type, feedback_param); | 3125 media_desc, payload_type, feedback_param); |
| 3129 } else if (media_type == cricket::MEDIA_TYPE_VIDEO) { | 3126 } else if (media_type == cricket::MEDIA_TYPE_VIDEO) { |
| 3130 UpdateCodec<VideoContentDescription, cricket::VideoCodec>( | 3127 UpdateCodec<VideoContentDescription, cricket::VideoCodec>( |
| 3131 media_desc, payload_type, feedback_param); | 3128 media_desc, payload_type, feedback_param); |
| 3132 } | 3129 } |
| 3133 return true; | 3130 return true; |
| 3134 } | 3131 } |
| 3135 | 3132 |
| 3136 } // namespace webrtc | 3133 } // namespace webrtc |
| OLD | NEW |