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* transport) { | |
1411 ASSERT(signaling_thread()->IsCurrent()); | |
1412 if (transport->HasChannels()) { | |
1413 SetIceConnectionReceiving(transport->no_channel_receiving()); | |
pthatcher1
2015/07/06 22:04:47
The session is receiving if no channel is receivin
honghaiz3
2015/08/05 23:56:57
Done. Modified as discussed.
| |
1414 } | |
1415 } | |
1416 | |
1417 void WebRtcSession::SetIceConnectionReceiving(bool receiving) { | |
1418 if (ice_connection_receiving_ == receiving) { | |
1419 return; | |
1420 } | |
1421 ice_connection_receiving_ = receiving; | |
1422 if (ice_observer_) { | |
1423 ice_observer_->OnIceConnectionReceivingChange(receiving); | |
1424 } | |
1425 } | |
1426 | |
1409 void WebRtcSession::OnTransportProxyCandidatesReady( | 1427 void WebRtcSession::OnTransportProxyCandidatesReady( |
1410 cricket::TransportProxy* proxy, const cricket::Candidates& candidates) { | 1428 cricket::TransportProxy* proxy, const cricket::Candidates& candidates) { |
1411 ASSERT(signaling_thread()->IsCurrent()); | 1429 ASSERT(signaling_thread()->IsCurrent()); |
1412 ProcessNewLocalCandidate(proxy->content_name(), candidates); | 1430 ProcessNewLocalCandidate(proxy->content_name(), candidates); |
1413 } | 1431 } |
1414 | 1432 |
1415 void WebRtcSession::OnCandidatesAllocationDone() { | 1433 void WebRtcSession::OnCandidatesAllocationDone() { |
1416 ASSERT(signaling_thread()->IsCurrent()); | 1434 ASSERT(signaling_thread()->IsCurrent()); |
1417 if (ice_observer_) { | 1435 if (ice_observer_) { |
1418 ice_observer_->OnIceGatheringChange( | 1436 ice_observer_->OnIceGatheringChange( |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1933 | 1951 |
1934 if (!srtp_cipher.empty()) { | 1952 if (!srtp_cipher.empty()) { |
1935 metrics_observer_->AddHistogramSample(srtp_name, srtp_cipher); | 1953 metrics_observer_->AddHistogramSample(srtp_name, srtp_cipher); |
1936 } | 1954 } |
1937 if (!ssl_cipher.empty()) { | 1955 if (!ssl_cipher.empty()) { |
1938 metrics_observer_->AddHistogramSample(ssl_name, ssl_cipher); | 1956 metrics_observer_->AddHistogramSample(ssl_name, ssl_cipher); |
1939 } | 1957 } |
1940 } | 1958 } |
1941 | 1959 |
1942 } // namespace webrtc | 1960 } // namespace webrtc |
OLD | NEW |