Wire up VideoOptions for payload-based padding.

BUG=1788
R=wu@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6759 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
pbos@webrtc.org 2014-07-23 07:01:31 +00:00
parent efe4b9af49
commit 543e589205
2 changed files with 31 additions and 0 deletions

View File

@ -664,6 +664,7 @@ void WebRtcVideoChannel2::Construct(webrtc::Call* call,
void WebRtcVideoChannel2::SetDefaultOptions() {
options_.video_noise_reduction.Set(true);
options_.use_payload_padding.Set(false);
}
WebRtcVideoChannel2::~WebRtcVideoChannel2() {
@ -1508,6 +1509,9 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::SetCodecAndOptions(
// Set RTX payload type if RTX is enabled.
if (!parameters_.config.rtp.rtx.ssrcs.empty()) {
parameters_.config.rtp.rtx.payload_type = codec_settings.rtx_payload_type;
options.use_payload_padding.Get(
&parameters_.config.rtp.rtx.pad_with_redundant_payloads);
}
if (IsNackEnabled(codec_settings.codec)) {
@ -1516,6 +1520,7 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::SetCodecAndOptions(
parameters_.codec_settings.Set(codec_settings);
parameters_.options = options;
RecreateWebRtcStream();
delete old_encoder;
}

View File

@ -1067,6 +1067,32 @@ TEST_F(WebRtcVideoChannel2Test,
FAIL() << "Not implemented."; // TODO(pbos): Implement.
}
TEST_F(WebRtcVideoChannel2Test, RedundantPayloadsDisabledByDefault) {
const std::vector<uint32> ssrcs = MAKE_VECTOR(kSsrcs1);
const std::vector<uint32> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1);
FakeVideoSendStream* stream = AddSendStream(
cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs));
EXPECT_FALSE(stream->GetConfig().rtp.rtx.pad_with_redundant_payloads);
}
TEST_F(WebRtcVideoChannel2Test, SetOptionsWithPayloadPadding) {
VideoOptions options;
options.use_payload_padding.Set(true);
channel_->SetOptions(options);
const std::vector<uint32> ssrcs = MAKE_VECTOR(kSsrcs1);
const std::vector<uint32> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1);
FakeVideoSendStream* stream = AddSendStream(
cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs));
EXPECT_TRUE(stream->GetConfig().rtp.rtx.pad_with_redundant_payloads);
options.use_payload_padding.Set(false);
channel_->SetOptions(options);
stream = fake_channel_->GetFakeCall()->GetVideoSendStreams()[0];
EXPECT_FALSE(stream->GetConfig().rtp.rtx.pad_with_redundant_payloads);
}
TEST_F(WebRtcVideoChannel2Test, Vp8DenoisingEnabledByDefault) {
FakeVideoSendStream* stream = AddSendStream();
webrtc::VideoCodecVP8 vp8_settings;