Add API for transmission smotthening.
BUG=818 TEST=Only API tests added now. Review URL: https://webrtc-codereview.appspot.com/787009 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2756 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
633a6fa815
commit
5a7507f26a
@ -219,6 +219,14 @@ class WEBRTC_DLLEXPORT ViERTP_RTCP {
|
||||
bool enable,
|
||||
int id) = 0;
|
||||
|
||||
// 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.
|
||||
// NOTE: This is still experimental functionality.
|
||||
// TODO(mflodman) Remove this note when BUG=818 is closed.
|
||||
virtual int SetTransmissionSmoothingStatus(int video_channel,
|
||||
bool enable) = 0;
|
||||
|
||||
// This function returns our locally created statistics of the received RTP
|
||||
// stream.
|
||||
virtual int GetReceivedRTCPStatistics(
|
||||
|
||||
@ -648,7 +648,18 @@ void ViEAutoTest::ViERtpRtcpAPITest()
|
||||
EXPECT_EQ(0, ViE.rtp_rtcp->SetReceiveTimestampOffsetStatus(
|
||||
tbChannel.videoChannel, false, 3));
|
||||
|
||||
|
||||
// Transmission smoothening.
|
||||
const int invalid_channel_id = 17;
|
||||
EXPECT_EQ(-1, ViE.rtp_rtcp->SetTransmissionSmoothingStatus(
|
||||
invalid_channel_id, true));
|
||||
EXPECT_EQ(0, ViE.rtp_rtcp->SetTransmissionSmoothingStatus(
|
||||
tbChannel.videoChannel, true));
|
||||
EXPECT_EQ(0, ViE.rtp_rtcp->SetTransmissionSmoothingStatus(
|
||||
tbChannel.videoChannel, true));
|
||||
EXPECT_EQ(0, ViE.rtp_rtcp->SetTransmissionSmoothingStatus(
|
||||
tbChannel.videoChannel, false));
|
||||
EXPECT_EQ(0, ViE.rtp_rtcp->SetTransmissionSmoothingStatus(
|
||||
tbChannel.videoChannel, false));
|
||||
|
||||
//***************************************************************
|
||||
// Testing finished. Tear down Video Engine
|
||||
|
||||
@ -230,6 +230,7 @@ WebRtc_Word32 ViEChannel::SetSendCodec(const VideoCodec& video_codec,
|
||||
rtp_rtcp_->SetSendingStatus(false);
|
||||
}
|
||||
NACKMethod nack_method = rtp_rtcp_->NACK();
|
||||
bool transmission_smoothening = rtp_rtcp_->TransmissionSmoothingStatus();
|
||||
|
||||
CriticalSectionScoped cs(rtp_rtcp_cs_.get());
|
||||
|
||||
@ -290,6 +291,7 @@ WebRtc_Word32 ViEChannel::SetSendCodec(const VideoCodec& video_codec,
|
||||
if (mtu_ != 0) {
|
||||
rtp_rtcp->SetMaxTransferUnit(mtu_);
|
||||
}
|
||||
rtp_rtcp->SetTransmissionSmoothingStatus(transmission_smoothening);
|
||||
if (restart_rtp) {
|
||||
rtp_rtcp->SetSendingStatus(true);
|
||||
}
|
||||
@ -685,6 +687,7 @@ bool ViEChannel::EnableRemb(bool enable) {
|
||||
}
|
||||
|
||||
int ViEChannel::SetSendTimestampOffsetStatus(bool enable, int id) {
|
||||
CriticalSectionScoped cs(rtp_rtcp_cs_.get());
|
||||
int error = 0;
|
||||
if (enable) {
|
||||
// Enable the extension, but disable possible old id to avoid errors.
|
||||
@ -724,6 +727,15 @@ int ViEChannel::SetReceiveTimestampOffsetStatus(bool enable, int id) {
|
||||
}
|
||||
}
|
||||
|
||||
void ViEChannel::SetTransmissionSmoothingStatus(bool enable) {
|
||||
CriticalSectionScoped cs(rtp_rtcp_cs_.get());
|
||||
rtp_rtcp_->SetTransmissionSmoothingStatus(enable);
|
||||
for (std::list<RtpRtcp*>::iterator it = simulcast_rtp_rtcp_.begin();
|
||||
it != simulcast_rtp_rtcp_.end(); ++it) {
|
||||
(*it)->SetTransmissionSmoothingStatus(enable);
|
||||
}
|
||||
}
|
||||
|
||||
WebRtc_Word32 ViEChannel::EnableTMMBR(const bool enable) {
|
||||
WEBRTC_TRACE(kTraceInfo, kTraceVideo, ViEId(engine_id_, channel_id_),
|
||||
"%s: %d", __FUNCTION__, enable);
|
||||
|
||||
@ -109,6 +109,7 @@ class ViEChannel
|
||||
bool EnableRemb(bool enable);
|
||||
int SetSendTimestampOffsetStatus(bool enable, int id);
|
||||
int SetReceiveTimestampOffsetStatus(bool enable, int id);
|
||||
void SetTransmissionSmoothingStatus(bool enable);
|
||||
WebRtc_Word32 EnableTMMBR(const bool enable);
|
||||
WebRtc_Word32 EnableKeyFrameRequestCallback(const bool enable);
|
||||
|
||||
|
||||
@ -660,6 +660,25 @@ int ViERTP_RTCPImpl::SetReceiveTimestampOffsetStatus(int video_channel,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ViERTP_RTCPImpl::SetTransmissionSmoothingStatus(int video_channel,
|
||||
bool enable) {
|
||||
WEBRTC_TRACE(kTraceApiCall, kTraceVideo,
|
||||
ViEId(shared_data_->instance_id(), video_channel),
|
||||
"%s(channel: %d, enble: %d)", __FUNCTION__, 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->SetTransmissionSmoothingStatus(enable);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ViERTP_RTCPImpl::GetReceivedRTCPStatistics(const int video_channel,
|
||||
uint16_t& fraction_lost,
|
||||
unsigned int& cumulative_lost,
|
||||
|
||||
@ -74,6 +74,7 @@ class ViERTP_RTCPImpl
|
||||
virtual int SetReceiveTimestampOffsetStatus(int video_channel,
|
||||
bool enable,
|
||||
int id);
|
||||
virtual int SetTransmissionSmoothingStatus(int video_channel, bool enable);
|
||||
virtual int GetReceivedRTCPStatistics(const int video_channel,
|
||||
uint16_t& fraction_lost,
|
||||
unsigned int& cumulative_lost,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user