Change from WebRtcRTPHeader to RTPHeader in NetEq tests and tools

With this CL, all tests and tools under the neteq/ folder are
converted to use RTPHeader instead of WebRtcRTPHeader. WebRtcRTPHeader
has an RTPHeader as a member. None of the other member in
WebRtcRTPHeader where used.

TBR=kjellander@webrtc.org
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_chromium_compile_rel_ng,linux_chromium_compile_dbg_ng
BUG=webrtc:7467

Review-Url: https://codereview.webrtc.org/2809153002
Cr-Commit-Position: refs/heads/master@{#17845}
diff --git a/webrtc/modules/audio_coding/neteq/neteq_unittest.cc b/webrtc/modules/audio_coding/neteq/neteq_unittest.cc
index 1a54c54..68a4921 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_unittest.cc
+++ b/webrtc/modules/audio_coding/neteq/neteq_unittest.cc
@@ -23,9 +23,10 @@
 #include "gflags/gflags.h"
 #include "webrtc/api/audio_codecs/builtin_audio_decoder_factory.h"
 #include "webrtc/base/ignore_wundef.h"
+#include "webrtc/base/protobuf_utils.h"
 #include "webrtc/base/sha1digest.h"
 #include "webrtc/base/stringencode.h"
-#include "webrtc/base/protobuf_utils.h"
+#include "webrtc/common_types.h"
 #include "webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.h"
 #include "webrtc/modules/audio_coding/neteq/tools/audio_loop.h"
 #include "webrtc/modules/audio_coding/neteq/tools/rtp_file_source.h"
@@ -250,10 +251,10 @@
 
   static void PopulateRtpInfo(int frame_index,
                               int timestamp,
-                              WebRtcRTPHeader* rtp_info);
+                              RTPHeader* rtp_info);
   static void PopulateCng(int frame_index,
                           int timestamp,
-                          WebRtcRTPHeader* rtp_info,
+                          RTPHeader* rtp_info,
                           uint8_t* payload,
                           size_t* payload_len);
 
@@ -318,15 +319,13 @@
   // Check if time to receive.
   while (packet_ && sim_clock_ >= packet_->time_ms()) {
     if (packet_->payload_length_bytes() > 0) {
-      WebRtcRTPHeader rtp_header;
-      packet_->ConvertHeader(&rtp_header);
 #ifndef WEBRTC_CODEC_ISAC
       // Ignore payload type 104 (iSAC-swb) if ISAC is not supported.
-      if (rtp_header.header.payloadType != 104)
+      if (packet_->header().payloadType != 104)
 #endif
         ASSERT_EQ(0,
                   neteq_->InsertPacket(
-                      rtp_header.header,
+                      packet_->header(),
                       rtc::ArrayView<const uint8_t>(
                           packet_->payload(), packet_->payload_length_bytes()),
                       static_cast<uint32_t>(packet_->time_ms() *
@@ -409,24 +408,24 @@
 
 void NetEqDecodingTest::PopulateRtpInfo(int frame_index,
                                         int timestamp,
-                                        WebRtcRTPHeader* rtp_info) {
-  rtp_info->header.sequenceNumber = frame_index;
-  rtp_info->header.timestamp = timestamp;
-  rtp_info->header.ssrc = 0x1234;  // Just an arbitrary SSRC.
-  rtp_info->header.payloadType = 94;  // PCM16b WB codec.
-  rtp_info->header.markerBit = 0;
+                                        RTPHeader* rtp_info) {
+  rtp_info->sequenceNumber = frame_index;
+  rtp_info->timestamp = timestamp;
+  rtp_info->ssrc = 0x1234;     // Just an arbitrary SSRC.
+  rtp_info->payloadType = 94;  // PCM16b WB codec.
+  rtp_info->markerBit = 0;
 }
 
 void NetEqDecodingTest::PopulateCng(int frame_index,
                                     int timestamp,
-                                    WebRtcRTPHeader* rtp_info,
+                                    RTPHeader* rtp_info,
                                     uint8_t* payload,
                                     size_t* payload_len) {
-  rtp_info->header.sequenceNumber = frame_index;
-  rtp_info->header.timestamp = timestamp;
-  rtp_info->header.ssrc = 0x1234;  // Just an arbitrary SSRC.
-  rtp_info->header.payloadType = 98;  // WB CNG.
-  rtp_info->header.markerBit = 0;
+  rtp_info->sequenceNumber = frame_index;
+  rtp_info->timestamp = timestamp;
+  rtp_info->ssrc = 0x1234;     // Just an arbitrary SSRC.
+  rtp_info->payloadType = 98;  // WB CNG.
+  rtp_info->markerBit = 0;
   payload[0] = 64;  // Noise level -64 dBov, quite arbitrarily chosen.
   *payload_len = 1;  // Only noise level, no spectral parameters.
 }
@@ -521,13 +520,13 @@
   const size_t kPayloadBytes = kSamples * 2;
   for (size_t i = 0; i < num_frames; ++i) {
     const uint8_t payload[kPayloadBytes] = {0};
-    WebRtcRTPHeader rtp_info;
-    rtp_info.header.sequenceNumber = i;
-    rtp_info.header.timestamp = i * kSamples;
-    rtp_info.header.ssrc = 0x1234;  // Just an arbitrary SSRC.
-    rtp_info.header.payloadType = 94;  // PCM16b WB codec.
-    rtp_info.header.markerBit = 0;
-    ASSERT_EQ(0, neteq_->InsertPacket(rtp_info.header, payload, 0));
+    RTPHeader rtp_info;
+    rtp_info.sequenceNumber = i;
+    rtp_info.timestamp = i * kSamples;
+    rtp_info.ssrc = 0x1234;     // Just an arbitrary SSRC.
+    rtp_info.payloadType = 94;  // PCM16b WB codec.
+    rtp_info.markerBit = 0;
+    ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, 0));
   }
   // Pull out all data.
   for (size_t i = 0; i < num_frames; ++i) {
@@ -566,9 +565,9 @@
     int num_packets = (frame_index % 10 == 0 ? 2 : 1);
     for (int n = 0; n < num_packets; ++n) {
       uint8_t payload[kPayloadBytes] = {0};
-      WebRtcRTPHeader rtp_info;
+      RTPHeader rtp_info;
       PopulateRtpInfo(frame_index, frame_index * kSamples, &rtp_info);
-      ASSERT_EQ(0, neteq_->InsertPacket(rtp_info.header, payload, 0));
+      ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, 0));
       ++frame_index;
     }
 
@@ -594,9 +593,9 @@
     int num_packets = (i % 10 == 9 ? 0 : 1);
     for (int n = 0; n < num_packets; ++n) {
       uint8_t payload[kPayloadBytes] = {0};
-      WebRtcRTPHeader rtp_info;
+      RTPHeader rtp_info;
       PopulateRtpInfo(frame_index, frame_index * kSamples, &rtp_info);
-      ASSERT_EQ(0, neteq_->InsertPacket(rtp_info.header, payload, 0));
+      ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, 0));
       ++frame_index;
     }
 
@@ -632,9 +631,9 @@
     while (next_input_time_ms <= t_ms) {
       // Insert one 30 ms speech frame.
       uint8_t payload[kPayloadBytes] = {0};
-      WebRtcRTPHeader rtp_info;
+      RTPHeader rtp_info;
       PopulateRtpInfo(seq_no, timestamp, &rtp_info);
-      ASSERT_EQ(0, neteq_->InsertPacket(rtp_info.header, payload, 0));
+      ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, 0));
       ++seq_no;
       timestamp += kSamples;
       next_input_time_ms += static_cast<double>(kFrameSizeMs) * drift_factor;
@@ -659,10 +658,10 @@
       // Insert one CNG frame each 100 ms.
       uint8_t payload[kPayloadBytes];
       size_t payload_len;
-      WebRtcRTPHeader rtp_info;
+      RTPHeader rtp_info;
       PopulateCng(seq_no, timestamp, &rtp_info, payload, &payload_len);
       ASSERT_EQ(0, neteq_->InsertPacket(
-                       rtp_info.header,
+                       rtp_info,
                        rtc::ArrayView<const uint8_t>(payload, payload_len), 0));
       ++seq_no;
       timestamp += kCngPeriodSamples;
@@ -702,10 +701,10 @@
       // Insert one CNG frame each 100 ms.
       uint8_t payload[kPayloadBytes];
       size_t payload_len;
-      WebRtcRTPHeader rtp_info;
+      RTPHeader rtp_info;
       PopulateCng(seq_no, timestamp, &rtp_info, payload, &payload_len);
       ASSERT_EQ(0, neteq_->InsertPacket(
-                       rtp_info.header,
+                       rtp_info,
                        rtc::ArrayView<const uint8_t>(payload, payload_len), 0));
       ++seq_no;
       timestamp += kCngPeriodSamples;
@@ -720,9 +719,9 @@
     while (next_input_time_ms <= t_ms) {
       // Insert one 30 ms speech frame.
       uint8_t payload[kPayloadBytes] = {0};
-      WebRtcRTPHeader rtp_info;
+      RTPHeader rtp_info;
       PopulateRtpInfo(seq_no, timestamp, &rtp_info);
-      ASSERT_EQ(0, neteq_->InsertPacket(rtp_info.header, payload, 0));
+      ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, 0));
       ++seq_no;
       timestamp += kSamples;
       next_input_time_ms += kFrameSizeMs * drift_factor;
@@ -831,10 +830,10 @@
 TEST_F(NetEqDecodingTest, UnknownPayloadType) {
   const size_t kPayloadBytes = 100;
   uint8_t payload[kPayloadBytes] = {0};
-  WebRtcRTPHeader rtp_info;
+  RTPHeader rtp_info;
   PopulateRtpInfo(0, 0, &rtp_info);
-  rtp_info.header.payloadType = 1;  // Not registered as a decoder.
-  EXPECT_EQ(NetEq::kFail, neteq_->InsertPacket(rtp_info.header, payload, 0));
+  rtp_info.payloadType = 1;  // Not registered as a decoder.
+  EXPECT_EQ(NetEq::kFail, neteq_->InsertPacket(rtp_info, payload, 0));
   EXPECT_EQ(NetEq::kUnknownRtpPayloadType, neteq_->LastError());
 }
 
@@ -847,10 +846,10 @@
 TEST_F(NetEqDecodingTest, MAYBE_DecoderError) {
   const size_t kPayloadBytes = 100;
   uint8_t payload[kPayloadBytes] = {0};
-  WebRtcRTPHeader rtp_info;
+  RTPHeader rtp_info;
   PopulateRtpInfo(0, 0, &rtp_info);
-  rtp_info.header.payloadType = 103;  // iSAC, but the payload is invalid.
-  EXPECT_EQ(0, neteq_->InsertPacket(rtp_info.header, payload, 0));
+  rtp_info.payloadType = 103;  // iSAC, but the payload is invalid.
+  EXPECT_EQ(0, neteq_->InsertPacket(rtp_info, payload, 0));
   // Set all of |out_data_| to 1, and verify that it was set to 0 by the call
   // to GetAudio.
   for (size_t i = 0; i < AudioFrame::kMaxDataSizeSamples; ++i) {
@@ -944,9 +943,9 @@
 
     // Payload of 10 ms of PCM16 32 kHz.
     uint8_t payload[kBlockSize32kHz * sizeof(int16_t)];
-    WebRtcRTPHeader rtp_info;
+    RTPHeader rtp_info;
     PopulateRtpInfo(0, 0, &rtp_info);
-    rtp_info.header.payloadType = payload_type;
+    rtp_info.payloadType = payload_type;
 
     uint32_t receive_timestamp = 0;
     bool muted;
@@ -958,7 +957,7 @@
       ASSERT_EQ(enc_len_bytes, expected_samples_per_channel * 2);
 
       ASSERT_EQ(0, neteq_->InsertPacket(
-                       rtp_info.header,
+                       rtp_info,
                        rtc::ArrayView<const uint8_t>(payload, enc_len_bytes),
                        receive_timestamp));
       output.Reset();
@@ -968,8 +967,8 @@
       ASSERT_EQ(AudioFrame::kNormalSpeech, output.speech_type_);
 
       // Next packet.
-      rtp_info.header.timestamp += expected_samples_per_channel;
-      rtp_info.header.sequenceNumber++;
+      rtp_info.timestamp += expected_samples_per_channel;
+      rtp_info.sequenceNumber++;
       receive_timestamp += expected_samples_per_channel;
     }
 
@@ -1090,12 +1089,12 @@
     while (next_input_time_ms <= t_ms) {
       // Insert one 30 ms speech frame.
       uint8_t payload[kPayloadBytes] = {0};
-      WebRtcRTPHeader rtp_info;
+      RTPHeader rtp_info;
       PopulateRtpInfo(seq_no, timestamp, &rtp_info);
       if (drop_seq_numbers.find(seq_no) == drop_seq_numbers.end()) {
         // This sequence number was not in the set to drop. Insert it.
-        ASSERT_EQ(0, neteq_->InsertPacket(rtp_info.header, payload,
-                                          receive_timestamp));
+        ASSERT_EQ(0,
+                  neteq_->InsertPacket(rtp_info, payload, receive_timestamp));
         ++packets_inserted;
       }
       NetEqNetworkStatistics network_stats;
@@ -1179,11 +1178,11 @@
   // Insert three speech packets. Three are needed to get the frame length
   // correct.
   uint8_t payload[kPayloadBytes] = {0};
-  WebRtcRTPHeader rtp_info;
+  RTPHeader rtp_info;
   bool muted;
   for (int i = 0; i < 3; ++i) {
     PopulateRtpInfo(seq_no, timestamp, &rtp_info);
-    ASSERT_EQ(0, neteq_->InsertPacket(rtp_info.header, payload, 0));
+    ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, 0));
     ++seq_no;
     timestamp += kSamples;
 
@@ -1200,9 +1199,9 @@
   size_t payload_len;
   PopulateCng(seq_no, timestamp, &rtp_info, payload, &payload_len);
   // This is the first time this CNG packet is inserted.
-  ASSERT_EQ(0, neteq_->InsertPacket(
-                   rtp_info.header,
-                   rtc::ArrayView<const uint8_t>(payload, payload_len), 0));
+  ASSERT_EQ(
+      0, neteq_->InsertPacket(
+             rtp_info, rtc::ArrayView<const uint8_t>(payload, payload_len), 0));
 
   // Pull audio once and make sure CNG is played.
   ASSERT_EQ(0, neteq_->GetAudio(&out_frame_, &muted));
@@ -1214,9 +1213,9 @@
 
   // Insert the same CNG packet again. Note that at this point it is old, since
   // we have already decoded the first copy of it.
-  ASSERT_EQ(0, neteq_->InsertPacket(
-                   rtp_info.header,
-                   rtc::ArrayView<const uint8_t>(payload, payload_len), 0));
+  ASSERT_EQ(
+      0, neteq_->InsertPacket(
+             rtp_info, rtc::ArrayView<const uint8_t>(payload, payload_len), 0));
 
   // Pull audio until we have played |kCngPeriodMs| of CNG. Start at 10 ms since
   // we have already pulled out CNG once.
@@ -1233,7 +1232,7 @@
   ++seq_no;
   timestamp += kCngPeriodSamples;
   PopulateRtpInfo(seq_no, timestamp, &rtp_info);
-  ASSERT_EQ(0, neteq_->InsertPacket(rtp_info.header, payload, 0));
+  ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, 0));
 
   // Pull audio once and verify that the output is speech again.
   ASSERT_EQ(0, neteq_->GetAudio(&out_frame_, &muted));
@@ -1263,13 +1262,13 @@
   size_t payload_len;
 
   uint8_t payload[kPayloadBytes] = {0};
-  WebRtcRTPHeader rtp_info;
+  RTPHeader rtp_info;
 
   PopulateCng(seq_no, timestamp, &rtp_info, payload, &payload_len);
-  ASSERT_EQ(NetEq::kOK,
-            neteq_->InsertPacket(
-                rtp_info.header,
-                rtc::ArrayView<const uint8_t>(payload, payload_len), 0));
+  ASSERT_EQ(
+      NetEq::kOK,
+      neteq_->InsertPacket(
+          rtp_info, rtc::ArrayView<const uint8_t>(payload, payload_len), 0));
   ++seq_no;
   timestamp += kCngPeriodSamples;
 
@@ -1285,7 +1284,7 @@
   do {
     ASSERT_LT(timeout_counter++, 20) << "Test timed out";
     PopulateRtpInfo(seq_no, timestamp, &rtp_info);
-    ASSERT_EQ(0, neteq_->InsertPacket(rtp_info.header, payload, 0));
+    ASSERT_EQ(0, neteq_->InsertPacket(rtp_info, payload, 0));
     ++seq_no;
     timestamp += kSamples;
 
@@ -1309,20 +1308,20 @@
 
   void InsertPacket(uint32_t rtp_timestamp) {
     uint8_t payload[kPayloadBytes] = {0};
-    WebRtcRTPHeader rtp_info;
+    RTPHeader rtp_info;
     PopulateRtpInfo(0, rtp_timestamp, &rtp_info);
-    EXPECT_EQ(0, neteq_->InsertPacket(rtp_info.header, payload, 0));
+    EXPECT_EQ(0, neteq_->InsertPacket(rtp_info, payload, 0));
   }
 
   void InsertCngPacket(uint32_t rtp_timestamp) {
     uint8_t payload[kPayloadBytes] = {0};
-    WebRtcRTPHeader rtp_info;
+    RTPHeader rtp_info;
     size_t payload_len;
     PopulateCng(0, rtp_timestamp, &rtp_info, payload, &payload_len);
-    EXPECT_EQ(NetEq::kOK,
-              neteq_->InsertPacket(
-                  rtp_info.header,
-                  rtc::ArrayView<const uint8_t>(payload, payload_len), 0));
+    EXPECT_EQ(
+        NetEq::kOK,
+        neteq_->InsertPacket(
+            rtp_info, rtc::ArrayView<const uint8_t>(payload, payload_len), 0));
   }
 
   bool GetAudioReturnMuted() {
@@ -1545,10 +1544,10 @@
   const size_t kSamples = 10 * 16;
   const size_t kPayloadBytes = kSamples * 2;
   uint8_t payload[kPayloadBytes] = {0};
-  WebRtcRTPHeader rtp_info;
+  RTPHeader rtp_info;
   PopulateRtpInfo(0, 0, &rtp_info);
-  EXPECT_EQ(0, neteq_->InsertPacket(rtp_info.header, payload, 0));
-  EXPECT_EQ(0, neteq2_->InsertPacket(rtp_info.header, payload, 0));
+  EXPECT_EQ(0, neteq_->InsertPacket(rtp_info, payload, 0));
+  EXPECT_EQ(0, neteq2_->InsertPacket(rtp_info, payload, 0));
 
   AudioFrame out_frame1, out_frame2;
   bool muted;
@@ -1570,8 +1569,8 @@
   // Insert new data. Timestamp is corrected for the time elapsed since the last
   // packet.
   PopulateRtpInfo(0, kSamples * 1000, &rtp_info);
-  EXPECT_EQ(0, neteq_->InsertPacket(rtp_info.header, payload, 0));
-  EXPECT_EQ(0, neteq2_->InsertPacket(rtp_info.header, payload, 0));
+  EXPECT_EQ(0, neteq_->InsertPacket(rtp_info, payload, 0));
+  EXPECT_EQ(0, neteq2_->InsertPacket(rtp_info, payload, 0));
 
   int counter = 0;
   while (out_frame1.speech_type_ != AudioFrame::kNormalSpeech) {