Bug 1064882 - Receive RTCP SR's on recvonly streams for A/V sync. r=jesup, a=bajaj
authorOscar Patino <opatinobugzilla@gmail.com>
Thu, 11 Sep 2014 09:25:47 -0400
changeset 224851 a68bd7dca981c829c79caf7020a730a0244ae468
parent 224850 c69612e0f67504df6d3d87bb65f9be7b4a9952a2
child 224852 21c3f268d27fe0be884d3e08eebec25057fb93b0
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup, bajaj
bugs1064882
milestone34.0a2
Bug 1064882 - Receive RTCP SR's on recvonly streams for A/V sync. r=jesup, a=bajaj
media/webrtc/signaling/src/media-conduit/AudioConduit.cpp
media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
media/webrtc/trunk/webrtc/video_engine/vie_channel.cc
old mode 100644
new mode 100755
--- a/media/webrtc/signaling/src/media-conduit/AudioConduit.cpp
+++ b/media/webrtc/signaling/src/media-conduit/AudioConduit.cpp
@@ -757,31 +757,25 @@ WebrtcAudioConduit::ReceivedRTPPacket(co
   return kMediaConduitNoError;
 }
 
 MediaConduitErrorCode
 WebrtcAudioConduit::ReceivedRTCPPacket(const void *data, int len)
 {
   CSFLogDebug(logTag,  "%s : channel %d",__FUNCTION__, mChannel);
 
-  if(mEngineTransmitting)
+  if(mPtrVoENetwork->ReceivedRTCPPacket(mChannel, data, len) == -1)
   {
-    if(mPtrVoENetwork->ReceivedRTCPPacket(mChannel, data, len) == -1)
+    int error = mPtrVoEBase->LastError();
+    CSFLogError(logTag, "%s RTCP Processing Error %d", __FUNCTION__, error);
+    if(error == VE_RTP_RTCP_MODULE_ERROR)
     {
-      int error = mPtrVoEBase->LastError();
-      CSFLogError(logTag, "%s RTCP Processing Error %d", __FUNCTION__, error);
-      if(error == VE_RTP_RTCP_MODULE_ERROR)
-      {
-        return kMediaConduitRTPRTCPModuleError;
-      }
-      return kMediaConduitUnknownError;
+      return kMediaConduitRTPRTCPModuleError;
     }
-  } else {
-    CSFLogError(logTag, "Error: %s when not receiving", __FUNCTION__);
-    return kMediaConduitSessionNotInited;
+    return kMediaConduitUnknownError;
   }
   return kMediaConduitNoError;
 }
 
 //WebRTC::RTP Callback Implementation
 int WebrtcAudioConduit::SendPacket(int channel, const void* data, int len)
 {
   CSFLogDebug(logTag,  "%s : channel %d %s", __FUNCTION__, channel,
old mode 100644
new mode 100755
--- a/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
+++ b/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
@@ -1133,31 +1133,25 @@ WebrtcVideoConduit::ReceivedRTPPacket(co
 }
 
 MediaConduitErrorCode
 WebrtcVideoConduit::ReceivedRTCPPacket(const void *data, int len)
 {
   CSFLogDebug(logTag, " %s Channel %d, Len %d ", __FUNCTION__, mChannel, len);
 
   //Media Engine should be receiving already
-  if(mEngineTransmitting)
+  if(mPtrViENetwork->ReceivedRTCPPacket(mChannel,data,len) == -1)
   {
-    if(mPtrViENetwork->ReceivedRTCPPacket(mChannel,data,len) == -1)
+    int error = mPtrViEBase->LastError();
+    CSFLogError(logTag, "%s RTP Processing Failed %d", __FUNCTION__, error);
+    if(error >= kViERtpRtcpInvalidChannelId && error <= kViERtpRtcpRtcpDisabled)
     {
-      int error = mPtrViEBase->LastError();
-      CSFLogError(logTag, "%s RTP Processing Failed %d", __FUNCTION__, error);
-      if(error >= kViERtpRtcpInvalidChannelId && error <= kViERtpRtcpRtcpDisabled)
-      {
-        return kMediaConduitRTPProcessingFailed;
-      }
-      return kMediaConduitRTPRTCPModuleError;
+      return kMediaConduitRTPProcessingFailed;
     }
-  } else {
-    CSFLogError(logTag, "Error: %s when not receiving", __FUNCTION__);
-    return kMediaConduitSessionNotInited;
+    return kMediaConduitRTPRTCPModuleError;
   }
   return kMediaConduitNoError;
 }
 
 //WebRTC::RTP Callback Implementation
 int WebrtcVideoConduit::SendPacket(int channel, const void* data, int len)
 {
   CSFLogDebug(logTag,  "%s : channel %d len %d %s", __FUNCTION__, channel, len,
old mode 100644
new mode 100755
--- a/media/webrtc/trunk/webrtc/video_engine/vie_channel.cc
+++ b/media/webrtc/trunk/webrtc/video_engine/vie_channel.cc
@@ -1679,24 +1679,26 @@ int32_t ViEChannel::StartReceive() {
   if (StartDecodeThread() != 0) {
     WEBRTC_TRACE(kTraceError, kTraceVideo, ViEId(engine_id_, channel_id_),
                  "%s: could not start decoder thread", __FUNCTION__);
 
     vie_receiver_.StopReceive();
     return -1;
   }
   vie_receiver_.StartReceive();
+  vie_receiver_.StartRTCPReceive(); // For receiving RTCP SR in one-way connections
   return 0;
 }
 
 int32_t ViEChannel::StopReceive() {
   WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s",
                __FUNCTION__);
 
   vie_receiver_.StopReceive();
+  vie_receiver_.StopRTCPReceive();
   StopDecodeThread();
   vcm_.ResetDecoder();
   return 0;
 }
 
 int32_t ViEChannel::RegisterSendTransport(Transport* transport) {
   WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_), "%s",
                __FUNCTION__);