(Auto)update libjingle 68985065-> 69005149

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6406 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
buildbot@webrtc.org 2014-06-11 18:41:17 +00:00
parent 4aeb94186a
commit e9e8007ab4
4 changed files with 21 additions and 143 deletions

View File

@ -285,7 +285,6 @@ class FakeWebRtcVideoEngine
receiver_target_delay_(0),
transmission_smoothing_(false),
nack_(false),
fec_(false),
hybrid_nack_fec_(false),
send_video_bitrate_(0),
send_fec_bitrate_(0),
@ -326,7 +325,6 @@ class FakeWebRtcVideoEngine
int receiver_target_delay_;
bool transmission_smoothing_;
bool nack_;
bool fec_;
bool hybrid_nack_fec_;
std::vector<webrtc::VideoCodec> recv_codecs;
std::set<unsigned int> ext_decoder_pl_types_;
@ -520,10 +518,6 @@ class FakeWebRtcVideoEngine
WEBRTC_ASSERT_CHANNEL(channel);
return channels_.find(channel)->second->receiver_target_delay_;
}
bool GetFecStatus(int channel) const {
WEBRTC_ASSERT_CHANNEL(channel);
return channels_.find(channel)->second->fec_;
}
bool GetNackStatus(int channel) const {
WEBRTC_ASSERT_CHANNEL(channel);
return channels_.find(channel)->second->nack_;
@ -1043,28 +1037,16 @@ class FakeWebRtcVideoEngine
channels_[channel]->hybrid_nack_fec_ = false;
return 0;
}
WEBRTC_FUNC(SetFECStatus, (const int channel, const bool enable,
const unsigned char red_type, const unsigned char fec_type)) {
WEBRTC_CHECK_CHANNEL(channel);
if (enable && (red_type == fec_type ||
red_type == channels_[channel]->send_codec.plType ||
fec_type == channels_[channel]->send_codec.plType)) {
return -1;
}
channels_[channel]->fec_ = enable;
channels_[channel]->nack_ = false;
channels_[channel]->hybrid_nack_fec_ = false;
return 0;
}
WEBRTC_STUB(SetFECStatus, (const int, const bool, const unsigned char,
const unsigned char));
WEBRTC_FUNC(SetHybridNACKFECStatus, (const int channel, const bool enable,
const unsigned char red_type, const unsigned char fec_type)) {
WEBRTC_CHECK_CHANNEL(channel);
if (enable && (red_type == fec_type ||
if (red_type == fec_type ||
red_type == channels_[channel]->send_codec.plType ||
fec_type == channels_[channel]->send_codec.plType)) {
fec_type == channels_[channel]->send_codec.plType) {
return -1;
}
channels_[channel]->fec_ = false;
channels_[channel]->nack_ = false;
channels_[channel]->hybrid_nack_fec_ = enable;
return 0;
@ -1129,7 +1111,7 @@ class FakeWebRtcVideoEngine
channels_[channel]->transmission_smoothing_ = enable;
return 0;
}
WEBRTC_FUNC(SetReservedTransmitBitrate, (int channel,
WEBRTC_FUNC(SetReservedTransmitBitrate, (int channel,
unsigned int reserved_transmit_bitrate_bps)) {
WEBRTC_CHECK_CHANNEL(channel);
channels_[channel]->reserved_transmit_bitrate_bps_ =

View File

@ -3622,71 +3622,24 @@ bool WebRtcVideoMediaChannel::SetNackFec(int channel_id,
int red_payload_type,
int fec_payload_type,
bool nack_enabled) {
bool fec_enabled = (red_payload_type != -1 && fec_payload_type != -1 &&
bool enable = (red_payload_type != -1 && fec_payload_type != -1 &&
!InConferenceMode());
bool hybrid_enabled = (fec_enabled && nack_enabled);
if (!SetHybridNackFecStatus(channel_id, hybrid_enabled,
red_payload_type, fec_payload_type)) {
return false;
if (enable) {
if (engine_->vie()->rtp()->SetHybridNACKFECStatus(
channel_id, nack_enabled, red_payload_type, fec_payload_type) != 0) {
LOG_RTCERR4(SetHybridNACKFECStatus,
channel_id, nack_enabled, red_payload_type, fec_payload_type);
return false;
}
LOG(LS_INFO) << "Hybrid NACK/FEC enabled for channel " << channel_id;
} else {
if (engine_->vie()->rtp()->SetNACKStatus(channel_id, nack_enabled) != 0) {
LOG_RTCERR1(SetNACKStatus, channel_id);
return false;
}
std::string enabled = nack_enabled ? "enabled" : "disabled";
LOG(LS_INFO) << "NACK " << enabled << " for channel " << channel_id;
}
if (hybrid_enabled) {
return true;
}
if (!SetFecStatus(channel_id, fec_enabled,
red_payload_type, fec_payload_type)) {
return false;
}
if (fec_enabled) {
return true;
}
if (!SetNackStatus(channel_id, nack_enabled)) {
return false;
}
return true;
}
bool WebRtcVideoMediaChannel::SetHybridNackFecStatus(int channel_id,
bool enabled,
int red_payload_type,
int fec_payload_type) {
if (engine_->vie()->rtp()->SetHybridNACKFECStatus(
channel_id, enabled, red_payload_type, fec_payload_type) != 0) {
LOG_RTCERR4(SetHybridNACKFECStatus, channel_id, enabled,
red_payload_type, fec_payload_type);
return false;
}
std::string enabled_str = enabled ? "enabled" : "disabled";
LOG(LS_INFO) << "Hybrid NACK/FEC " << enabled_str
<< " for channel " << channel_id;
return true;
}
bool WebRtcVideoMediaChannel::SetFecStatus(int channel_id,
bool enabled,
int red_payload_type,
int fec_payload_type) {
if (engine_->vie()->rtp()->SetFECStatus(
channel_id, enabled, red_payload_type, fec_payload_type) != 0) {
LOG_RTCERR4(SetFECStatus, channel_id, enabled,
red_payload_type, fec_payload_type);
return false;
}
std::string enabled_str = enabled ? "enabled" : "disabled";
LOG(LS_INFO) << "FEC " << enabled_str << " for channel " << channel_id;
return true;
}
bool WebRtcVideoMediaChannel::SetNackStatus(int channel_id, bool enabled) {
if (engine_->vie()->rtp()->SetNACKStatus(channel_id, enabled) != 0) {
LOG_RTCERR2(SetNACKStatus, channel_id, enabled);
return false;
}
std::string enabled_str = enabled ? "enabled" : "disabled";
LOG(LS_INFO) << "NACK " << enabled_str << " for channel " << channel_id;
return true;
}

View File

@ -336,11 +336,6 @@ class WebRtcVideoMediaChannel : public talk_base::MessageHandler,
bool ConfigureSending(int channel_id, uint32 local_ssrc_key);
bool SetNackFec(int channel_id, int red_payload_type, int fec_payload_type,
bool nack_enabled);
bool SetHybridNackFecStatus(int channel_id, bool enabled,
int red_payload_type, int fec_payload_type);
bool SetFecStatus(int channel_id, bool enabled,
int red_payload_type, int fec_payload_type);
bool SetNackStatus(int channel_id, bool enabled);
bool SetSendCodec(const webrtc::VideoCodec& codec);
bool SetSendCodec(WebRtcVideoChannelSendInfo* send_channel,
const webrtc::VideoCodec& codec);

View File

@ -384,7 +384,6 @@ TEST_F(WebRtcVideoEngineTestFake, SetSendCodecs) {
VerifyVP8SendCodec(channel_num, kVP8Codec.width, kVP8Codec.height);
EXPECT_TRUE(vie_.GetHybridNackFecStatus(channel_num));
EXPECT_FALSE(vie_.GetNackStatus(channel_num));
EXPECT_FALSE(vie_.GetFecStatus(channel_num));
EXPECT_EQ(1, vie_.GetNumSetSendCodecs());
// TODO(juberti): Check RTCP, PLI, TMMBR.
}
@ -1262,51 +1261,6 @@ TEST_F(WebRtcVideoEngineTestFake, NackEnabled) {
codecs.resize(1); // toss out red and ulpfec
EXPECT_TRUE(channel_->SetSendCodecs(codecs));
EXPECT_TRUE(vie_.GetNackStatus(channel_num));
EXPECT_FALSE(vie_.GetHybridNackFecStatus(channel_num));
EXPECT_FALSE(vie_.GetFecStatus(channel_num));
}
// Test that FEC is enabled and NACK is disabled if we offer
// RED/FEC and we disable nack.
TEST_F(WebRtcVideoEngineTestFake, FecEnabled) {
EXPECT_TRUE(SetupEngine());
int channel_num = vie_.GetLastChannel();
std::vector<cricket::VideoCodec> codecs = engine_.codecs();
// Clearing the codecs' FeedbackParams and setting send codecs should disable
// NACK.
for (std::vector<cricket::VideoCodec>::iterator iter = codecs.begin();
iter != codecs.end(); ++iter) {
// Intersecting with empty will clear the FeedbackParams.
cricket::FeedbackParams empty_params;
iter->feedback_params.Intersect(empty_params);
EXPECT_TRUE(iter->feedback_params.params().empty());
}
EXPECT_TRUE(channel_->SetSendCodecs(codecs));
EXPECT_TRUE(vie_.GetFecStatus(channel_num));
EXPECT_FALSE(vie_.GetHybridNackFecStatus(channel_num));
EXPECT_FALSE(vie_.GetNackStatus(channel_num));
}
// Test that FEC and NACK are disabled if we don't offer
// RED/FEC and we disable nack.
TEST_F(WebRtcVideoEngineTestFake, NackFecDisabled) {
EXPECT_TRUE(SetupEngine());
int channel_num = vie_.GetLastChannel();
std::vector<cricket::VideoCodec> codecs = engine_.codecs();
codecs.resize(1); // toss out red and ulpfec
// Clearing the codecs' FeedbackParams and setting send codecs should disable
// NACK.
for (std::vector<cricket::VideoCodec>::iterator iter = codecs.begin();
iter != codecs.end(); ++iter) {
// Intersecting with empty will clear the FeedbackParams.
cricket::FeedbackParams empty_params;
iter->feedback_params.Intersect(empty_params);
EXPECT_TRUE(iter->feedback_params.params().empty());
}
EXPECT_TRUE(channel_->SetSendCodecs(codecs));
EXPECT_FALSE(vie_.GetFecStatus(channel_num));
EXPECT_FALSE(vie_.GetHybridNackFecStatus(channel_num));
EXPECT_FALSE(vie_.GetNackStatus(channel_num));
}
// Test that we enable hybrid NACK FEC mode.
@ -1317,7 +1271,6 @@ TEST_F(WebRtcVideoEngineTestFake, HybridNackFec) {
EXPECT_TRUE(channel_->SetSendCodecs(engine_.codecs()));
EXPECT_TRUE(vie_.GetHybridNackFecStatus(channel_num));
EXPECT_FALSE(vie_.GetNackStatus(channel_num));
EXPECT_FALSE(vie_.GetFecStatus(channel_num));
}
// Test that we enable hybrid NACK FEC mode when calling SetSendCodecs and
@ -1329,7 +1282,6 @@ TEST_F(WebRtcVideoEngineTestFake, HybridNackFecReversedOrder) {
EXPECT_TRUE(channel_->SetRecvCodecs(engine_.codecs()));
EXPECT_TRUE(vie_.GetHybridNackFecStatus(channel_num));
EXPECT_FALSE(vie_.GetNackStatus(channel_num));
EXPECT_FALSE(vie_.GetFecStatus(channel_num));
}
// Test NACK vs Hybrid NACK/FEC interop call setup, i.e. only use NACK even if
@ -1345,7 +1297,6 @@ TEST_F(WebRtcVideoEngineTestFake, VideoProtectionInterop) {
EXPECT_TRUE(channel_->SetSendCodecs(send_codecs));
EXPECT_FALSE(vie_.GetHybridNackFecStatus(channel_num));
EXPECT_TRUE(vie_.GetNackStatus(channel_num));
EXPECT_FALSE(vie_.GetFecStatus(channel_num));
}
// Test NACK vs Hybrid NACK/FEC interop call setup, i.e. only use NACK even if
@ -1362,7 +1313,6 @@ TEST_F(WebRtcVideoEngineTestFake, VideoProtectionInteropReversed) {
EXPECT_TRUE(channel_->SetRecvCodecs(recv_codecs));
EXPECT_FALSE(vie_.GetHybridNackFecStatus(channel_num));
EXPECT_TRUE(vie_.GetNackStatus(channel_num));
EXPECT_FALSE(vie_.GetFecStatus(channel_num));
}
// Test that NACK, not hybrid mode, is enabled in conference mode.
@ -1377,13 +1327,11 @@ TEST_F(WebRtcVideoEngineTestFake, HybridNackFecConference) {
EXPECT_TRUE(channel_->SetSendCodecs(engine_.codecs()));
EXPECT_FALSE(vie_.GetHybridNackFecStatus(send_channel_num));
EXPECT_TRUE(vie_.GetNackStatus(send_channel_num));
EXPECT_FALSE(vie_.GetFecStatus(send_channel_num));
// Add a receive stream.
EXPECT_TRUE(channel_->AddRecvStream(cricket::StreamParams::CreateLegacy(1)));
int receive_channel_num = vie_.GetLastChannel();
EXPECT_FALSE(vie_.GetHybridNackFecStatus(receive_channel_num));
EXPECT_TRUE(vie_.GetNackStatus(receive_channel_num));
EXPECT_FALSE(vie_.GetFecStatus(receive_channel_num));
}
// Test that when AddRecvStream in conference mode, a new channel is created