Unify newapi::RtcpMode and RTCPMethod.
BUG=webrtc:1695 R=solenberg@webrtc.org, stefan@webrtc.org TBR=mflodman@webrtc.org Review URL: https://codereview.webrtc.org/1373903003 Cr-Commit-Position: refs/heads/master@{#10143}
This commit is contained in:
parent
c8ba105889
commit
da903eaabb
@ -1362,7 +1362,7 @@ TEST_F(WebRtcVideoChannel2Test, AddRecvStreamOnlyUsesOneReceiveStream) {
|
||||
|
||||
TEST_F(WebRtcVideoChannel2Test, RtcpIsCompoundByDefault) {
|
||||
FakeVideoReceiveStream* stream = AddRecvStream();
|
||||
EXPECT_EQ(webrtc::newapi::kRtcpCompound, stream->GetConfig().rtp.rtcp_mode);
|
||||
EXPECT_EQ(webrtc::RtcpMode::kCompound, stream->GetConfig().rtp.rtcp_mode);
|
||||
}
|
||||
|
||||
TEST_F(WebRtcVideoChannel2Test, RembIsEnabledByDefault) {
|
||||
|
||||
@ -111,13 +111,15 @@ namespace {
|
||||
// unnamed namespace. The intention is to make the compiler warn if anyone
|
||||
// adds unhandled new events/modes/etc.
|
||||
|
||||
rtclog::VideoReceiveConfig_RtcpMode ConvertRtcpMode(
|
||||
newapi::RtcpMode rtcp_mode) {
|
||||
rtclog::VideoReceiveConfig_RtcpMode ConvertRtcpMode(RtcpMode rtcp_mode) {
|
||||
switch (rtcp_mode) {
|
||||
case newapi::kRtcpCompound:
|
||||
case RtcpMode::kCompound:
|
||||
return rtclog::VideoReceiveConfig::RTCP_COMPOUND;
|
||||
case newapi::kRtcpReducedSize:
|
||||
case RtcpMode::kReducedSize:
|
||||
return rtclog::VideoReceiveConfig::RTCP_REDUCEDSIZE;
|
||||
case RtcpMode::kOff:
|
||||
RTC_NOTREACHED();
|
||||
return rtclog::VideoReceiveConfig::RTCP_COMPOUND;
|
||||
}
|
||||
RTC_NOTREACHED();
|
||||
return rtclog::VideoReceiveConfig::RTCP_COMPOUND;
|
||||
|
||||
@ -129,7 +129,7 @@ void VerifyReceiveStreamConfig(const rtclog::Event& event,
|
||||
EXPECT_EQ(config.rtp.local_ssrc, receiver_config.local_ssrc());
|
||||
// Check RTCP settings.
|
||||
ASSERT_TRUE(receiver_config.has_rtcp_mode());
|
||||
if (config.rtp.rtcp_mode == newapi::kRtcpCompound)
|
||||
if (config.rtp.rtcp_mode == RtcpMode::kCompound)
|
||||
EXPECT_EQ(rtclog::VideoReceiveConfig::RTCP_COMPOUND,
|
||||
receiver_config.rtcp_mode());
|
||||
else
|
||||
@ -356,8 +356,8 @@ void GenerateVideoReceiveConfig(uint32_t extensions_bitvector,
|
||||
config->rtp.remote_ssrc = rand();
|
||||
config->rtp.local_ssrc = rand();
|
||||
// Add extensions and settings for RTCP.
|
||||
config->rtp.rtcp_mode = rand() % 2 ? newapi::kRtcpCompound
|
||||
: newapi::kRtcpReducedSize;
|
||||
config->rtp.rtcp_mode =
|
||||
rand() % 2 ? RtcpMode::kCompound : RtcpMode::kReducedSize;
|
||||
config->rtp.rtcp_xr.receiver_reference_time_report = (rand() % 2 == 1);
|
||||
config->rtp.remb = (rand() % 2 == 1);
|
||||
// Add a map from a payload type to a new ssrc and a new payload type for RTX.
|
||||
|
||||
@ -893,6 +893,11 @@ class StreamDataCountersCallback {
|
||||
virtual void DataCountersUpdated(const StreamDataCounters& counters,
|
||||
uint32_t ssrc) = 0;
|
||||
};
|
||||
|
||||
// RTCP mode to use. Compound mode is described by RFC 4585 and reduced-size
|
||||
// RTCP mode is described by RFC 5506.
|
||||
enum class RtcpMode { kOff, kCompound, kReducedSize };
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_COMMON_TYPES_H_
|
||||
|
||||
@ -327,14 +327,14 @@ class RtpRtcp : public Module {
|
||||
/*
|
||||
* Get RTCP status
|
||||
*/
|
||||
virtual RTCPMethod RTCP() const = 0;
|
||||
virtual RtcpMode RTCP() const = 0;
|
||||
|
||||
/*
|
||||
* configure RTCP status i.e on(compound or non- compound)/off
|
||||
*
|
||||
* method - RTCP method to use
|
||||
*/
|
||||
virtual void SetRTCPStatus(RTCPMethod method) = 0;
|
||||
virtual void SetRTCPStatus(RtcpMode method) = 0;
|
||||
|
||||
/*
|
||||
* Set RTCP CName (i.e unique identifier)
|
||||
|
||||
@ -52,13 +52,6 @@ union PayloadUnion
|
||||
VideoPayload Video;
|
||||
};
|
||||
|
||||
enum RTCPMethod
|
||||
{
|
||||
kRtcpOff = 0,
|
||||
kRtcpCompound = 1,
|
||||
kRtcpNonCompound = 2
|
||||
};
|
||||
|
||||
enum RTPAliveType
|
||||
{
|
||||
kRtpDead = 0,
|
||||
|
||||
@ -130,9 +130,8 @@ class MockRtpRtcp : public RtpRtcp {
|
||||
MOCK_METHOD2(RegisterRtcpObservers,
|
||||
void(RtcpIntraFrameObserver* intraFrameCallback,
|
||||
RtcpBandwidthObserver* bandwidthCallback));
|
||||
MOCK_CONST_METHOD0(RTCP,
|
||||
RTCPMethod());
|
||||
MOCK_METHOD1(SetRTCPStatus, void(const RTCPMethod method));
|
||||
MOCK_CONST_METHOD0(RTCP, RtcpMode());
|
||||
MOCK_METHOD1(SetRTCPStatus, void(const RtcpMode method));
|
||||
MOCK_METHOD1(SetCNAME,
|
||||
int32_t(const char cName[RTCP_CNAME_SIZE]));
|
||||
MOCK_CONST_METHOD2(RemoteCNAME,
|
||||
|
||||
@ -197,7 +197,7 @@ class RtpRtcpRtxNackTest : public ::testing::Test {
|
||||
&rtp_payload_registry_));
|
||||
|
||||
rtp_rtcp_module_->SetSSRC(kTestSsrc);
|
||||
rtp_rtcp_module_->SetRTCPStatus(kRtcpCompound);
|
||||
rtp_rtcp_module_->SetRTCPStatus(RtcpMode::kCompound);
|
||||
rtp_receiver_->SetNACKStatus(kNackRtcp);
|
||||
rtp_rtcp_module_->SetStorePacketsStatus(true, 600);
|
||||
EXPECT_EQ(0, rtp_rtcp_module_->SetSendingStatus(true));
|
||||
|
||||
@ -116,7 +116,7 @@ TEST_F(RtcpFormatRembTest, TestRembStatus) {
|
||||
|
||||
TEST_F(RtcpFormatRembTest, TestNonCompund) {
|
||||
uint32_t SSRC = 456789;
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpNonCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize);
|
||||
rtcp_sender_->SetREMBData(1234, std::vector<uint32_t>(1, SSRC));
|
||||
RTCPSender::FeedbackState feedback_state =
|
||||
dummy_rtp_rtcp_impl_->GetFeedbackState();
|
||||
@ -125,7 +125,7 @@ TEST_F(RtcpFormatRembTest, TestNonCompund) {
|
||||
|
||||
TEST_F(RtcpFormatRembTest, TestCompund) {
|
||||
uint32_t SSRCs[2] = {456789, 98765};
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound);
|
||||
rtcp_sender_->SetREMBData(1234, std::vector<uint32_t>(SSRCs, SSRCs + 2));
|
||||
RTCPSender::FeedbackState feedback_state =
|
||||
dummy_rtp_rtcp_impl_->GetFeedbackState();
|
||||
|
||||
@ -43,7 +43,7 @@ RTCPReceiver::RTCPReceiver(
|
||||
: TMMBRHelp(),
|
||||
_clock(clock),
|
||||
receiver_only_(receiver_only),
|
||||
_method(kRtcpOff),
|
||||
_method(RtcpMode::kOff),
|
||||
_lastReceived(0),
|
||||
_rtpRtcp(*owner),
|
||||
_criticalSectionFeedbacks(
|
||||
@ -99,12 +99,12 @@ RTCPReceiver::~RTCPReceiver() {
|
||||
}
|
||||
}
|
||||
|
||||
RTCPMethod RTCPReceiver::Status() const {
|
||||
RtcpMode RTCPReceiver::Status() const {
|
||||
CriticalSectionScoped lock(_criticalSectionRTCPReceiver);
|
||||
return _method;
|
||||
}
|
||||
|
||||
void RTCPReceiver::SetRTCPStatus(RTCPMethod method) {
|
||||
void RTCPReceiver::SetRTCPStatus(RtcpMode method) {
|
||||
CriticalSectionScoped lock(_criticalSectionRTCPReceiver);
|
||||
_method = method;
|
||||
}
|
||||
|
||||
@ -38,8 +38,8 @@ public:
|
||||
ModuleRtpRtcpImpl* owner);
|
||||
virtual ~RTCPReceiver();
|
||||
|
||||
RTCPMethod Status() const;
|
||||
void SetRTCPStatus(RTCPMethod method);
|
||||
RtcpMode Status() const;
|
||||
void SetRTCPStatus(RtcpMode method);
|
||||
|
||||
int64_t LastReceived();
|
||||
int64_t LastReceivedReceiverReport() const;
|
||||
@ -239,7 +239,7 @@ protected:
|
||||
|
||||
Clock* const _clock;
|
||||
const bool receiver_only_;
|
||||
RTCPMethod _method;
|
||||
RtcpMode _method;
|
||||
int64_t _lastReceived;
|
||||
ModuleRtpRtcpImpl& _rtpRtcp;
|
||||
|
||||
|
||||
@ -139,7 +139,7 @@ RTCPSender::RTCPSender(
|
||||
Transport* outgoing_transport)
|
||||
: audio_(audio),
|
||||
clock_(clock),
|
||||
method_(kRtcpOff),
|
||||
method_(RtcpMode::kOff),
|
||||
transport_(outgoing_transport),
|
||||
|
||||
critical_section_rtcp_sender_(
|
||||
@ -196,16 +196,16 @@ RTCPSender::RTCPSender(
|
||||
RTCPSender::~RTCPSender() {
|
||||
}
|
||||
|
||||
RTCPMethod RTCPSender::Status() const {
|
||||
RtcpMode RTCPSender::Status() const {
|
||||
CriticalSectionScoped lock(critical_section_rtcp_sender_.get());
|
||||
return method_;
|
||||
}
|
||||
|
||||
void RTCPSender::SetRTCPStatus(RTCPMethod method) {
|
||||
void RTCPSender::SetRTCPStatus(RtcpMode method) {
|
||||
CriticalSectionScoped lock(critical_section_rtcp_sender_.get());
|
||||
method_ = method;
|
||||
|
||||
if (method == kRtcpOff)
|
||||
if (method == RtcpMode::kOff)
|
||||
return;
|
||||
next_time_to_send_rtcp_ =
|
||||
clock_->TimeInMilliseconds() +
|
||||
@ -223,7 +223,7 @@ int32_t RTCPSender::SetSendingStatus(const FeedbackState& feedback_state,
|
||||
{
|
||||
CriticalSectionScoped lock(critical_section_rtcp_sender_.get());
|
||||
|
||||
if (method_ != kRtcpOff) {
|
||||
if (method_ != RtcpMode::kOff) {
|
||||
if (sending == false && sending_ == true) {
|
||||
// Trigger RTCP bye
|
||||
sendRTCPBye = true;
|
||||
@ -402,7 +402,7 @@ From RFC 3550
|
||||
|
||||
CriticalSectionScoped lock(critical_section_rtcp_sender_.get());
|
||||
|
||||
if (method_ == kRtcpOff)
|
||||
if (method_ == RtcpMode::kOff)
|
||||
return false;
|
||||
|
||||
if (!audio_ && sendKeyframeBeforeRTP) {
|
||||
@ -933,7 +933,7 @@ int32_t RTCPSender::SendCompoundRTCP(
|
||||
uint64_t pictureID) {
|
||||
{
|
||||
CriticalSectionScoped lock(critical_section_rtcp_sender_.get());
|
||||
if (method_ == kRtcpOff) {
|
||||
if (method_ == RtcpMode::kOff) {
|
||||
LOG(LS_WARNING) << "Can't send rtcp if it is disabled.";
|
||||
return -1;
|
||||
}
|
||||
@ -977,8 +977,8 @@ int RTCPSender::PrepareRTCP(const FeedbackState& feedback_state,
|
||||
RTC_DCHECK(ConsumeFlag(kRtcpReport) == false);
|
||||
} else {
|
||||
generate_report =
|
||||
(ConsumeFlag(kRtcpReport) && method_ == kRtcpNonCompound) ||
|
||||
method_ == kRtcpCompound;
|
||||
(ConsumeFlag(kRtcpReport) && method_ == RtcpMode::kReducedSize) ||
|
||||
method_ == RtcpMode::kCompound;
|
||||
if (generate_report)
|
||||
SetFlag(sending_ ? kRtcpSr : kRtcpRr, true);
|
||||
}
|
||||
|
||||
@ -78,8 +78,8 @@ public:
|
||||
Transport* outgoing_transport);
|
||||
virtual ~RTCPSender();
|
||||
|
||||
RTCPMethod Status() const;
|
||||
void SetRTCPStatus(RTCPMethod method);
|
||||
RtcpMode Status() const;
|
||||
void SetRTCPStatus(RtcpMode method);
|
||||
|
||||
bool Sending() const;
|
||||
int32_t SetSendingStatus(const FeedbackState& feedback_state,
|
||||
@ -225,7 +225,7 @@ private:
|
||||
private:
|
||||
const bool audio_;
|
||||
Clock* const clock_;
|
||||
RTCPMethod method_ GUARDED_BY(critical_section_rtcp_sender_);
|
||||
RtcpMode method_ GUARDED_BY(critical_section_rtcp_sender_);
|
||||
|
||||
Transport* const transport_;
|
||||
|
||||
|
||||
@ -260,9 +260,9 @@ class RtcpSenderTest : public ::testing::Test {
|
||||
};
|
||||
|
||||
TEST_F(RtcpSenderTest, SetRtcpStatus) {
|
||||
EXPECT_EQ(kRtcpOff, rtcp_sender_->Status());
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpNonCompound);
|
||||
EXPECT_EQ(kRtcpNonCompound, rtcp_sender_->Status());
|
||||
EXPECT_EQ(RtcpMode::kOff, rtcp_sender_->Status());
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize);
|
||||
EXPECT_EQ(RtcpMode::kReducedSize, rtcp_sender_->Status());
|
||||
}
|
||||
|
||||
TEST_F(RtcpSenderTest, SetSendingStatus) {
|
||||
@ -272,14 +272,14 @@ TEST_F(RtcpSenderTest, SetSendingStatus) {
|
||||
}
|
||||
|
||||
TEST_F(RtcpSenderTest, NoPacketSentIfOff) {
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpOff);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kOff);
|
||||
EXPECT_EQ(-1, rtcp_sender_->SendRTCP(feedback_state(), kRtcpSr));
|
||||
}
|
||||
|
||||
TEST_F(RtcpSenderTest, SendSr) {
|
||||
const uint32_t kPacketCount = 0x12345;
|
||||
const uint32_t kOctetCount = 0x23456;
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpNonCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize);
|
||||
RTCPSender::FeedbackState feedback_state = rtp_rtcp_impl_->GetFeedbackState();
|
||||
feedback_state.packets_sent = kPacketCount;
|
||||
feedback_state.media_bytes_sent = kOctetCount;
|
||||
@ -297,7 +297,7 @@ TEST_F(RtcpSenderTest, SendSr) {
|
||||
}
|
||||
|
||||
TEST_F(RtcpSenderTest, SendRr) {
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpNonCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize);
|
||||
EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpRr));
|
||||
EXPECT_EQ(1, parser()->receiver_report()->num_packets());
|
||||
EXPECT_EQ(kSenderSsrc, parser()->receiver_report()->Ssrc());
|
||||
@ -307,7 +307,7 @@ TEST_F(RtcpSenderTest, SendRr) {
|
||||
TEST_F(RtcpSenderTest, SendRrWithOneReportBlock) {
|
||||
const uint16_t kSeqNum = 11111;
|
||||
InsertIncomingPacket(kRemoteSsrc, kSeqNum);
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound);
|
||||
EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpRr));
|
||||
EXPECT_EQ(1, parser()->receiver_report()->num_packets());
|
||||
EXPECT_EQ(kSenderSsrc, parser()->receiver_report()->Ssrc());
|
||||
@ -322,7 +322,7 @@ TEST_F(RtcpSenderTest, SendRrWithTwoReportBlocks) {
|
||||
const uint16_t kSeqNum = 11111;
|
||||
InsertIncomingPacket(kRemoteSsrc, kSeqNum);
|
||||
InsertIncomingPacket(kRemoteSsrc + 1, kSeqNum + 1);
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound);
|
||||
EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpRr));
|
||||
EXPECT_EQ(1, parser()->receiver_report()->num_packets());
|
||||
EXPECT_EQ(kSenderSsrc, parser()->receiver_report()->Ssrc());
|
||||
@ -332,7 +332,7 @@ TEST_F(RtcpSenderTest, SendRrWithTwoReportBlocks) {
|
||||
}
|
||||
|
||||
TEST_F(RtcpSenderTest, SendSdes) {
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpNonCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize);
|
||||
EXPECT_EQ(0, rtcp_sender_->SetCNAME("alice@host"));
|
||||
EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpSdes));
|
||||
EXPECT_EQ(1, parser()->sdes()->num_packets());
|
||||
@ -342,7 +342,7 @@ TEST_F(RtcpSenderTest, SendSdes) {
|
||||
}
|
||||
|
||||
TEST_F(RtcpSenderTest, SdesIncludedInCompoundPacket) {
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound);
|
||||
EXPECT_EQ(0, rtcp_sender_->SetCNAME("alice@host"));
|
||||
EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpReport));
|
||||
EXPECT_EQ(1, parser()->receiver_report()->num_packets());
|
||||
@ -351,14 +351,14 @@ TEST_F(RtcpSenderTest, SdesIncludedInCompoundPacket) {
|
||||
}
|
||||
|
||||
TEST_F(RtcpSenderTest, SendBye) {
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpNonCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize);
|
||||
EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpBye));
|
||||
EXPECT_EQ(1, parser()->bye()->num_packets());
|
||||
EXPECT_EQ(kSenderSsrc, parser()->bye()->Ssrc());
|
||||
}
|
||||
|
||||
TEST_F(RtcpSenderTest, StopSendingTriggersBye) {
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpNonCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize);
|
||||
EXPECT_EQ(0, rtcp_sender_->SetSendingStatus(feedback_state(), true));
|
||||
EXPECT_EQ(0, rtcp_sender_->SetSendingStatus(feedback_state(), false));
|
||||
EXPECT_EQ(1, parser()->bye()->num_packets());
|
||||
@ -375,7 +375,7 @@ TEST_F(RtcpSenderTest, SendApp) {
|
||||
const uint16_t kDataLength = sizeof(kData) / sizeof(kData[0]);
|
||||
EXPECT_EQ(0, rtcp_sender_->SetApplicationSpecificData(kSubType, name, kData,
|
||||
kDataLength));
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpNonCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize);
|
||||
EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpApp));
|
||||
EXPECT_EQ(1, parser()->app()->num_packets());
|
||||
EXPECT_EQ(kSubType, parser()->app()->SubType());
|
||||
@ -394,7 +394,7 @@ TEST_F(RtcpSenderTest, SendEmptyApp) {
|
||||
EXPECT_EQ(
|
||||
0, rtcp_sender_->SetApplicationSpecificData(kSubType, kName, nullptr, 0));
|
||||
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpNonCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize);
|
||||
EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpApp));
|
||||
EXPECT_EQ(1, parser()->app()->num_packets());
|
||||
EXPECT_EQ(kSubType, parser()->app()->SubType());
|
||||
@ -410,7 +410,7 @@ TEST_F(RtcpSenderTest, SetInvalidApplicationSpecificData) {
|
||||
}
|
||||
|
||||
TEST_F(RtcpSenderTest, SendFirNonRepeat) {
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpNonCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize);
|
||||
EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpFir));
|
||||
EXPECT_EQ(1, parser()->fir()->num_packets());
|
||||
EXPECT_EQ(kSenderSsrc, parser()->fir()->Ssrc());
|
||||
@ -425,7 +425,7 @@ TEST_F(RtcpSenderTest, SendFirNonRepeat) {
|
||||
}
|
||||
|
||||
TEST_F(RtcpSenderTest, SendFirRepeat) {
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpNonCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize);
|
||||
EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpFir));
|
||||
EXPECT_EQ(1, parser()->fir()->num_packets());
|
||||
EXPECT_EQ(1, parser()->fir_item()->num_packets());
|
||||
@ -439,7 +439,7 @@ TEST_F(RtcpSenderTest, SendFirRepeat) {
|
||||
}
|
||||
|
||||
TEST_F(RtcpSenderTest, SendPli) {
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpNonCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize);
|
||||
EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpPli));
|
||||
EXPECT_EQ(1, parser()->pli()->num_packets());
|
||||
EXPECT_EQ(kSenderSsrc, parser()->pli()->Ssrc());
|
||||
@ -449,7 +449,7 @@ TEST_F(RtcpSenderTest, SendPli) {
|
||||
TEST_F(RtcpSenderTest, SendRpsi) {
|
||||
const uint64_t kPictureId = 0x41;
|
||||
const int8_t kPayloadType = 100;
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpNonCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize);
|
||||
RTCPSender::FeedbackState feedback_state = rtp_rtcp_impl_->GetFeedbackState();
|
||||
feedback_state.send_payload_type = kPayloadType;
|
||||
EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state, kRtcpRpsi, 0, nullptr,
|
||||
@ -462,7 +462,7 @@ TEST_F(RtcpSenderTest, SendSli) {
|
||||
const uint16_t kFirstMb = 0;
|
||||
const uint16_t kNumberOfMb = 0x1FFF;
|
||||
const uint8_t kPictureId = 60;
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpNonCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize);
|
||||
EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpSli, 0, nullptr,
|
||||
false, kPictureId));
|
||||
EXPECT_EQ(1, parser()->sli()->num_packets());
|
||||
@ -475,7 +475,7 @@ TEST_F(RtcpSenderTest, SendSli) {
|
||||
}
|
||||
|
||||
TEST_F(RtcpSenderTest, SendNack) {
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpNonCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize);
|
||||
const uint16_t kList[] = {0, 1, 16};
|
||||
const int32_t kListLength = sizeof(kList) / sizeof(kList[0]);
|
||||
EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpNack, kListLength,
|
||||
@ -492,7 +492,7 @@ TEST_F(RtcpSenderTest, SendRemb) {
|
||||
std::vector<uint32_t> ssrcs;
|
||||
ssrcs.push_back(kRemoteSsrc);
|
||||
ssrcs.push_back(kRemoteSsrc + 1);
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpNonCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize);
|
||||
rtcp_sender_->SetREMBData(kBitrate, ssrcs);
|
||||
EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpRemb));
|
||||
EXPECT_EQ(1, parser()->psfb_app()->num_packets());
|
||||
@ -507,7 +507,7 @@ TEST_F(RtcpSenderTest, RembIncludedInCompoundPacketIfEnabled) {
|
||||
const int kBitrate = 261011;
|
||||
std::vector<uint32_t> ssrcs;
|
||||
ssrcs.push_back(kRemoteSsrc);
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound);
|
||||
rtcp_sender_->SetREMBStatus(true);
|
||||
EXPECT_TRUE(rtcp_sender_->REMB());
|
||||
rtcp_sender_->SetREMBData(kBitrate, ssrcs);
|
||||
@ -524,7 +524,7 @@ TEST_F(RtcpSenderTest, RembNotIncludedInCompoundPacketIfNotEnabled) {
|
||||
const int kBitrate = 261011;
|
||||
std::vector<uint32_t> ssrcs;
|
||||
ssrcs.push_back(kRemoteSsrc);
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound);
|
||||
rtcp_sender_->SetREMBData(kBitrate, ssrcs);
|
||||
EXPECT_FALSE(rtcp_sender_->REMB());
|
||||
EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpReport));
|
||||
@ -532,7 +532,7 @@ TEST_F(RtcpSenderTest, RembNotIncludedInCompoundPacketIfNotEnabled) {
|
||||
}
|
||||
|
||||
TEST_F(RtcpSenderTest, SendXrWithVoipMetric) {
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpNonCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize);
|
||||
RTCPVoIPMetric metric;
|
||||
metric.lossRate = 1;
|
||||
metric.discardRate = 2;
|
||||
@ -583,7 +583,7 @@ TEST_F(RtcpSenderTest, SendXrWithVoipMetric) {
|
||||
}
|
||||
|
||||
TEST_F(RtcpSenderTest, SendXrWithDlrr) {
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound);
|
||||
RTCPSender::FeedbackState feedback_state = rtp_rtcp_impl_->GetFeedbackState();
|
||||
feedback_state.has_last_xr_rr = true;
|
||||
RtcpReceiveTimeInfo last_xr_rr;
|
||||
@ -603,7 +603,7 @@ TEST_F(RtcpSenderTest, SendXrWithDlrr) {
|
||||
}
|
||||
|
||||
TEST_F(RtcpSenderTest, SendXrWithRrtr) {
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound);
|
||||
EXPECT_EQ(0, rtcp_sender_->SetSendingStatus(feedback_state(), false));
|
||||
rtcp_sender_->SendRtcpXrReceiverReferenceTime(true);
|
||||
uint32_t ntp_secs;
|
||||
@ -619,7 +619,7 @@ TEST_F(RtcpSenderTest, SendXrWithRrtr) {
|
||||
}
|
||||
|
||||
TEST_F(RtcpSenderTest, TestNoXrRrtrSentIfSending) {
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound);
|
||||
EXPECT_EQ(0, rtcp_sender_->SetSendingStatus(feedback_state(), true));
|
||||
rtcp_sender_->SendRtcpXrReceiverReferenceTime(true);
|
||||
EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpReport));
|
||||
@ -628,7 +628,7 @@ TEST_F(RtcpSenderTest, TestNoXrRrtrSentIfSending) {
|
||||
}
|
||||
|
||||
TEST_F(RtcpSenderTest, TestNoXrRrtrSentIfNotEnabled) {
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound);
|
||||
EXPECT_EQ(0, rtcp_sender_->SetSendingStatus(feedback_state(), false));
|
||||
rtcp_sender_->SendRtcpXrReceiverReferenceTime(false);
|
||||
EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpReport));
|
||||
@ -637,7 +637,7 @@ TEST_F(RtcpSenderTest, TestNoXrRrtrSentIfNotEnabled) {
|
||||
}
|
||||
|
||||
TEST_F(RtcpSenderTest, TestSendTimeOfXrRrtr) {
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound);
|
||||
RTCPSender::FeedbackState feedback_state = rtp_rtcp_impl_->GetFeedbackState();
|
||||
EXPECT_EQ(0, rtcp_sender_->SetSendingStatus(feedback_state, false));
|
||||
rtcp_sender_->SendRtcpXrReceiverReferenceTime(true);
|
||||
@ -669,7 +669,7 @@ TEST_F(RtcpSenderTest, TestRegisterRtcpPacketTypeObserver) {
|
||||
rtcp_sender_.reset(new RTCPSender(false, &clock_, receive_statistics_.get(),
|
||||
&observer, &test_transport_));
|
||||
rtcp_sender_->SetRemoteSSRC(kRemoteSsrc);
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpNonCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize);
|
||||
EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpPli));
|
||||
EXPECT_EQ(1, parser()->pli()->num_packets());
|
||||
EXPECT_EQ(kRemoteSsrc, observer.ssrc_);
|
||||
@ -680,7 +680,7 @@ TEST_F(RtcpSenderTest, TestRegisterRtcpPacketTypeObserver) {
|
||||
|
||||
TEST_F(RtcpSenderTest, SendTmmbr) {
|
||||
const unsigned int kBitrateBps = 312000;
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpNonCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kReducedSize);
|
||||
rtcp_sender_->SetTargetBitrate(kBitrateBps);
|
||||
EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpTmmbr));
|
||||
EXPECT_EQ(1, parser()->tmmbr()->num_packets());
|
||||
@ -692,7 +692,7 @@ TEST_F(RtcpSenderTest, SendTmmbr) {
|
||||
|
||||
TEST_F(RtcpSenderTest, TmmbrIncludedInCompoundPacketIfEnabled) {
|
||||
const unsigned int kBitrateBps = 312000;
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound);
|
||||
EXPECT_FALSE(rtcp_sender_->TMMBR());
|
||||
rtcp_sender_->SetTMMBRStatus(true);
|
||||
EXPECT_TRUE(rtcp_sender_->TMMBR());
|
||||
@ -710,7 +710,7 @@ TEST_F(RtcpSenderTest, TmmbrIncludedInCompoundPacketIfEnabled) {
|
||||
}
|
||||
|
||||
TEST_F(RtcpSenderTest, SendTmmbn) {
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound);
|
||||
TMMBRSet bounding_set;
|
||||
bounding_set.VerifyAndAllocateSet(1);
|
||||
const uint32_t kBitrateKbps = 32768;
|
||||
@ -735,7 +735,7 @@ TEST_F(RtcpSenderTest, SendTmmbn) {
|
||||
// See http://code.google.com/p/webrtc/issues/detail?id=468 for one
|
||||
// situation where this caused confusion.
|
||||
TEST_F(RtcpSenderTest, SendsTmmbnIfSetAndEmpty) {
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound);
|
||||
TMMBRSet bounding_set;
|
||||
EXPECT_EQ(0, rtcp_sender_->SetTMMBN(&bounding_set, 3));
|
||||
EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state(), kRtcpSr));
|
||||
@ -749,7 +749,7 @@ TEST_F(RtcpSenderTest, SendCompoundPliRemb) {
|
||||
const int kBitrate = 261011;
|
||||
std::vector<uint32_t> ssrcs;
|
||||
ssrcs.push_back(kRemoteSsrc);
|
||||
rtcp_sender_->SetRTCPStatus(kRtcpCompound);
|
||||
rtcp_sender_->SetRTCPStatus(RtcpMode::kCompound);
|
||||
rtcp_sender_->SetREMBData(kBitrate, ssrcs);
|
||||
std::set<RTCPPacketType> packet_types;
|
||||
packet_types.insert(kRtcpRemb);
|
||||
|
||||
@ -474,15 +474,15 @@ int32_t ModuleRtpRtcpImpl::SetMaxTransferUnit(const uint16_t mtu) {
|
||||
packet_overhead_);
|
||||
}
|
||||
|
||||
RTCPMethod ModuleRtpRtcpImpl::RTCP() const {
|
||||
if (rtcp_sender_.Status() != kRtcpOff) {
|
||||
RtcpMode ModuleRtpRtcpImpl::RTCP() const {
|
||||
if (rtcp_sender_.Status() != RtcpMode::kOff) {
|
||||
return rtcp_receiver_.Status();
|
||||
}
|
||||
return kRtcpOff;
|
||||
return RtcpMode::kOff;
|
||||
}
|
||||
|
||||
// Configure RTCP status i.e on/off.
|
||||
void ModuleRtpRtcpImpl::SetRTCPStatus(const RTCPMethod method) {
|
||||
void ModuleRtpRtcpImpl::SetRTCPStatus(const RtcpMode method) {
|
||||
rtcp_sender_.SetRTCPStatus(method);
|
||||
rtcp_receiver_.SetRTCPStatus(method);
|
||||
}
|
||||
@ -861,7 +861,7 @@ void ModuleRtpRtcpImpl::SetRemoteSSRC(const uint32_t ssrc) {
|
||||
// Configured via API ignore.
|
||||
return;
|
||||
}
|
||||
if (kRtcpOff != rtcp_sender_.Status()) {
|
||||
if (RtcpMode::kOff != rtcp_sender_.Status()) {
|
||||
// Send RTCP bye on the current SSRC.
|
||||
SendRTCP(kRtcpBye);
|
||||
}
|
||||
|
||||
@ -126,10 +126,10 @@ class ModuleRtpRtcpImpl : public RtpRtcp {
|
||||
// RTCP part.
|
||||
|
||||
// Get RTCP status.
|
||||
RTCPMethod RTCP() const override;
|
||||
RtcpMode RTCP() const override;
|
||||
|
||||
// Configure RTCP status i.e on/off.
|
||||
void SetRTCPStatus(RTCPMethod method) override;
|
||||
void SetRTCPStatus(RtcpMode method) override;
|
||||
|
||||
// Set RTCP CName.
|
||||
int32_t SetCNAME(const char* c_name) override;
|
||||
|
||||
@ -103,7 +103,7 @@ class RtpRtcpModule : public RtcpPacketTypeCounterObserver {
|
||||
config.rtt_stats = &rtt_stats_;
|
||||
|
||||
impl_.reset(new ModuleRtpRtcpImpl(config));
|
||||
impl_->SetRTCPStatus(kRtcpCompound);
|
||||
impl_->SetRTCPStatus(RtcpMode::kCompound);
|
||||
|
||||
transport_.SimulateNetworkDelay(kOneWayNetworkDelayMs, clock);
|
||||
}
|
||||
|
||||
@ -127,8 +127,7 @@ int32_t TestSenderReceiver::InitReceiver (const uint16_t rtpPort,
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (_rtp->SetRTCPStatus(kRtcpNonCompound) != 0)
|
||||
{
|
||||
if (_rtp->SetRTCPStatus(RtcpMode::kReducedSize) != 0) {
|
||||
throw "_rtp->SetRTCPStatus";
|
||||
exit(1);
|
||||
}
|
||||
@ -343,8 +342,7 @@ int32_t TestSenderReceiver::InitSender (const uint32_t startBitrateKbps,
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (_rtp->SetRTCPStatus(kRtcpNonCompound) != 0)
|
||||
{
|
||||
if (_rtp->SetRTCPStatus(RtcpMode::kReducedSize) != 0) {
|
||||
throw "_rtp->SetRTCPStatus";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@ -139,9 +139,9 @@ TEST_F(RtpRtcpAPITest, SSRC) {
|
||||
}
|
||||
|
||||
TEST_F(RtpRtcpAPITest, RTCP) {
|
||||
EXPECT_EQ(kRtcpOff, module_->RTCP());
|
||||
module_->SetRTCPStatus(kRtcpCompound);
|
||||
EXPECT_EQ(kRtcpCompound, module_->RTCP());
|
||||
EXPECT_EQ(RtcpMode::kOff, module_->RTCP());
|
||||
module_->SetRTCPStatus(RtcpMode::kCompound);
|
||||
EXPECT_EQ(RtcpMode::kCompound, module_->RTCP());
|
||||
|
||||
EXPECT_EQ(0, module_->SetCNAME("john.doe@test.test"));
|
||||
|
||||
|
||||
@ -123,8 +123,8 @@ class RtpRtcpRtcpTest : public ::testing::Test {
|
||||
myRTCPFeedback1->SetModule(module1);
|
||||
myRTCPFeedback2->SetModule(module2);
|
||||
|
||||
module1->SetRTCPStatus(kRtcpCompound);
|
||||
module2->SetRTCPStatus(kRtcpCompound);
|
||||
module1->SetRTCPStatus(RtcpMode::kCompound);
|
||||
module2->SetRTCPStatus(RtcpMode::kCompound);
|
||||
|
||||
module2->SetSSRC(test_ssrc + 1);
|
||||
module1->SetSSRC(test_ssrc);
|
||||
|
||||
@ -53,7 +53,7 @@ class RtpRtcpVideoTest : public ::testing::Test {
|
||||
rtp_receiver_.reset(RtpReceiver::CreateVideoReceiver(
|
||||
&fake_clock, receiver_, NULL, &rtp_payload_registry_));
|
||||
|
||||
video_module_->SetRTCPStatus(kRtcpCompound);
|
||||
video_module_->SetRTCPStatus(RtcpMode::kCompound);
|
||||
video_module_->SetSSRC(test_ssrc_);
|
||||
rtp_receiver_->SetNACKStatus(kNackRtcp);
|
||||
video_module_->SetStorePacketsStatus(true, 600);
|
||||
|
||||
@ -74,7 +74,7 @@ class EndToEndTest : public test::CallTest {
|
||||
|
||||
void DecodesRetransmittedFrame(bool use_rtx, bool use_red);
|
||||
void ReceivesPliAndRecovers(int rtp_history_ms);
|
||||
void RespectsRtcpMode(newapi::RtcpMode rtcp_mode);
|
||||
void RespectsRtcpMode(RtcpMode rtcp_mode);
|
||||
void TestXrReceiverReferenceTimeReport(bool enable_rrtr);
|
||||
void TestSendsSetSsrcs(size_t num_ssrcs, bool send_single_ssrc_first);
|
||||
void TestRtpStatePreservation(bool use_rtx);
|
||||
@ -1054,11 +1054,11 @@ TEST_F(EndToEndTest, UnknownRtpPacketGivesUnknownSsrcReturnCode) {
|
||||
receive_transport.StopSending();
|
||||
}
|
||||
|
||||
void EndToEndTest::RespectsRtcpMode(newapi::RtcpMode rtcp_mode) {
|
||||
void EndToEndTest::RespectsRtcpMode(RtcpMode rtcp_mode) {
|
||||
static const int kNumCompoundRtcpPacketsToObserve = 10;
|
||||
class RtcpModeObserver : public test::EndToEndTest {
|
||||
public:
|
||||
explicit RtcpModeObserver(newapi::RtcpMode rtcp_mode)
|
||||
explicit RtcpModeObserver(RtcpMode rtcp_mode)
|
||||
: EndToEndTest(kDefaultTimeoutMs),
|
||||
rtcp_mode_(rtcp_mode),
|
||||
sent_rtp_(0),
|
||||
@ -1089,10 +1089,10 @@ void EndToEndTest::RespectsRtcpMode(newapi::RtcpMode rtcp_mode) {
|
||||
}
|
||||
|
||||
switch (rtcp_mode_) {
|
||||
case newapi::kRtcpCompound:
|
||||
case RtcpMode::kCompound:
|
||||
if (!has_report_block) {
|
||||
ADD_FAILURE() << "Received RTCP packet without receiver report for "
|
||||
"kRtcpCompound.";
|
||||
"RtcpMode::kCompound.";
|
||||
observation_complete_->Set();
|
||||
}
|
||||
|
||||
@ -1100,10 +1100,13 @@ void EndToEndTest::RespectsRtcpMode(newapi::RtcpMode rtcp_mode) {
|
||||
observation_complete_->Set();
|
||||
|
||||
break;
|
||||
case newapi::kRtcpReducedSize:
|
||||
case RtcpMode::kReducedSize:
|
||||
if (!has_report_block)
|
||||
observation_complete_->Set();
|
||||
break;
|
||||
case RtcpMode::kOff:
|
||||
RTC_NOTREACHED();
|
||||
break;
|
||||
}
|
||||
|
||||
return SEND_PACKET;
|
||||
@ -1119,12 +1122,12 @@ void EndToEndTest::RespectsRtcpMode(newapi::RtcpMode rtcp_mode) {
|
||||
|
||||
void PerformTest() override {
|
||||
EXPECT_EQ(kEventSignaled, Wait())
|
||||
<< (rtcp_mode_ == newapi::kRtcpCompound
|
||||
<< (rtcp_mode_ == RtcpMode::kCompound
|
||||
? "Timed out before observing enough compound packets."
|
||||
: "Timed out before receiving a non-compound RTCP packet.");
|
||||
}
|
||||
|
||||
newapi::RtcpMode rtcp_mode_;
|
||||
RtcpMode rtcp_mode_;
|
||||
int sent_rtp_;
|
||||
int sent_rtcp_;
|
||||
} test(rtcp_mode);
|
||||
@ -1133,11 +1136,11 @@ void EndToEndTest::RespectsRtcpMode(newapi::RtcpMode rtcp_mode) {
|
||||
}
|
||||
|
||||
TEST_F(EndToEndTest, UsesRtcpCompoundMode) {
|
||||
RespectsRtcpMode(newapi::kRtcpCompound);
|
||||
RespectsRtcpMode(RtcpMode::kCompound);
|
||||
}
|
||||
|
||||
TEST_F(EndToEndTest, UsesRtcpReducedSizeMode) {
|
||||
RespectsRtcpMode(newapi::kRtcpReducedSize);
|
||||
RespectsRtcpMode(RtcpMode::kReducedSize);
|
||||
}
|
||||
|
||||
// Test sets up a Call multiple senders with different resolutions and SSRCs.
|
||||
@ -2036,7 +2039,7 @@ void EndToEndTest::TestXrReceiverReferenceTimeReport(bool enable_rrtr) {
|
||||
void ModifyConfigs(VideoSendStream::Config* send_config,
|
||||
std::vector<VideoReceiveStream::Config>* receive_configs,
|
||||
VideoEncoderConfig* encoder_config) override {
|
||||
(*receive_configs)[0].rtp.rtcp_mode = newapi::kRtcpReducedSize;
|
||||
(*receive_configs)[0].rtp.rtcp_mode = RtcpMode::kReducedSize;
|
||||
(*receive_configs)[0].rtp.rtcp_xr.receiver_reference_time_report =
|
||||
enable_rrtr_;
|
||||
}
|
||||
@ -3112,7 +3115,7 @@ TEST_F(EndToEndTest, VerifyDefaultSendConfigParameters) {
|
||||
|
||||
TEST_F(EndToEndTest, VerifyDefaultReceiveConfigParameters) {
|
||||
VideoReceiveStream::Config default_receive_config(nullptr);
|
||||
EXPECT_EQ(newapi::kRtcpCompound, default_receive_config.rtp.rtcp_mode)
|
||||
EXPECT_EQ(RtcpMode::kCompound, default_receive_config.rtp.rtcp_mode)
|
||||
<< "Reduced-size RTCP require rtcp-rsize to be negotiated.";
|
||||
EXPECT_FALSE(default_receive_config.rtp.remb)
|
||||
<< "REMB require rtcp-fb: goog-remb to be negotiated.";
|
||||
|
||||
@ -63,9 +63,9 @@ std::string VideoReceiveStream::Config::Rtp::ToString() const {
|
||||
std::stringstream ss;
|
||||
ss << "{remote_ssrc: " << remote_ssrc;
|
||||
ss << ", local_ssrc: " << local_ssrc;
|
||||
ss << ", rtcp_mode: " << (rtcp_mode == newapi::kRtcpCompound
|
||||
? "kRtcpCompound"
|
||||
: "kRtcpReducedSize");
|
||||
ss << ", rtcp_mode: "
|
||||
<< (rtcp_mode == RtcpMode::kCompound ? "RtcpMode::kCompound"
|
||||
: "RtcpMode::kReducedSize");
|
||||
ss << ", rtcp_xr: ";
|
||||
ss << "{receiver_reference_time_report: "
|
||||
<< (rtcp_xr.receiver_reference_time_report ? "on" : "off");
|
||||
@ -148,7 +148,10 @@ VideoReceiveStream::VideoReceiveStream(int num_cpu_cores,
|
||||
vie_channel_->SetProtectionMode(config_.rtp.nack.rtp_history_ms > 0, false,
|
||||
-1, -1);
|
||||
vie_channel_->SetKeyFrameRequestMethod(kKeyFrameReqPliRtcp);
|
||||
SetRtcpMode(config_.rtp.rtcp_mode);
|
||||
RTC_DCHECK(config_.rtp.rtcp_mode != RtcpMode::kOff)
|
||||
<< "A stream should not be configured with RTCP disabled. This value is "
|
||||
"reserved for internal usage.";
|
||||
vie_channel_->SetRTCPMode(config_.rtp.rtcp_mode);
|
||||
|
||||
RTC_DCHECK(config_.rtp.remote_ssrc != 0);
|
||||
// TODO(pbos): What's an appropriate local_ssrc for receive-only streams?
|
||||
@ -325,21 +328,9 @@ int VideoReceiveStream::RenderFrame(const uint32_t /*stream_id*/,
|
||||
}
|
||||
|
||||
void VideoReceiveStream::SignalNetworkState(NetworkState state) {
|
||||
if (state == kNetworkUp)
|
||||
SetRtcpMode(config_.rtp.rtcp_mode);
|
||||
if (state == kNetworkDown)
|
||||
vie_channel_->SetRTCPMode(kRtcpOff);
|
||||
vie_channel_->SetRTCPMode(state == kNetworkUp ? config_.rtp.rtcp_mode
|
||||
: RtcpMode::kOff);
|
||||
}
|
||||
|
||||
void VideoReceiveStream::SetRtcpMode(newapi::RtcpMode mode) {
|
||||
switch (mode) {
|
||||
case newapi::kRtcpCompound:
|
||||
vie_channel_->SetRTCPMode(kRtcpCompound);
|
||||
break;
|
||||
case newapi::kRtcpReducedSize:
|
||||
vie_channel_->SetRTCPMode(kRtcpNonCompound);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} // namespace internal
|
||||
} // namespace webrtc
|
||||
|
||||
@ -68,8 +68,6 @@ class VideoReceiveStream : public webrtc::VideoReceiveStream,
|
||||
void SetSyncChannel(VoiceEngine* voice_engine, int audio_channel_id);
|
||||
|
||||
private:
|
||||
void SetRtcpMode(newapi::RtcpMode mode);
|
||||
|
||||
TransportAdapter transport_adapter_;
|
||||
EncodedFrameCallbackAdapter encoded_frame_proxy_;
|
||||
const VideoReceiveStream::Config config_;
|
||||
|
||||
@ -442,10 +442,10 @@ void VideoSendStream::SignalNetworkState(NetworkState state) {
|
||||
// When it goes down, disable RTCP afterwards. This ensures that any packets
|
||||
// sent due to the network state changed will not be dropped.
|
||||
if (state == kNetworkUp)
|
||||
vie_channel_->SetRTCPMode(kRtcpCompound);
|
||||
vie_channel_->SetRTCPMode(RtcpMode::kCompound);
|
||||
vie_encoder_->SetNetworkTransmissionState(state == kNetworkUp);
|
||||
if (state == kNetworkDown)
|
||||
vie_channel_->SetRTCPMode(kRtcpOff);
|
||||
vie_channel_->SetRTCPMode(RtcpMode::kOff);
|
||||
}
|
||||
|
||||
int64_t VideoSendStream::GetRtt() const {
|
||||
|
||||
@ -332,7 +332,7 @@ TEST_F(VideoSendStreamTest, SupportsFec) {
|
||||
&lossy_receive_stats, nullptr,
|
||||
&transport_adapter_);
|
||||
|
||||
rtcp_sender.SetRTCPStatus(kRtcpNonCompound);
|
||||
rtcp_sender.SetRTCPStatus(RtcpMode::kReducedSize);
|
||||
rtcp_sender.SetRemoteSSRC(kSendSsrcs[0]);
|
||||
|
||||
RTCPSender::FeedbackState feedback_state;
|
||||
@ -413,7 +413,7 @@ void VideoSendStreamTest::TestNackRetransmission(
|
||||
RTCPSender rtcp_sender(false, Clock::GetRealTimeClock(), &null_stats,
|
||||
nullptr, &transport_adapter_);
|
||||
|
||||
rtcp_sender.SetRTCPStatus(kRtcpNonCompound);
|
||||
rtcp_sender.SetRTCPStatus(RtcpMode::kReducedSize);
|
||||
rtcp_sender.SetRemoteSSRC(kSendSsrcs[0]);
|
||||
|
||||
RTCPSender::FeedbackState feedback_state;
|
||||
@ -600,7 +600,7 @@ void VideoSendStreamTest::TestPacketFragmentationSize(VideoFormat format,
|
||||
&lossy_receive_stats, nullptr,
|
||||
&transport_adapter_);
|
||||
|
||||
rtcp_sender.SetRTCPStatus(kRtcpNonCompound);
|
||||
rtcp_sender.SetRTCPStatus(RtcpMode::kReducedSize);
|
||||
rtcp_sender.SetRemoteSSRC(kSendSsrcs[0]);
|
||||
|
||||
RTCPSender::FeedbackState feedback_state;
|
||||
@ -830,7 +830,7 @@ TEST_F(VideoSendStreamTest, SuspendBelowMinBitrate) {
|
||||
RTCPSender rtcp_sender(false, clock_, &receive_stats, nullptr,
|
||||
&transport_adapter_);
|
||||
|
||||
rtcp_sender.SetRTCPStatus(kRtcpNonCompound);
|
||||
rtcp_sender.SetRTCPStatus(RtcpMode::kReducedSize);
|
||||
rtcp_sender.SetRemoteSSRC(kSendSsrcs[0]);
|
||||
if (remb_value > 0) {
|
||||
rtcp_sender.SetREMBStatus(true);
|
||||
@ -889,7 +889,7 @@ TEST_F(VideoSendStreamTest, NoPaddingWhenVideoIsMuted) {
|
||||
RTCPSender rtcp_sender(false, Clock::GetRealTimeClock(), &receive_stats,
|
||||
nullptr, &transport_adapter_);
|
||||
|
||||
rtcp_sender.SetRTCPStatus(kRtcpNonCompound);
|
||||
rtcp_sender.SetRTCPStatus(RtcpMode::kReducedSize);
|
||||
rtcp_sender.SetRemoteSSRC(kSendSsrcs[0]);
|
||||
|
||||
RTCPSender::FeedbackState feedback_state;
|
||||
@ -950,7 +950,7 @@ TEST_F(VideoSendStreamTest, MinTransmitBitrateRespectsRemb) {
|
||||
config.outgoing_transport = &feedback_transport_;
|
||||
rtp_rtcp_.reset(RtpRtcp::CreateRtpRtcp(config));
|
||||
rtp_rtcp_->SetREMBStatus(true);
|
||||
rtp_rtcp_->SetRTCPStatus(kRtcpNonCompound);
|
||||
rtp_rtcp_->SetRTCPStatus(RtcpMode::kReducedSize);
|
||||
}
|
||||
|
||||
void OnStreamsCreated(
|
||||
|
||||
@ -472,7 +472,7 @@ int ViEChannel::ReceiveDelay() const {
|
||||
return vcm_->Delay();
|
||||
}
|
||||
|
||||
void ViEChannel::SetRTCPMode(const RTCPMethod rtcp_mode) {
|
||||
void ViEChannel::SetRTCPMode(const RtcpMode rtcp_mode) {
|
||||
for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_)
|
||||
rtp_rtcp->SetRTCPStatus(rtcp_mode);
|
||||
}
|
||||
@ -518,7 +518,7 @@ void ViEChannel::SetProtectionMode(bool enable_nack,
|
||||
void ViEChannel::ProcessNACKRequest(const bool enable) {
|
||||
if (enable) {
|
||||
// Turn on NACK.
|
||||
if (rtp_rtcp_modules_[0]->RTCP() == kRtcpOff)
|
||||
if (rtp_rtcp_modules_[0]->RTCP() == RtcpMode::kOff)
|
||||
return;
|
||||
vie_receiver_.SetNackStatus(true, max_nack_reordering_threshold_);
|
||||
|
||||
@ -1169,7 +1169,7 @@ std::vector<RtpRtcp*> ViEChannel::CreateRtpRtcpModules(
|
||||
RtpRtcp* rtp_rtcp = RtpRtcp::CreateRtpRtcp(configuration);
|
||||
rtp_rtcp->SetSendingStatus(false);
|
||||
rtp_rtcp->SetSendingMediaStatus(false);
|
||||
rtp_rtcp->SetRTCPStatus(kRtcpCompound);
|
||||
rtp_rtcp->SetRTCPStatus(RtcpMode::kCompound);
|
||||
modules.push_back(rtp_rtcp);
|
||||
// Receive statistics and remote bitrate estimator should only be set for
|
||||
// the primary (first) module.
|
||||
|
||||
@ -101,7 +101,7 @@ class ViEChannel : public VCMFrameTypeCallback,
|
||||
// Returns the estimated delay in milliseconds.
|
||||
int ReceiveDelay() const;
|
||||
|
||||
void SetRTCPMode(const RTCPMethod rtcp_mode);
|
||||
void SetRTCPMode(const RtcpMode rtcp_mode);
|
||||
void SetProtectionMode(bool enable_nack,
|
||||
bool enable_fec,
|
||||
int payload_type_red,
|
||||
|
||||
@ -24,12 +24,6 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
namespace newapi {
|
||||
// RTCP mode to use. Compound mode is described by RFC 4585 and reduced-size
|
||||
// RTCP mode is described by RFC 5506.
|
||||
enum RtcpMode { kRtcpCompound, kRtcpReducedSize };
|
||||
} // namespace newapi
|
||||
|
||||
class VideoDecoder;
|
||||
|
||||
class VideoReceiveStream : public ReceiveStream {
|
||||
@ -107,7 +101,7 @@ class VideoReceiveStream : public ReceiveStream {
|
||||
uint32_t local_ssrc = 0;
|
||||
|
||||
// See RtcpMode for description.
|
||||
newapi::RtcpMode rtcp_mode = newapi::kRtcpCompound;
|
||||
RtcpMode rtcp_mode = RtcpMode::kCompound;
|
||||
|
||||
// Extended RTCP settings.
|
||||
struct RtcpXr {
|
||||
|
||||
@ -921,7 +921,7 @@ Channel::Init()
|
||||
// be transmitted since the Transport object will then be invalid.
|
||||
telephone_event_handler_->SetTelephoneEventForwardToDecoder(true);
|
||||
// RTCP is enabled by default.
|
||||
_rtpRtcpModule->SetRTCPStatus(kRtcpCompound);
|
||||
_rtpRtcpModule->SetRTCPStatus(RtcpMode::kCompound);
|
||||
// --- Register all permanent callbacks
|
||||
const bool fail =
|
||||
(audio_coding_->RegisterTransportCallback(this) == -1) ||
|
||||
@ -2783,14 +2783,14 @@ int Channel::SetReceiveAbsoluteSenderTimeStatus(bool enable, unsigned char id) {
|
||||
void Channel::SetRTCPStatus(bool enable) {
|
||||
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId),
|
||||
"Channel::SetRTCPStatus()");
|
||||
_rtpRtcpModule->SetRTCPStatus(enable ? kRtcpCompound : kRtcpOff);
|
||||
_rtpRtcpModule->SetRTCPStatus(enable ? RtcpMode::kCompound : RtcpMode::kOff);
|
||||
}
|
||||
|
||||
int
|
||||
Channel::GetRTCPStatus(bool& enabled)
|
||||
{
|
||||
RTCPMethod method = _rtpRtcpModule->RTCP();
|
||||
enabled = (method != kRtcpOff);
|
||||
RtcpMode method = _rtpRtcpModule->RTCP();
|
||||
enabled = (method != RtcpMode::kOff);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2936,9 +2936,8 @@ Channel::SendApplicationDefinedRTCPPacket(unsigned char subType,
|
||||
"SendApplicationDefinedRTCPPacket() invalid length value");
|
||||
return -1;
|
||||
}
|
||||
RTCPMethod status = _rtpRtcpModule->RTCP();
|
||||
if (status == kRtcpOff)
|
||||
{
|
||||
RtcpMode status = _rtpRtcpModule->RTCP();
|
||||
if (status == RtcpMode::kOff) {
|
||||
_engineStatisticsPtr->SetLastError(
|
||||
VE_RTCP_ERROR, kTraceError,
|
||||
"SendApplicationDefinedRTCPPacket() RTCP is disabled");
|
||||
@ -2968,7 +2967,7 @@ Channel::GetRTPStatistics(
|
||||
{
|
||||
// The jitter statistics is updated for each received RTP packet and is
|
||||
// based on received packets.
|
||||
if (_rtpRtcpModule->RTCP() == kRtcpOff) {
|
||||
if (_rtpRtcpModule->RTCP() == RtcpMode::kOff) {
|
||||
// If RTCP is off, there is no timed thread in the RTCP module regularly
|
||||
// generating new stats, trigger the update manually here instead.
|
||||
StreamStatistician* statistician =
|
||||
@ -3039,8 +3038,9 @@ Channel::GetRTPStatistics(CallStatistics& stats)
|
||||
RtcpStatistics statistics;
|
||||
StreamStatistician* statistician =
|
||||
rtp_receive_statistics_->GetStatistician(rtp_receiver_->SSRC());
|
||||
if (!statistician || !statistician->GetStatistics(
|
||||
&statistics, _rtpRtcpModule->RTCP() == kRtcpOff)) {
|
||||
if (!statistician ||
|
||||
!statistician->GetStatistics(
|
||||
&statistics, _rtpRtcpModule->RTCP() == RtcpMode::kOff)) {
|
||||
_engineStatisticsPtr->SetLastError(
|
||||
VE_CANNOT_RETRIEVE_RTP_STAT, kTraceWarning,
|
||||
"GetRTPStatistics() failed to read RTP statistics from the "
|
||||
@ -3911,8 +3911,8 @@ int32_t Channel::GetPlayoutFrequency() {
|
||||
}
|
||||
|
||||
int64_t Channel::GetRTT(bool allow_associate_channel) const {
|
||||
RTCPMethod method = _rtpRtcpModule->RTCP();
|
||||
if (method == kRtcpOff) {
|
||||
RtcpMode method = _rtpRtcpModule->RTCP();
|
||||
if (method == RtcpMode::kOff) {
|
||||
return 0;
|
||||
}
|
||||
std::vector<RTCPReportBlock> report_blocks;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user