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

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: Modified the unit test. Created 4 years, 6 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
« no previous file with comments | « webrtc/api/webrtcsession.h ('k') | webrtc/pc/channel.h » ('j') | 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 a7c712c6a1f8c407f74d41992aeb6def83cf8634..b9a3fc8453389dc040a28f51a47d0a4649e0eb49 100644
--- a/webrtc/api/webrtcsession.cc
+++ b/webrtc/api/webrtcsession.cc
@@ -1767,6 +1767,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,
@@ -1790,6 +1792,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,
@@ -1831,6 +1835,21 @@ void WebRtcSession::OnDtlsSetupFailure(cricket::BaseChannel*, bool rtcp) {
rtcp ? kDtlsSetupFailureRtcp : kDtlsSetupFailureRtp);
}
+void WebRtcSession::OnChannelFirstPacketReceived(
+ cricket::BaseChannel* channel) {
+ ASSERT(signaling_thread()->IsCurrent());
+
+ if (!received_first_audio_packet_ &&
+ channel->media_type() == cricket::MEDIA_TYPE_AUDIO) {
+ received_first_audio_packet_ = true;
+ SignalFirstAudioPacketReceived();
+ } else if (!received_first_video_packet_ &&
+ channel->media_type() == cricket::MEDIA_TYPE_VIDEO) {
+ received_first_video_packet_ = true;
+ SignalFirstVideoPacketReceived();
+ }
+}
+
void WebRtcSession::OnDataChannelMessageReceived(
cricket::DataChannel* channel,
const cricket::ReceiveDataParams& params,
« no previous file with comments | « webrtc/api/webrtcsession.h ('k') | webrtc/pc/channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698