Remove deprecated methods from AudioFrame.
Bug: webrtc:6548
Change-Id: I85bdba3acbef3216b3d836515dde10188ff0dbc6
Reviewed-on: https://webrtc-review.googlesource.com/54304
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22824}diff --git a/api/audio/BUILD.gn b/api/audio/BUILD.gn
index f3bca7c..5558ab1 100644
--- a/api/audio/BUILD.gn
+++ b/api/audio/BUILD.gn
@@ -18,7 +18,6 @@
   deps = [
     "../../:typedefs",
     "../../rtc_base:checks",
-    "../../rtc_base:deprecation",
     "../../rtc_base:rtc_base_approved",
   ]
 }
diff --git a/api/audio/audio_frame.cc b/api/audio/audio_frame.cc
index 108a523..864188d 100644
--- a/api/audio/audio_frame.cc
+++ b/api/audio/audio_frame.cc
@@ -13,7 +13,6 @@
 #include "api/audio/audio_frame.h"
 
 #include "rtc_base/checks.h"
-#include "rtc_base/numerics/safe_conversions.h"
 #include "rtc_base/timeutils.h"
 
 namespace webrtc {
@@ -43,12 +42,12 @@
 }
 
 void AudioFrame::UpdateFrame(uint32_t timestamp,
-                                    const int16_t* data,
-                                    size_t samples_per_channel,
-                                    int sample_rate_hz,
-                                    SpeechType speech_type,
-                                    VADActivity vad_activity,
-                                    size_t num_channels) {
+                             const int16_t* data,
+                             size_t samples_per_channel,
+                             int sample_rate_hz,
+                             SpeechType speech_type,
+                             VADActivity vad_activity,
+                             size_t num_channels) {
   timestamp_ = timestamp;
   samples_per_channel_ = samples_per_channel;
   sample_rate_hz_ = sample_rate_hz;
@@ -119,62 +118,6 @@
 
 bool AudioFrame::muted() const { return muted_; }
 
-AudioFrame& AudioFrame::operator>>=(const int rhs) {
-  RTC_CHECK_GT(num_channels_, 0);
-  RTC_CHECK_LT(num_channels_, 3);
-  if ((num_channels_ > 2) || (num_channels_ < 1)) return *this;
-  if (muted_) return *this;
-
-  for (size_t i = 0; i < samples_per_channel_ * num_channels_; i++) {
-    data_[i] = static_cast<int16_t>(data_[i] >> rhs);
-  }
-  return *this;
-}
-
-AudioFrame& AudioFrame::operator+=(const AudioFrame& rhs) {
-  // Sanity check
-  RTC_CHECK_GT(num_channels_, 0);
-  RTC_CHECK_LT(num_channels_, 3);
-  if ((num_channels_ > 2) || (num_channels_ < 1)) return *this;
-  if (num_channels_ != rhs.num_channels_) return *this;
-
-  bool noPrevData = muted_;
-  if (samples_per_channel_ != rhs.samples_per_channel_) {
-    if (samples_per_channel_ == 0) {
-      // special case we have no data to start with
-      samples_per_channel_ = rhs.samples_per_channel_;
-      noPrevData = true;
-    } else {
-      return *this;
-    }
-  }
-
-  if ((vad_activity_ == kVadActive) || rhs.vad_activity_ == kVadActive) {
-    vad_activity_ = kVadActive;
-  } else if (vad_activity_ == kVadUnknown || rhs.vad_activity_ == kVadUnknown) {
-    vad_activity_ = kVadUnknown;
-  }
-
-  if (speech_type_ != rhs.speech_type_) speech_type_ = kUndefined;
-
-  if (!rhs.muted()) {
-    muted_ = false;
-    if (noPrevData) {
-      memcpy(data_, rhs.data(),
-             sizeof(int16_t) * rhs.samples_per_channel_ * num_channels_);
-    } else {
-      // IMPROVEMENT this can be done very fast in assembly
-      for (size_t i = 0; i < samples_per_channel_ * num_channels_; i++) {
-        int32_t wrap_guard =
-            static_cast<int32_t>(data_[i]) + static_cast<int32_t>(rhs.data_[i]);
-        data_[i] = rtc::saturated_cast<int16_t>(wrap_guard);
-      }
-    }
-  }
-
-  return *this;
-}
-
 // static
 const int16_t* AudioFrame::empty_data() {
   static const int16_t kEmptyData[kMaxDataSizeSamples] = {0};
diff --git a/api/audio/audio_frame.h b/api/audio/audio_frame.h
index 5cb2019..d69f607 100644
--- a/api/audio/audio_frame.h
+++ b/api/audio/audio_frame.h
@@ -11,11 +11,7 @@
 #ifndef API_AUDIO_AUDIO_FRAME_H_
 #define API_AUDIO_AUDIO_FRAME_H_
 
-#include <stdint.h>
-#include <stdlib.h>
-
 #include "rtc_base/constructormagic.h"
-#include "rtc_base/deprecation.h"
 #include "typedefs.h"  // NOLINT(build/include)
 
 namespace webrtc {
@@ -68,17 +64,6 @@
   // ResetWithoutMuting() to skip this wasteful zeroing.
   void ResetWithoutMuting();
 
-  // TODO(solenberg): Remove once downstream users of AudioFrame have updated.
-  RTC_DEPRECATED
-      void UpdateFrame(int id, uint32_t timestamp, const int16_t* data,
-                       size_t samples_per_channel, int sample_rate_hz,
-                       SpeechType speech_type, VADActivity vad_activity,
-                       size_t num_channels = 1) {
-    RTC_UNUSED(id);
-    UpdateFrame(timestamp, data, samples_per_channel, sample_rate_hz,
-                speech_type, vad_activity, num_channels);
-  }
-
   void UpdateFrame(uint32_t timestamp, const int16_t* data,
                    size_t samples_per_channel, int sample_rate_hz,
                    SpeechType speech_type, VADActivity vad_activity,
@@ -108,13 +93,6 @@
   // Frame is muted by default.
   bool muted() const;
 
-  // These methods are deprecated. Use the functions in
-  // webrtc/audio/utility instead. These methods will exists for a
-  // short period of time until webrtc clients have updated. See
-  // webrtc:6548 for details.
-  RTC_DEPRECATED AudioFrame& operator>>=(const int rhs);
-  RTC_DEPRECATED AudioFrame& operator+=(const AudioFrame& rhs);
-
   // RTP timestamp of the first sample in the AudioFrame.
   uint32_t timestamp_ = 0;
   // Time since the first frame in milliseconds.