AI automatically translates all comments in the code into English (#3917)

This commit is contained in:
alex
2024-09-19 14:53:50 +08:00
committed by GitHub
parent 046de691cb
commit 4152dcd409
279 changed files with 10602 additions and 3038 deletions

View File

@@ -39,7 +39,8 @@ void TwccContext::onRtp(uint32_t ssrc, uint16_t twcc_ext_seq, uint64_t stamp_ms)
}
if (needSendTwcc()) {
//其他匹配条件立即发送twcc
// 其他匹配条件立即发送twcc [AUTO-TRANSLATED:959d22b6]
// Send twcc immediately if other matching conditions are met
onSendTwcc(ssrc);
}
}
@@ -58,25 +59,30 @@ int TwccContext::checkSeqStatus(uint16_t twcc_ext_seq) const {
auto max = _rtp_recv_status.rbegin()->first;
auto delta = (int32_t) twcc_ext_seq - (int32_t) max;
if (delta > 0 && delta < 0xFFFF / 2) {
//正常增长
// 正常增长 [AUTO-TRANSLATED:7699c37d]
// Normal growth
return (int) ExtSeqStatus::normal;
}
if (delta < -0xFF00) {
//回环
// 回环 [AUTO-TRANSLATED:82956e03]
// Loop
TraceL << "rtp twcc ext seq looped:" << max << " -> " << twcc_ext_seq;
return (int) ExtSeqStatus::looped;
}
if (delta > 0xFF00) {
//回环后收到前面大的乱序的包,无法处理,丢弃
// 回环后收到前面大的乱序的包,无法处理,丢弃 [AUTO-TRANSLATED:512cc269]
// Discard packets that are out of order and large after looping back, as they cannot be processed
TraceL << "rtp twcc ext seq jumped after looped:" << max << " -> " << twcc_ext_seq;
return (int) ExtSeqStatus::jumped;
}
auto min = _rtp_recv_status.begin()->first;
if (min <= twcc_ext_seq || twcc_ext_seq <= max) {
//正常回退
// 正常回退 [AUTO-TRANSLATED:c8c6803f]
// Normal rollback
return (int) ExtSeqStatus::normal;
}
//seq莫名的大幅增加或减少无法处理丢弃
// seq莫名的大幅增加或减少无法处理丢弃 [AUTO-TRANSLATED:44dbbd28]
// Discard packets with a large increase or decrease in seq, as they cannot be processed
TraceL << "rtp twcc ext seq jumped:" << max << " -> " << twcc_ext_seq;
return (int) ExtSeqStatus::jumped;
}
@@ -85,9 +91,11 @@ void TwccContext::onSendTwcc(uint32_t ssrc) {
auto max = _rtp_recv_status.rbegin()->first;
auto begin = _rtp_recv_status.begin();
auto min = begin->first;
//参考时间戳的最小单位是64ms
// 参考时间戳的最小单位是64ms [AUTO-TRANSLATED:2e701a8c]
// The minimum unit of the reference timestamp is 64ms
auto ref_time = begin->second >> 6;
//还原基准时间戳
// 还原基准时间戳 [AUTO-TRANSLATED:bab53195]
// Restore the baseline timestamp
auto last_time = ref_time << 6;
FCI_TWCC::TwccPacketStatus status;
for (auto seq = min; seq <= max; ++seq) {
@@ -95,7 +103,8 @@ void TwccContext::onSendTwcc(uint32_t ssrc) {
SymbolStatus symbol = SymbolStatus::not_received;
auto it = _rtp_recv_status.find(seq);
if (it != _rtp_recv_status.end()) {
//recv delta,单位为250us,1ms等于4x250us
// recv delta,单位为250us,1ms等于4x250us [AUTO-TRANSLATED:46a0e186]
// recv delta, unit is 250us, 1ms equals 4x250us
delta = (int16_t) (4 * ((int64_t) it->second - (int64_t) last_time));
if (delta < 0 || delta > 0xFF) {
symbol = SymbolStatus::large_delta;