Change NetEq::GetAudio to use AudioFrame

With this change, NetEq now uses AudioFrame as output type, like the
surrounding functions in ACM and VoiceEngine already do.

The computational savings is probably slim, since one memcpy is
removed while another one is added (both in AcmReceiver::GetAudio).

More simplifications and clean-up will be done in
AcmReceiver::GetAudio in future CLs.

BUG=webrtc:5607

Review URL: https://codereview.webrtc.org/1750353002

Cr-Commit-Position: refs/heads/master@{#11874}
diff --git a/webrtc/modules/audio_coding/neteq/sync_buffer.cc b/webrtc/modules/audio_coding/neteq/sync_buffer.cc
index d1802e1..543f78b 100644
--- a/webrtc/modules/audio_coding/neteq/sync_buffer.cc
+++ b/webrtc/modules/audio_coding/neteq/sync_buffer.cc
@@ -8,10 +8,9 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#include <assert.h>
-
 #include <algorithm>  // Access to min.
 
+#include "webrtc/base/checks.h"
 #include "webrtc/modules/audio_coding/neteq/sync_buffer.h"
 
 namespace webrtc {
@@ -71,16 +70,18 @@
   ReplaceAtIndex(insert_this, insert_this.Size(), position);
 }
 
-size_t SyncBuffer::GetNextAudioInterleaved(size_t requested_len,
-                                           int16_t* output) {
-  if (!output) {
-    assert(false);
-    return 0;
-  }
-  size_t samples_to_read = std::min(FutureLength(), requested_len);
-  ReadInterleavedFromIndex(next_index_, samples_to_read, output);
-  next_index_ += samples_to_read;
-  return samples_to_read;
+void SyncBuffer::GetNextAudioInterleaved(size_t requested_len,
+                                         AudioFrame* output) {
+  RTC_DCHECK(output);
+  const size_t samples_to_read = std::min(FutureLength(), requested_len);
+  output->Reset();
+  const size_t tot_samples_read =
+      ReadInterleavedFromIndex(next_index_, samples_to_read, output->data_);
+  const size_t samples_read_per_channel = tot_samples_read / Channels();
+  next_index_ += samples_read_per_channel;
+  output->interleaved_ = true;
+  output->num_channels_ = Channels();
+  output->samples_per_channel_ = samples_read_per_channel;
 }
 
 void SyncBuffer::IncreaseEndTimestamp(uint32_t increment) {