MCPcopy Create free account
hub / github.com/Haivision/srt / getFirstReadablePacketInfo

Method getFirstReadablePacketInfo

srtcore/buffer_rcv.cpp:728–761  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

726}
727
728CRcvBuffer::PacketInfo CRcvBuffer::getFirstReadablePacketInfo(time_point time_now) const
729{
730 const PacketInfo unreadableInfo = {SRT_SEQNO_NONE, false, time_point()};
731 const bool hasInorderPackets = hasReadableInorderPkts();
732
733 if (!m_tsbpd.isEnabled())
734 {
735 if (hasInorderPackets)
736 {
737 const CPacket& packet = packetAt(m_iStartPos);
738 const PacketInfo info = {packet.getSeqNo(), false, time_point()};
739 return info;
740 }
741 SRT_ASSERT((!m_bMessageAPI && m_numOutOfOrderPackets == 0) || m_bMessageAPI);
742 if (m_iFirstReadableOutOfOrder >= 0)
743 {
744 SRT_ASSERT(m_numOutOfOrderPackets > 0);
745 const CPacket& packet = packetAt(m_iFirstReadableOutOfOrder);
746 const PacketInfo info = {packet.getSeqNo(), true, time_point()};
747 return info;
748 }
749 return unreadableInfo;
750 }
751
752 if (!hasInorderPackets)
753 return unreadableInfo;
754
755 const PacketInfo info = getFirstValidPacketInfo();
756
757 if (info.tsbpd_time <= time_now)
758 return info;
759 else
760 return unreadableInfo;
761}
762
763int32_t CRcvBuffer::getFirstNonreadSeqNo() const
764{

Callers 2

sendCtrlAckMethod · 0.80
recvMethod · 0.80

Calls 2

isEnabledMethod · 0.80
getSeqNoMethod · 0.80

Tested by

no test coverage detected