TimestampScaler no longer depends on NetEqDecoder to figure out scaling.

This is still a tiny lie, since it checks for kCodecArbitrary to avoid
scaling a codec with an external decoder, because of missing information
in that case. The main point is still true, though. Once the next CL is
in, removing NetEqDecoder usage completely in DecoderDatabase, another
workaround will be in place for external decoders until we can fully
deprecate them.

BUG=webrtc:5805

Review-Url: https://codereview.webrtc.org/2270063006
Cr-Commit-Position: refs/heads/master@{#13952}
diff --git a/webrtc/modules/audio_coding/neteq/timestamp_scaler_unittest.cc b/webrtc/modules/audio_coding/neteq/timestamp_scaler_unittest.cc
index 91e1342..1b8910e 100644
--- a/webrtc/modules/audio_coding/neteq/timestamp_scaler_unittest.cc
+++ b/webrtc/modules/audio_coding/neteq/timestamp_scaler_unittest.cc
@@ -12,6 +12,7 @@
 
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h"
 #include "webrtc/modules/audio_coding/neteq/mock/mock_decoder_database.h"
 #include "webrtc/modules/audio_coding/neteq/packet.h"
 
@@ -23,8 +24,10 @@
 
 TEST(TimestampScaler, TestNoScaling) {
   MockDecoderDatabase db;
+  auto factory = CreateBuiltinAudioDecoderFactory();
   // Use PCMu, because it doesn't use scaled timestamps.
-  const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderPCMu, "");
+  const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderPCMu, "",
+                                          factory);
   static const uint8_t kRtpPayloadType = 0;
   EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
       .WillRepeatedly(Return(&info));
@@ -43,8 +46,10 @@
 
 TEST(TimestampScaler, TestNoScalingLargeStep) {
   MockDecoderDatabase db;
+  auto factory = CreateBuiltinAudioDecoderFactory();
   // Use PCMu, because it doesn't use scaled timestamps.
-  const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderPCMu, "");
+  const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderPCMu, "",
+                                          factory);
   static const uint8_t kRtpPayloadType = 0;
   EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
       .WillRepeatedly(Return(&info));
@@ -68,8 +73,10 @@
 
 TEST(TimestampScaler, TestG722) {
   MockDecoderDatabase db;
+  auto factory = CreateBuiltinAudioDecoderFactory();
   // Use G722, which has a factor 2 scaling.
-  const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, "");
+  const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, "",
+                                          factory);
   static const uint8_t kRtpPayloadType = 17;
   EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
       .WillRepeatedly(Return(&info));
@@ -92,8 +99,10 @@
 
 TEST(TimestampScaler, TestG722LargeStep) {
   MockDecoderDatabase db;
+  auto factory = CreateBuiltinAudioDecoderFactory();
   // Use G722, which has a factor 2 scaling.
-  const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, "");
+  const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, "",
+                                          factory);
   static const uint8_t kRtpPayloadType = 17;
   EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
       .WillRepeatedly(Return(&info));
@@ -120,9 +129,12 @@
 
 TEST(TimestampScaler, TestG722WithCng) {
   MockDecoderDatabase db;
+  auto factory = CreateBuiltinAudioDecoderFactory();
   // Use G722, which has a factor 2 scaling.
-  const DecoderDatabase::DecoderInfo info_g722(NetEqDecoder::kDecoderG722, "");
-  const DecoderDatabase::DecoderInfo info_cng(NetEqDecoder::kDecoderCNGwb, "");
+  const DecoderDatabase::DecoderInfo info_g722(NetEqDecoder::kDecoderG722, "",
+                                               factory);
+  const DecoderDatabase::DecoderInfo info_cng(NetEqDecoder::kDecoderCNGwb, "",
+                                              factory);
   static const uint8_t kRtpPayloadTypeG722 = 17;
   static const uint8_t kRtpPayloadTypeCng = 13;
   EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadTypeG722))
@@ -161,8 +173,10 @@
 // as many tests here.
 TEST(TimestampScaler, TestG722Packet) {
   MockDecoderDatabase db;
+  auto factory = CreateBuiltinAudioDecoderFactory();
   // Use G722, which has a factor 2 scaling.
-  const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, "");
+  const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, "",
+                                          factory);
   static const uint8_t kRtpPayloadType = 17;
   EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
       .WillRepeatedly(Return(&info));
@@ -189,8 +203,10 @@
 // we are not doing as many tests here.
 TEST(TimestampScaler, TestG722PacketList) {
   MockDecoderDatabase db;
+  auto factory = CreateBuiltinAudioDecoderFactory();
   // Use G722, which has a factor 2 scaling.
-  const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, "");
+  const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, "",
+                                          factory);
   static const uint8_t kRtpPayloadType = 17;
   EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
       .WillRepeatedly(Return(&info));
@@ -218,8 +234,10 @@
 
 TEST(TimestampScaler, TestG722Reset) {
   MockDecoderDatabase db;
+  auto factory = CreateBuiltinAudioDecoderFactory();
   // Use G722, which has a factor 2 scaling.
-  const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, "");
+  const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderG722, "",
+                                          factory);
   static const uint8_t kRtpPayloadType = 17;
   EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
       .WillRepeatedly(Return(&info));
@@ -258,7 +276,9 @@
 // timestamp scaler.
 TEST(TimestampScaler, TestOpusLargeStep) {
   MockDecoderDatabase db;
-  const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderOpus, "");
+  auto factory = CreateBuiltinAudioDecoderFactory();
+  const DecoderDatabase::DecoderInfo info(NetEqDecoder::kDecoderOpus, "",
+                                          factory);
   static const uint8_t kRtpPayloadType = 17;
   EXPECT_CALL(db, GetDecoderInfo(kRtpPayloadType))
       .WillRepeatedly(Return(&info));