Fixed issue with how MTU is calculated.

BUG=
R=holmer@google.com, stefan@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/2410004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4976 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
sprang@webrtc.org 2013-10-16 13:29:14 +00:00
parent b400aa7cd4
commit 25fce9adc5
3 changed files with 4 additions and 5 deletions

View File

@ -166,8 +166,8 @@ VideoSendStream::VideoSendStream(newapi::Transport* transport,
assert(network_ != NULL);
network_->RegisterSendTransport(channel_, transport_adapter_);
network_->SetMTU(channel_, config_.rtp.max_packet_size +
VideoSendStream::Config::kDefaultPacketOverheader);
// 28 to match packet overhead in ModuleRtpRtcpImpl.
network_->SetMTU(channel_, config_.rtp.max_packet_size + 28);
if (config.encoder) {
external_codec_ = ViEExternalCodec::GetInterface(video_engine);

View File

@ -84,8 +84,7 @@ class VideoSendStream {
start_state(NULL) {}
VideoCodec codec;
static const size_t kDefaultPacketOverheader = 20 + 20; // IPv4 + TCP
static const size_t kDefaultMaxPacketSize = 1500 - kDefaultPacketOverheader;
static const size_t kDefaultMaxPacketSize = 1500 - 40; // TCP over IPv4.
struct Rtp {
Rtp() : mode(newapi::kRtcpReducedSize),
max_packet_size(kDefaultMaxPacketSize) {}

View File

@ -443,7 +443,7 @@ TEST_F(VideoSendStreamTest, MaxPacketSize) {
EXPECT_TRUE(
rtp_header_parser_->Parse(packet, static_cast<int>(length), &header));
EXPECT_TRUE(length <= max_length_);
EXPECT_LE(length, max_length_);
accumulated_size_ += length;