Bug 1274340 - Call SetReceiveCodec for RED and ULPFEC when FEC is enabled; r=jesup
authorDan Minor <dminor@mozilla.com>
Thu, 30 Jun 2016 12:20:19 -0400
changeset 334851 ac0708fe8f742c67355d9578bb87954769a037ce
parent 334850 c9b04662c81bcfdf8cf2d26c9afcabfdeb2ca87f
child 334852 581bf8b4f433e44150ae7d11fa033064608e443c
push id10033
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:50:26 +0000
treeherdermozilla-aurora@5dddbefdf759 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs1274340
milestone51.0a1
Bug 1274340 - Call SetReceiveCodec for RED and ULPFEC when FEC is enabled; r=jesup We need to call SetReceiveCodec for RED and ULPFEC so we know how to handle those packets when received. MozReview-Commit-ID: A9EluM7p2NH
media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
--- a/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
+++ b/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
@@ -978,16 +978,34 @@ WebrtcVideoConduit::ConfigureRecvMediaCo
     uint8_t payload_type_ulpfec = INVALID_RTP_PAYLOAD;
     if (!DetermineREDAndULPFECPayloadTypes(payload_type_red, payload_type_ulpfec)) {
       CSFLogError(logTag, "%s Unable to set FEC status: could not determine"
                   "payload type: red %u ulpfec %u",
                   __FUNCTION__, payload_type_red, payload_type_ulpfec);
         return kMediaConduitFECStatusError;
     }
 
+    // We also need to call SetReceiveCodec for RED and ULPFEC codecs
+    for(int idx=0; idx < mPtrViECodec->NumberOfCodecs(); idx++) {
+      webrtc::VideoCodec video_codec;
+      if(mPtrViECodec->GetCodec(idx, video_codec) == 0) {
+        payloadName = video_codec.plName;
+        if(video_codec.codecType == webrtc::VideoCodecType::kVideoCodecRED ||
+           video_codec.codecType == webrtc::VideoCodecType::kVideoCodecULPFEC) {
+          if(mPtrViECodec->SetReceiveCodec(mChannel,video_codec) == -1) {
+            CSFLogError(logTag, "%s Invalid Receive Codec %d ", __FUNCTION__,
+                        mPtrViEBase->LastError());
+          } else {
+            CSFLogDebug(logTag, "%s Successfully Set the codec %s", __FUNCTION__,
+                        video_codec.plName);
+          }
+        }
+      }
+    }
+
     if (use_nack_basic) {
       CSFLogDebug(logTag, "Enabling NACK/FEC (recv) for video stream\n");
       if (mPtrRTP->SetHybridNACKFECStatus(mChannel, true,
                                           payload_type_red,
                                           payload_type_ulpfec) != 0) {
         CSFLogError(logTag,  "%s SetHybridNACKFECStatus Failed %d ",
                     __FUNCTION__, mPtrViEBase->LastError());
         return kMediaConduitNACKStatusError;