OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2004 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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
441 | 441 |
442 const bool include_flexfec_stream = | 442 const bool include_flexfec_stream = |
443 ContainsFlexfecCodec(content_description->codecs()); | 443 ContainsFlexfecCodec(content_description->codecs()); |
444 | 444 |
445 MediaSessionOptions::Streams::const_iterator stream_it; | 445 MediaSessionOptions::Streams::const_iterator stream_it; |
446 for (stream_it = streams.begin(); | 446 for (stream_it = streams.begin(); |
447 stream_it != streams.end(); ++stream_it) { | 447 stream_it != streams.end(); ++stream_it) { |
448 if (stream_it->type != media_type) | 448 if (stream_it->type != media_type) |
449 continue; // Wrong media type. | 449 continue; // Wrong media type. |
450 | 450 |
451 const StreamParams* param = | 451 StreamParams* param = GetStreamByIds(*current_streams, "", stream_it->id); |
pthatcher1
2017/04/13 21:31:21
Instead of making this non-const and adding all th
Taylor Brandstetter
2017/04/14 15:52:08
Just because this way is more convenient/efficient
| |
452 GetStreamByIds(*current_streams, "", stream_it->id); | |
453 // groupid is empty for StreamParams generated using | 452 // groupid is empty for StreamParams generated using |
454 // MediaSessionDescriptionFactory. | 453 // MediaSessionDescriptionFactory. |
455 if (!param) { | 454 if (!param) { |
456 // This is a new stream. | 455 // This is a new stream. |
457 std::vector<uint32_t> ssrcs; | 456 std::vector<uint32_t> ssrcs; |
458 GenerateSsrcs(*current_streams, stream_it->num_sim_layers, &ssrcs); | 457 GenerateSsrcs(*current_streams, stream_it->num_sim_layers, &ssrcs); |
459 StreamParams stream_param; | 458 StreamParams stream_param; |
460 stream_param.id = stream_it->id; | 459 stream_param.id = stream_it->id; |
461 // Add the generated ssrc. | 460 // Add the generated ssrc. |
462 for (size_t i = 0; i < ssrcs.size(); ++i) { | 461 for (size_t i = 0; i < ssrcs.size(); ++i) { |
(...skipping 30 matching lines...) Expand all Loading... | |
493 } | 492 } |
494 } | 493 } |
495 stream_param.cname = options.rtcp_cname; | 494 stream_param.cname = options.rtcp_cname; |
496 stream_param.sync_label = stream_it->sync_label; | 495 stream_param.sync_label = stream_it->sync_label; |
497 content_description->AddStream(stream_param); | 496 content_description->AddStream(stream_param); |
498 | 497 |
499 // Store the new StreamParams in current_streams. | 498 // Store the new StreamParams in current_streams. |
500 // This is necessary so that we can use the CNAME for other media types. | 499 // This is necessary so that we can use the CNAME for other media types. |
501 current_streams->push_back(stream_param); | 500 current_streams->push_back(stream_param); |
502 } else { | 501 } else { |
502 // Use existing generated SSRCs/groups, but update the sync_label and | |
503 // cname if necessary. | |
pthatcher1
2017/04/13 21:31:22
Can you explain why this is necessary in the comme
Taylor Brandstetter
2017/04/14 15:52:08
Done. And there is no stream_it->cname.
| |
504 param->cname = options.rtcp_cname; | |
505 param->sync_label = stream_it->sync_label; | |
503 content_description->AddStream(*param); | 506 content_description->AddStream(*param); |
504 } | 507 } |
505 } | 508 } |
506 return true; | 509 return true; |
507 } | 510 } |
508 | 511 |
509 // Updates the transport infos of the |sdesc| according to the given | 512 // Updates the transport infos of the |sdesc| according to the given |
510 // |bundle_group|. The transport infos of the content names within the | 513 // |bundle_group|. The transport infos of the content names within the |
511 // |bundle_group| should be updated to use the ufrag, pwd and DTLS role of the | 514 // |bundle_group| should be updated to use the ufrag, pwd and DTLS role of the |
512 // first content within the |bundle_group|. | 515 // first content within the |bundle_group|. |
(...skipping 1670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2183 GetFirstMediaContentDescription(sdesc, MEDIA_TYPE_VIDEO)); | 2186 GetFirstMediaContentDescription(sdesc, MEDIA_TYPE_VIDEO)); |
2184 } | 2187 } |
2185 | 2188 |
2186 DataContentDescription* GetFirstDataContentDescription( | 2189 DataContentDescription* GetFirstDataContentDescription( |
2187 SessionDescription* sdesc) { | 2190 SessionDescription* sdesc) { |
2188 return static_cast<DataContentDescription*>( | 2191 return static_cast<DataContentDescription*>( |
2189 GetFirstMediaContentDescription(sdesc, MEDIA_TYPE_DATA)); | 2192 GetFirstMediaContentDescription(sdesc, MEDIA_TYPE_DATA)); |
2190 } | 2193 } |
2191 | 2194 |
2192 } // namespace cricket | 2195 } // namespace cricket |
OLD | NEW |