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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 session_->SignalVoiceChannelDestroyed.connect( | 656 session_->SignalVoiceChannelDestroyed.connect( |
657 this, &PeerConnection::OnVoiceChannelDestroyed); | 657 this, &PeerConnection::OnVoiceChannelDestroyed); |
658 session_->SignalVideoChannelDestroyed.connect( | 658 session_->SignalVideoChannelDestroyed.connect( |
659 this, &PeerConnection::OnVideoChannelDestroyed); | 659 this, &PeerConnection::OnVideoChannelDestroyed); |
660 session_->SignalDataChannelCreated.connect( | 660 session_->SignalDataChannelCreated.connect( |
661 this, &PeerConnection::OnDataChannelCreated); | 661 this, &PeerConnection::OnDataChannelCreated); |
662 session_->SignalDataChannelDestroyed.connect( | 662 session_->SignalDataChannelDestroyed.connect( |
663 this, &PeerConnection::OnDataChannelDestroyed); | 663 this, &PeerConnection::OnDataChannelDestroyed); |
664 session_->SignalDataChannelOpenMessage.connect( | 664 session_->SignalDataChannelOpenMessage.connect( |
665 this, &PeerConnection::OnDataChannelOpenMessage); | 665 this, &PeerConnection::OnDataChannelOpenMessage); |
| 666 session_->SignalFirstPacketReceived.connect( |
| 667 this, &PeerConnection::OnFirstPacketReceived); |
666 return true; | 668 return true; |
667 } | 669 } |
668 | 670 |
669 rtc::scoped_refptr<StreamCollectionInterface> | 671 rtc::scoped_refptr<StreamCollectionInterface> |
670 PeerConnection::local_streams() { | 672 PeerConnection::local_streams() { |
671 return local_streams_; | 673 return local_streams_; |
672 } | 674 } |
673 | 675 |
674 rtc::scoped_refptr<StreamCollectionInterface> | 676 rtc::scoped_refptr<StreamCollectionInterface> |
675 PeerConnection::remote_streams() { | 677 PeerConnection::remote_streams() { |
(...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1949 InternalCreateDataChannel(label, &config)); | 1951 InternalCreateDataChannel(label, &config)); |
1950 if (!channel.get()) { | 1952 if (!channel.get()) { |
1951 LOG(LS_ERROR) << "Failed to create DataChannel from the OPEN message."; | 1953 LOG(LS_ERROR) << "Failed to create DataChannel from the OPEN message."; |
1952 return; | 1954 return; |
1953 } | 1955 } |
1954 | 1956 |
1955 observer_->OnDataChannel( | 1957 observer_->OnDataChannel( |
1956 DataChannelProxy::Create(signaling_thread(), channel)); | 1958 DataChannelProxy::Create(signaling_thread(), channel)); |
1957 } | 1959 } |
1958 | 1960 |
| 1961 void PeerConnection::OnFirstPacketReceived() { |
| 1962 RTC_DCHECK(signaling_thread()->IsCurrent()); |
| 1963 observer_->OnFirstPacketReceived(); |
| 1964 } |
| 1965 |
1959 RtpSenderInterface* PeerConnection::FindSenderById(const std::string& id) { | 1966 RtpSenderInterface* PeerConnection::FindSenderById(const std::string& id) { |
1960 auto it = | 1967 auto it = |
1961 std::find_if(senders_.begin(), senders_.end(), | 1968 std::find_if(senders_.begin(), senders_.end(), |
1962 [id](const rtc::scoped_refptr<RtpSenderInterface>& sender) { | 1969 [id](const rtc::scoped_refptr<RtpSenderInterface>& sender) { |
1963 return sender->id() == id; | 1970 return sender->id() == id; |
1964 }); | 1971 }); |
1965 return it != senders_.end() ? it->get() : nullptr; | 1972 return it != senders_.end() ? it->get() : nullptr; |
1966 } | 1973 } |
1967 | 1974 |
1968 std::vector<rtc::scoped_refptr<RtpSenderInterface>>::iterator | 1975 std::vector<rtc::scoped_refptr<RtpSenderInterface>>::iterator |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2015 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { | 2022 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { |
2016 for (const auto& channel : sctp_data_channels_) { | 2023 for (const auto& channel : sctp_data_channels_) { |
2017 if (channel->id() == sid) { | 2024 if (channel->id() == sid) { |
2018 return channel; | 2025 return channel; |
2019 } | 2026 } |
2020 } | 2027 } |
2021 return nullptr; | 2028 return nullptr; |
2022 } | 2029 } |
2023 | 2030 |
2024 } // namespace webrtc | 2031 } // namespace webrtc |
OLD | NEW |