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 25 matching lines...) Expand all Loading... | |
36 std::unique_ptr<webrtc::AudioSinkInterface>* sink) { | 36 std::unique_ptr<webrtc::AudioSinkInterface>* sink) { |
37 channel->SetRawAudioSink(ssrc, std::move(*sink)); | 37 channel->SetRawAudioSink(ssrc, std::move(*sink)); |
38 return true; | 38 return true; |
39 } | 39 } |
40 | 40 |
41 struct SendPacketMessageData : public rtc::MessageData { | 41 struct SendPacketMessageData : public rtc::MessageData { |
42 rtc::CopyOnWriteBuffer packet; | 42 rtc::CopyOnWriteBuffer packet; |
43 rtc::PacketOptions options; | 43 rtc::PacketOptions options; |
44 }; | 44 }; |
45 | 45 |
46 #if defined(ENABLE_EXTERNAL_AUTH) | |
47 // Returns the named header extension if found among all extensions, | 46 // Returns the named header extension if found among all extensions, |
48 // nullptr otherwise. | 47 // nullptr otherwise. |
49 const webrtc::RtpExtension* FindHeaderExtension( | 48 const webrtc::RtpExtension* FindHeaderExtension( |
50 const std::vector<webrtc::RtpExtension>& extensions, | 49 const std::vector<webrtc::RtpExtension>& extensions, |
51 const std::string& uri) { | 50 const std::string& uri) { |
52 for (const auto& extension : extensions) { | 51 for (const auto& extension : extensions) { |
53 if (extension.uri == uri) | 52 if (extension.uri == uri) |
54 return &extension; | 53 return &extension; |
55 } | 54 } |
56 return nullptr; | 55 return nullptr; |
57 } | 56 } |
58 #endif | |
59 | 57 |
60 } // namespace | 58 } // namespace |
61 | 59 |
62 enum { | 60 enum { |
63 MSG_EARLYMEDIATIMEOUT = 1, | 61 MSG_EARLYMEDIATIMEOUT = 1, |
64 MSG_SEND_RTP_PACKET, | 62 MSG_SEND_RTP_PACKET, |
65 MSG_SEND_RTCP_PACKET, | 63 MSG_SEND_RTCP_PACKET, |
66 MSG_CHANNEL_ERROR, | 64 MSG_CHANNEL_ERROR, |
67 MSG_READYTOSENDDATA, | 65 MSG_READYTOSENDDATA, |
68 MSG_DATARECEIVED, | 66 MSG_DATARECEIVED, |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
317 return; | 315 return; |
318 } | 316 } |
319 | 317 |
320 // When using DTLS-SRTP, we must reset the SrtpFilter every time the transport | 318 // When using DTLS-SRTP, we must reset the SrtpFilter every time the transport |
321 // changes and wait until the DTLS handshake is complete to set the newly | 319 // changes and wait until the DTLS handshake is complete to set the newly |
322 // negotiated parameters. | 320 // negotiated parameters. |
323 if (ShouldSetupDtlsSrtp_n()) { | 321 if (ShouldSetupDtlsSrtp_n()) { |
324 // Set |writable_| to false such that UpdateWritableState_w can set up | 322 // Set |writable_| to false such that UpdateWritableState_w can set up |
325 // DTLS-SRTP when |writable_| becomes true again. | 323 // DTLS-SRTP when |writable_| becomes true again. |
326 writable_ = false; | 324 writable_ = false; |
325 if (srtp_filter_.IsActive()) { | |
326 // Only clear header information if transport changes (i.e. SRTP has been | |
327 // activated before), not on initial transport (which might happen during | |
328 // offer/answer processing). | |
329 rtp_encrypted_headers_ready_ = 0; | |
Taylor Brandstetter
2017/03/22 18:00:11
This would mean that a new offer/answer is needed
joachim
2017/03/23 00:04:33
Right, I missed this. No longer applies with the c
| |
330 } | |
pthatcher1
2017/03/21 07:07:06
It shouldn't become writable again until we get th
joachim
2017/03/23 00:04:33
The extra state has now been removed.
| |
327 srtp_filter_.ResetParams(); | 331 srtp_filter_.ResetParams(); |
328 } | 332 } |
329 | 333 |
330 // If this BaseChannel doesn't require RTCP mux and we haven't fully | 334 // If this BaseChannel doesn't require RTCP mux and we haven't fully |
331 // negotiated RTCP mux, we need an RTCP transport. | 335 // negotiated RTCP mux, we need an RTCP transport. |
332 if (rtcp_packet_transport) { | 336 if (rtcp_packet_transport) { |
333 LOG(LS_INFO) << "Setting RTCP Transport for " << content_name() << " on " | 337 LOG(LS_INFO) << "Setting RTCP Transport for " << content_name() << " on " |
334 << debug_name << " transport " << rtcp_packet_transport; | 338 << debug_name << " transport " << rtcp_packet_transport; |
335 SetTransport_n(true, rtcp_dtls_transport, rtcp_packet_transport); | 339 SetTransport_n(true, rtcp_dtls_transport, rtcp_packet_transport); |
336 } | 340 } |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
984 << (was_ever_writable_ ? "" : " for the first time"); | 988 << (was_ever_writable_ ? "" : " for the first time"); |
985 | 989 |
986 if (selected_candidate_pair_) | 990 if (selected_candidate_pair_) |
987 LOG(LS_INFO) | 991 LOG(LS_INFO) |
988 << "Using " | 992 << "Using " |
989 << selected_candidate_pair_->local_candidate().ToSensitiveString() | 993 << selected_candidate_pair_->local_candidate().ToSensitiveString() |
990 << "->" | 994 << "->" |
991 << selected_candidate_pair_->remote_candidate().ToSensitiveString(); | 995 << selected_candidate_pair_->remote_candidate().ToSensitiveString(); |
992 | 996 |
993 was_ever_writable_ = true; | 997 was_ever_writable_ = true; |
998 writable_ = true; | |
994 MaybeSetupDtlsSrtp_n(); | 999 MaybeSetupDtlsSrtp_n(); |
pthatcher1
2017/03/21 07:07:06
Why did this have to change?
Taylor Brandstetter
2017/03/22 18:00:11
Because ShouldSetupDtlsSrtp_n now checks it. May w
joachim
2017/03/23 00:04:32
Right, added a comment for now.
| |
995 writable_ = true; | |
996 UpdateMediaSendRecvState(); | 1000 UpdateMediaSendRecvState(); |
997 } | 1001 } |
998 | 1002 |
999 void BaseChannel::SignalDtlsSrtpSetupFailure_n(bool rtcp) { | 1003 void BaseChannel::SignalDtlsSrtpSetupFailure_n(bool rtcp) { |
1000 RTC_DCHECK(network_thread_->IsCurrent()); | 1004 RTC_DCHECK(network_thread_->IsCurrent()); |
1001 invoker_.AsyncInvoke<void>( | 1005 invoker_.AsyncInvoke<void>( |
1002 RTC_FROM_HERE, signaling_thread(), | 1006 RTC_FROM_HERE, signaling_thread(), |
1003 Bind(&BaseChannel::SignalDtlsSrtpSetupFailure_s, this, rtcp)); | 1007 Bind(&BaseChannel::SignalDtlsSrtpSetupFailure_s, this, rtcp)); |
1004 } | 1008 } |
1005 | 1009 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1092 send_key = &client_write_key; | 1096 send_key = &client_write_key; |
1093 recv_key = &server_write_key; | 1097 recv_key = &server_write_key; |
1094 } | 1098 } |
1095 | 1099 |
1096 if (rtcp) { | 1100 if (rtcp) { |
1097 ret = srtp_filter_.SetRtcpParams(selected_crypto_suite, &(*send_key)[0], | 1101 ret = srtp_filter_.SetRtcpParams(selected_crypto_suite, &(*send_key)[0], |
1098 static_cast<int>(send_key->size()), | 1102 static_cast<int>(send_key->size()), |
1099 selected_crypto_suite, &(*recv_key)[0], | 1103 selected_crypto_suite, &(*recv_key)[0], |
1100 static_cast<int>(recv_key->size())); | 1104 static_cast<int>(recv_key->size())); |
1101 } else { | 1105 } else { |
1106 std::vector<int> send_encrypted_headers; | |
1107 std::vector<int> recv_encrypted_headers; | |
1108 | |
1109 // Send local extension header encrypted if the remote also uses it | |
1110 // encrypted and vice versa. | |
1111 for (const webrtc::RtpExtension& extension : rtp_local_encrypted_headers_) { | |
1112 if (FindHeaderExtension(rtp_remote_encrypted_headers_, extension.uri)) { | |
1113 send_encrypted_headers.push_back(extension.id); | |
1114 } | |
1115 } | |
1116 for (const webrtc::RtpExtension& extension : | |
1117 rtp_remote_encrypted_headers_) { | |
1118 if (FindHeaderExtension(rtp_local_encrypted_headers_, extension.uri)) { | |
1119 recv_encrypted_headers.push_back(extension.id); | |
1120 } | |
1121 } | |
pthatcher1
2017/03/21 07:07:06
Why not just pass in all header extensions and let
Taylor Brandstetter
2017/03/22 18:00:11
It looks like you're taking the intersection of rt
joachim
2017/03/23 00:04:33
The lists already contain only encrypted extension
joachim
2017/03/23 00:04:33
The ids of the extensions could be different for t
Taylor Brandstetter
2017/03/23 20:10:56
Ah, right. May be helpful to mention this in a com
joachim
2017/03/30 22:43:49
Done (in "SrtpFilter::GetSendRecvEncryptedHeaderEx
| |
1122 | |
1102 ret = srtp_filter_.SetRtpParams(selected_crypto_suite, &(*send_key)[0], | 1123 ret = srtp_filter_.SetRtpParams(selected_crypto_suite, &(*send_key)[0], |
1103 static_cast<int>(send_key->size()), | 1124 static_cast<int>(send_key->size()), |
1125 send_encrypted_headers, | |
1104 selected_crypto_suite, &(*recv_key)[0], | 1126 selected_crypto_suite, &(*recv_key)[0], |
1105 static_cast<int>(recv_key->size())); | 1127 static_cast<int>(recv_key->size()), |
1128 recv_encrypted_headers); | |
1106 } | 1129 } |
1107 | 1130 |
1108 if (!ret) { | 1131 if (!ret) { |
1109 LOG(LS_WARNING) << "DTLS-SRTP key installation failed"; | 1132 LOG(LS_WARNING) << "DTLS-SRTP key installation failed"; |
1110 } else { | 1133 } else { |
1111 dtls_keyed_ = true; | 1134 dtls_keyed_ = true; |
1112 UpdateTransportOverhead(); | 1135 UpdateTransportOverhead(); |
1113 } | 1136 } |
1114 return ret; | 1137 return ret; |
1115 } | 1138 } |
1116 | 1139 |
1117 void BaseChannel::MaybeSetupDtlsSrtp_n() { | 1140 bool BaseChannel::MaybeSetupDtlsSrtp_n() { |
1118 if (srtp_filter_.IsActive()) { | 1141 if (srtp_filter_.IsActive()) { |
1119 return; | 1142 return false; |
1143 } | |
1144 | |
1145 if (!writable_) { | |
1146 return false; | |
1147 } | |
1148 | |
1149 if (rtp_encrypted_headers_ready_ != kAllEncryptedHeadersReady) { | |
1150 return false; | |
pthatcher1
2017/03/21 07:07:06
It seems like it would be more clear to put this i
joachim
2017/03/23 00:04:33
Code has been removed in latest update.
| |
1120 } | 1151 } |
1121 | 1152 |
1122 if (!ShouldSetupDtlsSrtp_n()) { | 1153 if (!ShouldSetupDtlsSrtp_n()) { |
1123 return; | 1154 return false; |
1124 } | 1155 } |
1125 | 1156 |
1126 if (!SetupDtlsSrtp_n(false)) { | 1157 if (!SetupDtlsSrtp_n(false)) { |
1127 SignalDtlsSrtpSetupFailure_n(false); | 1158 SignalDtlsSrtpSetupFailure_n(false); |
1128 return; | 1159 return false; |
1129 } | 1160 } |
1130 | 1161 |
1131 if (rtcp_dtls_transport_) { | 1162 if (rtcp_dtls_transport_) { |
1132 if (!SetupDtlsSrtp_n(true)) { | 1163 if (!SetupDtlsSrtp_n(true)) { |
1133 SignalDtlsSrtpSetupFailure_n(true); | 1164 SignalDtlsSrtpSetupFailure_n(true); |
1134 return; | 1165 return false; |
1135 } | 1166 } |
1136 } | 1167 } |
1168 | |
1169 return true; | |
1137 } | 1170 } |
1138 | 1171 |
1139 void BaseChannel::ChannelNotWritable_n() { | 1172 void BaseChannel::ChannelNotWritable_n() { |
1140 RTC_DCHECK(network_thread_->IsCurrent()); | 1173 RTC_DCHECK(network_thread_->IsCurrent()); |
1141 if (!writable_) | 1174 if (!writable_) |
1142 return; | 1175 return; |
1143 | 1176 |
1144 LOG(LS_INFO) << "Channel not writable (" << content_name_ << ")"; | 1177 LOG(LS_INFO) << "Channel not writable (" << content_name_ << ")"; |
1145 writable_ = false; | 1178 writable_ = false; |
1146 UpdateMediaSendRecvState(); | 1179 UpdateMediaSendRecvState(); |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1473 FindHeaderExtension(extensions, webrtc::RtpExtension::kAbsSendTimeUri); | 1506 FindHeaderExtension(extensions, webrtc::RtpExtension::kAbsSendTimeUri); |
1474 int rtp_abs_sendtime_extn_id = | 1507 int rtp_abs_sendtime_extn_id = |
1475 send_time_extension ? send_time_extension->id : -1; | 1508 send_time_extension ? send_time_extension->id : -1; |
1476 invoker_.AsyncInvoke<void>( | 1509 invoker_.AsyncInvoke<void>( |
1477 RTC_FROM_HERE, network_thread_, | 1510 RTC_FROM_HERE, network_thread_, |
1478 Bind(&BaseChannel::CacheRtpAbsSendTimeHeaderExtension_n, this, | 1511 Bind(&BaseChannel::CacheRtpAbsSendTimeHeaderExtension_n, this, |
1479 rtp_abs_sendtime_extn_id)); | 1512 rtp_abs_sendtime_extn_id)); |
1480 #endif | 1513 #endif |
1481 } | 1514 } |
1482 | 1515 |
1516 void BaseChannel::PrepareHeaderExtensions_w(ContentSource source, | |
1517 const std::vector<webrtc::RtpExtension>& extensions) { | |
1518 std::vector<webrtc::RtpExtension> encrypted_headers; | |
1519 for (const webrtc::RtpExtension& extension : extensions) { | |
1520 if (extension.encrypted) { | |
1521 LOG(LS_INFO) << "Using " << source << " encrypted extension: " | |
1522 << extension.ToString(); | |
1523 encrypted_headers.push_back(extension); | |
1524 } | |
1525 } | |
1526 | |
1527 invoker_.AsyncInvoke<void>( | |
1528 RTC_FROM_HERE, network_thread_, | |
1529 Bind(&BaseChannel::PrepareHeaderExtensions_n, this, source, | |
1530 encrypted_headers)); | |
Taylor Brandstetter
2017/03/22 18:00:10
Is there a reason why PrepareHeaderExtensions_w is
joachim
2017/03/23 00:04:32
I wanted to do the actual "work" (i.e. filtering t
Taylor Brandstetter
2017/04/01 00:28:58
In this case the work is pretty trivial, so I woul
joachim
2017/04/17 10:46:09
Ok, the whole separated "preparing" code has been
| |
1531 } | |
1532 | |
1483 void BaseChannel::CacheRtpAbsSendTimeHeaderExtension_n( | 1533 void BaseChannel::CacheRtpAbsSendTimeHeaderExtension_n( |
1484 int rtp_abs_sendtime_extn_id) { | 1534 int rtp_abs_sendtime_extn_id) { |
1485 rtp_abs_sendtime_extn_id_ = rtp_abs_sendtime_extn_id; | 1535 rtp_abs_sendtime_extn_id_ = rtp_abs_sendtime_extn_id; |
1486 } | 1536 } |
1487 | 1537 |
1538 void BaseChannel::PrepareHeaderExtensions_n(ContentSource source, | |
Taylor Brandstetter
2017/03/22 18:00:10
Can this be done in SetRtpTransportParameters_n, t
joachim
2017/03/23 00:04:33
Done.
| |
1539 const std::vector<webrtc::RtpExtension> encrypted_headers) { | |
1540 if (source == CS_LOCAL) { | |
1541 rtp_local_encrypted_headers_ = encrypted_headers; | |
1542 rtp_encrypted_headers_ready_ |= kLocalEncryptedHeadersReady; | |
pthatcher1
2017/03/21 07:07:06
I don't understand why we need this extra state.
joachim
2017/03/23 00:04:32
Right, and no longer needed with the latest change
| |
1543 } else { | |
1544 rtp_remote_encrypted_headers_ = encrypted_headers; | |
1545 rtp_encrypted_headers_ready_ |= kRemoteEncryptedHeadersReady; | |
1546 } | |
1547 if (MaybeSetupDtlsSrtp_n()) { | |
Taylor Brandstetter
2017/03/22 18:00:11
If the encrypted headers are only set when SRTP is
joachim
2017/03/23 00:04:33
With the change to set the encrypted headers throu
Taylor Brandstetter
2017/03/23 20:10:56
Even though they're set through SetRtpTransportPar
joachim
2017/03/30 22:43:49
Adding/changing encrypted extensions is now suppor
| |
1548 UpdateMediaSendRecvState(); | |
pthatcher1
2017/03/21 07:07:06
This should only be necessary if IsReadyToSendMedi
joachim
2017/03/23 00:04:32
This is no longer needed with the latest changes.
| |
1549 } | |
1550 } | |
1551 | |
1488 void BaseChannel::OnMessage(rtc::Message *pmsg) { | 1552 void BaseChannel::OnMessage(rtc::Message *pmsg) { |
1489 TRACE_EVENT0("webrtc", "BaseChannel::OnMessage"); | 1553 TRACE_EVENT0("webrtc", "BaseChannel::OnMessage"); |
1490 switch (pmsg->message_id) { | 1554 switch (pmsg->message_id) { |
1491 case MSG_SEND_RTP_PACKET: | 1555 case MSG_SEND_RTP_PACKET: |
1492 case MSG_SEND_RTCP_PACKET: { | 1556 case MSG_SEND_RTCP_PACKET: { |
1493 RTC_DCHECK(network_thread_->IsCurrent()); | 1557 RTC_DCHECK(network_thread_->IsCurrent()); |
1494 SendPacketMessageData* data = | 1558 SendPacketMessageData* data = |
1495 static_cast<SendPacketMessageData*>(pmsg->pdata); | 1559 static_cast<SendPacketMessageData*>(pmsg->pdata); |
1496 bool rtcp = pmsg->message_id == MSG_SEND_RTCP_PACKET; | 1560 bool rtcp = pmsg->message_id == MSG_SEND_RTCP_PACKET; |
1497 SendPacket(rtcp, &data->packet, data->options); | 1561 SendPacket(rtcp, &data->packet, data->options); |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1797 LOG(LS_INFO) << "Setting local voice description"; | 1861 LOG(LS_INFO) << "Setting local voice description"; |
1798 | 1862 |
1799 const AudioContentDescription* audio = | 1863 const AudioContentDescription* audio = |
1800 static_cast<const AudioContentDescription*>(content); | 1864 static_cast<const AudioContentDescription*>(content); |
1801 RTC_DCHECK(audio != NULL); | 1865 RTC_DCHECK(audio != NULL); |
1802 if (!audio) { | 1866 if (!audio) { |
1803 SafeSetError("Can't find audio content in local description.", error_desc); | 1867 SafeSetError("Can't find audio content in local description.", error_desc); |
1804 return false; | 1868 return false; |
1805 } | 1869 } |
1806 | 1870 |
1871 PrepareHeaderExtensions_w(CS_LOCAL, audio->rtp_header_extensions()); | |
1872 | |
1807 if (!SetRtpTransportParameters(content, action, CS_LOCAL, error_desc)) { | 1873 if (!SetRtpTransportParameters(content, action, CS_LOCAL, error_desc)) { |
1808 return false; | 1874 return false; |
1809 } | 1875 } |
1810 | 1876 |
1811 AudioRecvParameters recv_params = last_recv_params_; | 1877 AudioRecvParameters recv_params = last_recv_params_; |
1812 RtpParametersFromMediaDescription(audio, &recv_params); | 1878 RtpParametersFromMediaDescription(audio, &recv_params); |
1813 if (!media_channel()->SetRecvParameters(recv_params)) { | 1879 if (!media_channel()->SetRecvParameters(recv_params)) { |
1814 SafeSetError("Failed to set local audio description recv parameters.", | 1880 SafeSetError("Failed to set local audio description recv parameters.", |
1815 error_desc); | 1881 error_desc); |
1816 return false; | 1882 return false; |
(...skipping 25 matching lines...) Expand all Loading... | |
1842 LOG(LS_INFO) << "Setting remote voice description"; | 1908 LOG(LS_INFO) << "Setting remote voice description"; |
1843 | 1909 |
1844 const AudioContentDescription* audio = | 1910 const AudioContentDescription* audio = |
1845 static_cast<const AudioContentDescription*>(content); | 1911 static_cast<const AudioContentDescription*>(content); |
1846 RTC_DCHECK(audio != NULL); | 1912 RTC_DCHECK(audio != NULL); |
1847 if (!audio) { | 1913 if (!audio) { |
1848 SafeSetError("Can't find audio content in remote description.", error_desc); | 1914 SafeSetError("Can't find audio content in remote description.", error_desc); |
1849 return false; | 1915 return false; |
1850 } | 1916 } |
1851 | 1917 |
1918 PrepareHeaderExtensions_w(CS_REMOTE, audio->rtp_header_extensions()); | |
1919 | |
1852 if (!SetRtpTransportParameters(content, action, CS_REMOTE, error_desc)) { | 1920 if (!SetRtpTransportParameters(content, action, CS_REMOTE, error_desc)) { |
1853 return false; | 1921 return false; |
1854 } | 1922 } |
1855 | 1923 |
1856 AudioSendParameters send_params = last_send_params_; | 1924 AudioSendParameters send_params = last_send_params_; |
1857 RtpSendParametersFromMediaDescription(audio, &send_params); | 1925 RtpSendParametersFromMediaDescription(audio, &send_params); |
1858 if (audio->agc_minus_10db()) { | 1926 if (audio->agc_minus_10db()) { |
1859 send_params.options.adjust_agc_delta = rtc::Optional<int>(kAgcMinus10db); | 1927 send_params.options.adjust_agc_delta = rtc::Optional<int>(kAgcMinus10db); |
1860 } | 1928 } |
1861 | 1929 |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2075 LOG(LS_INFO) << "Setting local video description"; | 2143 LOG(LS_INFO) << "Setting local video description"; |
2076 | 2144 |
2077 const VideoContentDescription* video = | 2145 const VideoContentDescription* video = |
2078 static_cast<const VideoContentDescription*>(content); | 2146 static_cast<const VideoContentDescription*>(content); |
2079 RTC_DCHECK(video != NULL); | 2147 RTC_DCHECK(video != NULL); |
2080 if (!video) { | 2148 if (!video) { |
2081 SafeSetError("Can't find video content in local description.", error_desc); | 2149 SafeSetError("Can't find video content in local description.", error_desc); |
2082 return false; | 2150 return false; |
2083 } | 2151 } |
2084 | 2152 |
2153 PrepareHeaderExtensions_w(CS_LOCAL, video->rtp_header_extensions()); | |
2154 | |
2085 if (!SetRtpTransportParameters(content, action, CS_LOCAL, error_desc)) { | 2155 if (!SetRtpTransportParameters(content, action, CS_LOCAL, error_desc)) { |
2086 return false; | 2156 return false; |
2087 } | 2157 } |
2088 | 2158 |
2089 VideoRecvParameters recv_params = last_recv_params_; | 2159 VideoRecvParameters recv_params = last_recv_params_; |
2090 RtpParametersFromMediaDescription(video, &recv_params); | 2160 RtpParametersFromMediaDescription(video, &recv_params); |
2091 if (!media_channel()->SetRecvParameters(recv_params)) { | 2161 if (!media_channel()->SetRecvParameters(recv_params)) { |
2092 SafeSetError("Failed to set local video description recv parameters.", | 2162 SafeSetError("Failed to set local video description recv parameters.", |
2093 error_desc); | 2163 error_desc); |
2094 return false; | 2164 return false; |
(...skipping 25 matching lines...) Expand all Loading... | |
2120 LOG(LS_INFO) << "Setting remote video description"; | 2190 LOG(LS_INFO) << "Setting remote video description"; |
2121 | 2191 |
2122 const VideoContentDescription* video = | 2192 const VideoContentDescription* video = |
2123 static_cast<const VideoContentDescription*>(content); | 2193 static_cast<const VideoContentDescription*>(content); |
2124 RTC_DCHECK(video != NULL); | 2194 RTC_DCHECK(video != NULL); |
2125 if (!video) { | 2195 if (!video) { |
2126 SafeSetError("Can't find video content in remote description.", error_desc); | 2196 SafeSetError("Can't find video content in remote description.", error_desc); |
2127 return false; | 2197 return false; |
2128 } | 2198 } |
2129 | 2199 |
2200 PrepareHeaderExtensions_w(CS_REMOTE, video->rtp_header_extensions()); | |
2201 | |
2130 if (!SetRtpTransportParameters(content, action, CS_REMOTE, error_desc)) { | 2202 if (!SetRtpTransportParameters(content, action, CS_REMOTE, error_desc)) { |
2131 return false; | 2203 return false; |
2132 } | 2204 } |
2133 | 2205 |
2134 VideoSendParameters send_params = last_send_params_; | 2206 VideoSendParameters send_params = last_send_params_; |
2135 RtpSendParametersFromMediaDescription(video, &send_params); | 2207 RtpSendParametersFromMediaDescription(video, &send_params); |
2136 if (video->conference_mode()) { | 2208 if (video->conference_mode()) { |
2137 send_params.conference_mode = true; | 2209 send_params.conference_mode = true; |
2138 } | 2210 } |
2139 | 2211 |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2465 signaling_thread()->Post(RTC_FROM_HERE, this, MSG_READYTOSENDDATA, | 2537 signaling_thread()->Post(RTC_FROM_HERE, this, MSG_READYTOSENDDATA, |
2466 new DataChannelReadyToSendMessageData(writable)); | 2538 new DataChannelReadyToSendMessageData(writable)); |
2467 } | 2539 } |
2468 | 2540 |
2469 void RtpDataChannel::GetSrtpCryptoSuites_n( | 2541 void RtpDataChannel::GetSrtpCryptoSuites_n( |
2470 std::vector<int>* crypto_suites) const { | 2542 std::vector<int>* crypto_suites) const { |
2471 GetSupportedDataCryptoSuites(crypto_options(), crypto_suites); | 2543 GetSupportedDataCryptoSuites(crypto_options(), crypto_suites); |
2472 } | 2544 } |
2473 | 2545 |
2474 } // namespace cricket | 2546 } // namespace cricket |
OLD | NEW |