Bug 1237630 - Part 1: Video freeze from WebRTC sender. r=rjesup, a=sylvestre
authorPaul Kerr [:pkerr] <pkerr@mozilla.com>
Thu, 21 Jan 2016 07:54:03 -0800
changeset 310978 015db92e8e458c5b5e874ba2214aa4436d97a347
parent 310977 1f9e03713e943de13b032b53b8a4af748b1d09f0
child 310979 e5961b5798f237b9d1d35c72f173eb2583a1ddb8
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrjesup, sylvestre
bugs1237630
milestone45.0a2
Bug 1237630 - Part 1: Video freeze from WebRTC sender. r=rjesup, a=sylvestre Removed captured frame to codec config frame size check: revert to allowing the encoder to handle frame size changes dynamically. Re-enable frame size update handling in VP8 Encode.
media/webrtc/trunk/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc
media/webrtc/trunk/webrtc/modules/video_coding/main/source/video_sender.cc
--- a/media/webrtc/trunk/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc
+++ b/media/webrtc/trunk/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc
@@ -733,18 +733,18 @@ int VP8EncoderImpl::Encode(
   // Only apply scaling to improve for single-layer streams. The scaling metrics
   // use framedrops as a signal and is only applicable when we drop frames.
   const bool use_quality_scaler = encoders_.size() == 1 &&
                                   configurations_[0].rc_dropframe_thresh > 0 &&
                                   codec_.codecSpecific.VP8.automaticResizeOn;
   const I420VideoFrame& input_image =
       use_quality_scaler ? quality_scaler_.GetScaledFrame(frame) : frame;
 
-  if (use_quality_scaler && (input_image.width() != codec_.width ||
-      input_image.height() != codec_.height)) {
+  if (input_image.width() != codec_.width ||
+      input_image.height() != codec_.height) {
     int ret = UpdateCodecFrameSize(input_image);
     if (ret < 0)
       return ret;
   }
 
   // Since we are extracting raw pointers from |input_image| to
   // |raw_images_[0]|, the resolution of these frames must match. Note that
   // |input_image| might be scaled from |frame|. In that case, the resolution of
--- a/media/webrtc/trunk/webrtc/modules/video_coding/main/source/video_sender.cc
+++ b/media/webrtc/trunk/webrtc/modules/video_coding/main/source/video_sender.cc
@@ -368,27 +368,31 @@ int32_t VideoSender::AddVideoFrame(const
   // TODO(holmer): Add support for dropping frames per stream. Currently we
   // only have one frame dropper for all streams.
   if (_nextFrameTypes[0] == kFrameEmpty) {
     return VCM_OK;
   }
   if (_mediaOpt.DropFrame()) {
     return VCM_OK;
   }
+
   _mediaOpt.UpdateContentData(contentMetrics);
+#ifdef VERIFY_FRAME_SIZE_VS_DATABASE
   // TODO(pbos): Make sure setting send codec is synchronized with video
   // processing so frame size always matches.
   if (!_codecDataBase.MatchesCurrentResolution(videoFrame.width(),
                                                videoFrame.height())) {
     LOG(LS_ERROR) << "Incoming frame doesn't match set resolution. Dropping.";
     return VCM_PARAMETER_ERROR;
   }
+#endif
   int32_t ret =
       _encoder->Encode(videoFrame, codecSpecificInfo, _nextFrameTypes);
   recorder_->Add(videoFrame);
+
   if (ret < 0) {
     LOG(LS_ERROR) << "Failed to encode frame. Error code: " << ret;
     return ret;
   }
   for (size_t i = 0; i < _nextFrameTypes.size(); ++i) {
     _nextFrameTypes[i] = kVideoFrameDelta;  // Default frame type.
   }
   return VCM_OK;