| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 | 1156 |
| 1157 const SessionDescriptionInterface* PeerConnection::remote_description() const { | 1157 const SessionDescriptionInterface* PeerConnection::remote_description() const { |
| 1158 return session_->remote_description(); | 1158 return session_->remote_description(); |
| 1159 } | 1159 } |
| 1160 | 1160 |
| 1161 void PeerConnection::Close() { | 1161 void PeerConnection::Close() { |
| 1162 // Update stats here so that we have the most recent stats for tracks and | 1162 // Update stats here so that we have the most recent stats for tracks and |
| 1163 // streams before the channels are closed. | 1163 // streams before the channels are closed. |
| 1164 stats_->UpdateStats(kStatsOutputLevelStandard); | 1164 stats_->UpdateStats(kStatsOutputLevelStandard); |
| 1165 | 1165 |
| 1166 session_->Terminate(); | 1166 session_->Close(); |
| 1167 } | 1167 } |
| 1168 | 1168 |
| 1169 void PeerConnection::OnSessionStateChange(cricket::BaseSession* /*session*/, | 1169 void PeerConnection::OnSessionStateChange(WebRtcSession* /*session*/, |
| 1170 cricket::BaseSession::State state) { | 1170 WebRtcSession::State state) { |
| 1171 switch (state) { | 1171 switch (state) { |
| 1172 case cricket::BaseSession::STATE_INIT: | 1172 case WebRtcSession::STATE_INIT: |
| 1173 ChangeSignalingState(PeerConnectionInterface::kStable); | 1173 ChangeSignalingState(PeerConnectionInterface::kStable); |
| 1174 break; | 1174 break; |
| 1175 case cricket::BaseSession::STATE_SENTINITIATE: | 1175 case WebRtcSession::STATE_SENTOFFER: |
| 1176 ChangeSignalingState(PeerConnectionInterface::kHaveLocalOffer); | 1176 ChangeSignalingState(PeerConnectionInterface::kHaveLocalOffer); |
| 1177 break; | 1177 break; |
| 1178 case cricket::BaseSession::STATE_SENTPRACCEPT: | 1178 case WebRtcSession::STATE_SENTPRANSWER: |
| 1179 ChangeSignalingState(PeerConnectionInterface::kHaveLocalPrAnswer); | 1179 ChangeSignalingState(PeerConnectionInterface::kHaveLocalPrAnswer); |
| 1180 break; | 1180 break; |
| 1181 case cricket::BaseSession::STATE_RECEIVEDINITIATE: | 1181 case WebRtcSession::STATE_RECEIVEDOFFER: |
| 1182 ChangeSignalingState(PeerConnectionInterface::kHaveRemoteOffer); | 1182 ChangeSignalingState(PeerConnectionInterface::kHaveRemoteOffer); |
| 1183 break; | 1183 break; |
| 1184 case cricket::BaseSession::STATE_RECEIVEDPRACCEPT: | 1184 case WebRtcSession::STATE_RECEIVEDPRANSWER: |
| 1185 ChangeSignalingState(PeerConnectionInterface::kHaveRemotePrAnswer); | 1185 ChangeSignalingState(PeerConnectionInterface::kHaveRemotePrAnswer); |
| 1186 break; | 1186 break; |
| 1187 case cricket::BaseSession::STATE_SENTACCEPT: | 1187 case WebRtcSession::STATE_INPROGRESS: |
| 1188 case cricket::BaseSession::STATE_RECEIVEDACCEPT: | |
| 1189 ChangeSignalingState(PeerConnectionInterface::kStable); | 1188 ChangeSignalingState(PeerConnectionInterface::kStable); |
| 1190 break; | 1189 break; |
| 1191 case cricket::BaseSession::STATE_RECEIVEDTERMINATE: | 1190 case WebRtcSession::STATE_CLOSED: |
| 1192 ChangeSignalingState(PeerConnectionInterface::kClosed); | 1191 ChangeSignalingState(PeerConnectionInterface::kClosed); |
| 1193 break; | 1192 break; |
| 1194 default: | 1193 default: |
| 1195 break; | 1194 break; |
| 1196 } | 1195 } |
| 1197 } | 1196 } |
| 1198 | 1197 |
| 1199 void PeerConnection::OnMessage(rtc::Message* msg) { | 1198 void PeerConnection::OnMessage(rtc::Message* msg) { |
| 1200 switch (msg->message_id) { | 1199 switch (msg->message_id) { |
| 1201 case MSG_SET_SESSIONDESCRIPTION_SUCCESS: { | 1200 case MSG_SET_SESSIONDESCRIPTION_SUCCESS: { |
| (...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1950 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { | 1949 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { |
| 1951 for (const auto& channel : sctp_data_channels_) { | 1950 for (const auto& channel : sctp_data_channels_) { |
| 1952 if (channel->id() == sid) { | 1951 if (channel->id() == sid) { |
| 1953 return channel; | 1952 return channel; |
| 1954 } | 1953 } |
| 1955 } | 1954 } |
| 1956 return nullptr; | 1955 return nullptr; |
| 1957 } | 1956 } |
| 1958 | 1957 |
| 1959 } // namespace webrtc | 1958 } // namespace webrtc |
| OLD | NEW |