提交 8b935fec authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

RtpDataCounter: use window size of 2500 ms instead of 1000 ms

- Fixes false "lack of RTP" detection in some screen sharing usages with simulcast
- Fixes #312
上级 d4414607
...@@ -12,11 +12,11 @@ namespace RTC ...@@ -12,11 +12,11 @@ namespace RTC
class RateCalculator class RateCalculator
{ {
public: public:
static constexpr float BpsScale{ 8000.0f };
static constexpr size_t DefaultWindowSize{ 1000 }; static constexpr size_t DefaultWindowSize{ 1000 };
static constexpr float DefaultBpsScale{ 8000.0f };
public: public:
explicit RateCalculator(size_t windowSize = DefaultWindowSize, float scale = BpsScale); explicit RateCalculator(size_t windowSize = DefaultWindowSize, float scale = DefaultBpsScale);
void Update(size_t size, uint64_t now); void Update(size_t size, uint64_t now);
uint32_t GetRate(uint64_t now); uint32_t GetRate(uint64_t now);
size_t GetBytes() const; size_t GetBytes() const;
...@@ -44,7 +44,7 @@ namespace RTC ...@@ -44,7 +44,7 @@ namespace RTC
// Window Size (in milliseconds). // Window Size (in milliseconds).
size_t windowSize{ DefaultWindowSize }; size_t windowSize{ DefaultWindowSize };
// Scale in which the rate is represented. // Scale in which the rate is represented.
const float scale{ BpsScale }; const float scale{ DefaultBpsScale };
// Total bytes transmitted. // Total bytes transmitted.
size_t bytes{ 0 }; size_t bytes{ 0 };
}; };
...@@ -89,7 +89,7 @@ namespace RTC ...@@ -89,7 +89,7 @@ namespace RTC
size_t GetBytes() const; size_t GetBytes() const;
private: private:
RateCalculator rate; RateCalculator rate{ /*windowSize*/ 2500 };
size_t packets{ 0 }; size_t packets{ 0 };
}; };
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论