Enable automatic resizing for RTX-enabled senders.
These were accidentally disabled due to checking ssrcs_.size() (which includes RTX SSRCs) instead of rtp.ssrcs.size() to determine whether a stream is simulcast or not. BUG=webrtc:4965 R=asapersson@webrtc.org Review URL: https://codereview.webrtc.org/1318193003 . Cr-Commit-Position: refs/heads/master@{#9907}
This commit is contained in:
@ -487,8 +487,9 @@ void* WebRtcVideoChannel2::WebRtcVideoSendStream::ConfigureVideoEncoderSettings(
|
||||
const VideoCodec& codec,
|
||||
const VideoOptions& options,
|
||||
bool is_screencast) {
|
||||
// No automatic resizing when using simulcast.
|
||||
bool automatic_resize = !is_screencast && ssrcs_.size() == 1;
|
||||
// No automatic resizing when using simulcast or screencast.
|
||||
bool automatic_resize =
|
||||
!is_screencast && parameters_.config.rtp.ssrcs.size() == 1;
|
||||
bool frame_dropping = !is_screencast;
|
||||
bool denoising;
|
||||
if (is_screencast) {
|
||||
|
||||
@ -1022,17 +1022,24 @@ class WebRtcVideoChannel2Test : public WebRtcVideoEngine2Test,
|
||||
return fake_call_->GetVideoSendStreams().back();
|
||||
}
|
||||
|
||||
FakeVideoSendStream* SetUpSimulcast(bool enabled) {
|
||||
FakeVideoSendStream* SetUpSimulcast(bool enabled, bool with_rtx) {
|
||||
const int kRtxSsrcOffset = 0xDEADBEEF;
|
||||
last_ssrc_ += 3;
|
||||
if (enabled) {
|
||||
std::vector<uint32_t> ssrcs;
|
||||
ssrcs.push_back(last_ssrc_);
|
||||
ssrcs.push_back(last_ssrc_ + 1);
|
||||
ssrcs.push_back(last_ssrc_ + 2);
|
||||
return AddSendStream(CreateSimStreamParams("cname", ssrcs));
|
||||
} else {
|
||||
return AddSendStream(StreamParams::CreateLegacy(last_ssrc_));
|
||||
std::vector<uint32_t> ssrcs;
|
||||
std::vector<uint32_t> rtx_ssrcs;
|
||||
uint32_t num_streams = enabled ? 3 : 1;
|
||||
for (uint32_t i = 0; i < num_streams; ++i) {
|
||||
uint32_t ssrc = last_ssrc_ + i;
|
||||
ssrcs.push_back(ssrc);
|
||||
if (with_rtx) {
|
||||
rtx_ssrcs.push_back(ssrc + kRtxSsrcOffset);
|
||||
}
|
||||
}
|
||||
if (with_rtx) {
|
||||
return AddSendStream(
|
||||
cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs));
|
||||
}
|
||||
return AddSendStream(CreateSimStreamParams("cname", ssrcs));
|
||||
}
|
||||
|
||||
FakeCall* fake_call_;
|
||||
@ -1570,7 +1577,10 @@ TEST_F(WebRtcVideoChannel2Test, VerifyVp8SpecificSettings) {
|
||||
codecs.push_back(kVp8Codec720p);
|
||||
ASSERT_TRUE(channel_->SetSendCodecs(codecs));
|
||||
|
||||
FakeVideoSendStream* stream = SetUpSimulcast(false);
|
||||
// Single-stream settings should apply with RTX as well (verifies that we
|
||||
// check number of regular SSRCs and not StreamParams::ssrcs which contains
|
||||
// both RTX and regular SSRCs).
|
||||
FakeVideoSendStream* stream = SetUpSimulcast(false, true);
|
||||
|
||||
cricket::FakeVideoCapturer capturer;
|
||||
capturer.SetScreencast(false);
|
||||
@ -1597,7 +1607,7 @@ TEST_F(WebRtcVideoChannel2Test, VerifyVp8SpecificSettings) {
|
||||
EXPECT_TRUE(vp8_settings.frameDroppingOn);
|
||||
|
||||
EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL));
|
||||
stream = SetUpSimulcast(true);
|
||||
stream = SetUpSimulcast(true, false);
|
||||
EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer));
|
||||
channel_->SetSend(true);
|
||||
EXPECT_TRUE(capturer.CaptureFrame());
|
||||
@ -1658,7 +1668,7 @@ TEST_F(Vp9SettingsTest, VerifyVp9SpecificSettings) {
|
||||
codecs.push_back(kVp9Codec);
|
||||
ASSERT_TRUE(channel_->SetSendCodecs(codecs));
|
||||
|
||||
FakeVideoSendStream* stream = SetUpSimulcast(false);
|
||||
FakeVideoSendStream* stream = SetUpSimulcast(false, false);
|
||||
|
||||
cricket::FakeVideoCapturer capturer;
|
||||
capturer.SetScreencast(false);
|
||||
|
||||
Reference in New Issue
Block a user