diff --git a/test/BUILD.gn b/test/BUILD.gn index 9172eb3227..d645621e79 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -517,6 +517,7 @@ if (rtc_include_tests && !build_with_chromium) { ":test_support_test_artifacts", ":video_test_common", ":video_test_support", + "../api:array_view", "../api:create_frame_generator", "../api:create_simulcast_test_fixture_api", "../api:frame_generator_api", @@ -530,7 +531,6 @@ if (rtc_include_tests && !build_with_chromium) { "../call:video_stream_api", "../common_video", "../media:rtc_media_base", - "../modules/rtp_rtcp", "../modules/rtp_rtcp:rtp_rtcp_format", "../modules/video_coding:simulcast_test_fixture_impl", "../modules/video_coding:video_codec_interface", diff --git a/test/peer_scenario/tests/BUILD.gn b/test/peer_scenario/tests/BUILD.gn index 042b636690..dd72473bf8 100644 --- a/test/peer_scenario/tests/BUILD.gn +++ b/test/peer_scenario/tests/BUILD.gn @@ -21,7 +21,6 @@ if (rtc_include_tests) { "../../:field_trial", "../../:test_support", "../../../media:rtc_media_base", - "../../../modules/rtp_rtcp:rtp_rtcp", "../../../modules/rtp_rtcp:rtp_rtcp_format", "../../../pc:rtc_pc_base", "../../../pc:session_description", diff --git a/test/peer_scenario/tests/remote_estimate_test.cc b/test/peer_scenario/tests/remote_estimate_test.cc index f1d8345fde..429a5b4ef6 100644 --- a/test/peer_scenario/tests/remote_estimate_test.cc +++ b/test/peer_scenario/tests/remote_estimate_test.cc @@ -8,8 +8,10 @@ * be found in the AUTHORS file in the root of the source tree. */ +#include "modules/rtp_rtcp/include/rtp_header_extension_map.h" +#include "modules/rtp_rtcp/source/rtp_header_extensions.h" +#include "modules/rtp_rtcp/source/rtp_packet.h" #include "modules/rtp_rtcp/source/rtp_util.h" -#include "modules/rtp_rtcp/source/rtp_utility.h" #include "pc/media_session.h" #include "pc/session_description.h" #include "test/field_trial.h" @@ -26,19 +28,6 @@ RtpHeaderExtensionMap AudioExtensions( return RtpHeaderExtensionMap(audio_desc->rtp_header_extensions()); } -absl::optional GetRtpPacketExtensions( - const rtc::ArrayView packet, - const RtpHeaderExtensionMap& extension_map) { - RtpUtility::RtpHeaderParser rtp_parser(packet.data(), packet.size()); - if (IsRtpPacket(packet)) { - RTPHeader header; - if (rtp_parser.Parse(&header, &extension_map, true)) { - return header.extension; - } - } - return absl::nullopt; -} - } // namespace TEST(RemoteEstimateEndToEnd, OfferedCapabilityIsInAnswer) { @@ -106,13 +95,10 @@ TEST(RemoteEstimateEndToEnd, AudioUsesAbsSendTimeExtension) { // The dummy packets used by the fake signaling are filled with 0. We // want to ignore those and we can do that on the basis that the first // byte of RTP packets are guaranteed to not be 0. - // TODO(srte): Find a more elegant way to check for RTP traffic. - if (packet.size() > 1 && packet.cdata()[0] != 0) { - auto extensions = GetRtpPacketExtensions(packet.data, extension_map); - if (extensions) { - EXPECT_TRUE(extensions->hasAbsoluteSendTime); - received_abs_send_time = true; - } + RtpPacket rtp_packet(&extension_map); + if (rtp_packet.Parse(packet.data)) { + EXPECT_TRUE(rtp_packet.HasExtension()); + received_abs_send_time = true; } }); RTC_CHECK(s.WaitAndProcess(&received_abs_send_time)); diff --git a/test/rtp_file_reader_unittest.cc b/test/rtp_file_reader_unittest.cc index 8dc817de60..995d9fbc9d 100644 --- a/test/rtp_file_reader_unittest.cc +++ b/test/rtp_file_reader_unittest.cc @@ -13,7 +13,8 @@ #include #include -#include "modules/rtp_rtcp/source/rtp_utility.h" +#include "api/array_view.h" +#include "modules/rtp_rtcp/source/rtp_util.h" #include "test/gtest.h" #include "test/testsupport/file_utils.h" @@ -84,11 +85,9 @@ class TestPcapFileReader : public ::testing::Test { PacketsPerSsrc pps; test::RtpPacket packet; while (rtp_packet_source_->NextPacket(&packet)) { - RtpUtility::RtpHeaderParser rtp_header_parser(packet.data, packet.length); - webrtc::RTPHeader header; - if (!rtp_header_parser.RTCP() && - rtp_header_parser.Parse(&header, nullptr)) { - pps[header.ssrc]++; + rtc::ArrayView raw(packet.data, packet.length); + if (IsRtpPacket(raw)) { + pps[ParseRtpSsrc(raw)]++; } } return pps;