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 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
483 rtc::ToString(rtc::CreateRandomId64() & LLONG_MAX), | 483 rtc::ToString(rtc::CreateRandomId64() & LLONG_MAX), |
484 cricket::NS_JINGLE_RTP, | 484 cricket::NS_JINGLE_RTP, |
485 false), | 485 false), |
486 // RFC 3264: The numeric value of the session id and version in the | 486 // RFC 3264: The numeric value of the session id and version in the |
487 // o line MUST be representable with a "64 bit signed integer". | 487 // o line MUST be representable with a "64 bit signed integer". |
488 // Due to this constraint session id |sid_| is max limited to LLONG_MAX. | 488 // Due to this constraint session id |sid_| is max limited to LLONG_MAX. |
489 channel_manager_(channel_manager), | 489 channel_manager_(channel_manager), |
490 mediastream_signaling_(mediastream_signaling), | 490 mediastream_signaling_(mediastream_signaling), |
491 ice_observer_(NULL), | 491 ice_observer_(NULL), |
492 ice_connection_state_(PeerConnectionInterface::kIceConnectionNew), | 492 ice_connection_state_(PeerConnectionInterface::kIceConnectionNew), |
493 ice_connection_receiving_(true), | |
493 older_version_remote_peer_(false), | 494 older_version_remote_peer_(false), |
494 dtls_enabled_(false), | 495 dtls_enabled_(false), |
495 data_channel_type_(cricket::DCT_NONE), | 496 data_channel_type_(cricket::DCT_NONE), |
496 ice_restart_latch_(new IceRestartAnswerLatch), | 497 ice_restart_latch_(new IceRestartAnswerLatch), |
497 metrics_observer_(NULL) { | 498 metrics_observer_(NULL) { |
498 } | 499 } |
499 | 500 |
500 WebRtcSession::~WebRtcSession() { | 501 WebRtcSession::~WebRtcSession() { |
501 // Destroy video_channel_ first since it may have a pointer to the | 502 // Destroy video_channel_ first since it may have a pointer to the |
502 // voice_channel_. | 503 // voice_channel_. |
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1399 ReportNegotiatedCiphers(stats); | 1400 ReportNegotiatedCiphers(stats); |
1400 } | 1401 } |
1401 } | 1402 } |
1402 } | 1403 } |
1403 | 1404 |
1404 void WebRtcSession::OnTransportFailed(cricket::Transport* transport) { | 1405 void WebRtcSession::OnTransportFailed(cricket::Transport* transport) { |
1405 ASSERT(signaling_thread()->IsCurrent()); | 1406 ASSERT(signaling_thread()->IsCurrent()); |
1406 SetIceConnectionState(PeerConnectionInterface::kIceConnectionFailed); | 1407 SetIceConnectionState(PeerConnectionInterface::kIceConnectionFailed); |
1407 } | 1408 } |
1408 | 1409 |
1410 void WebRtcSession::OnTransportReceiving(cricket::Transport* transp) { | |
pthatcher1
2015/07/07 20:49:55
transp?
honghaiz3
2015/08/05 23:56:57
The parameter is not used and I wanted to avoid th
| |
1411 ASSERT(signaling_thread()->IsCurrent()); | |
1412 // The ice connection is considered not_receiving if every transport is | |
1413 // not receiving on any channels. | |
1414 bool not_receiving = true; | |
1415 for (const auto& kv : transport_proxies()) { | |
1416 cricket::Transport* transport = kv.second->impl(); | |
1417 if (transport && transport->HasChannels()) { | |
1418 not_receiving &= transport->no_channel_receiving(); | |
1419 } | |
1420 } | |
1421 SetIceConnectionReceiving(!not_receiving); | |
pthatcher1
2015/07/07 20:49:55
Actually, now that I see it, I think it would be m
honghaiz3
2015/08/05 23:56:57
Done. This is better. Thanks!
| |
1422 } | |
1423 | |
1424 void WebRtcSession::SetIceConnectionReceiving(bool receiving) { | |
1425 if (ice_connection_receiving_ == receiving) { | |
1426 return; | |
1427 } | |
1428 ice_connection_receiving_ = receiving; | |
1429 if (ice_observer_) { | |
1430 ice_observer_->OnIceConnectionReceivingChange(receiving); | |
1431 } | |
1432 } | |
1433 | |
1409 void WebRtcSession::OnTransportProxyCandidatesReady( | 1434 void WebRtcSession::OnTransportProxyCandidatesReady( |
1410 cricket::TransportProxy* proxy, const cricket::Candidates& candidates) { | 1435 cricket::TransportProxy* proxy, const cricket::Candidates& candidates) { |
1411 ASSERT(signaling_thread()->IsCurrent()); | 1436 ASSERT(signaling_thread()->IsCurrent()); |
1412 ProcessNewLocalCandidate(proxy->content_name(), candidates); | 1437 ProcessNewLocalCandidate(proxy->content_name(), candidates); |
1413 } | 1438 } |
1414 | 1439 |
1415 void WebRtcSession::OnCandidatesAllocationDone() { | 1440 void WebRtcSession::OnCandidatesAllocationDone() { |
1416 ASSERT(signaling_thread()->IsCurrent()); | 1441 ASSERT(signaling_thread()->IsCurrent()); |
1417 if (ice_observer_) { | 1442 if (ice_observer_) { |
1418 ice_observer_->OnIceGatheringChange( | 1443 ice_observer_->OnIceGatheringChange( |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1933 | 1958 |
1934 if (!srtp_cipher.empty()) { | 1959 if (!srtp_cipher.empty()) { |
1935 metrics_observer_->AddHistogramSample(srtp_name, srtp_cipher); | 1960 metrics_observer_->AddHistogramSample(srtp_name, srtp_cipher); |
1936 } | 1961 } |
1937 if (!ssl_cipher.empty()) { | 1962 if (!ssl_cipher.empty()) { |
1938 metrics_observer_->AddHistogramSample(ssl_name, ssl_cipher); | 1963 metrics_observer_->AddHistogramSample(ssl_name, ssl_cipher); |
1939 } | 1964 } |
1940 } | 1965 } |
1941 | 1966 |
1942 } // namespace webrtc | 1967 } // namespace webrtc |
OLD | NEW |