Enable pacing by default and remove the option to disable it from the new API.
BUG=1672 R=mflodman@webrtc.org, pbos@webrtc.org Review URL: https://webrtc-codereview.appspot.com/17659004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6416 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
27f062ae6f
commit
cb254aac3b
@ -124,7 +124,7 @@ PacedSender::PacedSender(Callback* callback,
|
||||
int max_bitrate_kbps,
|
||||
int min_bitrate_kbps)
|
||||
: callback_(callback),
|
||||
enabled_(false),
|
||||
enabled_(true),
|
||||
paused_(false),
|
||||
max_queue_length_ms_(kDefaultMaxQueueLengthMs),
|
||||
critsect_(CriticalSectionWrapper::CreateCriticalSection()),
|
||||
|
@ -61,7 +61,6 @@ class PacedSenderTest : public ::testing::Test {
|
||||
// Need to initialize PacedSender after we initialize clock.
|
||||
send_bucket_.reset(
|
||||
new PacedSender(&callback_, kPaceMultiplier * kTargetBitrate, 0));
|
||||
send_bucket_->SetStatus(true);
|
||||
}
|
||||
|
||||
void SendAndExpectPacket(PacedSender::Priority priority,
|
||||
@ -276,7 +275,6 @@ TEST_F(PacedSenderTest, VerifyAverageBitrateVaryingMediaPayload) {
|
||||
PacedSenderPadding callback;
|
||||
send_bucket_.reset(
|
||||
new PacedSender(&callback, kPaceMultiplier * kTargetBitrate, 0));
|
||||
send_bucket_->SetStatus(true);
|
||||
send_bucket_->UpdateBitrate(kPaceMultiplier * kTargetBitrate, kTargetBitrate);
|
||||
int64_t start_time = TickTime::MillisecondTimestamp();
|
||||
int media_bytes = 0;
|
||||
|
@ -642,7 +642,6 @@ void CallPerfTest::TestMinTransmitBitrate(bool pad_to_min_bitrate) {
|
||||
|
||||
observer.SetReceivers(receiver_call->Receiver(), sender_call->Receiver());
|
||||
|
||||
send_config_.pacing = true;
|
||||
if (pad_to_min_bitrate) {
|
||||
send_config_.rtp.min_transmit_bitrate_bps = kMinTransmitBitrateBps;
|
||||
} else {
|
||||
|
@ -407,7 +407,7 @@ class RampUpTest : public ::testing::Test {
|
||||
virtual void SetUp() { reserved_ssrcs_.clear(); }
|
||||
|
||||
protected:
|
||||
void RunRampUpTest(bool pacing, bool rtx, size_t num_streams) {
|
||||
void RunRampUpTest(bool rtx, size_t num_streams) {
|
||||
std::vector<uint32_t> ssrcs(GenerateSsrcs(num_streams, 100));
|
||||
std::vector<uint32_t> rtx_ssrcs(GenerateSsrcs(num_streams, 200));
|
||||
StreamObserver::SsrcMap rtx_ssrc_map;
|
||||
@ -438,7 +438,6 @@ class RampUpTest : public ::testing::Test {
|
||||
video_streams[0].max_bitrate_bps = 2000000;
|
||||
}
|
||||
|
||||
send_config.pacing = pacing;
|
||||
send_config.rtp.nack.rtp_history_ms = 1000;
|
||||
send_config.rtp.ssrcs = ssrcs;
|
||||
if (rtx) {
|
||||
@ -516,7 +515,6 @@ class RampUpTest : public ::testing::Test {
|
||||
RtpExtension(RtpExtension::kTOffset,
|
||||
kTransmissionTimeOffsetExtensionId));
|
||||
send_config.suspend_below_min_bitrate = true;
|
||||
send_config.pacing = true;
|
||||
|
||||
VideoSendStream* send_stream =
|
||||
call->CreateVideoSendStream(send_config, video_streams, NULL);
|
||||
@ -565,24 +563,16 @@ class RampUpTest : public ::testing::Test {
|
||||
std::map<uint32_t, bool> reserved_ssrcs_;
|
||||
};
|
||||
|
||||
TEST_F(RampUpTest, SingleStreamWithoutPacing) {
|
||||
RunRampUpTest(false, false, 1);
|
||||
TEST_F(RampUpTest, SingleStream) {
|
||||
RunRampUpTest(false, 1);
|
||||
}
|
||||
|
||||
TEST_F(RampUpTest, SingleStreamWithPacing) {
|
||||
RunRampUpTest(true, false, 1);
|
||||
TEST_F(RampUpTest, Simulcast) {
|
||||
RunRampUpTest(false, 3);
|
||||
}
|
||||
|
||||
TEST_F(RampUpTest, SimulcastWithoutPacing) {
|
||||
RunRampUpTest(false, false, 3);
|
||||
}
|
||||
|
||||
TEST_F(RampUpTest, SimulcastWithPacing) {
|
||||
RunRampUpTest(true, false, 3);
|
||||
}
|
||||
|
||||
TEST_F(RampUpTest, SimulcastWithPacingAndRtx) {
|
||||
RunRampUpTest(true, true, 3);
|
||||
TEST_F(RampUpTest, SimulcastWithRtx) {
|
||||
RunRampUpTest(true, 3);
|
||||
}
|
||||
|
||||
TEST_F(RampUpTest, UpDownUpOneStream) { RunRampUpDownUpTest(1, false); }
|
||||
|
@ -101,8 +101,6 @@ std::string VideoSendStream::Config::ToString() const {
|
||||
}
|
||||
if (target_delay_ms > 0)
|
||||
ss << ", target_delay_ms: " << target_delay_ms;
|
||||
if (pacing)
|
||||
ss << ", pacing: on";
|
||||
if (suspend_below_min_bitrate)
|
||||
ss << ", suspend_below_min_bitrate: on";
|
||||
ss << '}';
|
||||
@ -131,9 +129,6 @@ VideoSendStream::VideoSendStream(newapi::Transport* transport,
|
||||
assert(rtp_rtcp_ != NULL);
|
||||
|
||||
assert(config_.rtp.ssrcs.size() > 0);
|
||||
if (config_.suspend_below_min_bitrate)
|
||||
assert(config_.pacing);
|
||||
rtp_rtcp_->SetTransmissionSmoothingStatus(channel_, config_.pacing);
|
||||
|
||||
assert(config_.rtp.min_transmit_bitrate_bps >= 0);
|
||||
rtp_rtcp_->SetMinTransmitBitrate(channel_,
|
||||
|
@ -75,8 +75,7 @@ class VideoSendStreamTest : public ::testing::Test {
|
||||
}
|
||||
|
||||
void TestNackRetransmission(uint32_t retransmit_ssrc,
|
||||
uint8_t retransmit_payload_type,
|
||||
bool enable_pacing);
|
||||
uint8_t retransmit_payload_type);
|
||||
|
||||
void TestPacketFragmentationSize(VideoFormat format, bool with_fec);
|
||||
|
||||
@ -504,8 +503,7 @@ TEST_F(VideoSendStreamTest, SupportsFec) {
|
||||
|
||||
void VideoSendStreamTest::TestNackRetransmission(
|
||||
uint32_t retransmit_ssrc,
|
||||
uint8_t retransmit_payload_type,
|
||||
bool enable_pacing) {
|
||||
uint8_t retransmit_payload_type) {
|
||||
class NackObserver : public test::RtpRtcpObserver {
|
||||
public:
|
||||
explicit NackObserver(uint32_t retransmit_ssrc,
|
||||
@ -574,7 +572,6 @@ void VideoSendStreamTest::TestNackRetransmission(
|
||||
CreateTestConfig(call.get(), 1);
|
||||
send_config_.rtp.nack.rtp_history_ms = 1000;
|
||||
send_config_.rtp.rtx.payload_type = retransmit_payload_type;
|
||||
send_config_.pacing = enable_pacing;
|
||||
if (retransmit_ssrc != kSendSsrc)
|
||||
send_config_.rtp.rtx.ssrcs.push_back(retransmit_ssrc);
|
||||
|
||||
@ -583,17 +580,12 @@ void VideoSendStreamTest::TestNackRetransmission(
|
||||
|
||||
TEST_F(VideoSendStreamTest, RetransmitsNack) {
|
||||
// Normal NACKs should use the send SSRC.
|
||||
TestNackRetransmission(kSendSsrc, kFakeSendPayloadType, false);
|
||||
TestNackRetransmission(kSendSsrc, kFakeSendPayloadType);
|
||||
}
|
||||
|
||||
TEST_F(VideoSendStreamTest, RetransmitsNackOverRtx) {
|
||||
// NACKs over RTX should use a separate SSRC.
|
||||
TestNackRetransmission(kSendRtxSsrc, kSendRtxPayloadType, false);
|
||||
}
|
||||
|
||||
TEST_F(VideoSendStreamTest, RetransmitsNackOverRtxWithPacing) {
|
||||
// NACKs over RTX should use a separate SSRC.
|
||||
TestNackRetransmission(kSendRtxSsrc, kSendRtxPayloadType, true);
|
||||
TestNackRetransmission(kSendRtxSsrc, kSendRtxPayloadType);
|
||||
}
|
||||
|
||||
void VideoSendStreamTest::TestPacketFragmentationSize(VideoFormat format,
|
||||
@ -774,7 +766,6 @@ void VideoSendStreamTest::TestPacketFragmentationSize(VideoFormat format,
|
||||
if (format == kVP8)
|
||||
send_config_.encoder_settings.payload_name = "VP8";
|
||||
|
||||
send_config_.pacing = false;
|
||||
send_config_.encoder_settings.encoder = &encoder;
|
||||
send_config_.rtp.max_packet_size = kMaxPacketSize;
|
||||
send_config_.post_encode_callback = &observer;
|
||||
@ -955,7 +946,6 @@ TEST_F(VideoSendStreamTest, SuspendBelowMinBitrate) {
|
||||
send_config_.rtp.nack.rtp_history_ms = 1000;
|
||||
send_config_.pre_encode_callback = &observer;
|
||||
send_config_.suspend_below_min_bitrate = true;
|
||||
send_config_.pacing = true;
|
||||
int min_bitrate_bps = video_streams_[0].min_bitrate_bps;
|
||||
observer.set_low_remb_bps(min_bitrate_bps - 10000);
|
||||
int threshold_window = std::max(min_bitrate_bps / 10, 10000);
|
||||
@ -1114,7 +1104,6 @@ TEST_F(VideoSendStreamTest, ProducesStats) {
|
||||
|
||||
CreateTestConfig(call.get(), 1);
|
||||
send_config_.rtp.c_name = kCName;
|
||||
send_config_.pacing = true;
|
||||
observer.SetConfig(send_config_);
|
||||
|
||||
send_stream_ =
|
||||
|
@ -43,10 +43,13 @@ void TestI420CallSetup(webrtc::ViECodec* codec_interface,
|
||||
webrtc::VideoEngine* video_engine,
|
||||
webrtc::ViEBase* base_interface,
|
||||
webrtc::ViENetwork* network_interface,
|
||||
webrtc::ViERTP_RTCP* rtp_rtcp_interface,
|
||||
int video_channel,
|
||||
const char* device_name) {
|
||||
webrtc::VideoCodec video_codec;
|
||||
memset(&video_codec, 0, sizeof(webrtc::VideoCodec));
|
||||
EXPECT_EQ(0, rtp_rtcp_interface->SetTransmissionSmoothingStatus(video_channel,
|
||||
false));
|
||||
|
||||
ConfigureCodecsToI420(video_channel, video_codec, codec_interface);
|
||||
|
||||
|
@ -16,6 +16,7 @@ class VideoEngine;
|
||||
class ViEBase;
|
||||
class ViECodec;
|
||||
class ViENetwork;
|
||||
class ViERTP_RTCP;
|
||||
}
|
||||
|
||||
// Tests a I420-to-I420 call. This test exercises the most basic WebRTC
|
||||
@ -26,6 +27,7 @@ void TestI420CallSetup(webrtc::ViECodec* codec_interface,
|
||||
webrtc::VideoEngine* video_engine,
|
||||
webrtc::ViEBase* base_interface,
|
||||
webrtc::ViENetwork* network_interface,
|
||||
webrtc::ViERTP_RTCP* rtp_rtcp_interface,
|
||||
int video_channel,
|
||||
const char* device_name);
|
||||
|
||||
|
@ -67,8 +67,8 @@ void ViEAutoTest::ViEBaseStandardTest() {
|
||||
ViETest::Log("You should shortly see a local preview from camera %s"
|
||||
" in window 1 and the remote video in window 2.", device_name);
|
||||
::TestI420CallSetup(interfaces.codec, interfaces.video_engine,
|
||||
base_interface, interfaces.network, video_channel,
|
||||
device_name);
|
||||
base_interface, interfaces.network, interfaces.rtp_rtcp,
|
||||
video_channel, device_name);
|
||||
|
||||
// ***************************************************************
|
||||
// Testing finished. Tear down Video Engine
|
||||
|
@ -179,8 +179,6 @@ void ViEAutoTest::ViERtpRtcpStandardTest()
|
||||
myTransport.ClearStats();
|
||||
|
||||
EXPECT_EQ(0, ViE.rtp_rtcp->SetNACKStatus(tbChannel.videoChannel, true));
|
||||
EXPECT_EQ(0, ViE.rtp_rtcp->SetTransmissionSmoothingStatus(
|
||||
tbChannel.videoChannel, true));
|
||||
EXPECT_EQ(0, ViE.base->StartReceive(tbChannel.videoChannel));
|
||||
EXPECT_EQ(0, ViE.base->StartSend(tbChannel.videoChannel));
|
||||
|
||||
@ -220,6 +218,7 @@ void ViEAutoTest::ViERtpRtcpStandardTest()
|
||||
myTransport.ClearStats();
|
||||
|
||||
const uint8_t kRtxPayloadType = 96;
|
||||
// Temporarily disable pacing.
|
||||
EXPECT_EQ(0, ViE.rtp_rtcp->SetTransmissionSmoothingStatus(
|
||||
tbChannel.videoChannel, false));
|
||||
EXPECT_EQ(0, ViE.rtp_rtcp->SetNACKStatus(tbChannel.videoChannel, true));
|
||||
@ -523,6 +522,7 @@ void ViEAutoTest::ViERtpRtcpStandardTest()
|
||||
ViETest::Log("Testing Network Down...\n");
|
||||
|
||||
EXPECT_EQ(0, ViE.rtp_rtcp->SetNACKStatus(tbChannel.videoChannel, true));
|
||||
// Reenable pacing.
|
||||
EXPECT_EQ(0, ViE.rtp_rtcp->SetTransmissionSmoothingStatus(
|
||||
tbChannel.videoChannel, true));
|
||||
|
||||
|
@ -66,8 +66,8 @@ bool ViEFileBasedComparisonTests::TestCallSetup(
|
||||
const char* device_name = "Fake Capture Device";
|
||||
|
||||
::TestI420CallSetup(interfaces.codec, interfaces.video_engine,
|
||||
interfaces.base, interfaces.network, video_channel,
|
||||
device_name);
|
||||
interfaces.base, interfaces.network, interfaces.rtp_rtcp,
|
||||
video_channel, device_name);
|
||||
|
||||
EXPECT_EQ(0, render_interface->StopRender(video_channel));
|
||||
EXPECT_EQ(0, render_interface->RemoveRenderer(video_channel));
|
||||
|
@ -61,7 +61,6 @@ class VideoSendStream {
|
||||
local_renderer(NULL),
|
||||
render_delay_ms(0),
|
||||
target_delay_ms(0),
|
||||
pacing(false),
|
||||
suspend_below_min_bitrate(false) {}
|
||||
std::string ToString() const;
|
||||
|
||||
@ -144,14 +143,9 @@ class VideoSendStream {
|
||||
// used for streaming instead of a real-time call.
|
||||
int target_delay_ms;
|
||||
|
||||
// True if network a send-side packet buffer should be used to pace out
|
||||
// packets onto the network.
|
||||
bool pacing;
|
||||
|
||||
// True if the stream should be suspended when the available bitrate fall
|
||||
// below the minimum configured bitrate. If this variable is false, the
|
||||
// stream may send at a rate higher than the estimated available bitrate.
|
||||
// |suspend_below_min_bitrate| requires |pacing| to be enabled as well.
|
||||
bool suspend_below_min_bitrate;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user