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...) 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...) 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* transport) { |
| 1411 ASSERT(signaling_thread()->IsCurrent()); |
| 1412 // The ice connection is considered receiving if at least one transport is |
| 1413 // receiving on any channels. |
| 1414 bool receiving = false; |
| 1415 for (const auto& kv : transport_proxies()) { |
| 1416 cricket::Transport* transport = kv.second->impl(); |
| 1417 if (transport && transport->any_channel_receiving()) { |
| 1418 receiving = true; |
| 1419 break; |
| 1420 } |
| 1421 } |
| 1422 SetIceConnectionReceiving(receiving); |
| 1423 } |
| 1424 |
| 1425 void WebRtcSession::SetIceConnectionReceiving(bool receiving) { |
| 1426 if (ice_connection_receiving_ == receiving) { |
| 1427 return; |
| 1428 } |
| 1429 ice_connection_receiving_ = receiving; |
| 1430 if (ice_observer_) { |
| 1431 ice_observer_->OnIceConnectionReceivingChange(receiving); |
| 1432 } |
| 1433 } |
| 1434 |
1409 void WebRtcSession::OnTransportProxyCandidatesReady( | 1435 void WebRtcSession::OnTransportProxyCandidatesReady( |
1410 cricket::TransportProxy* proxy, const cricket::Candidates& candidates) { | 1436 cricket::TransportProxy* proxy, const cricket::Candidates& candidates) { |
1411 ASSERT(signaling_thread()->IsCurrent()); | 1437 ASSERT(signaling_thread()->IsCurrent()); |
1412 ProcessNewLocalCandidate(proxy->content_name(), candidates); | 1438 ProcessNewLocalCandidate(proxy->content_name(), candidates); |
1413 } | 1439 } |
1414 | 1440 |
1415 void WebRtcSession::OnCandidatesAllocationDone() { | 1441 void WebRtcSession::OnCandidatesAllocationDone() { |
1416 ASSERT(signaling_thread()->IsCurrent()); | 1442 ASSERT(signaling_thread()->IsCurrent()); |
1417 if (ice_observer_) { | 1443 if (ice_observer_) { |
1418 ice_observer_->OnIceGatheringChange( | 1444 ice_observer_->OnIceGatheringChange( |
(...skipping 514 matching lines...) Loading... |
1933 | 1959 |
1934 if (!srtp_cipher.empty()) { | 1960 if (!srtp_cipher.empty()) { |
1935 metrics_observer_->AddHistogramSample(srtp_name, srtp_cipher); | 1961 metrics_observer_->AddHistogramSample(srtp_name, srtp_cipher); |
1936 } | 1962 } |
1937 if (!ssl_cipher.empty()) { | 1963 if (!ssl_cipher.empty()) { |
1938 metrics_observer_->AddHistogramSample(ssl_name, ssl_cipher); | 1964 metrics_observer_->AddHistogramSample(ssl_name, ssl_cipher); |
1939 } | 1965 } |
1940 } | 1966 } |
1941 | 1967 |
1942 } // namespace webrtc | 1968 } // namespace webrtc |
OLD | NEW |