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 <steveanton@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25259}
This commit is contained in:
parent
192eeec14d
commit
7dc97740ea
@ -10,90 +10,14 @@
|
||||
|
||||
#include "media/base/testutils.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
|
||||
#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),
|
||||
|
||||
@ -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<T> 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<>,
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -14,7 +14,6 @@
|
||||
#include <vector>
|
||||
|
||||
#include "api/video/i420_buffer.h"
|
||||
#include "media/base/testutils.h"
|
||||
#include "media/engine/webrtcvideocapturer.h"
|
||||
#include "rtc_base/task_queue_for_test.h"
|
||||
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
*/
|
||||
|
||||
#include "pc/rtcpmuxfilter.h"
|
||||
#include "media/base/testutils.h"
|
||||
#include "rtc_base/gunit.h"
|
||||
|
||||
TEST(RtcpMuxFilterTest, IsActiveSender) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user