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 v6.0.81 (#3808)
fix https://github.com/ossrs/srs/issues/3155 Build srt-1-fit fails with `standard attributes in middle of decl-specifiers` on GCC 12,Arch Linux. See https://github.com/Haivision/srt/releases/tag/v1.5.3
This commit is contained in:
parent
f9bba0a9b0
commit
c5e067fb0b
94 changed files with 5974 additions and 6273 deletions
59
trunk/3rdparty/srt-1-fit/srtcore/fec.cpp
vendored
59
trunk/3rdparty/srt-1-fit/srtcore/fec.cpp
vendored
|
@ -345,13 +345,13 @@ void FECFilterBuiltin::ConfigureColumns(Container& which, int32_t isn)
|
|||
{
|
||||
offset = col + 1; // +1 because we want it for the next column
|
||||
HLOGC(pflog.Debug, log << "ConfigureColumns: [" << (col+1) << "]... (resetting to row 0: +"
|
||||
<< offset << " %" << CSeqNo::incseq(isn, offset) << ")");
|
||||
<< offset << " %" << CSeqNo::incseq(isn, (int32_t)offset) << ")");
|
||||
}
|
||||
else
|
||||
{
|
||||
offset += 1 + sizeRow();
|
||||
HLOGC(pflog.Debug, log << "ConfigureColumns: [" << (col+1) << "] ... (continue +"
|
||||
<< offset << " %" << CSeqNo::incseq(isn, offset) << ")");
|
||||
<< offset << " %" << CSeqNo::incseq(isn, (int32_t)offset) << ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -453,7 +453,9 @@ void FECFilterBuiltin::feedSource(CPacket& packet)
|
|||
HLOGC(pflog.Debug, log << "FEC:feedSource: %" << packet.getSeqNo() << " rowoff=" << baseoff
|
||||
<< " column=" << vert_gx << " .base=%" << vert_base << " coloff=" << vert_off);
|
||||
|
||||
if (vert_off >= 0 && sizeCol() > 1)
|
||||
// [[assert sizeCol() >= 2]]; // see the condition above.
|
||||
|
||||
if (vert_off >= 0)
|
||||
{
|
||||
// BEWARE! X % Y with different signedness upgrades int to unsigned!
|
||||
|
||||
|
@ -468,7 +470,7 @@ void FECFilterBuiltin::feedSource(CPacket& packet)
|
|||
return;
|
||||
}
|
||||
|
||||
SRT_ASSERT(vert_off >= 0);
|
||||
// [[assert vert_off >= 0]]; // this condition branch
|
||||
int vert_pos = vert_off / int(sizeRow());
|
||||
|
||||
HLOGC(pflog.Debug, log << "FEC:feedSource: %" << packet.getSeqNo()
|
||||
|
@ -496,7 +498,6 @@ void FECFilterBuiltin::feedSource(CPacket& packet)
|
|||
}
|
||||
else
|
||||
{
|
||||
|
||||
HLOGC(pflog.Debug, log << "FEC:feedSource: %" << packet.getSeqNo()
|
||||
<< " B:%" << baseoff << " H:*[" << horiz_pos << "] V(B=%" << vert_base
|
||||
<< ")[col=" << vert_gx << "]<NO-COLUMN>"
|
||||
|
@ -604,8 +605,8 @@ void FECFilterBuiltin::ClipData(Group& g, uint16_t length_net, uint8_t kflg,
|
|||
}
|
||||
|
||||
// Fill the rest with zeros. When this packet is going to be
|
||||
// recovered, the payload extraced from this process will have
|
||||
// the maximum lenght, but it will be cut to the right length
|
||||
// recovered, the payload extracted from this process will have
|
||||
// the maximum length, but it will be cut to the right length
|
||||
// and these padding 0s taken out.
|
||||
for (size_t i = payload_size; i < payloadSize(); ++i)
|
||||
g.payload_clip[i] = g.payload_clip[i] ^ 0;
|
||||
|
@ -1128,10 +1129,10 @@ static void DebugPrintCells(int32_t base, const std::deque<bool>& cells, size_t
|
|||
for ( ; i < cells.size(); i += row_size )
|
||||
{
|
||||
std::ostringstream os;
|
||||
os << "cell[" << i << "-" << (i+row_size-1) << "] %" << CSeqNo::incseq(base, i) << ":";
|
||||
os << "cell[" << i << "-" << (i+row_size-1) << "] %" << CSeqNo::incseq(base, (int32_t)i) << ":";
|
||||
for (size_t y = 0; y < row_size; ++y)
|
||||
{
|
||||
os << " " << CellMark(cells, i+y);
|
||||
os << " " << CellMark(cells, (int)(i+y));
|
||||
}
|
||||
LOGP(pflog.Debug, os.str());
|
||||
}
|
||||
|
@ -1568,11 +1569,10 @@ size_t FECFilterBuiltin::ExtendRows(size_t rowx)
|
|||
const size_t size_in_packets = rowx * numberCols();
|
||||
const int n_series = int(rowx / numberRows());
|
||||
|
||||
if (size_in_packets > rcvBufferSize() && n_series > 2)
|
||||
if (CheckEmergencyShrink(n_series, size_in_packets))
|
||||
{
|
||||
HLOGC(pflog.Debug, log << "FEC: Emergency resize, rowx=" << rowx << " series=" << n_series
|
||||
HLOGC(pflog.Debug, log << "FEC: DONE Emergency resize, rowx=" << rowx << " series=" << n_series
|
||||
<< "npackets=" << size_in_packets << " exceeds buf=" << rcvBufferSize());
|
||||
EmergencyShrink(n_series);
|
||||
}
|
||||
|
||||
// Create and configure next groups.
|
||||
|
@ -1700,8 +1700,27 @@ bool FECFilterBuiltin::IsLost(int32_t seq) const
|
|||
return rcv.cells[offset];
|
||||
}
|
||||
|
||||
void FECFilterBuiltin::EmergencyShrink(size_t n_series)
|
||||
bool FECFilterBuiltin::CheckEmergencyShrink(size_t n_series, size_t size_in_packets)
|
||||
{
|
||||
// The minimum required size of the covered sequence range must be such
|
||||
// that groups for packets from the previous range must be still reachable.
|
||||
// It's then "this and previous" series in case of even arrangement.
|
||||
//
|
||||
// For staircase arrangement the potential range for a single column series
|
||||
// (number of columns equal to a row size) spans for 2 matrices (rows * cols)
|
||||
// minus one row. As dismissal is only allowed to be done by one full series
|
||||
// of rows and columns, the history must keep as many groups as needed to reach
|
||||
// out for this very packet of this group and all packets in the same row.
|
||||
// Hence we need two series of columns to cover a similar range as two row, twice.
|
||||
|
||||
const size_t min_series_history = m_arrangement_staircase ? 4 : 2;
|
||||
|
||||
if (n_series <= min_series_history)
|
||||
return false;
|
||||
|
||||
if (size_in_packets < rcvBufferSize() && n_series < SRT_FEC_MAX_RCV_HISTORY)
|
||||
return false;
|
||||
|
||||
// Shrink is required in order to prepare place for
|
||||
// either vertical or horizontal group in series `n_series`.
|
||||
|
||||
|
@ -1782,7 +1801,7 @@ void FECFilterBuiltin::EmergencyShrink(size_t n_series)
|
|||
else
|
||||
{
|
||||
HLOGC(pflog.Debug, log << "FEC: Shifting rcv row %" << oldbase << " -> %" << newbase);
|
||||
rcv.rowq.erase(rcv.rowq.begin(), rcv.rowq.end() + shift_rows);
|
||||
rcv.rowq.erase(rcv.rowq.begin(), rcv.rowq.begin() + shift_rows);
|
||||
}
|
||||
|
||||
const size_t shift_cols = shift_series * numberCols();
|
||||
|
@ -1816,6 +1835,8 @@ void FECFilterBuiltin::EmergencyShrink(size_t n_series)
|
|||
rcv.cells.push_back(false);
|
||||
}
|
||||
rcv.cell_base = newbase;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
FECFilterBuiltin::EHangStatus FECFilterBuiltin::HangVertical(const CPacket& rpkt, signed char fec_col, loss_seqs_t& irrecover)
|
||||
|
@ -1932,7 +1953,7 @@ void FECFilterBuiltin::RcvCheckDismissColumn(int32_t seq, int colgx, loss_seqs_t
|
|||
{
|
||||
HLOGC(pflog.Debug, log << "FEC/V: ... [" << i << "] base=%"
|
||||
<< pg.base << " TOO EARLY (last=%"
|
||||
<< CSeqNo::incseq(pg.base, (sizeCol()-1)*sizeRow())
|
||||
<< CSeqNo::incseq(pg.base, (int32_t)((sizeCol()-1)*sizeRow()))
|
||||
<< ")");
|
||||
continue;
|
||||
}
|
||||
|
@ -1943,7 +1964,7 @@ void FECFilterBuiltin::RcvCheckDismissColumn(int32_t seq, int colgx, loss_seqs_t
|
|||
|
||||
HLOGC(pflog.Debug, log << "FEC/V: ... [" << i << "] base=%"
|
||||
<< pg.base << " - PAST last=%"
|
||||
<< CSeqNo::incseq(pg.base, (sizeCol()-1)*sizeRow())
|
||||
<< CSeqNo::incseq(pg.base, (int32_t)((sizeCol()-1)*sizeRow()))
|
||||
<< " - collecting losses.");
|
||||
|
||||
pg.dismissed = true; // mark irrecover already collected
|
||||
|
@ -2489,11 +2510,11 @@ size_t FECFilterBuiltin::ExtendColumns(size_t colgx)
|
|||
// of packets as many as the number of rows, so simply multiply this.
|
||||
const size_t size_in_packets = colgx * numberRows();
|
||||
const size_t n_series = colgx / numberCols();
|
||||
if (size_in_packets > rcvBufferSize()/2 || n_series > SRT_FEC_MAX_RCV_HISTORY)
|
||||
|
||||
if (CheckEmergencyShrink(n_series, size_in_packets))
|
||||
{
|
||||
HLOGC(pflog.Debug, log << "FEC: Emergency resize, colgx=" << colgx << " series=" << n_series
|
||||
HLOGC(pflog.Debug, log << "FEC: DONE Emergency resize, colgx=" << colgx << " series=" << n_series
|
||||
<< "npackets=" << size_in_packets << " exceeds buf=" << rcvBufferSize());
|
||||
EmergencyShrink(n_series);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue