Remove AudioCodingModule::IncomingPayload

This method is no longer in use.

Bug: webrtc:3520
Change-Id: Ie1419fa95e6ef482e9adc1ed7af57af2c3510a65
Reviewed-on: https://webrtc-review.googlesource.com/4667
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20047}
diff --git a/modules/audio_coding/acm2/audio_coding_module.cc b/modules/audio_coding/acm2/audio_coding_module.cc
index 2778610..3320d1b 100644
--- a/modules/audio_coding/acm2/audio_coding_module.cc
+++ b/modules/audio_coding/acm2/audio_coding_module.cc
@@ -149,13 +149,6 @@
                      const size_t payload_length,
                      const WebRtcRTPHeader& rtp_info) override;
 
-  // Incoming payloads, without rtp-info, the rtp-info will be created in ACM.
-  // One usage for this API is when pre-encoded files are pushed in ACM.
-  int IncomingPayload(const uint8_t* incoming_payload,
-                      const size_t payload_length,
-                      uint8_t payload_type,
-                      uint32_t timestamp) override;
-
   // Minimum playout delay.
   int SetMinimumPlayoutDelay(int time_ms) override;
 
@@ -291,14 +284,6 @@
   // This is to keep track of CN instances where we can send DTMFs.
   uint8_t previous_pltype_ RTC_GUARDED_BY(acm_crit_sect_);
 
-  // Used when payloads are pushed into ACM without any RTP info
-  // One example is when pre-encoded bit-stream is pushed from
-  // a file.
-  // IMPORTANT: this variable is only used in IncomingPayload(), therefore,
-  // no lock acquired when interacting with this variable. If it is going to
-  // be used in other methods, locks need to be taken.
-  std::unique_ptr<WebRtcRTPHeader> aux_rtp_header_;
-
   bool receiver_initialized_ RTC_GUARDED_BY(acm_crit_sect_);
 
   AudioFrame preprocess_frame_ RTC_GUARDED_BY(acm_crit_sect_);
@@ -1147,35 +1132,6 @@
   return 0;
 }
 
-// TODO(kwiberg): Remove this method, and have callers call IncomingPacket
-// instead. The translation logic and state belong with them, not with
-// AudioCodingModuleImpl.
-int AudioCodingModuleImpl::IncomingPayload(const uint8_t* incoming_payload,
-                                           size_t payload_length,
-                                           uint8_t payload_type,
-                                           uint32_t timestamp) {
-  // We are not acquiring any lock when interacting with |aux_rtp_header_| no
-  // other method uses this member variable.
-  if (!aux_rtp_header_) {
-    // This is the first time that we are using |dummy_rtp_header_|
-    // so we have to create it.
-    aux_rtp_header_.reset(new WebRtcRTPHeader);
-    aux_rtp_header_->header.payloadType = payload_type;
-    // Don't matter in this case.
-    aux_rtp_header_->header.ssrc = 0;
-    aux_rtp_header_->header.markerBit = false;
-    // Start with random numbers.
-    aux_rtp_header_->header.sequenceNumber = 0x1234;  // Arbitrary.
-    aux_rtp_header_->type.Audio.channel = 1;
-  }
-
-  aux_rtp_header_->header.timestamp = timestamp;
-  IncomingPacket(incoming_payload, payload_length, *aux_rtp_header_);
-  // Get ready for the next payload.
-  aux_rtp_header_->header.sequenceNumber++;
-  return 0;
-}
-
 int AudioCodingModuleImpl::SetOpusApplication(OpusApplicationMode application) {
   rtc::CritScope lock(&acm_crit_sect_);
   if (!HaveValidEncoder("SetOpusApplication")) {
diff --git a/modules/audio_coding/include/audio_coding_module.h b/modules/audio_coding/include/audio_coding_module.h
index 2013cd7..41756fb 100644
--- a/modules/audio_coding/include/audio_coding_module.h
+++ b/modules/audio_coding/include/audio_coding_module.h
@@ -588,35 +588,6 @@
                                  const WebRtcRTPHeader& rtp_info) = 0;
 
   ///////////////////////////////////////////////////////////////////////////
-  // int32_t IncomingPayload()
-  // Call this API to push incoming payloads when there is no rtp-info.
-  // The rtp-info will be created in ACM. One usage for this API is when
-  // pre-encoded files are pushed in ACM
-  //
-  // Inputs:
-  //   -incoming_payload   : received payload.
-  //   -payload_len_byte   : the length, in bytes, of the received payload.
-  //   -payload_type       : the payload-type. This specifies which codec has
-  //                         to be used to decode the payload.
-  //   -timestamp          : send timestamp of the payload. ACM starts with
-  //                         a random value and increment it by the
-  //                         packet-size, which is given when the codec in
-  //                         question is registered by RegisterReceiveCodec().
-  //                         Therefore, it is essential to have the timestamp
-  //                         if the frame-size differ from the registered
-  //                         value or if the incoming payload contains DTX
-  //                         packets.
-  //
-  // Return value:
-  //   -1 if failed to push in the payload
-  //    0 if payload is successfully pushed in.
-  //
-  virtual int32_t IncomingPayload(const uint8_t* incoming_payload,
-                                  const size_t payload_len_byte,
-                                  const uint8_t payload_type,
-                                  const uint32_t timestamp = 0) = 0;
-
-  ///////////////////////////////////////////////////////////////////////////
   // int SetMinimumPlayoutDelay()
   // Set a minimum for the playout delay, used for lip-sync. NetEq maintains
   // such a delay unless channel condition yields to a higher delay.