Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[功能请求] Nack的相关控制配置 #3507

Closed
gongluck opened this issue May 2, 2024 · 2 comments
Closed

[功能请求] Nack的相关控制配置 #3507

gongluck opened this issue May 2, 2024 · 2 comments

Comments

@gongluck
Copy link
Contributor

gongluck commented May 2, 2024

Nack模块中的

static constexpr uint32_t kMaxNackMS = 5 * 1000;
static constexpr uint32_t kRtpCacheCheckInterval = 100;

这两个配置是否可以设置成可配置?

// RTC配置项目
namespace Rtc {
#define RTC_FIELD "rtc."
// Nack缓存包最早时间间隔
const string kMaxNackMS = RTC_FIELD "maxNackMS";
// Nack包检查间隔(包数量)
const string kRtpCacheCheckInterval = RTC_FIELD "rtpCacheCheckInterval";

static onceToken token([]() {
    mINI::Instance()[kMaxNackMS] = 5 * 1000;
    mINI::Instance()[kRtpCacheCheckInterval] = 100;
});

} // namespace RTC

void NackList::pushBack(RtpPacket::Ptr rtp) {
    auto seq = rtp->getSeq();
    _nack_cache_seq.emplace_back(seq);
    _nack_cache_pkt.emplace(seq, std::move(rtp));
    GET_CONFIG(uint32_t, rtpcache_checkinterval, Rtc::kRtpCacheCheckInterval);
    if (++_cache_ms_check < rtpcache_checkinterval) {
        return;
    }
    GET_CONFIG(uint32_t, maxnackms, Rtc::kMaxNackMS);
    _cache_ms_check = 0;
    while (getCacheMS() >= maxnackms) {
        // 需要清除部分nack缓存
        popFront();
    }
}
@xiongguangjie
Copy link
Member

你可以提交个pr

@gongluck
Copy link
Contributor Author

gongluck commented May 6, 2024

你可以提交个pr

好的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants