提交 752883bc authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

RtpRetransmissionBuffer: improve methods' name and logs

上级 4b0d5be9
...@@ -46,8 +46,8 @@ namespace RTC ...@@ -46,8 +46,8 @@ namespace RTC
Item* GetNewest() const; Item* GetNewest() const;
void RemoveOldest(); void RemoveOldest();
void RemoveOldest(uint16_t numItems); void RemoveOldest(uint16_t numItems);
bool ClearTooOld(uint32_t newestTimestamp); bool ClearTooOldByTimestamp(uint32_t newestTimestamp);
bool IsTooOld(uint32_t timestamp, uint32_t newestTimestamp) const; bool IsTooOldTimestamp(uint32_t timestamp, uint32_t newestTimestamp) const;
Item* FillItem( Item* FillItem(
Item* item, RTC::RtpPacket* packet, std::shared_ptr<RTC::RtpPacket>& sharedPacket) const; Item* item, RTC::RtpPacket* packet, std::shared_ptr<RTC::RtpPacket>& sharedPacket) const;
......
...@@ -94,9 +94,9 @@ namespace RTC ...@@ -94,9 +94,9 @@ namespace RTC
? timestamp ? timestamp
: newestItem->timestamp; : newestItem->timestamp;
// ClearTooOld() returns true if at least one packet has been removed from // ClearTooOldByTimestamp() returns true if at least one packet has been
// the front. // removed from the front.
if (ClearTooOld(newestTimestamp)) if (ClearTooOldByTimestamp(newestTimestamp))
{ {
// Buffer content has been modified so we must check it again. // Buffer content has been modified so we must check it again.
if (this->buffer.empty()) if (this->buffer.empty())
...@@ -132,7 +132,7 @@ namespace RTC ...@@ -132,7 +132,7 @@ namespace RTC
{ {
MS_WARN_TAG( MS_WARN_TAG(
rtp, rtp,
"packet has higher seq but less timestamp than newest packet in the buffer, discarding it [ssrc:%" PRIu32 "packet has higher seq but lower timestamp than newest packet in the buffer, discarding it [ssrc:%" PRIu32
", seq:%" PRIu16 ", timestamp:%" PRIu32 "]", ", seq:%" PRIu16 ", timestamp:%" PRIu32 "]",
ssrc, ssrc,
seq, seq,
...@@ -204,10 +204,12 @@ namespace RTC ...@@ -204,10 +204,12 @@ namespace RTC
timestamp); timestamp);
// Ensure that packet is not too old to be stored. // Ensure that packet is not too old to be stored.
if (IsTooOld(timestamp, newestItem->timestamp)) if (IsTooOldTimestamp(timestamp, newestItem->timestamp))
{ {
MS_WARN_DEV( MS_WARN_DEV(
"packet too old, discarding it [seq:%" PRIu16 ", timestamp:%" PRIu32 "]", seq, timestamp); "packet's timestamp too old, discarding it [seq:%" PRIu16 ", timestamp:%" PRIu32 "]",
seq,
timestamp);
return; return;
} }
...@@ -218,7 +220,7 @@ namespace RTC ...@@ -218,7 +220,7 @@ namespace RTC
{ {
MS_WARN_TAG( MS_WARN_TAG(
rtp, rtp,
"packet has less seq but higher timestamp than oldest packet in the buffer, discarding it [ssrc:%" PRIu32 "packet has lower seq but higher timestamp than oldest packet in the buffer, discarding it [ssrc:%" PRIu32
", seq:%" PRIu16 ", timestamp:%" PRIu32 "]", ", seq:%" PRIu16 ", timestamp:%" PRIu32 "]",
ssrc, ssrc,
seq, seq,
...@@ -305,7 +307,7 @@ namespace RTC ...@@ -305,7 +307,7 @@ namespace RTC
{ {
MS_WARN_TAG( MS_WARN_TAG(
rtp, rtp,
"packet timestamp is less than timestamp of immediate older packet in the buffer, discarding it [ssrc:%" PRIu32 "packet timestamp is lower than timestamp of immediate older packet in the buffer, discarding it [ssrc:%" PRIu32
", seq:%" PRIu16 ", timestamp:%" PRIu32 "]", ", seq:%" PRIu16 ", timestamp:%" PRIu32 "]",
ssrc, ssrc,
seq, seq,
...@@ -486,7 +488,7 @@ namespace RTC ...@@ -486,7 +488,7 @@ namespace RTC
} }
} }
bool RtpRetransmissionBuffer::ClearTooOld(uint32_t newestTimestamp) bool RtpRetransmissionBuffer::ClearTooOldByTimestamp(uint32_t newestTimestamp)
{ {
MS_TRACE(); MS_TRACE();
...@@ -497,7 +499,7 @@ namespace RTC ...@@ -497,7 +499,7 @@ namespace RTC
// that contain too old packets. // that contain too old packets.
while ((oldestItem = GetOldest())) while ((oldestItem = GetOldest()))
{ {
if (IsTooOld(oldestItem->timestamp, newestTimestamp)) if (IsTooOldTimestamp(oldestItem->timestamp, newestTimestamp))
{ {
RemoveOldest(); RemoveOldest();
...@@ -514,7 +516,7 @@ namespace RTC ...@@ -514,7 +516,7 @@ namespace RTC
return itemsRemoved; return itemsRemoved;
} }
bool RtpRetransmissionBuffer::IsTooOld(uint32_t timestamp, uint32_t newestTimestamp) const bool RtpRetransmissionBuffer::IsTooOldTimestamp(uint32_t timestamp, uint32_t newestTimestamp) const
{ {
MS_TRACE(); MS_TRACE();
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论