From 7dc97740ea3a69f2a45e3a296b7af07f45bfe1a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= Date: Thu, 18 Oct 2018 15:29:52 +0200 Subject: [PATCH] Delete unused code from media/base/testutils.{cc,h} Bug: None Change-Id: I7ae33e74299500bc97b4b561275ff968d10cba3c Reviewed-on: https://webrtc-review.googlesource.com/c/106902 Reviewed-by: Steve Anton Commit-Queue: Niels Moller Cr-Commit-Position: refs/heads/master@{#25259} --- media/base/testutils.cc | 76 --------------------- media/base/testutils.h | 40 ----------- media/base/videoadapter_unittest.cc | 1 - media/base/videocapturer_unittest.cc | 1 - media/engine/fakewebrtcvideocapturemodule.h | 1 - pc/channel_unittest.cc | 1 - pc/rtcpmuxfilter_unittest.cc | 1 - 7 files changed, 121 deletions(-) diff --git a/media/base/testutils.cc b/media/base/testutils.cc index 93c2bc98ae..512dc91f93 100644 --- a/media/base/testutils.cc +++ b/media/base/testutils.cc @@ -10,90 +10,14 @@ #include "media/base/testutils.h" -#include #include #include #include "api/video/video_frame.h" #include "media/base/videocapturer.h" -#include "rtc_base/bytebuffer.h" -#include "rtc_base/gunit.h" -#include "rtc_base/stream.h" -#include "rtc_base/stringutils.h" -#include "rtc_base/testutils.h" namespace cricket { -///////////////////////////////////////////////////////////////////////// -// Implementation of RawRtpPacket -///////////////////////////////////////////////////////////////////////// -void RawRtpPacket::WriteToByteBuffer(uint32_t in_ssrc, - rtc::ByteBufferWriter* buf) const { - if (!buf) - return; - - buf->WriteUInt8(ver_to_cc); - buf->WriteUInt8(m_to_pt); - buf->WriteUInt16(sequence_number); - buf->WriteUInt32(timestamp); - buf->WriteUInt32(in_ssrc); - buf->WriteBytes(payload, sizeof(payload)); -} - -bool RawRtpPacket::ReadFromByteBuffer(rtc::ByteBufferReader* buf) { - if (!buf) - return false; - - bool ret = true; - ret &= buf->ReadUInt8(&ver_to_cc); - ret &= buf->ReadUInt8(&m_to_pt); - ret &= buf->ReadUInt16(&sequence_number); - ret &= buf->ReadUInt32(×tamp); - ret &= buf->ReadUInt32(&ssrc); - ret &= buf->ReadBytes(payload, sizeof(payload)); - return ret; -} - -bool RawRtpPacket::SameExceptSeqNumTimestampSsrc(const RawRtpPacket& packet, - uint16_t seq, - uint32_t ts, - uint32_t ssc) const { - return sequence_number == seq && timestamp == ts && - ver_to_cc == packet.ver_to_cc && m_to_pt == packet.m_to_pt && - ssrc == ssc && 0 == memcmp(payload, packet.payload, sizeof(payload)); -} - -///////////////////////////////////////////////////////////////////////// -// Implementation of RawRtcpPacket -///////////////////////////////////////////////////////////////////////// -void RawRtcpPacket::WriteToByteBuffer(rtc::ByteBufferWriter* buf) const { - if (!buf) - return; - - buf->WriteUInt8(ver_to_count); - buf->WriteUInt8(type); - buf->WriteUInt16(length); - buf->WriteBytes(payload, sizeof(payload)); -} - -bool RawRtcpPacket::ReadFromByteBuffer(rtc::ByteBufferReader* buf) { - if (!buf) - return false; - - bool ret = true; - ret &= buf->ReadUInt8(&ver_to_count); - ret &= buf->ReadUInt8(&type); - ret &= buf->ReadUInt16(&length); - ret &= buf->ReadBytes(payload, sizeof(payload)); - return ret; -} - -bool RawRtcpPacket::EqualsTo(const RawRtcpPacket& packet) const { - return ver_to_count == packet.ver_to_count && type == packet.type && - length == packet.length && - 0 == memcmp(payload, packet.payload, sizeof(payload)); -} - // Implementation of VideoCaptureListener. VideoCapturerListener::VideoCapturerListener(VideoCapturer* capturer) : capturer_(capturer), diff --git a/media/base/testutils.h b/media/base/testutils.h index c84696236b..6b63ffd180 100644 --- a/media/base/testutils.h +++ b/media/base/testutils.h @@ -20,12 +20,6 @@ #include "rtc_base/arraysize.h" #include "rtc_base/third_party/sigslot/sigslot.h" -namespace rtc { -class ByteBufferReader; -class ByteBufferWriter; -class StreamInterface; -} // namespace rtc - namespace webrtc { class VideoFrame; } @@ -43,40 +37,6 @@ inline std::vector MakeVector(const T a[], size_t s) { } #define MAKE_VECTOR(a) cricket::MakeVector(a, arraysize(a)) -struct RtpDumpPacket; -class RtpDumpWriter; - -struct RawRtpPacket { - void WriteToByteBuffer(uint32_t in_ssrc, rtc::ByteBufferWriter* buf) const; - bool ReadFromByteBuffer(rtc::ByteBufferReader* buf); - // Check if this packet is the same as the specified packet except the - // sequence number and timestamp, which should be the same as the specified - // parameters. - bool SameExceptSeqNumTimestampSsrc(const RawRtpPacket& packet, - uint16_t seq, - uint32_t ts, - uint32_t ssc) const; - int size() const { return 28; } - - uint8_t ver_to_cc; - uint8_t m_to_pt; - uint16_t sequence_number; - uint32_t timestamp; - uint32_t ssrc; - char payload[16]; -}; - -struct RawRtcpPacket { - void WriteToByteBuffer(rtc::ByteBufferWriter* buf) const; - bool ReadFromByteBuffer(rtc::ByteBufferReader* buf); - bool EqualsTo(const RawRtcpPacket& packet) const; - - uint8_t ver_to_count; - uint8_t type; - uint16_t length; - char payload[16]; -}; - // Test helper for testing VideoCapturer implementations. class VideoCapturerListener : public sigslot::has_slots<>, diff --git a/media/base/videoadapter_unittest.cc b/media/base/videoadapter_unittest.cc index 67a662639e..ea7528117e 100644 --- a/media/base/videoadapter_unittest.cc +++ b/media/base/videoadapter_unittest.cc @@ -18,7 +18,6 @@ #include "absl/memory/memory.h" #include "media/base/fakeframesource.h" #include "media/base/mediachannel.h" -#include "media/base/testutils.h" #include "media/base/videoadapter.h" #include "rtc_base/gunit.h" #include "rtc_base/logging.h" diff --git a/media/base/videocapturer_unittest.cc b/media/base/videocapturer_unittest.cc index 080f4a08ca..07344ca7ac 100644 --- a/media/base/videocapturer_unittest.cc +++ b/media/base/videocapturer_unittest.cc @@ -15,7 +15,6 @@ #include "media/base/fakevideocapturer.h" #include "media/base/fakevideorenderer.h" -#include "media/base/testutils.h" #include "media/base/videocapturer.h" #include "rtc_base/gunit.h" #include "rtc_base/logging.h" diff --git a/media/engine/fakewebrtcvideocapturemodule.h b/media/engine/fakewebrtcvideocapturemodule.h index 47f1393c3f..7556811f2d 100644 --- a/media/engine/fakewebrtcvideocapturemodule.h +++ b/media/engine/fakewebrtcvideocapturemodule.h @@ -14,7 +14,6 @@ #include #include "api/video/i420_buffer.h" -#include "media/base/testutils.h" #include "media/engine/webrtcvideocapturer.h" #include "rtc_base/task_queue_for_test.h" diff --git a/pc/channel_unittest.cc b/pc/channel_unittest.cc index f17032c3b5..fc3f20ac1e 100644 --- a/pc/channel_unittest.cc +++ b/pc/channel_unittest.cc @@ -15,7 +15,6 @@ #include "media/base/fakemediaengine.h" #include "media/base/fakertp.h" #include "media/base/mediachannel.h" -#include "media/base/testutils.h" #include "p2p/base/fakecandidatepair.h" #include "p2p/base/fakedtlstransport.h" #include "p2p/base/fakepackettransport.h" diff --git a/pc/rtcpmuxfilter_unittest.cc b/pc/rtcpmuxfilter_unittest.cc index 555ab5c468..a6ac4478fc 100644 --- a/pc/rtcpmuxfilter_unittest.cc +++ b/pc/rtcpmuxfilter_unittest.cc @@ -9,7 +9,6 @@ */ #include "pc/rtcpmuxfilter.h" -#include "media/base/testutils.h" #include "rtc_base/gunit.h" TEST(RtcpMuxFilterTest, IsActiveSender) {