Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Unified Diff: webrtc/modules/pacing/packet_router.cc

Issue 2655033002: Prioritize video packets when sending padding or preemptive retransmits. (Closed)
Patch Set: . Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/pacing/packet_router_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/pacing/packet_router.cc
diff --git a/webrtc/modules/pacing/packet_router.cc b/webrtc/modules/pacing/packet_router.cc
index af1d5595be9193f491058ab3b179a9161cfd5bec..65d6db7cb704015cb6dac0fa2e6f309fe93f8440 100644
--- a/webrtc/modules/pacing/packet_router.cc
+++ b/webrtc/modules/pacing/packet_router.cc
@@ -30,7 +30,13 @@ void PacketRouter::AddRtpModule(RtpRtcp* rtp_module) {
rtc::CritScope cs(&modules_crit_);
RTC_DCHECK(std::find(rtp_modules_.begin(), rtp_modules_.end(), rtp_module) ==
rtp_modules_.end());
- rtp_modules_.push_back(rtp_module);
+ // Put modules which can use regular payload packets (over rtx) instead of
+ // padding first as it's less of a waste
+ if ((rtp_module->RtxSendStatus() & kRtxRedundantPayloads) > 0) {
+ rtp_modules_.push_front(rtp_module);
+ } else {
+ rtp_modules_.push_back(rtp_module);
+ }
}
void PacketRouter::RemoveRtpModule(RtpRtcp* rtp_module) {
@@ -64,6 +70,7 @@ size_t PacketRouter::TimeToSendPadding(size_t bytes_to_send,
RTC_DCHECK(pacer_thread_checker_.CalledOnValidThread());
size_t total_bytes_sent = 0;
rtc::CritScope cs(&modules_crit_);
+ // Rtp modules are ordered by which stream can most benefit from padding.
for (RtpRtcp* module : rtp_modules_) {
if (module->SendingMedia()) {
size_t bytes_sent = module->TimeToSendPadding(
« no previous file with comments | « no previous file | webrtc/modules/pacing/packet_router_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698