| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 | 313 |
| 314 void DecrementUsrSctpUsageCount() { | 314 void DecrementUsrSctpUsageCount() { |
| 315 rtc::GlobalLockScope lock(&g_usrsctp_lock_); | 315 rtc::GlobalLockScope lock(&g_usrsctp_lock_); |
| 316 --g_usrsctp_usage_count; | 316 --g_usrsctp_usage_count; |
| 317 if (!g_usrsctp_usage_count) { | 317 if (!g_usrsctp_usage_count) { |
| 318 UninitializeUsrSctp(); | 318 UninitializeUsrSctp(); |
| 319 } | 319 } |
| 320 } | 320 } |
| 321 | 321 |
| 322 DataCodec GetSctpDataCodec() { | 322 DataCodec GetSctpDataCodec() { |
| 323 DataCodec codec(kGoogleSctpDataCodecId, kGoogleSctpDataCodecName); | 323 DataCodec codec(kGoogleSctpDataCodecPlType, kGoogleSctpDataCodecName); |
| 324 codec.SetParam(kCodecParamPort, kSctpDefaultPort); | 324 codec.SetParam(kCodecParamPort, kSctpDefaultPort); |
| 325 return codec; | 325 return codec; |
| 326 } | 326 } |
| 327 | 327 |
| 328 } // namespace | 328 } // namespace |
| 329 | 329 |
| 330 SctpDataEngine::SctpDataEngine() : codecs_(1, GetSctpDataCodec()) {} | 330 SctpDataEngine::SctpDataEngine() : codecs_(1, GetSctpDataCodec()) {} |
| 331 | 331 |
| 332 SctpDataEngine::~SctpDataEngine() {} | 332 SctpDataEngine::~SctpDataEngine() {} |
| 333 | 333 |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 978 *dest = rtc::FromString<int>(value); | 978 *dest = rtc::FromString<int>(value); |
| 979 return true; | 979 return true; |
| 980 } | 980 } |
| 981 } | 981 } |
| 982 } | 982 } |
| 983 return false; | 983 return false; |
| 984 } | 984 } |
| 985 | 985 |
| 986 bool SctpDataMediaChannel::SetSendCodecs(const std::vector<DataCodec>& codecs) { | 986 bool SctpDataMediaChannel::SetSendCodecs(const std::vector<DataCodec>& codecs) { |
| 987 return GetCodecIntParameter( | 987 return GetCodecIntParameter( |
| 988 codecs, kGoogleSctpDataCodecId, kGoogleSctpDataCodecName, kCodecParamPort, | 988 codecs, kGoogleSctpDataCodecPlType, kGoogleSctpDataCodecName, |
| 989 &remote_port_); | 989 kCodecParamPort, &remote_port_); |
| 990 } | 990 } |
| 991 | 991 |
| 992 bool SctpDataMediaChannel::SetRecvCodecs(const std::vector<DataCodec>& codecs) { | 992 bool SctpDataMediaChannel::SetRecvCodecs(const std::vector<DataCodec>& codecs) { |
| 993 return GetCodecIntParameter( | 993 return GetCodecIntParameter( |
| 994 codecs, kGoogleSctpDataCodecId, kGoogleSctpDataCodecName, kCodecParamPort, | 994 codecs, kGoogleSctpDataCodecPlType, kGoogleSctpDataCodecName, |
| 995 &local_port_); | 995 kCodecParamPort, &local_port_); |
| 996 } | 996 } |
| 997 | 997 |
| 998 void SctpDataMediaChannel::OnPacketFromSctpToNetwork( | 998 void SctpDataMediaChannel::OnPacketFromSctpToNetwork( |
| 999 rtc::CopyOnWriteBuffer* buffer) { | 999 rtc::CopyOnWriteBuffer* buffer) { |
| 1000 if (buffer->size() > (kSctpMtu)) { | 1000 if (buffer->size() > (kSctpMtu)) { |
| 1001 LOG(LS_ERROR) << debug_name_ << "->OnPacketFromSctpToNetwork(...): " | 1001 LOG(LS_ERROR) << debug_name_ << "->OnPacketFromSctpToNetwork(...): " |
| 1002 << "SCTP seems to have made a packet that is bigger " | 1002 << "SCTP seems to have made a packet that is bigger " |
| 1003 << "than its official MTU: " << buffer->size() | 1003 << "than its official MTU: " << buffer->size() |
| 1004 << " vs max of " << kSctpMtu; | 1004 << " vs max of " << kSctpMtu; |
| 1005 } | 1005 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1057 } | 1057 } |
| 1058 case MSG_SCTPOUTBOUNDPACKET: { | 1058 case MSG_SCTPOUTBOUNDPACKET: { |
| 1059 std::unique_ptr<OutboundPacketMessage> pdata( | 1059 std::unique_ptr<OutboundPacketMessage> pdata( |
| 1060 static_cast<OutboundPacketMessage*>(msg->pdata)); | 1060 static_cast<OutboundPacketMessage*>(msg->pdata)); |
| 1061 OnPacketFromSctpToNetwork(pdata->data().get()); | 1061 OnPacketFromSctpToNetwork(pdata->data().get()); |
| 1062 break; | 1062 break; |
| 1063 } | 1063 } |
| 1064 } | 1064 } |
| 1065 } | 1065 } |
| 1066 } // namespace cricket | 1066 } // namespace cricket |
| OLD | NEW |