Delete class NullRtpData and function NullObjectRtpData.
BUG=webrtc:5565 Review-Url: https://codereview.webrtc.org/2885823002 Cr-Commit-Position: refs/heads/master@{#18366}
This commit is contained in:
parent
a0bf559b52
commit
7fcdb6d7ca
@ -405,23 +405,6 @@ inline int32_t NullRtpFeedback::OnInitializeDecoder(
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Null object version of RtpData.
|
||||
class NullRtpData : public RtpData {
|
||||
public:
|
||||
~NullRtpData() override {}
|
||||
|
||||
int32_t OnReceivedPayloadData(const uint8_t* payload_data,
|
||||
size_t payload_size,
|
||||
const WebRtcRTPHeader* rtp_header) override;
|
||||
};
|
||||
|
||||
inline int32_t NullRtpData::OnReceivedPayloadData(
|
||||
const uint8_t* payload_data,
|
||||
size_t payload_size,
|
||||
const WebRtcRTPHeader* rtp_header) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Statistics about packet loss for a single directional connection. All values
|
||||
// are totals since the connection initiated.
|
||||
struct RtpPacketLossStats {
|
||||
|
||||
@ -31,9 +31,6 @@ class MockRtpData : public RtpData {
|
||||
int32_t(const uint8_t* payload_data,
|
||||
size_t payload_size,
|
||||
const WebRtcRTPHeader* rtp_header));
|
||||
|
||||
MOCK_METHOD2(OnRecoveredPacket,
|
||||
bool(const uint8_t* packet, size_t packet_length));
|
||||
};
|
||||
|
||||
class MockRtpRtcp : public RtpRtcp {
|
||||
|
||||
@ -37,7 +37,7 @@ const int kPayloadType = 123;
|
||||
const int kRtxPayloadType = 98;
|
||||
const int64_t kMaxRttMs = 1000;
|
||||
|
||||
class VerifyingRtxReceiver : public NullRtpData {
|
||||
class VerifyingRtxReceiver : public RtpData {
|
||||
public:
|
||||
VerifyingRtxReceiver() {}
|
||||
|
||||
|
||||
@ -197,7 +197,7 @@ class RtcpPacketTypeCounterObserverImpl : public RtcpPacketTypeCounterObserver {
|
||||
};
|
||||
|
||||
class TestTransport : public Transport,
|
||||
public NullRtpData {
|
||||
public RtpData {
|
||||
public:
|
||||
TestTransport() {}
|
||||
|
||||
|
||||
@ -36,8 +36,7 @@ RtpReceiver* RtpReceiver::CreateVideoReceiver(
|
||||
RtpData* incoming_payload_callback,
|
||||
RtpFeedback* incoming_messages_callback,
|
||||
RTPPayloadRegistry* rtp_payload_registry) {
|
||||
if (!incoming_payload_callback)
|
||||
incoming_payload_callback = NullObjectRtpData();
|
||||
RTC_DCHECK(incoming_payload_callback != nullptr);
|
||||
if (!incoming_messages_callback)
|
||||
incoming_messages_callback = NullObjectRtpFeedback();
|
||||
return new RtpReceiverImpl(
|
||||
@ -50,8 +49,7 @@ RtpReceiver* RtpReceiver::CreateAudioReceiver(
|
||||
RtpData* incoming_payload_callback,
|
||||
RtpFeedback* incoming_messages_callback,
|
||||
RTPPayloadRegistry* rtp_payload_registry) {
|
||||
if (!incoming_payload_callback)
|
||||
incoming_payload_callback = NullObjectRtpData();
|
||||
RTC_DCHECK(incoming_payload_callback != nullptr);
|
||||
if (!incoming_messages_callback)
|
||||
incoming_messages_callback = NullObjectRtpFeedback();
|
||||
return new RtpReceiverImpl(
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
#include "webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h"
|
||||
#include "webrtc/modules/rtp_rtcp/include/rtp_receiver.h"
|
||||
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||
#include "webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.h"
|
||||
#include "webrtc/test/gmock.h"
|
||||
#include "webrtc/test/gtest.h"
|
||||
@ -22,6 +23,7 @@
|
||||
namespace webrtc {
|
||||
namespace {
|
||||
|
||||
using ::testing::NiceMock;
|
||||
using ::testing::UnorderedElementsAre;
|
||||
|
||||
const uint32_t kTestRate = 64000u;
|
||||
@ -46,7 +48,7 @@ class RtpReceiverTest : public ::testing::Test {
|
||||
: fake_clock_(123456),
|
||||
rtp_receiver_(
|
||||
RtpReceiver::CreateAudioReceiver(&fake_clock_,
|
||||
nullptr,
|
||||
&mock_rtp_data_,
|
||||
nullptr,
|
||||
&rtp_payload_registry_)) {
|
||||
CodecInst voice_codec = {};
|
||||
@ -73,6 +75,7 @@ class RtpReceiverTest : public ::testing::Test {
|
||||
}
|
||||
|
||||
SimulatedClock fake_clock_;
|
||||
NiceMock<MockRtpData> mock_rtp_data_;
|
||||
RTPPayloadRegistry rtp_payload_registry_;
|
||||
std::unique_ptr<RtpReceiver> rtp_receiver_;
|
||||
};
|
||||
|
||||
@ -50,7 +50,7 @@ class RtcpRttStatsTestImpl : public RtcpRttStats {
|
||||
};
|
||||
|
||||
class SendTransport : public Transport,
|
||||
public NullRtpData {
|
||||
public RtpData {
|
||||
public:
|
||||
SendTransport()
|
||||
: receiver_(NULL),
|
||||
@ -88,6 +88,11 @@ class SendTransport : public Transport,
|
||||
EXPECT_EQ(0, receiver_->IncomingRtcpPacket(data, len));
|
||||
return true;
|
||||
}
|
||||
int32_t OnReceivedPayloadData(const uint8_t* payload_data,
|
||||
size_t payload_size,
|
||||
const WebRtcRTPHeader* rtp_header) override {
|
||||
return 0;
|
||||
}
|
||||
ModuleRtpRtcpImpl* receiver_;
|
||||
SimulatedClock* clock_;
|
||||
int64_t delay_ms_;
|
||||
|
||||
@ -19,11 +19,6 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
RtpData* NullObjectRtpData() {
|
||||
static NullRtpData null_rtp_data;
|
||||
return &null_rtp_data;
|
||||
}
|
||||
|
||||
RtpFeedback* NullObjectRtpFeedback() {
|
||||
static NullRtpFeedback null_rtp_feedback;
|
||||
return &null_rtp_feedback;
|
||||
|
||||
@ -24,7 +24,6 @@ namespace webrtc {
|
||||
|
||||
const uint8_t kRtpMarkerBitMask = 0x80;
|
||||
|
||||
RtpData* NullObjectRtpData();
|
||||
RtpFeedback* NullObjectRtpFeedback();
|
||||
ReceiveStatistics* NullObjectReceiveStatistics();
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ class LoopBackTransport : public Transport {
|
||||
RtpRtcp* rtp_rtcp_module_;
|
||||
};
|
||||
|
||||
class TestRtpReceiver : public NullRtpData {
|
||||
class TestRtpReceiver : public RtpData {
|
||||
public:
|
||||
int32_t OnReceivedPayloadData(
|
||||
const uint8_t* payload_data,
|
||||
|
||||
@ -47,7 +47,7 @@ bool IsComfortNoisePayload(uint8_t payload_type) {
|
||||
return false;
|
||||
}
|
||||
|
||||
class VerifyingAudioReceiver : public NullRtpData {
|
||||
class VerifyingAudioReceiver : public RtpData {
|
||||
public:
|
||||
int32_t OnReceivedPayloadData(
|
||||
const uint8_t* payloadData,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user