Added API for enabling/disabling RTCP Receiver Reference Time extension.
R=mflodman@webrtc.org Review URL: https://webrtc-codereview.appspot.com/3419005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5147 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
54a05518e2
commit
8d02f5dc71
@ -510,6 +510,8 @@ class RtpRtcp : public Module {
|
||||
*/
|
||||
virtual void SetRtcpXrRrtrStatus(bool enable) = 0;
|
||||
|
||||
virtual bool RtcpXrRrtrStatus() const = 0;
|
||||
|
||||
/*
|
||||
* (REMB) Receiver Estimated Max Bitrate
|
||||
*/
|
||||
|
@ -170,6 +170,8 @@ class MockRtpRtcp : public RtpRtcp {
|
||||
int32_t(const RTCPVoIPMetric* VoIPMetric));
|
||||
MOCK_METHOD1(SetRtcpXrRrtrStatus,
|
||||
void(bool enable));
|
||||
MOCK_CONST_METHOD0(RtcpXrRrtrStatus,
|
||||
bool());
|
||||
MOCK_CONST_METHOD0(REMB,
|
||||
bool());
|
||||
MOCK_METHOD1(SetREMBStatus,
|
||||
|
@ -2182,6 +2182,11 @@ void RTCPSender::SendRtcpXrReceiverReferenceTime(bool enable) {
|
||||
xrSendReceiverReferenceTimeEnabled_ = enable;
|
||||
}
|
||||
|
||||
bool RTCPSender::RtcpXrReceiverReferenceTime() const {
|
||||
CriticalSectionScoped lock(_criticalSectionRTCPSender);
|
||||
return xrSendReceiverReferenceTimeEnabled_;
|
||||
}
|
||||
|
||||
// called under critsect _criticalSectionRTCPSender
|
||||
int32_t RTCPSender::WriteAllReportBlocksToBuffer(
|
||||
uint8_t* rtcpbuffer,
|
||||
|
@ -171,6 +171,8 @@ public:
|
||||
|
||||
void SendRtcpXrReceiverReferenceTime(bool enable);
|
||||
|
||||
bool RtcpXrReceiverReferenceTime() const;
|
||||
|
||||
int32_t SetCSRCs(const uint32_t arrOfCSRC[kRtpCsrcSize],
|
||||
const uint8_t arrLength);
|
||||
|
||||
|
@ -963,6 +963,10 @@ void ModuleRtpRtcpImpl::SetRtcpXrRrtrStatus(bool enable) {
|
||||
return rtcp_sender_.SendRtcpXrReceiverReferenceTime(enable);
|
||||
}
|
||||
|
||||
bool ModuleRtpRtcpImpl::RtcpXrRrtrStatus() const {
|
||||
return rtcp_sender_.RtcpXrReceiverReferenceTime();
|
||||
}
|
||||
|
||||
int32_t ModuleRtpRtcpImpl::DataCountersRTP(
|
||||
uint32_t* bytes_sent,
|
||||
uint32_t* packets_sent) const {
|
||||
|
@ -259,6 +259,8 @@ class ModuleRtpRtcpImpl : public RtpRtcp {
|
||||
// (XR) Receiver reference time report.
|
||||
virtual void SetRtcpXrRrtrStatus(bool enable) OVERRIDE;
|
||||
|
||||
virtual bool RtcpXrRrtrStatus() const OVERRIDE;
|
||||
|
||||
// Audio part.
|
||||
|
||||
// Set audio packet size, used to determine when it's time to send a DTMF
|
||||
|
@ -124,6 +124,12 @@ TEST_F(RtpRtcpImplTest, Rtt) {
|
||||
rtp_rtcp_impl_->RTT(kSsrc + 1, &rtt, &avg_rtt, &min_rtt, &max_rtt));
|
||||
}
|
||||
|
||||
TEST_F(RtpRtcpImplTest, SetRtcpXrRrtrStatus) {
|
||||
EXPECT_FALSE(rtp_rtcp_impl_->RtcpXrRrtrStatus());
|
||||
rtp_rtcp_impl_->SetRtcpXrRrtrStatus(true);
|
||||
EXPECT_TRUE(rtp_rtcp_impl_->RtcpXrRrtrStatus());
|
||||
}
|
||||
|
||||
TEST_F(RtpRtcpImplTest, RttForReceiverOnly) {
|
||||
rtp_rtcp_impl_->SetRtcpXrRrtrStatus(true);
|
||||
EXPECT_EQ(0, rtp_rtcp_impl_->SetSendingStatus(false));
|
||||
|
@ -254,6 +254,11 @@ class WEBRTC_DLLEXPORT ViERTP_RTCP {
|
||||
bool enable,
|
||||
int id) = 0;
|
||||
|
||||
// Enables/disables RTCP Receiver Reference Time Report Block extension/
|
||||
// DLRR Report Block extension (RFC 3611).
|
||||
// TODO(asapersson): Remove default implementation.
|
||||
virtual int SetRtcpXrRrtrStatus(int video_channel, bool enable) { return -1; }
|
||||
|
||||
// Enables transmission smoothening, i.e. packets belonging to the same frame
|
||||
// will be sent over a longer period of time instead of sending them
|
||||
// back-to-back.
|
||||
|
@ -406,6 +406,7 @@ int32_t ViEChannel::SetSendCodec(const VideoCodec& video_codec,
|
||||
rtp_rtcp->DeregisterSendRtpHeaderExtension(
|
||||
kRtpExtensionAbsoluteSendTime);
|
||||
}
|
||||
rtp_rtcp->SetRtcpXrRrtrStatus(rtp_rtcp_->RtcpXrRrtrStatus());
|
||||
}
|
||||
// |RegisterSimulcastRtpRtcpModules| resets all old weak pointers and old
|
||||
// modules can be deleted after this step.
|
||||
@ -922,6 +923,15 @@ bool ViEChannel::GetReceiveAbsoluteSendTimeStatus() const {
|
||||
return receive_absolute_send_time_enabled_;
|
||||
}
|
||||
|
||||
void ViEChannel::SetRtcpXrRrtrStatus(bool enable) {
|
||||
CriticalSectionScoped cs(rtp_rtcp_cs_.get());
|
||||
rtp_rtcp_->SetRtcpXrRrtrStatus(enable);
|
||||
for (std::list<RtpRtcp*>::iterator it = simulcast_rtp_rtcp_.begin();
|
||||
it != simulcast_rtp_rtcp_.end(); it++) {
|
||||
(*it)->SetRtcpXrRrtrStatus(enable);
|
||||
}
|
||||
}
|
||||
|
||||
void ViEChannel::SetTransmissionSmoothingStatus(bool enable) {
|
||||
assert(paced_sender_ && "No paced sender registered.");
|
||||
paced_sender_->SetStatus(enable);
|
||||
|
@ -125,6 +125,7 @@ class ViEChannel
|
||||
int SetSendAbsoluteSendTimeStatus(bool enable, int id);
|
||||
int SetReceiveAbsoluteSendTimeStatus(bool enable, int id);
|
||||
bool GetReceiveAbsoluteSendTimeStatus() const;
|
||||
void SetRtcpXrRrtrStatus(bool enable);
|
||||
void SetTransmissionSmoothingStatus(bool enable);
|
||||
int32_t EnableTMMBR(const bool enable);
|
||||
int32_t EnableKeyFrameRequestCallback(const bool enable);
|
||||
|
@ -804,6 +804,25 @@ int ViERTP_RTCPImpl::SetReceiveAbsoluteSendTimeStatus(int video_channel,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ViERTP_RTCPImpl::SetRtcpXrRrtrStatus(int video_channel, bool enable) {
|
||||
WEBRTC_TRACE(kTraceApiCall, kTraceVideo,
|
||||
ViEId(shared_data_->instance_id(), video_channel),
|
||||
"ViERTP_RTCPImpl::SetRtcpXrRrtrStatus(%d, %d)",
|
||||
video_channel, enable);
|
||||
|
||||
ViEChannelManagerScoped cs(*(shared_data_->channel_manager()));
|
||||
ViEChannel* vie_channel = cs.Channel(video_channel);
|
||||
if (!vie_channel) {
|
||||
WEBRTC_TRACE(kTraceError, kTraceVideo,
|
||||
ViEId(shared_data_->instance_id(), video_channel),
|
||||
"%s: Channel %d doesn't exist", __FUNCTION__, video_channel);
|
||||
shared_data_->SetLastError(kViERtpRtcpInvalidChannelId);
|
||||
return -1;
|
||||
}
|
||||
vie_channel->SetRtcpXrRrtrStatus(enable);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ViERTP_RTCPImpl::SetTransmissionSmoothingStatus(int video_channel,
|
||||
bool enable) {
|
||||
WEBRTC_TRACE(kTraceApiCall, kTraceVideo,
|
||||
|
@ -88,6 +88,7 @@ class ViERTP_RTCPImpl
|
||||
virtual int SetReceiveAbsoluteSendTimeStatus(int video_channel,
|
||||
bool enable,
|
||||
int id);
|
||||
virtual int SetRtcpXrRrtrStatus(int video_channel, bool enable);
|
||||
virtual int SetTransmissionSmoothingStatus(int video_channel, bool enable);
|
||||
virtual int GetReceiveChannelRtcpStatistics(const int video_channel,
|
||||
RtcpStatistics& basic_stats,
|
||||
|
Loading…
x
Reference in New Issue
Block a user