Only return Rtx mode in RTXSendStatus().
There is no need to return 'ssrc' and 'payloadtype' inside this function since they are never used. BUG= R=pbos@webrtc.org, stefan@webrtc.org Review URL: https://webrtc-codereview.appspot.com/38569004 Patch from Changbin Shao <changbin.shao@intel.com>. git-svn-id: http://webrtc.googlecode.com/svn/trunk@8049 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
3df38b442f
commit
0b0c24177b
@ -220,7 +220,13 @@ class RtpRtcp : public Module {
|
|||||||
* Turn on/off sending RTX (RFC 4588). The modes can be set as a combination
|
* Turn on/off sending RTX (RFC 4588). The modes can be set as a combination
|
||||||
* of values of the enumerator RtxMode.
|
* of values of the enumerator RtxMode.
|
||||||
*/
|
*/
|
||||||
virtual void SetRTXSendStatus(int modes) = 0;
|
virtual void SetRtxSendStatus(int modes) = 0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get status of sending RTX (RFC 4588). The returned value can be
|
||||||
|
* a combination of values of the enumerator RtxMode.
|
||||||
|
*/
|
||||||
|
virtual int RtxSendStatus() const = 0;
|
||||||
|
|
||||||
// Sets the SSRC to use when sending RTX packets. This doesn't enable RTX,
|
// Sets the SSRC to use when sending RTX packets. This doesn't enable RTX,
|
||||||
// only the SSRC is set.
|
// only the SSRC is set.
|
||||||
@ -230,12 +236,6 @@ class RtpRtcp : public Module {
|
|||||||
// doesn't enable RTX, only the payload type is set.
|
// doesn't enable RTX, only the payload type is set.
|
||||||
virtual void SetRtxSendPayloadType(int payload_type) = 0;
|
virtual void SetRtxSendPayloadType(int payload_type) = 0;
|
||||||
|
|
||||||
/*
|
|
||||||
* Get status of sending RTX (RFC 4588) on a specific SSRC.
|
|
||||||
*/
|
|
||||||
virtual void RTXSendStatus(int* modes, uint32_t* ssrc,
|
|
||||||
int* payloadType) const = 0;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* sends kRtcpByeCode when going from true to false
|
* sends kRtcpByeCode when going from true to false
|
||||||
*
|
*
|
||||||
|
@ -95,10 +95,8 @@ class MockRtpRtcp : public RtpRtcp {
|
|||||||
MOCK_METHOD1(SetCsrcs, void(const std::vector<uint32_t>& csrcs));
|
MOCK_METHOD1(SetCsrcs, void(const std::vector<uint32_t>& csrcs));
|
||||||
MOCK_METHOD1(SetCSRCStatus,
|
MOCK_METHOD1(SetCSRCStatus,
|
||||||
int32_t(const bool include));
|
int32_t(const bool include));
|
||||||
MOCK_METHOD1(SetRTXSendStatus,
|
MOCK_METHOD1(SetRtxSendStatus, void(int modes));
|
||||||
void(int modes));
|
MOCK_CONST_METHOD0(RtxSendStatus, int());
|
||||||
MOCK_CONST_METHOD3(RTXSendStatus,
|
|
||||||
void(int* modes, uint32_t* ssrc, int* payload_type));
|
|
||||||
MOCK_METHOD1(SetRtxSsrc,
|
MOCK_METHOD1(SetRtxSsrc,
|
||||||
void(uint32_t));
|
void(uint32_t));
|
||||||
MOCK_METHOD1(SetRtxSendPayloadType,
|
MOCK_METHOD1(SetRtxSendPayloadType,
|
||||||
|
@ -259,7 +259,7 @@ class RtpRtcpRtxNackTest : public ::testing::Test {
|
|||||||
|
|
||||||
void RunRtxTest(RtxMode rtx_method, int loss) {
|
void RunRtxTest(RtxMode rtx_method, int loss) {
|
||||||
rtp_payload_registry_.SetRtxSsrc(kTestSsrc + 1);
|
rtp_payload_registry_.SetRtxSsrc(kTestSsrc + 1);
|
||||||
rtp_rtcp_module_->SetRTXSendStatus(rtx_method);
|
rtp_rtcp_module_->SetRtxSendStatus(rtx_method);
|
||||||
rtp_rtcp_module_->SetRtxSsrc(kTestSsrc + 1);
|
rtp_rtcp_module_->SetRtxSsrc(kTestSsrc + 1);
|
||||||
transport_.DropEveryNthPacket(loss);
|
transport_.DropEveryNthPacket(loss);
|
||||||
uint32_t timestamp = 3000;
|
uint32_t timestamp = 3000;
|
||||||
|
@ -243,14 +243,12 @@ int32_t ModuleRtpRtcpImpl::Process() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModuleRtpRtcpImpl::SetRTXSendStatus(int mode) {
|
void ModuleRtpRtcpImpl::SetRtxSendStatus(int mode) {
|
||||||
rtp_sender_.SetRTXStatus(mode);
|
rtp_sender_.SetRtxStatus(mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModuleRtpRtcpImpl::RTXSendStatus(int* mode,
|
int ModuleRtpRtcpImpl::RtxSendStatus() const {
|
||||||
uint32_t* ssrc,
|
return rtp_sender_.RtxStatus();
|
||||||
int* payload_type) const {
|
|
||||||
rtp_sender_.RTXStatus(mode, ssrc, payload_type);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModuleRtpRtcpImpl::SetRtxSsrc(uint32_t ssrc) {
|
void ModuleRtpRtcpImpl::SetRtxSsrc(uint32_t ssrc) {
|
||||||
@ -1315,12 +1313,8 @@ int64_t ModuleRtpRtcpImpl::RtcpReportInterval() {
|
|||||||
void ModuleRtpRtcpImpl::SetRtcpReceiverSsrcs(uint32_t main_ssrc) {
|
void ModuleRtpRtcpImpl::SetRtcpReceiverSsrcs(uint32_t main_ssrc) {
|
||||||
std::set<uint32_t> ssrcs;
|
std::set<uint32_t> ssrcs;
|
||||||
ssrcs.insert(main_ssrc);
|
ssrcs.insert(main_ssrc);
|
||||||
int rtx_mode = kRtxOff;
|
if (rtp_sender_.RtxStatus() != kRtxOff)
|
||||||
uint32_t rtx_ssrc = 0;
|
ssrcs.insert(rtp_sender_.RtxSsrc());
|
||||||
int rtx_payload_type = 0;
|
|
||||||
rtp_sender_.RTXStatus(&rtx_mode, &rtx_ssrc, &rtx_payload_type);
|
|
||||||
if (rtx_mode != kRtxOff)
|
|
||||||
ssrcs.insert(rtx_ssrc);
|
|
||||||
rtcp_receiver_.SetSsrcs(main_ssrc, ssrcs);
|
rtcp_receiver_.SetSsrcs(main_ssrc, ssrcs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,10 +87,8 @@ class ModuleRtpRtcpImpl : public RtpRtcp {
|
|||||||
|
|
||||||
int CurrentSendFrequencyHz() const;
|
int CurrentSendFrequencyHz() const;
|
||||||
|
|
||||||
virtual void SetRTXSendStatus(int mode) OVERRIDE;
|
virtual void SetRtxSendStatus(int mode) OVERRIDE;
|
||||||
|
virtual int RtxSendStatus() const OVERRIDE;
|
||||||
virtual void RTXSendStatus(int* mode, uint32_t* ssrc,
|
|
||||||
int* payloadType) const OVERRIDE;
|
|
||||||
|
|
||||||
virtual void SetRtxSsrc(uint32_t ssrc) OVERRIDE;
|
virtual void SetRtxSsrc(uint32_t ssrc) OVERRIDE;
|
||||||
|
|
||||||
|
@ -693,7 +693,7 @@ TEST_F(RtpSendingTest, DISABLED_RoundRobinPaddingRtx) {
|
|||||||
1);
|
1);
|
||||||
senders_[i]->SetRtxSendPayloadType(96);
|
senders_[i]->SetRtxSendPayloadType(96);
|
||||||
senders_[i]->SetRtxSsrc(kSenderRtxSsrc + i);
|
senders_[i]->SetRtxSsrc(kSenderRtxSsrc + i);
|
||||||
senders_[i]->SetRTXSendStatus(kRtxRetransmitted);
|
senders_[i]->SetRtxSendStatus(kRtxRetransmitted);
|
||||||
}
|
}
|
||||||
transport_.ResetCounters();
|
transport_.ResetCounters();
|
||||||
senders_[0]->TimeToSendPadding(500);
|
senders_[0]->TimeToSendPadding(500);
|
||||||
@ -718,7 +718,7 @@ TEST_F(RtpSendingTest, DISABLED_RoundRobinPaddingRtxRedundantPayloads) {
|
|||||||
for (int i = 1; i < codec_.numberOfSimulcastStreams + 1; ++i) {
|
for (int i = 1; i < codec_.numberOfSimulcastStreams + 1; ++i) {
|
||||||
senders_[i]->SetRtxSendPayloadType(96);
|
senders_[i]->SetRtxSendPayloadType(96);
|
||||||
senders_[i]->SetRtxSsrc(kSenderRtxSsrc + i);
|
senders_[i]->SetRtxSsrc(kSenderRtxSsrc + i);
|
||||||
senders_[i]->SetRTXSendStatus(kRtxRetransmitted | kRtxRedundantPayloads);
|
senders_[i]->SetRtxSendStatus(kRtxRetransmitted | kRtxRedundantPayloads);
|
||||||
senders_[i]->SetStorePacketsStatus(true, 100);
|
senders_[i]->SetStorePacketsStatus(true, 100);
|
||||||
}
|
}
|
||||||
// First send payloads so that we have something to retransmit.
|
// First send payloads so that we have something to retransmit.
|
||||||
|
@ -383,11 +383,16 @@ size_t RTPSender::MaxPayloadLength() const {
|
|||||||
|
|
||||||
uint16_t RTPSender::PacketOverHead() const { return packet_over_head_; }
|
uint16_t RTPSender::PacketOverHead() const { return packet_over_head_; }
|
||||||
|
|
||||||
void RTPSender::SetRTXStatus(int mode) {
|
void RTPSender::SetRtxStatus(int mode) {
|
||||||
CriticalSectionScoped cs(send_critsect_);
|
CriticalSectionScoped cs(send_critsect_);
|
||||||
rtx_ = mode;
|
rtx_ = mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int RTPSender::RtxStatus() const {
|
||||||
|
CriticalSectionScoped cs(send_critsect_);
|
||||||
|
return rtx_;
|
||||||
|
}
|
||||||
|
|
||||||
void RTPSender::SetRtxSsrc(uint32_t ssrc) {
|
void RTPSender::SetRtxSsrc(uint32_t ssrc) {
|
||||||
CriticalSectionScoped cs(send_critsect_);
|
CriticalSectionScoped cs(send_critsect_);
|
||||||
ssrc_rtx_ = ssrc;
|
ssrc_rtx_ = ssrc;
|
||||||
@ -398,14 +403,6 @@ uint32_t RTPSender::RtxSsrc() const {
|
|||||||
return ssrc_rtx_;
|
return ssrc_rtx_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTPSender::RTXStatus(int* mode, uint32_t* ssrc,
|
|
||||||
int* payload_type) const {
|
|
||||||
CriticalSectionScoped cs(send_critsect_);
|
|
||||||
*mode = rtx_;
|
|
||||||
*ssrc = ssrc_rtx_;
|
|
||||||
*payload_type = payload_type_rtx_;
|
|
||||||
}
|
|
||||||
|
|
||||||
void RTPSender::SetRtxPayloadType(int payload_type) {
|
void RTPSender::SetRtxPayloadType(int payload_type) {
|
||||||
CriticalSectionScoped cs(send_critsect_);
|
CriticalSectionScoped cs(send_critsect_);
|
||||||
payload_type_rtx_ = payload_type;
|
payload_type_rtx_ = payload_type;
|
||||||
|
@ -184,9 +184,8 @@ class RTPSender : public RTPSenderInterface {
|
|||||||
bool ProcessNACKBitRate(uint32_t now);
|
bool ProcessNACKBitRate(uint32_t now);
|
||||||
|
|
||||||
// RTX.
|
// RTX.
|
||||||
void SetRTXStatus(int mode);
|
void SetRtxStatus(int mode);
|
||||||
|
int RtxStatus() const;
|
||||||
void RTXStatus(int* mode, uint32_t* ssrc, int* payload_type) const;
|
|
||||||
|
|
||||||
uint32_t RtxSsrc() const;
|
uint32_t RtxSsrc() const;
|
||||||
void SetRtxSsrc(uint32_t ssrc);
|
void SetRtxSsrc(uint32_t ssrc);
|
||||||
|
@ -667,7 +667,7 @@ TEST_F(RtpSenderTest, SendRedundantPayloads) {
|
|||||||
rtp_header_len += 4; // 4 bytes extension.
|
rtp_header_len += 4; // 4 bytes extension.
|
||||||
rtp_header_len += 4; // 4 extra bytes common to all extension headers.
|
rtp_header_len += 4; // 4 extra bytes common to all extension headers.
|
||||||
|
|
||||||
rtp_sender_->SetRTXStatus(kRtxRetransmitted | kRtxRedundantPayloads);
|
rtp_sender_->SetRtxStatus(kRtxRetransmitted | kRtxRedundantPayloads);
|
||||||
rtp_sender_->SetRtxSsrc(1234);
|
rtp_sender_->SetRtxSsrc(1234);
|
||||||
|
|
||||||
// Create and set up parser.
|
// Create and set up parser.
|
||||||
@ -1124,7 +1124,7 @@ TEST_F(RtpSenderTest, BytesReportedCorrectly) {
|
|||||||
rtp_sender_->SetSSRC(1234);
|
rtp_sender_->SetSSRC(1234);
|
||||||
rtp_sender_->SetRtxSsrc(4321);
|
rtp_sender_->SetRtxSsrc(4321);
|
||||||
rtp_sender_->SetRtxPayloadType(kPayloadType - 1);
|
rtp_sender_->SetRtxPayloadType(kPayloadType - 1);
|
||||||
rtp_sender_->SetRTXStatus(kRtxRetransmitted | kRtxRedundantPayloads);
|
rtp_sender_->SetRtxStatus(kRtxRetransmitted | kRtxRedundantPayloads);
|
||||||
|
|
||||||
ASSERT_EQ(
|
ASSERT_EQ(
|
||||||
0,
|
0,
|
||||||
|
@ -103,28 +103,17 @@ TEST_F(RtpRtcpAPITest, RTCP) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(RtpRtcpAPITest, RtxSender) {
|
TEST_F(RtpRtcpAPITest, RtxSender) {
|
||||||
unsigned int ssrc = 0;
|
module->SetRtxSendStatus(kRtxRetransmitted);
|
||||||
int rtx_mode = kRtxOff;
|
int rtx_mode = module->RtxSendStatus();
|
||||||
const int kRtxPayloadType = 119;
|
|
||||||
int payload_type = -1;
|
|
||||||
module->SetRTXSendStatus(kRtxRetransmitted);
|
|
||||||
module->SetRtxSendPayloadType(kRtxPayloadType);
|
|
||||||
module->SetRtxSsrc(1);
|
|
||||||
module->RTXSendStatus(&rtx_mode, &ssrc, &payload_type);
|
|
||||||
EXPECT_EQ(kRtxRetransmitted, rtx_mode);
|
EXPECT_EQ(kRtxRetransmitted, rtx_mode);
|
||||||
EXPECT_EQ(1u, ssrc);
|
|
||||||
EXPECT_EQ(kRtxPayloadType, payload_type);
|
module->SetRtxSendStatus(kRtxOff);
|
||||||
rtx_mode = kRtxOff;
|
rtx_mode = module->RtxSendStatus();
|
||||||
module->SetRTXSendStatus(kRtxOff);
|
|
||||||
payload_type = -1;
|
|
||||||
module->SetRtxSendPayloadType(kRtxPayloadType);
|
|
||||||
module->RTXSendStatus(&rtx_mode, &ssrc, &payload_type);
|
|
||||||
EXPECT_EQ(kRtxOff, rtx_mode);
|
EXPECT_EQ(kRtxOff, rtx_mode);
|
||||||
EXPECT_EQ(kRtxPayloadType, payload_type);
|
|
||||||
module->SetRTXSendStatus(kRtxRetransmitted);
|
module->SetRtxSendStatus(kRtxRetransmitted);
|
||||||
module->RTXSendStatus(&rtx_mode, &ssrc, &payload_type);
|
rtx_mode = module->RtxSendStatus();
|
||||||
EXPECT_EQ(kRtxRetransmitted, rtx_mode);
|
EXPECT_EQ(kRtxRetransmitted, rtx_mode);
|
||||||
EXPECT_EQ(kRtxPayloadType, payload_type);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(RtpRtcpAPITest, RtxReceiver) {
|
TEST_F(RtpRtcpAPITest, RtxReceiver) {
|
||||||
|
@ -364,12 +364,7 @@ int32_t ViEChannel::SetSendCodec(const VideoCodec& video_codec,
|
|||||||
}
|
}
|
||||||
rtp_rtcp->SetSendingStatus(rtp_rtcp_->Sending());
|
rtp_rtcp->SetSendingStatus(rtp_rtcp_->Sending());
|
||||||
rtp_rtcp->SetSendingMediaStatus(rtp_rtcp_->SendingMedia());
|
rtp_rtcp->SetSendingMediaStatus(rtp_rtcp_->SendingMedia());
|
||||||
|
rtp_rtcp->SetRtxSendStatus(rtp_rtcp_->RtxSendStatus());
|
||||||
int mode;
|
|
||||||
uint32_t ssrc;
|
|
||||||
int payload_type;
|
|
||||||
rtp_rtcp_->RTXSendStatus(&mode, &ssrc, &payload_type);
|
|
||||||
rtp_rtcp->SetRTXSendStatus(mode);
|
|
||||||
simulcast_rtp_rtcp_.push_back(rtp_rtcp);
|
simulcast_rtp_rtcp_.push_back(rtp_rtcp);
|
||||||
|
|
||||||
// Silently ignore error.
|
// Silently ignore error.
|
||||||
@ -912,11 +907,11 @@ int ViEChannel::SetRtxSendPayloadType(int payload_type) {
|
|||||||
void ViEChannel::SetRtxSendStatus(bool enable) {
|
void ViEChannel::SetRtxSendStatus(bool enable) {
|
||||||
int rtx_settings =
|
int rtx_settings =
|
||||||
enable ? kRtxRetransmitted | kRtxRedundantPayloads : kRtxOff;
|
enable ? kRtxRetransmitted | kRtxRedundantPayloads : kRtxOff;
|
||||||
rtp_rtcp_->SetRTXSendStatus(rtx_settings);
|
rtp_rtcp_->SetRtxSendStatus(rtx_settings);
|
||||||
CriticalSectionScoped cs(rtp_rtcp_cs_.get());
|
CriticalSectionScoped cs(rtp_rtcp_cs_.get());
|
||||||
for (std::list<RtpRtcp*>::iterator it = simulcast_rtp_rtcp_.begin();
|
for (std::list<RtpRtcp*>::iterator it = simulcast_rtp_rtcp_.begin();
|
||||||
it != simulcast_rtp_rtcp_.end(); it++) {
|
it != simulcast_rtp_rtcp_.end(); it++) {
|
||||||
(*it)->SetRTXSendStatus(rtx_settings);
|
(*it)->SetRtxSendStatus(rtx_settings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user