Delete remaining usage of RtpHeaderParser test helper.

Bug: None
Change-Id: Ia4f8c5dc212f25b1a507e13955973ce4aa6a7ddc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225550
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34525}
diff --git a/call/BUILD.gn b/call/BUILD.gn
index 638eb0b..04b5e50 100644
--- a/call/BUILD.gn
+++ b/call/BUILD.gn
@@ -548,7 +548,6 @@
         "../test:fileutils",
         "../test:null_transport",
         "../test:perf_test",
-        "../test:rtp_test_utils",
         "../test:test_common",
         "../test:test_support",
         "../test:video_test_common",
diff --git a/call/call_perf_tests.cc b/call/call_perf_tests.cc
index c163ab2..701dda7 100644
--- a/call/call_perf_tests.cc
+++ b/call/call_perf_tests.cc
@@ -43,7 +43,6 @@
 #include "test/frame_generator_capturer.h"
 #include "test/gtest.h"
 #include "test/null_transport.h"
-#include "test/rtp_header_parser.h"
 #include "test/rtp_rtcp_observer.h"
 #include "test/testsupport/file_utils.h"
 #include "test/testsupport/perf_test.h"
diff --git a/modules/rtp_rtcp/source/rtp_rtcp_impl2_unittest.cc b/modules/rtp_rtcp/source/rtp_rtcp_impl2_unittest.cc
index c8ab15d..123b68a 100644
--- a/modules/rtp_rtcp/source/rtp_rtcp_impl2_unittest.cc
+++ b/modules/rtp_rtcp/source/rtp_rtcp_impl2_unittest.cc
@@ -31,7 +31,6 @@
 #include "test/gmock.h"
 #include "test/gtest.h"
 #include "test/rtcp_packet_parser.h"
-#include "test/rtp_header_parser.h"
 #include "test/run_loop.h"
 #include "test/time_controller/simulated_time_controller.h"
 
diff --git a/modules/rtp_rtcp/source/rtp_rtcp_impl_unittest.cc b/modules/rtp_rtcp/source/rtp_rtcp_impl_unittest.cc
index ac05584..0902e90 100644
--- a/modules/rtp_rtcp/source/rtp_rtcp_impl_unittest.cc
+++ b/modules/rtp_rtcp/source/rtp_rtcp_impl_unittest.cc
@@ -24,7 +24,6 @@
 #include "test/gmock.h"
 #include "test/gtest.h"
 #include "test/rtcp_packet_parser.h"
-#include "test/rtp_header_parser.h"
 
 using ::testing::ElementsAre;
 using ::testing::Eq;
diff --git a/modules/rtp_rtcp/source/rtp_sender_unittest.cc b/modules/rtp_rtcp/source/rtp_sender_unittest.cc
index e9be0161..7237bee 100644
--- a/modules/rtp_rtcp/source/rtp_sender_unittest.cc
+++ b/modules/rtp_rtcp/source/rtp_sender_unittest.cc
@@ -40,7 +40,6 @@
 #include "test/gmock.h"
 #include "test/gtest.h"
 #include "test/mock_transport.h"
-#include "test/rtp_header_parser.h"
 #include "test/time_controller/simulated_time_controller.h"
 
 namespace webrtc {
diff --git a/test/BUILD.gn b/test/BUILD.gn
index 82d0b9e..9172eb3 100644
--- a/test/BUILD.gn
+++ b/test/BUILD.gn
@@ -196,8 +196,6 @@
     "rtp_file_reader.h",
     "rtp_file_writer.cc",
     "rtp_file_writer.h",
-    "rtp_header_parser.cc",
-    "rtp_header_parser.h",
   ]
 
   deps = [
@@ -212,7 +210,6 @@
     "../rtc_base/synchronization:mutex",
     "../rtc_base/system:arch",
   ]
-  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
 }
 
 rtc_library("field_trial") {
diff --git a/test/fuzzers/BUILD.gn b/test/fuzzers/BUILD.gn
index 201cb49..1561e8b 100644
--- a/test/fuzzers/BUILD.gn
+++ b/test/fuzzers/BUILD.gn
@@ -618,11 +618,6 @@
   ]
 }
 
-webrtc_fuzzer_test("rtp_header_parser_fuzzer") {
-  sources = [ "rtp_header_parser_fuzzer.cc" ]
-  deps = [ "../:rtp_test_utils" ]
-}
-
 webrtc_fuzzer_test("ssl_certificate_fuzzer") {
   sources = [ "ssl_certificate_fuzzer.cc" ]
   deps = [
diff --git a/test/fuzzers/rtp_header_parser_fuzzer.cc b/test/fuzzers/rtp_header_parser_fuzzer.cc
deleted file mode 100644
index 435c64b..0000000
--- a/test/fuzzers/rtp_header_parser_fuzzer.cc
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- *  Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-#include <stddef.h>
-#include <stdint.h>
-
-#include <algorithm>
-#include <memory>
-#include <string>
-
-#include "test/rtp_header_parser.h"
-
-namespace webrtc {
-
-void FuzzOneInput(const uint8_t* data, size_t size) {
-  RtpHeaderParser::GetSsrc(data, size);
-}
-
-}  // namespace webrtc
diff --git a/test/peer_scenario/tests/BUILD.gn b/test/peer_scenario/tests/BUILD.gn
index a8b9c25..042b636 100644
--- a/test/peer_scenario/tests/BUILD.gn
+++ b/test/peer_scenario/tests/BUILD.gn
@@ -19,7 +19,6 @@
     deps = [
       "..:peer_scenario",
       "../../:field_trial",
-      "../../:rtp_test_utils",
       "../../:test_support",
       "../../../media:rtc_media_base",
       "../../../modules/rtp_rtcp:rtp_rtcp",
diff --git a/test/peer_scenario/tests/unsignaled_stream_test.cc b/test/peer_scenario/tests/unsignaled_stream_test.cc
index e0fe02e..3fd3c7d 100644
--- a/test/peer_scenario/tests/unsignaled_stream_test.cc
+++ b/test/peer_scenario/tests/unsignaled_stream_test.cc
@@ -17,7 +17,6 @@
 #include "test/gmock.h"
 #include "test/gtest.h"
 #include "test/peer_scenario/peer_scenario.h"
-#include "test/rtp_header_parser.h"
 
 namespace webrtc {
 namespace test {
diff --git a/test/rtp_header_parser.cc b/test/rtp_header_parser.cc
deleted file mode 100644
index 48e493d..0000000
--- a/test/rtp_header_parser.cc
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- *  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-#include "test/rtp_header_parser.h"
-
-#include "modules/rtp_rtcp/source/rtp_utility.h"
-
-namespace webrtc {
-
-absl::optional<uint32_t> RtpHeaderParser::GetSsrc(const uint8_t* packet,
-                                                  size_t length) {
-  RtpUtility::RtpHeaderParser rtp_parser(packet, length);
-  RTPHeader header;
-  if (rtp_parser.Parse(&header, nullptr)) {
-    return header.ssrc;
-  }
-  return absl::nullopt;
-}
-
-}  // namespace webrtc
diff --git a/test/rtp_header_parser.h b/test/rtp_header_parser.h
deleted file mode 100644
index f6ed74c..0000000
--- a/test/rtp_header_parser.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- *  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-#ifndef TEST_RTP_HEADER_PARSER_H_
-#define TEST_RTP_HEADER_PARSER_H_
-
-#include <stddef.h>
-#include <stdint.h>
-
-#include "absl/types/optional.h"
-
-namespace webrtc {
-
-class RtpHeaderParser {
- public:
-  static absl::optional<uint32_t> GetSsrc(const uint8_t* packet, size_t length);
-};
-}  // namespace webrtc
-#endif  // TEST_RTP_HEADER_PARSER_H_
diff --git a/test/scenario/BUILD.gn b/test/scenario/BUILD.gn
index a64f831..561cd7b 100644
--- a/test/scenario/BUILD.gn
+++ b/test/scenario/BUILD.gn
@@ -71,7 +71,6 @@
       ":column_printer",
       "../:fake_video_codecs",
       "../:fileutils",
-      "../:rtp_test_utils",
       "../:test_common",
       "../:test_support",
       "../:video_test_common",
diff --git a/test/scenario/call_client.cc b/test/scenario/call_client.cc
index be8d39f..d45909c 100644
--- a/test/scenario/call_client.cc
+++ b/test/scenario/call_client.cc
@@ -18,7 +18,6 @@
 #include "api/transport/network_types.h"
 #include "modules/audio_mixer/audio_mixer_impl.h"
 #include "modules/rtp_rtcp/source/rtp_util.h"
-#include "test/rtp_header_parser.h"
 
 namespace webrtc {
 namespace test {
@@ -295,9 +294,7 @@
 void CallClient::OnPacketReceived(EmulatedIpPacket packet) {
   MediaType media_type = MediaType::ANY;
   if (IsRtpPacket(packet.data)) {
-    auto ssrc = RtpHeaderParser::GetSsrc(packet.cdata(), packet.data.size());
-    RTC_CHECK(ssrc.has_value());
-    media_type = ssrc_media_types_[*ssrc];
+    media_type = ssrc_media_types_[ParseRtpSsrc(packet.data)];
   }
   task_queue_.PostTask(
       [call = call_.get(), media_type, packet = std::move(packet)]() mutable {