mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Upgrade libsrt to v1.5.3. v5.0.183 (#3808)
This commit is contained in:
parent
389a62ee3a
commit
632d457194
154 changed files with 39813 additions and 17038 deletions
57
trunk/3rdparty/srt-1-fit/srtcore/fec.h
vendored
57
trunk/3rdparty/srt-1-fit/srtcore/fec.h
vendored
|
@ -9,8 +9,8 @@
|
|||
*/
|
||||
|
||||
|
||||
#ifndef INC__SRT_FEC_H
|
||||
#define INC__SRT_FEC_H
|
||||
#ifndef INC_SRT_FEC_H
|
||||
#define INC_SRT_FEC_H
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
@ -19,6 +19,8 @@
|
|||
|
||||
#include "packetfilter_api.h"
|
||||
|
||||
namespace srt {
|
||||
|
||||
class FECFilterBuiltin: public SrtPacketFilterBase
|
||||
{
|
||||
SrtFilterConfig cfg;
|
||||
|
@ -45,7 +47,7 @@ public:
|
|||
size_t drop; //< by how much the sequence should increase to get to the next series
|
||||
size_t collected; //< how many packets were taken to collect the clip
|
||||
|
||||
Group(): base(CSeqNo::m_iMaxSeqNo), step(0), drop(0), collected(0)
|
||||
Group(): base(SRT_SEQNO_NONE), step(0), drop(0), collected(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -68,6 +70,12 @@ public:
|
|||
SINGLE // Horizontal-only with no recursion
|
||||
};
|
||||
|
||||
static Type FlipType(Type t)
|
||||
{
|
||||
SRT_ASSERT(t != SINGLE);
|
||||
return (t == HORIZ) ? VERT : HORIZ;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
struct RcvGroup: Group
|
||||
|
@ -79,7 +87,7 @@ public:
|
|||
#if ENABLE_HEAVY_LOGGING
|
||||
std::string DisplayStats()
|
||||
{
|
||||
if (base == CSeqNo::m_iMaxSeqNo)
|
||||
if (base == SRT_SEQNO_NONE)
|
||||
return "UNINITIALIZED!!!";
|
||||
|
||||
std::ostringstream os;
|
||||
|
@ -183,21 +191,43 @@ private:
|
|||
|
||||
// Receiving
|
||||
void CheckLargeDrop(int32_t seqno);
|
||||
int ExtendRows(int rowx);
|
||||
int ExtendColumns(int colgx);
|
||||
void MarkCellReceived(int32_t seq);
|
||||
bool HangHorizontal(const CPacket& pkt, bool fec_ctl, loss_seqs_t& irrecover);
|
||||
bool HangVertical(const CPacket& pkt, signed char fec_colx, loss_seqs_t& irrecover);
|
||||
size_t ExtendRows(size_t rowx);
|
||||
size_t ExtendColumns(size_t colgx);
|
||||
|
||||
enum ECellReceived
|
||||
{
|
||||
CELL_RECEIVED, //< mark cell for a received packet (no matter current value)
|
||||
CELL_EXTEND, //< just make sure there's a place for a packet, set false if not
|
||||
CELL_REMOVE //< even if a packet was marked true, remove the cell existence confirmation
|
||||
};
|
||||
void MarkCellReceived(int32_t seq, ECellReceived recv = CELL_RECEIVED);
|
||||
|
||||
enum EHangStatus
|
||||
{
|
||||
HANG_NOTDONE,
|
||||
HANG_SUCCESS,
|
||||
HANG_PAST,
|
||||
HANG_CRAZY
|
||||
};
|
||||
|
||||
friend bool operator <(FECFilterBuiltin::EHangStatus a, FECFilterBuiltin::EHangStatus b)
|
||||
{
|
||||
return int(a) < int(b);
|
||||
}
|
||||
|
||||
EHangStatus HangHorizontal(const CPacket& pkt, bool fec_ctl, loss_seqs_t& irrecover);
|
||||
EHangStatus HangVertical(const CPacket& pkt, signed char fec_colx, loss_seqs_t& irrecover);
|
||||
void ClipControlPacket(Group& g, const CPacket& pkt);
|
||||
void ClipRebuiltPacket(Group& g, Receive::PrivPacket& pkt);
|
||||
void RcvRebuild(Group& g, int32_t seqno, Group::Type tp);
|
||||
int32_t RcvGetLossSeqHoriz(Group& g);
|
||||
int32_t RcvGetLossSeqVert(Group& g);
|
||||
bool CheckEmergencyShrink(size_t n_series, size_t size_in_packets);
|
||||
|
||||
static void TranslateLossRecords(const std::set<int32_t>& loss, loss_seqs_t& irrecover);
|
||||
void RcvCheckDismissColumn(int32_t seqno, int colgx, loss_seqs_t& irrecover);
|
||||
int RcvGetRowGroupIndex(int32_t seq);
|
||||
int RcvGetColumnGroupIndex(int32_t seq);
|
||||
int RcvGetRowGroupIndex(int32_t seq, EHangStatus& w_status);
|
||||
int RcvGetColumnGroupIndex(int32_t seqno, EHangStatus& w_status);
|
||||
void CollectIrrecoverRow(RcvGroup& g, loss_seqs_t& irrecover) const;
|
||||
bool IsLost(int32_t seq) const;
|
||||
|
||||
|
@ -243,6 +273,11 @@ public:
|
|||
static const size_t EXTRA_SIZE = 4;
|
||||
|
||||
virtual SRT_ARQLevel arqLevel() ATR_OVERRIDE { return m_fallback_level; }
|
||||
|
||||
static const char defaultConfig [];
|
||||
static bool verifyConfig(const SrtFilterConfig& config, std::string& w_errormsg);
|
||||
};
|
||||
|
||||
} // namespace srt
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue