Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(357)

Unified Diff: talk/app/webrtc/webrtcsession.cc

Issue 1581693006: Adding "first packet received" notification to PeerConnectionObserver. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing race condition in unit test. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: talk/app/webrtc/webrtcsession.cc
diff --git a/talk/app/webrtc/webrtcsession.cc b/talk/app/webrtc/webrtcsession.cc
index c6d1856f0353957224932aeb8e0c076e4ccdfaa9..0270c554fbb1861bc7b7026d92d9e2a67d020fde 100644
--- a/talk/app/webrtc/webrtcsession.cc
+++ b/talk/app/webrtc/webrtcsession.cc
@@ -1844,6 +1844,8 @@ bool WebRtcSession::CreateVoiceChannel(const cricket::ContentInfo* content) {
voice_channel_->SignalDtlsSetupFailure.connect(
this, &WebRtcSession::OnDtlsSetupFailure);
+ voice_channel_->SignalFirstPacketReceived.connect(
+ this, &WebRtcSession::OnChannelFirstPacketReceived);
SignalVoiceChannelCreated();
voice_channel_->transport_channel()->SignalSentPacket.connect(
@@ -1861,6 +1863,8 @@ bool WebRtcSession::CreateVideoChannel(const cricket::ContentInfo* content) {
video_channel_->SignalDtlsSetupFailure.connect(
this, &WebRtcSession::OnDtlsSetupFailure);
+ video_channel_->SignalFirstPacketReceived.connect(
+ this, &WebRtcSession::OnChannelFirstPacketReceived);
SignalVideoChannelCreated();
video_channel_->transport_channel()->SignalSentPacket.connect(
@@ -1895,6 +1899,14 @@ void WebRtcSession::OnDtlsSetupFailure(cricket::BaseChannel*, bool rtcp) {
rtcp ? kDtlsSetupFailureRtcp : kDtlsSetupFailureRtp);
}
+void WebRtcSession::OnChannelFirstPacketReceived(cricket::BaseChannel*) {
+ ASSERT(signaling_thread()->IsCurrent());
+ if (!has_received_media_packet_) {
+ has_received_media_packet_ = true;
+ SignalFirstMediaPacketReceived();
+ }
+}
+
void WebRtcSession::OnDataChannelMessageReceived(
cricket::DataChannel* channel,
const cricket::ReceiveDataParams& params,
« no previous file with comments | « talk/app/webrtc/webrtcsession.h ('k') | webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698