Delete unused method PayloadRouter::MaxPayloadLength.
Documentation was also unclear, it seems it returned the RTP packet size including RTP headers. BUG=None. Review-Url: https://codereview.webrtc.org/2588343002 Cr-Commit-Position: refs/heads/master@{#15707}
This commit is contained in:
parent
8bab796db7
commit
5206667dad
@ -98,11 +98,6 @@ PayloadRouter::PayloadRouter(const std::vector<RtpRtcp*>& rtp_modules,
|
||||
|
||||
PayloadRouter::~PayloadRouter() {}
|
||||
|
||||
size_t PayloadRouter::DefaultMaxPayloadLength() {
|
||||
const size_t kIpUdpSrtpLength = 44;
|
||||
return IP_PACKET_SIZE - kIpUdpSrtpLength;
|
||||
}
|
||||
|
||||
void PayloadRouter::SetActive(bool active) {
|
||||
rtc::CritScope lock(&crit_);
|
||||
if (active_ == active)
|
||||
@ -149,17 +144,6 @@ EncodedImageCallback::Result PayloadRouter::OnEncodedImage(
|
||||
return Result(Result::OK, frame_id);
|
||||
}
|
||||
|
||||
size_t PayloadRouter::MaxPayloadLength() const {
|
||||
size_t min_payload_length = DefaultMaxPayloadLength();
|
||||
rtc::CritScope lock(&crit_);
|
||||
for (size_t i = 0; i < rtp_modules_.size(); ++i) {
|
||||
size_t module_payload_length = rtp_modules_[i]->MaxDataPayloadLength();
|
||||
if (module_payload_length < min_payload_length)
|
||||
min_payload_length = module_payload_length;
|
||||
}
|
||||
return min_payload_length;
|
||||
}
|
||||
|
||||
void PayloadRouter::OnBitrateAllocationUpdated(
|
||||
const BitrateAllocation& bitrate) {
|
||||
rtc::CritScope lock(&crit_);
|
||||
|
||||
@ -36,8 +36,6 @@ class PayloadRouter : public EncodedImageCallback {
|
||||
int payload_type);
|
||||
~PayloadRouter();
|
||||
|
||||
static size_t DefaultMaxPayloadLength();
|
||||
|
||||
// PayloadRouter will only route packets if being active, all packets will be
|
||||
// dropped otherwise.
|
||||
void SetActive(bool active);
|
||||
@ -50,10 +48,6 @@ class PayloadRouter : public EncodedImageCallback {
|
||||
const CodecSpecificInfo* codec_specific_info,
|
||||
const RTPFragmentationHeader* fragmentation) override;
|
||||
|
||||
// Returns the maximum allowed data payload length, given the configured MTU
|
||||
// and RTP headers.
|
||||
size_t MaxPayloadLength() const;
|
||||
|
||||
void OnBitrateAllocationUpdated(const BitrateAllocation& bitrate);
|
||||
|
||||
private:
|
||||
|
||||
@ -149,40 +149,6 @@ TEST(PayloadRouterTest, SendSimulcast) {
|
||||
.error);
|
||||
}
|
||||
|
||||
TEST(PayloadRouterTest, MaxPayloadLength) {
|
||||
// Without any limitations from the modules, verify we get the max payload
|
||||
// length for IP/UDP/SRTP with a MTU of 150 bytes.
|
||||
const size_t kDefaultMaxLength = 1500 - 20 - 8 - 12 - 4;
|
||||
NiceMock<MockRtpRtcp> rtp_1;
|
||||
NiceMock<MockRtpRtcp> rtp_2;
|
||||
std::vector<RtpRtcp*> modules;
|
||||
modules.push_back(&rtp_1);
|
||||
modules.push_back(&rtp_2);
|
||||
PayloadRouter payload_router(modules, 42);
|
||||
|
||||
EXPECT_EQ(kDefaultMaxLength, PayloadRouter::DefaultMaxPayloadLength());
|
||||
std::vector<VideoStream> streams(2);
|
||||
|
||||
// Modules return a higher length than the default value.
|
||||
EXPECT_CALL(rtp_1, MaxDataPayloadLength())
|
||||
.Times(1)
|
||||
.WillOnce(Return(kDefaultMaxLength + 10));
|
||||
EXPECT_CALL(rtp_2, MaxDataPayloadLength())
|
||||
.Times(1)
|
||||
.WillOnce(Return(kDefaultMaxLength + 10));
|
||||
EXPECT_EQ(kDefaultMaxLength, payload_router.MaxPayloadLength());
|
||||
|
||||
// The modules return a value lower than default.
|
||||
const size_t kTestMinPayloadLength = 1001;
|
||||
EXPECT_CALL(rtp_1, MaxDataPayloadLength())
|
||||
.Times(1)
|
||||
.WillOnce(Return(kTestMinPayloadLength + 10));
|
||||
EXPECT_CALL(rtp_2, MaxDataPayloadLength())
|
||||
.Times(1)
|
||||
.WillOnce(Return(kTestMinPayloadLength));
|
||||
EXPECT_EQ(kTestMinPayloadLength, payload_router.MaxPayloadLength());
|
||||
}
|
||||
|
||||
TEST(PayloadRouterTest, SimulcastTargetBitrate) {
|
||||
NiceMock<MockRtpRtcp> rtp_1;
|
||||
NiceMock<MockRtpRtcp> rtp_2;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user