Bug 1255371 - Invalid RTCP SR sent by Firefox when h264 is used; r?jesup draft
authorDan Minor <dminor@mozilla.com>
Tue, 23 Aug 2016 09:46:23 -0400
changeset 405464 644836c2582b837b762659c37d9475269e143ba3
parent 403581 f97a056ae6235de7855fd8aaa04fb1c8d183bd06
child 529448 a63fbcc237bbb05417f93534ab2e7aae534127fe
push id27497
push userdminor@mozilla.com
push dateThu, 25 Aug 2016 14:18:55 +0000
reviewersjesup
bugs1255371
milestone51.0a1
Bug 1255371 - Invalid RTCP SR sent by Firefox when h264 is used; r?jesup Setting the capture_time_ms to -1 causes RTCPSender::SetLastRtpTime to ignore it and use the current clock time. The default value of 0 will be used in the the calculation in RTCPSender::BuildSR and cause mismatched timestamps. MozReview-Commit-ID: IK8lLK8Rmla
media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
--- a/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
+++ b/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
@@ -641,23 +641,24 @@ WebrtcGmpVideoEncoder::Encoded(GMPVideoE
       for (size_t i = 0; i < num_nals; i++) {
         fragmentation.fragmentationOffset[i] = nals[i].offset;
         fragmentation.fragmentationLength[i] = nals[i].size;
       }
 
       webrtc::EncodedImage unit(aEncodedFrame->Buffer(), size, size);
       unit._frameType = ft;
       unit._timeStamp = timestamp;
+      // Ensure we ignore this when calculating RTCP timestamps
+      unit.capture_time_ms_ = -1;
       unit._completeFrame = true;
 
       // TODO: Currently the OpenH264 codec does not preserve any codec
       //       specific info passed into it and just returns default values.
-      //       Even if we were to add packetization mode to the codec specific info
-      //       the value passed in would not be returned to us. If this changes in
-      //       the future, it would be nice to get rid of mCodecSpecificInfo.
+      //       If this changes in the future, it would be nice to get rid of
+      //       mCodecSpecificInfo.
       mCallback->Encoded(unit, &mCodecSpecificInfo, &fragmentation);
     }
   }
 }
 
 // Decoder.
 WebrtcGmpVideoDecoder::WebrtcGmpVideoDecoder() :
   mGMP(nullptr),