Add unlimited retransmission experiment for screenshare
Bug: webrtc:9659 Change-Id: Idcdc647c112ed2c7c027a7a0056b145ce8f45788 Reviewed-on: https://webrtc-review.googlesource.com/95724 Reviewed-by: Åsa Persson <asapersson@webrtc.org> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24422}
This commit is contained in:

committed by
Commit Bot

parent
cd634ce933
commit
523b4c4330
@ -203,6 +203,7 @@ rtc_static_library("rtp_rtcp") {
|
||||
"../../api/audio_codecs:audio_codecs_api",
|
||||
"../../api/video:video_bitrate_allocation",
|
||||
"../../api/video:video_bitrate_allocator",
|
||||
"../../api/video:video_frame",
|
||||
"../../api/video_codecs:video_codecs_api",
|
||||
"../../common_video",
|
||||
"../../logging:rtc_event_audio",
|
||||
|
@ -160,7 +160,9 @@ RTPSender::RTPSender(
|
||||
overhead_observer_(overhead_observer),
|
||||
populate_network2_timestamp_(populate_network2_timestamp),
|
||||
send_side_bwe_with_overhead_(
|
||||
webrtc::field_trial::IsEnabled("WebRTC-SendSideBwe-WithOverhead")) {
|
||||
webrtc::field_trial::IsEnabled("WebRTC-SendSideBwe-WithOverhead")),
|
||||
unlimited_retransmission_experiment_(
|
||||
field_trial::IsEnabled("WebRTC-UnlimitedScreenshareRetransmission")) {
|
||||
// This random initialization is not intended to be cryptographic strong.
|
||||
timestamp_offset_ = random_.Rand<uint32_t>();
|
||||
// Random start, 16 bits. Can't be 0.
|
||||
@ -412,6 +414,11 @@ bool RTPSender::SendOutgoingData(FrameType frame_type,
|
||||
*transport_frame_id_out = rtp_timestamp;
|
||||
if (!sending_media_)
|
||||
return true;
|
||||
|
||||
// Cache video content type.
|
||||
if (!audio_configured_ && rtp_header) {
|
||||
video_content_type_ = rtp_header->content_type;
|
||||
}
|
||||
}
|
||||
VideoCodecType video_type = kVideoCodecGeneric;
|
||||
if (CheckPayloadType(payload_type, &video_type) != 0) {
|
||||
@ -643,10 +650,21 @@ int32_t RTPSender::ReSendPacket(uint16_t packet_id) {
|
||||
|
||||
const int32_t packet_size = static_cast<int32_t>(stored_packet->payload_size);
|
||||
|
||||
// Skip retransmission rate check if sending screenshare and the experiment
|
||||
// is on.
|
||||
bool skip_retransmission_rate_limit;
|
||||
{
|
||||
rtc::CritScope lock(&send_critsect_);
|
||||
skip_retransmission_rate_limit =
|
||||
unlimited_retransmission_experiment_ && video_content_type_ &&
|
||||
videocontenttypehelpers::IsScreenshare(*video_content_type_);
|
||||
}
|
||||
|
||||
RTC_DCHECK(retransmission_rate_limiter_);
|
||||
// Check if we're overusing retransmission bitrate.
|
||||
// TODO(sprang): Add histograms for nack success or failure reasons.
|
||||
if (!retransmission_rate_limiter_->TryUseRate(packet_size)) {
|
||||
if (!skip_retransmission_rate_limit &&
|
||||
!retransmission_rate_limiter_->TryUseRate(packet_size)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "absl/types/optional.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/call/transport.h"
|
||||
#include "api/video/video_content_type.h"
|
||||
#include "common_types.h" // NOLINT(build/include)
|
||||
#include "modules/rtp_rtcp/include/flexfec_sender.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_header_extension_map.h"
|
||||
@ -338,6 +339,11 @@ class RTPSender {
|
||||
|
||||
const bool send_side_bwe_with_overhead_;
|
||||
|
||||
const bool unlimited_retransmission_experiment_;
|
||||
|
||||
absl::optional<VideoContentType> video_content_type_
|
||||
RTC_GUARDED_BY(send_critsect_);
|
||||
|
||||
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSender);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user