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

Unified Diff: webrtc/api/webrtcsession.cc

Issue 1999853002: Forward the SignalFirstPacketReceived to RtpReceiver. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Make the destructor of RtpReceiverObserverInterface virtual. Created 4 years, 7 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
« webrtc/api/rtpreceiverinterface.h ('K') | « webrtc/api/webrtcsession.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/webrtcsession.cc
diff --git a/webrtc/api/webrtcsession.cc b/webrtc/api/webrtcsession.cc
index 80352cf83246f3ff5f42a4bfa4be64f496a5e153..70571db0f34f2874444deef56b49dd7027b77878 100644
--- a/webrtc/api/webrtcsession.cc
+++ b/webrtc/api/webrtcsession.cc
@@ -1817,6 +1817,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_->SignalSentPacket.connect(this,
@@ -1840,6 +1842,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_->SignalSentPacket.connect(this,
@@ -1881,6 +1885,21 @@ void WebRtcSession::OnDtlsSetupFailure(cricket::BaseChannel*, bool rtcp) {
rtcp ? kDtlsSetupFailureRtcp : kDtlsSetupFailureRtp);
}
+void WebRtcSession::OnChannelFirstPacketReceived(
+ cricket::BaseChannel* channel) {
+ ASSERT(signaling_thread()->IsCurrent());
+
+ if (!has_received_audio_packet_ &&
+ channel->content_name() == cricket::CN_AUDIO) {
pthatcher2 2016/05/20 20:23:14 We should use the media type, not the content name
zhihuang1 2016/05/24 01:01:44 Done.
+ has_received_audio_packet_ = true;
+ SignalFirstAudioPacketReceived();
+ } else if (!has_received_video_packet_ &&
+ channel->content_name() == cricket::CN_VIDEO) {
+ has_received_video_packet_ = true;
+ SignalFirstVideoPacketReceived();
+ }
+}
+
void WebRtcSession::OnDataChannelMessageReceived(
cricket::DataChannel* channel,
const cricket::ReceiveDataParams& params,
« webrtc/api/rtpreceiverinterface.h ('K') | « webrtc/api/webrtcsession.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698