+36
-6
lines changedFilter options
+36
-6
lines changed Original file line number Diff line number Diff line change
@@ -438,7 +438,8 @@ std::string TransmissionEventStr(ETransmissionEvent ev)
438
438
"checktimer",
439
439
"send",
440
440
"receive",
441
-
"custom"
441
+
"custom",
442
+
"sync"
442
443
};
443
444
444
445
size_t vals_size = Size(vals);
Original file line number Diff line number Diff line change
@@ -290,6 +290,7 @@ enum ETransmissionEvent
290
290
TEV_SEND, // --> When the packet is scheduled for sending - older CCC::onPktSent
291
291
TEV_RECEIVE, // --> When a data packet was received - older CCC::onPktReceived
292
292
TEV_CUSTOM, // --> probably dead call - older CCC::processCustomMsg
293
+
TEV_SYNC, // --> Backup group. When rate estimation is derived from an active member, and update is needed.
293
294
294
295
TEV_E_SIZE
295
296
};
Original file line number Diff line number Diff line change
@@ -7551,7 +7551,7 @@ bool srt::CUDT::updateCC(ETransmissionEvent evt, const EventVariant arg)
7551
7551
7552
7552
// This part is also required only by LiveCC, however not
7553
7553
// moved there due to that it needs access to CSndBuffer.
7554
-
if (evt == TEV_ACK || evt == TEV_LOSSREPORT || evt == TEV_CHECKTIMER)
7554
+
if (evt == TEV_ACK || evt == TEV_LOSSREPORT || evt == TEV_CHECKTIMER || evt == TEV_SYNC)
7555
7555
{
7556
7556
// Specific part done when MaxBW is set to 0 (auto) and InputBW is 0.
7557
7557
// This requests internal input rate sampling.
Original file line number Diff line number Diff line change
@@ -728,6 +728,22 @@ class CUDT
728
728
static loss_seqs_t defaultPacketArrival(void* vself, CPacket& pkt);
729
729
static loss_seqs_t groupPacketArrival(void* vself, CPacket& pkt);
730
730
731
+
CRateEstimator getRateEstimator() const
732
+
{
733
+
if (!m_pSndBuffer)
734
+
return CRateEstimator();
735
+
return m_pSndBuffer->getRateEstimator();
736
+
}
737
+
738
+
void setRateEstimator(const CRateEstimator& rate)
739
+
{
740
+
if (!m_pSndBuffer)
741
+
return;
742
+
743
+
m_pSndBuffer->setRateEstimator(rate);
744
+
updateCC(TEV_SYNC, EventVariant(0));
745
+
}
746
+
731
747
732
748
private: // Identification
733
749
CUDTSocket* const m_parent; // Temporary, until the CUDTSocket class is merged with CUDT
Original file line number Diff line number Diff line change
@@ -3525,8 +3525,8 @@ size_t CUDTGroup::sendBackup_TryActivateStandbyIfNeeded(
3525
3525
return 0;
3526
3526
}
3527
3527
3528
-
const unsigned num_stable = w_sendBackupCtx.countMembersByState(BKUPST_ACTIVE_FRESH);
3529
-
const unsigned num_fresh = w_sendBackupCtx.countMembersByState(BKUPST_ACTIVE_STABLE);
3528
+
const unsigned num_stable = w_sendBackupCtx.countMembersByState(BKUPST_ACTIVE_STABLE);
3529
+
const unsigned num_fresh = w_sendBackupCtx.countMembersByState(BKUPST_ACTIVE_FRESH);
3530
3530
3531
3531
if (num_stable + num_fresh == 0)
3532
3532
{
@@ -3571,6 +3571,10 @@ size_t CUDTGroup::sendBackup_TryActivateStandbyIfNeeded(
3571
3571
3572
3572
try
3573
3573
{
3574
+
CUDT& cudt = d->ps->core();
3575
+
// Take source rate estimation from an active member (needed for the input rate estimation mode).
3576
+
cudt.setRateEstimator(w_sendBackupCtx.getRateEstimate());
3577
+
3574
3578
// TODO: At this point all packets that could be sent
3575
3579
// are located in m_SenderBuffer. So maybe just use sendBackupRexmit()?
3576
3580
if (w_curseq == SRT_SEQNO_NONE)
@@ -3582,7 +3586,7 @@ size_t CUDTGroup::sendBackup_TryActivateStandbyIfNeeded(
3582
3586
HLOGC(gslog.Debug,
3583
3587
log << "grp/sendBackup: ... trying @" << d->id << " - sending the VERY FIRST message");
3584
3588
3585
-
stat = d->ps->core().sendmsg2(buf, len, (w_mc));
3589
+
stat = cudt.sendmsg2(buf, len, (w_mc));
3586
3590
if (stat != -1)
3587
3591
{
3588
3592
// This will be no longer used, but let it stay here.
@@ -3599,7 +3603,7 @@ size_t CUDTGroup::sendBackup_TryActivateStandbyIfNeeded(
3599
3603
<< " collected messages...");
3600
3604
// Note: this will set the currently required packet
3601
3605
// because it has been just freshly added to the sender buffer
3602
-
stat = sendBackupRexmit(d->ps->core(), (w_mc));
3606
+
stat = sendBackupRexmit(cudt, (w_mc));
3603
3607
}
3604
3608
++num_activated;
3605
3609
}
@@ -4384,6 +4388,9 @@ int CUDTGroup::sendBackup_SendOverActive(const char* buf, int len, SRT_MSGCTRL&
4384
4388
{
4385
4389
++w_nsuccessful;
4386
4390
w_maxActiveWeight = max(w_maxActiveWeight, d->weight);
4391
+
4392
+
if (u.m_pSndBuffer)
4393
+
w_sendBackupCtx.setRateEstimate(u.m_pSndBuffer->getRateEstimator());
4387
4394
}
4388
4395
else if (erc == SRT_EASYNCSND)
4389
4396
{
Original file line number Diff line number Diff line change
@@ -110,11 +110,16 @@ namespace groups
110
110
111
111
std::string printMembers() const;
112
112
113
+
void setRateEstimate(const CRateEstimator& rate) { m_rateEstimate = rate; }
114
+
115
+
const CRateEstimator& getRateEstimate() const { return m_rateEstimate; }
116
+
113
117
private:
114
118
std::vector<BackupMemberStateEntry> m_memberStates; // TODO: consider std::map here?
115
119
unsigned m_stateCounter[BKUPST_E_SIZE];
116
120
uint16_t m_activeMaxWeight;
117
121
uint16_t m_standbyMaxWeight;
122
+
CRateEstimator m_rateEstimate; // The rate estimator state of the active link to copy to a backup on activation.
118
123
};
119
124
120
125
} // namespace groups
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4