OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 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 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1496 !remote_video_tracks_.empty(); | 1496 !remote_video_tracks_.empty(); |
1497 } | 1497 } |
1498 session_options->bundle_enabled = | 1498 session_options->bundle_enabled = |
1499 session_options->bundle_enabled && | 1499 session_options->bundle_enabled && |
1500 (session_options->has_audio() || session_options->has_video() || | 1500 (session_options->has_audio() || session_options->has_video() || |
1501 session_options->has_data()); | 1501 session_options->has_data()); |
1502 | 1502 |
1503 if (session_->data_channel_type() == cricket::DCT_SCTP && HasDataChannels()) { | 1503 if (session_->data_channel_type() == cricket::DCT_SCTP && HasDataChannels()) { |
1504 session_options->data_channel_type = cricket::DCT_SCTP; | 1504 session_options->data_channel_type = cricket::DCT_SCTP; |
1505 } | 1505 } |
| 1506 session_options->crypto_options = factory_->options().crypto_options; |
1506 return true; | 1507 return true; |
1507 } | 1508 } |
1508 | 1509 |
1509 void PeerConnection::FinishOptionsForAnswer( | 1510 void PeerConnection::FinishOptionsForAnswer( |
1510 cricket::MediaSessionOptions* session_options) { | 1511 cricket::MediaSessionOptions* session_options) { |
1511 // TODO(deadbeef): Once we have transceivers, enumerate them here instead of | 1512 // TODO(deadbeef): Once we have transceivers, enumerate them here instead of |
1512 // ContentInfos. | 1513 // ContentInfos. |
1513 if (session_->remote_description()) { | 1514 if (session_->remote_description()) { |
1514 // Initialize the transport_options map. | 1515 // Initialize the transport_options map. |
1515 for (const cricket::ContentInfo& content : | 1516 for (const cricket::ContentInfo& content : |
1516 session_->remote_description()->description()->contents()) { | 1517 session_->remote_description()->description()->contents()) { |
1517 session_options->transport_options[content.name] = | 1518 session_options->transport_options[content.name] = |
1518 cricket::TransportOptions(); | 1519 cricket::TransportOptions(); |
1519 } | 1520 } |
1520 } | 1521 } |
1521 AddSendStreams(session_options, senders_, rtp_data_channels_); | 1522 AddSendStreams(session_options, senders_, rtp_data_channels_); |
1522 session_options->bundle_enabled = | 1523 session_options->bundle_enabled = |
1523 session_options->bundle_enabled && | 1524 session_options->bundle_enabled && |
1524 (session_options->has_audio() || session_options->has_video() || | 1525 (session_options->has_audio() || session_options->has_video() || |
1525 session_options->has_data()); | 1526 session_options->has_data()); |
1526 | 1527 |
1527 // RTP data channel is handled in MediaSessionOptions::AddStream. SCTP streams | 1528 // RTP data channel is handled in MediaSessionOptions::AddStream. SCTP streams |
1528 // are not signaled in the SDP so does not go through that path and must be | 1529 // are not signaled in the SDP so does not go through that path and must be |
1529 // handled here. | 1530 // handled here. |
1530 if (session_->data_channel_type() == cricket::DCT_SCTP) { | 1531 if (session_->data_channel_type() == cricket::DCT_SCTP) { |
1531 session_options->data_channel_type = cricket::DCT_SCTP; | 1532 session_options->data_channel_type = cricket::DCT_SCTP; |
1532 } | 1533 } |
| 1534 session_options->crypto_options = factory_->options().crypto_options; |
1533 } | 1535 } |
1534 | 1536 |
1535 bool PeerConnection::GetOptionsForAnswer( | 1537 bool PeerConnection::GetOptionsForAnswer( |
1536 const MediaConstraintsInterface* constraints, | 1538 const MediaConstraintsInterface* constraints, |
1537 cricket::MediaSessionOptions* session_options) { | 1539 cricket::MediaSessionOptions* session_options) { |
1538 session_options->recv_audio = false; | 1540 session_options->recv_audio = false; |
1539 session_options->recv_video = false; | 1541 session_options->recv_video = false; |
1540 if (!ParseConstraintsForAnswer(constraints, session_options)) { | 1542 if (!ParseConstraintsForAnswer(constraints, session_options)) { |
1541 return false; | 1543 return false; |
1542 } | 1544 } |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2058 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { | 2060 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { |
2059 for (const auto& channel : sctp_data_channels_) { | 2061 for (const auto& channel : sctp_data_channels_) { |
2060 if (channel->id() == sid) { | 2062 if (channel->id() == sid) { |
2061 return channel; | 2063 return channel; |
2062 } | 2064 } |
2063 } | 2065 } |
2064 return nullptr; | 2066 return nullptr; |
2065 } | 2067 } |
2066 | 2068 |
2067 } // namespace webrtc | 2069 } // namespace webrtc |
OLD | NEW |