Restructure neteq_rtpplay into a library with small executable wrapper.

Most of the code in neteq_rtpplay is moved into a factory class for
NetEqTest. The factory method takes the same argc and argv arguments as
neteq_rtpplay.
This CL also adds a small public API for neteq_test to allow easy
integration into external software.

Bug: webrtc:9667
Change-Id: I5241c1f51736cb6fbe47b0ad25f4bc83dabd727d
Reviewed-on: https://webrtc-review.googlesource.com/96100
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24531}
diff --git a/api/BUILD.gn b/api/BUILD.gn
index ce66627..f8b6ca3 100644
--- a/api/BUILD.gn
+++ b/api/BUILD.gn
@@ -309,6 +309,14 @@
   ]
 }
 
+rtc_source_set("neteq_simulator_api") {
+  visibility = [ "*" ]
+  sources = [
+    "test/neteq_simulator.cc",
+    "test/neteq_simulator.h",
+  ]
+}
+
 if (rtc_include_tests) {
   if (rtc_enable_protobuf) {
     rtc_source_set("audioproc_f_api") {
@@ -324,6 +332,20 @@
         "../modules/audio_processing:audioproc_f_impl",
       ]
     }
+
+    rtc_source_set("neteq_simulator_factory") {
+      visibility = [ "*" ]
+      testonly = true
+      sources = [
+        "test/neteq_simulator_factory.cc",
+        "test/neteq_simulator_factory.h",
+      ]
+      deps = [
+        ":neteq_simulator_api",
+        "../modules/audio_coding:neteq_test_factory",
+        "//third_party/abseil-cpp/absl/memory",
+      ]
+    }
   }
 
   rtc_source_set("simulcast_test_fixture_api") {