Delete VideoStreamEncoder::OnReceivedIntraFrameRequest.

Duplicates SendKeyFrame, since current simulcast encoders always
produces key frames for all simulcast layers.

Bug: webrtc:8830
Change-Id: Iec0e46d52de9d85e59fb5b99761416ce027ea876
Reviewed-on: https://webrtc-review.googlesource.com/54300
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22057}
diff --git a/video/encoder_rtcp_feedback.cc b/video/encoder_rtcp_feedback.cc
index 5a1194f..9e02274 100644
--- a/video/encoder_rtcp_feedback.cc
+++ b/video/encoder_rtcp_feedback.cc
@@ -60,7 +60,8 @@
     time_last_intra_request_ms_[index] = now_ms;
   }
 
-  video_stream_encoder_->OnReceivedIntraFrameRequest(index);
+  // Always produce key frame for all streams.
+  video_stream_encoder_->SendKeyFrame();
 }
 
 }  // namespace webrtc
diff --git a/video/encoder_rtcp_feedback_unittest.cc b/video/encoder_rtcp_feedback_unittest.cc
index cf9d62e..07e8978 100644
--- a/video/encoder_rtcp_feedback_unittest.cc
+++ b/video/encoder_rtcp_feedback_unittest.cc
@@ -33,7 +33,7 @@
                                CpuOveruseOptions(), nullptr)) {}
   ~MockVideoStreamEncoder() { Stop(); }
 
-  MOCK_METHOD1(OnReceivedIntraFrameRequest, void(size_t));
+  MOCK_METHOD0(SendKeyFrame, void());
 };
 
 class VieKeyRequestTest : public ::testing::Test {
@@ -59,18 +59,18 @@
 };
 
 TEST_F(VieKeyRequestTest, CreateAndTriggerRequests) {
-  EXPECT_CALL(encoder_, OnReceivedIntraFrameRequest(0)).Times(1);
+  EXPECT_CALL(encoder_, SendKeyFrame()).Times(1);
   encoder_rtcp_feedback_.OnReceivedIntraFrameRequest(kSsrc);
 }
 
 TEST_F(VieKeyRequestTest, TooManyOnReceivedIntraFrameRequest) {
-  EXPECT_CALL(encoder_, OnReceivedIntraFrameRequest(0)).Times(1);
+  EXPECT_CALL(encoder_, SendKeyFrame()).Times(1);
   encoder_rtcp_feedback_.OnReceivedIntraFrameRequest(kSsrc);
   encoder_rtcp_feedback_.OnReceivedIntraFrameRequest(kSsrc);
   simulated_clock_.AdvanceTimeMilliseconds(10);
   encoder_rtcp_feedback_.OnReceivedIntraFrameRequest(kSsrc);
 
-  EXPECT_CALL(encoder_, OnReceivedIntraFrameRequest(0)).Times(1);
+  EXPECT_CALL(encoder_, SendKeyFrame()).Times(1);
   simulated_clock_.AdvanceTimeMilliseconds(300);
   encoder_rtcp_feedback_.OnReceivedIntraFrameRequest(kSsrc);
   encoder_rtcp_feedback_.OnReceivedIntraFrameRequest(kSsrc);
diff --git a/video/video_stream_encoder.cc b/video/video_stream_encoder.cc
index 340bbf4..575f7d3 100644
--- a/video/video_stream_encoder.cc
+++ b/video/video_stream_encoder.cc
@@ -815,6 +815,7 @@
     return;
   }
   RTC_DCHECK_RUN_ON(&encoder_queue_);
+  TRACE_EVENT0("webrtc", "OnKeyFrameRequest");
   video_sender_.IntraFrameRequest(0);
 }
 
@@ -873,18 +874,6 @@
   }
 }
 
-void VideoStreamEncoder::OnReceivedIntraFrameRequest(size_t stream_index) {
-  if (!encoder_queue_.IsCurrent()) {
-    encoder_queue_.PostTask(
-        [this, stream_index] { OnReceivedIntraFrameRequest(stream_index); });
-    return;
-  }
-  RTC_DCHECK_RUN_ON(&encoder_queue_);
-  // Key frame request from remote side, signal to VCM.
-  TRACE_EVENT0("webrtc", "OnKeyFrameRequest");
-  video_sender_.IntraFrameRequest(stream_index);
-}
-
 void VideoStreamEncoder::OnBitrateUpdated(uint32_t bitrate_bps,
                                           uint8_t fraction_lost,
                                           int64_t round_trip_time_ms) {
diff --git a/video/video_stream_encoder.h b/video/video_stream_encoder.h
index d8679bd..9a0e4c1 100644
--- a/video/video_stream_encoder.h
+++ b/video/video_stream_encoder.h
@@ -99,10 +99,8 @@
   // guaranteed that no encoded frames will be delivered to the sink.
   void Stop();
 
-  void SendKeyFrame();
-
-  // virtual to test EncoderStateFeedback with mocks.
-  virtual void OnReceivedIntraFrameRequest(size_t stream_index);
+  // virtual to test EncoderRtcpFeedback with mocks.
+  virtual void SendKeyFrame();
 
   void OnBitrateUpdated(uint32_t bitrate_bps,
                         uint8_t fraction_lost,