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_->SignalFirstMediaPacketReceived.connect( |
| 667 this, &PeerConnection::OnFirstMediaPacketReceived); |
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 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2022 InternalCreateDataChannel(label, &config)); | 2024 InternalCreateDataChannel(label, &config)); |
2023 if (!channel.get()) { | 2025 if (!channel.get()) { |
2024 LOG(LS_ERROR) << "Failed to create DataChannel from the OPEN message."; | 2026 LOG(LS_ERROR) << "Failed to create DataChannel from the OPEN message."; |
2025 return; | 2027 return; |
2026 } | 2028 } |
2027 | 2029 |
2028 observer_->OnDataChannel( | 2030 observer_->OnDataChannel( |
2029 DataChannelProxy::Create(signaling_thread(), channel)); | 2031 DataChannelProxy::Create(signaling_thread(), channel)); |
2030 } | 2032 } |
2031 | 2033 |
| 2034 void PeerConnection::OnFirstMediaPacketReceived() { |
| 2035 RTC_DCHECK(signaling_thread()->IsCurrent()); |
| 2036 observer_->OnFirstMediaPacketReceived(); |
| 2037 } |
| 2038 |
2032 RtpSenderInterface* PeerConnection::FindSenderById(const std::string& id) { | 2039 RtpSenderInterface* PeerConnection::FindSenderById(const std::string& id) { |
2033 auto it = | 2040 auto it = |
2034 std::find_if(senders_.begin(), senders_.end(), | 2041 std::find_if(senders_.begin(), senders_.end(), |
2035 [id](const rtc::scoped_refptr<RtpSenderInterface>& sender) { | 2042 [id](const rtc::scoped_refptr<RtpSenderInterface>& sender) { |
2036 return sender->id() == id; | 2043 return sender->id() == id; |
2037 }); | 2044 }); |
2038 return it != senders_.end() ? it->get() : nullptr; | 2045 return it != senders_.end() ? it->get() : nullptr; |
2039 } | 2046 } |
2040 | 2047 |
2041 std::vector<rtc::scoped_refptr<RtpSenderInterface>>::iterator | 2048 std::vector<rtc::scoped_refptr<RtpSenderInterface>>::iterator |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2088 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { | 2095 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { |
2089 for (const auto& channel : sctp_data_channels_) { | 2096 for (const auto& channel : sctp_data_channels_) { |
2090 if (channel->id() == sid) { | 2097 if (channel->id() == sid) { |
2091 return channel; | 2098 return channel; |
2092 } | 2099 } |
2093 } | 2100 } |
2094 return nullptr; | 2101 return nullptr; |
2095 } | 2102 } |
2096 | 2103 |
2097 } // namespace webrtc | 2104 } // namespace webrtc |
OLD | NEW |