Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{FEC} Application support #857

Merged
merged 39 commits into from
Sep 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
c0db916
Random refactoring and small bugfixes during FEC works.
Sep 4, 2019
275518d
Added lacking setupCC fix
Sep 4, 2019
73f7a4c
Added changes for packet filter FW and API
Sep 4, 2019
b856a84
Added packetfiler option doc
Sep 4, 2019
4ed2773
Added FEC filter
Sep 4, 2019
7cc342b
Added application support
Sep 5, 2019
b784855
Introduced a capability flag for packet filter. Added standard capabi…
Sep 6, 2019
3d8bd2c
Merge branch 'pr-fec-core-packetfilter-api' into pf-fec-docs-packetfi…
Sep 6, 2019
6a2f264
Merge branch 'pf-fec-docs-packetfilter-api' into pf-fec-core-fec
Sep 6, 2019
1dd599d
Merge branch 'pf-fec-core-fec' into pf-fec-apps-support
Sep 6, 2019
9d10077
Post-review fixes (docs/comments only)
Sep 6, 2019
7281917
Post-review fixes
Sep 6, 2019
a27b275
Updated from parent
Sep 6, 2019
328d988
Merge branch 'pr-fec-core-packetfilter-api' into pf-fec-docs-packetfi…
Sep 6, 2019
90206c3
Merge branch 'pf-fec-docs-packetfilter-api' into pf-fec-core-fec
Sep 6, 2019
3873f92
Merge branch 'pf-fec-core-fec' into pf-fec-apps-support
Sep 6, 2019
6d7d265
Fixed automatic merge mistake
Sep 6, 2019
5b8b403
Post-review fixes.
Sep 9, 2019
7a5b060
Merge branch 'pr-fec-core-packetfilter-api' into pf-fec-docs-packetfi…
Sep 9, 2019
c9bd7f3
Merge branch 'pf-fec-docs-packetfilter-api' into pf-fec-core-fec
Sep 9, 2019
076cb4c
Merge branch 'pf-fec-core-fec' into pf-fec-apps-support
Sep 9, 2019
12b1417
Made extraSize implemented as static. Check filter extra size against…
Sep 9, 2019
c28d2a1
Merge branch 'pr-fec-core-packetfilter-api' into pf-fec-core-fec
Sep 9, 2019
56c6b45
Fixed according to the changes in the packet filter API.
Sep 9, 2019
37ebad4
Backfixes after testing with apps
Sep 9, 2019
e793db7
Merge branch 'pf-fec-core-fec' into pf-fec-apps-support
Sep 9, 2019
dfc10c4
Fixed design flaw in virtual factory
Sep 9, 2019
db57706
Backfix (ManagedPtr design flaw)
Sep 9, 2019
48ae77a
Merge branch 'pr-fec-core-packetfilter-api' into pf-fec-docs-packetfi…
Sep 9, 2019
e43be24
Updated from parent
Sep 9, 2019
65264f4
Merge branch 'pf-fec-core-fec' into pf-fec-apps-support
Sep 9, 2019
9cb12fb
Merge branch 'master' into pf-fec-docs-packetfilter-api
Sep 10, 2019
4e5a99f
Merge branch 'pf-fec-docs-packetfilter-api' into pf-fec-core-fec
Sep 10, 2019
958362f
Merge branch 'pf-fec-core-fec' into pf-fec-apps-support
Sep 10, 2019
4895f5b
Added const where it's due
Sep 10, 2019
1c21e5c
Merge branch 'master' into pf-fec-core-fec
Sep 10, 2019
c8898c9
Merge branch 'pf-fec-core-fec' into pf-fec-apps-support
Sep 10, 2019
a22e7eb
Merge branch 'master' into pf-fec-apps-support
ethouris Sep 10, 2019
7ca61c3
Reverted the extra variable
ethouris Sep 10, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/socketoptions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ const SocketOption srt_options [] {
{ "kmrefreshrate", 0, SRTO_KMREFRESHRATE, SocketOption::PRE, SocketOption::INT, nullptr },
{ "kmpreannounce", 0, SRTO_KMPREANNOUNCE, SocketOption::PRE, SocketOption::INT, nullptr },
{ "strictenc", 0, SRTO_STRICTENC, SocketOption::PRE, SocketOption::BOOL, nullptr },
{ "peeridletimeo", 0, SRTO_PEERIDLETIMEO, SocketOption::PRE, SocketOption::INT, nullptr }
{ "peeridletimeo", 0, SRTO_PEERIDLETIMEO, SocketOption::PRE, SocketOption::INT, nullptr },
{ "packetfilter", 0, SRTO_PACKETFILTER, SocketOption::PRE, SocketOption::STRING, nullptr }
};
}

Expand Down
19 changes: 16 additions & 3 deletions apps/transmitmedia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ class SrtStatsJson : public SrtStatsWriter
output << "\"packets\":" << mon.pktSent << ",";
output << "\"packetsLost\":" << mon.pktSndLoss << ",";
output << "\"packetsDropped\":" << mon.pktSndDrop << ",";
output << "\"packetsRetransmitted\":" << mon.pktRetrans << ",";
output << "\"packetsRetransmitted\":" << mon.pktRetrans << ",";
output << "\"packetsFilterExtra\":" << mon.pktSndFilterExtra << ",";
output << "\"bytes\":" << mon.byteSent << ",";
output << "\"bytesDropped\":" << mon.byteSndDrop << ",";
output << "\"mbitRate\":" << mon.mbpsSendRate;
Expand All @@ -137,6 +138,9 @@ class SrtStatsJson : public SrtStatsWriter
output << "\"packetsDropped\":" << mon.pktRcvDrop << ",";
output << "\"packetsRetransmitted\":" << mon.pktRcvRetrans << ",";
output << "\"packetsBelated\":" << mon.pktRcvBelated << ",";
output << "\"packetsFilterExtra\":" << mon.pktRcvFilterExtra << ",";
output << "\"packetsFilterSupply\":" << mon.pktRcvFilterSupply << ",";
output << "\"packetsFilterLoss\":" << mon.pktRcvFilterLoss << ",";
output << "\"bytes\":" << mon.byteRecv << ",";
output << "\"bytesLost\":" << mon.byteRcvLoss << ",";
output << "\"bytesDropped\":" << mon.byteRcvDrop << ",";
Expand Down Expand Up @@ -171,7 +175,9 @@ class SrtStatsCsv : public SrtStatsWriter
output << "msRTT,mbpsBandwidth,mbpsMaxBW,pktSent,pktSndLoss,pktSndDrop,";
output << "pktRetrans,byteSent,byteSndDrop,mbpsSendRate,usPktSndPeriod,";
output << "pktRecv,pktRcvLoss,pktRcvDrop,pktRcvRetrans,pktRcvBelated,";
output << "byteRecv,byteRcvLoss,byteRcvDrop,mbpsRecvRate,RCVLATENCYms";
output << "byteRecv,byteRcvLoss,byteRcvDrop,mbpsRecvRate,RCVLATENCYms,";
// Filter stats
output << "pktSndFilterExtra,pktRcvFilterExtra,pktRcvFilterSupply,pktRcvFilterLoss";
output << endl;
first_line_printed = true;
}
Expand Down Expand Up @@ -204,7 +210,12 @@ class SrtStatsCsv : public SrtStatsWriter
output << mon.byteRcvLoss << ",";
output << mon.byteRcvDrop << ",";
output << mon.mbpsRecvRate << ",";
output << rcv_latency;
output << rcv_latency << ",";
// Filter stats
output << mon.pktSndFilterExtra << ",";
output << mon.pktRcvFilterExtra << ",";
output << mon.pktRcvFilterSupply << ",";
output << mon.pktRcvFilterLoss; //<< ",";
output << endl;
return output.str();
}
Expand All @@ -228,6 +239,8 @@ class SrtStatsCols : public SrtStatsWriter
output << "LOST PKT SENT: " << setw(11) << mon.pktSndLoss << " RECEIVED: " << setw(11) << mon.pktRcvLoss << endl;
output << "REXMIT SENT: " << setw(11) << mon.pktRetrans << " RECEIVED: " << setw(11) << mon.pktRcvRetrans << endl;
output << "DROP PKT SENT: " << setw(11) << mon.pktSndDrop << " RECEIVED: " << setw(11) << mon.pktRcvDrop << endl;
output << "FILTER EXTRA TX: " << setw(11) << mon.pktSndFilterExtra << " RX: " << setw(11) << mon.pktRcvFilterExtra << endl;
output << "FILTER RX SUPPL: " << setw(11) << mon.pktRcvFilterSupply << " RX LOSS: " << setw(11) << mon.pktRcvFilterLoss << endl;
output << "RATE SENDING: " << setw(11) << mon.mbpsSendRate << " RECEIVING: " << setw(11) << mon.mbpsRecvRate << endl;
output << "BELATED RECEIVED: " << setw(11) << mon.pktRcvBelated << " AVG TIME: " << setw(11) << mon.pktRcvAvgBelatedTime << endl;
output << "REORDER DISTANCE: " << setw(11) << mon.pktReorderDistance << endl;
Expand Down
13 changes: 13 additions & 0 deletions testing/srt-test-live.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,19 @@ int main( int argc, char** argv )
bool internal_log = Option("no", "loginternal") != "no";
bool skip_flushing = Option("no", "S", "skipflush") != "no";

// Print format
string pf = Option("default", "pf", "printformat");
if (pf == "json")
{
transmit_printformat_json = true;
}
else if (pf != "default")
{
cerr << "ERROR: Unsupported print format: " << pf << endl;
return 1;
}


// Options that require integer conversion
size_t bandwidth;
size_t stoptime;
Expand Down
75 changes: 65 additions & 10 deletions testing/testmedia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ volatile bool transmit_throw_on_interrupt = false;
int transmit_bw_report = 0;
unsigned transmit_stats_report = 0;
size_t transmit_chunk_size = SRT_LIVE_DEF_PLSIZE;
bool transmit_printformat_json = false;
srt_listen_callback_fn* transmit_accept_hook_fn = nullptr;
void* transmit_accept_hook_op = nullptr;

Expand Down Expand Up @@ -176,16 +177,70 @@ Iface* CreateFile(const string& name) { return new typename File<Iface>::type (n
template <class PerfMonType>
void PrintSrtStats(int sid, const PerfMonType& mon)
{
Verb() << "======= SRT STATS: sid=" << sid;
Verb() << "PACKETS SENT: " << mon.pktSent << " RECEIVED: " << mon.pktRecv;
Verb() << "LOST PKT SENT: " << mon.pktSndLoss << " RECEIVED: " << mon.pktRcvLoss;
Verb() << "REXMIT SENT: " << mon.pktRetrans << " RECEIVED: " << mon.pktRcvRetrans;
Verb() << "RATE SENDING: " << mon.mbpsSendRate << " RECEIVING: " << mon.mbpsRecvRate;
Verb() << "BELATED RECEIVED: " << mon.pktRcvBelated << " AVG TIME: " << mon.pktRcvAvgBelatedTime;
Verb() << "REORDER DISTANCE: " << mon.pktReorderDistance;
Verb() << "WINDOW: FLOW: " << mon.pktFlowWindow << " CONGESTION: " << mon.pktCongestionWindow << " FLIGHT: " << mon.pktFlightSize;
Verb() << "RTT: " << mon.msRTT << "ms BANDWIDTH: " << mon.mbpsBandwidth << "Mb/s\n";
Verb() << "BUFFERLEFT: SND: " << mon.byteAvailSndBuf << " RCV: " << mon.byteAvailRcvBuf;
if (transmit_printformat_json)
{
cout << "{" << endl;
cout << "\t\"sid\":" << sid << "," << endl;
cout << "\t\"time\":" << mon.msTimeStamp << "," << endl;
cout << "\t\"window\":{" << endl;
cout << "\t\t\"flow\":" << mon.pktFlowWindow << "," << endl;
cout << "\t\t\"congestion\":" << mon.pktCongestionWindow << "," << endl;
cout << "\t\t\"flight\":" << mon.pktFlightSize << endl;
cout << "\t}," << endl;
cout << "\t\"link\":{" << endl;
cout << "\t\t\"rtt\":" << mon.msRTT << "," << endl;
cout << "\t\t\"bandwidth\":" << mon.mbpsBandwidth << "," << endl;
cout << "\t\t\"maxBandwidth\":" << mon.mbpsMaxBW << endl;
cout << "\t}," << endl;
cout << "\t\"send\":{" << endl;
cout << "\t\t\"packets\":" << mon.pktSent << "," << endl;
cout << "\t\t\"packetsLost\":" << mon.pktSndLoss << "," << endl;
cout << "\t\t\"packetsDropped\":" << mon.pktSndDrop << "," << endl;
cout << "\t\t\"packetsRetransmitted\":" << mon.pktRetrans << "," << endl;
cout << "\t\t\"packetsFilterExtra\":" << mon.pktSndFilterExtra << "," << endl;
cout << "\t\t\"bytes\":" << mon.byteSent << "," << endl;
cout << "\t\t\"bytesDropped\":" << mon.byteSndDrop << "," << endl;
cout << "\t\t\"mbitRate\":" << mon.mbpsSendRate << endl;
cout << "\t}," << endl;
cout << "\t\"recv\":{" << endl;
cout << "\t\t\"packets\":" << mon.pktRecv << "," << endl;
cout << "\t\t\"packetsLost\":" << mon.pktRcvLoss << "," << endl;
cout << "\t\t\"packetsDropped\":" << mon.pktRcvDrop << "," << endl;
cout << "\t\t\"packetsRetransmitted\":" << mon.pktRcvRetrans << "," << endl;
cout << "\t\t\"packetsBelated\":" << mon.pktRcvBelated << "," << endl;
cout << "\t\t\"packetsFilterExtra\":" << mon.pktRcvFilterExtra << "," << endl;
cout << "\t\t\"packetsFilterSupplied\":" << mon.pktRcvFilterSupply << "," << endl;
cout << "\t\t\"packetsFilterLoss\":" << mon.pktRcvFilterLoss << "," << endl;
cout << "\t\t\"bytes\":" << mon.byteRecv << "," << endl;
cout << "\t\t\"bytesLost\":" << mon.byteRcvLoss << "," << endl;
cout << "\t\t\"bytesDropped\":" << mon.byteRcvDrop << "," << endl;
cout << "\t\t\"mbitRate\":" << mon.mbpsRecvRate << endl;
cout << "\t}," << endl;
cout << "\tfilter:{" << endl;
cout << "\t\t\"sndExtra\":" << mon.pktSndFilterExtra << endl;
cout << "\t\t\"rcvExtra\":" << mon.pktRcvFilterExtra << endl;
cout << "\t\t\"rcvSupply\":" << mon.pktRcvFilterSupply << endl;
cout << "\t\t\"rcvLoss\":" << mon.pktRcvFilterLoss << endl;
cout << "\t}" << endl;
cout << "}" << endl;

return;
}

cout << "======= SRT STATS: sid=" << sid << endl;
cout << "PACKETS SENT: " << setw(11) << mon.pktSent << " RECEIVED: " << setw(11) << mon.pktRecv << endl;
cout << "LOST PKT SENT: " << setw(11) << mon.pktSndLoss << " RECEIVED: " << setw(11) << mon.pktRcvLoss << endl;
cout << "REXMIT SENT: " << setw(11) << mon.pktRetrans << " RECEIVED: " << setw(11) << mon.pktRcvRetrans << endl;
cout << "DROP PKT SENT: " << setw(11) << mon.pktSndDrop << " RECEIVED: " << setw(11) << mon.pktRcvDrop << endl;
cout << "FILTER EXTRA TX: " << setw(11) << mon.pktSndFilterExtra << " RX: " << setw(11) << mon.pktRcvFilterExtra << endl;
cout << "FILTER RX SUPPL: " << setw(11) << mon.pktRcvFilterSupply << " RX LOSS: " << setw(11) << mon.pktRcvFilterLoss << endl;
cout << "RATE SENDING: " << setw(11) << mon.mbpsSendRate << " RECEIVING: " << setw(11) << mon.mbpsRecvRate << endl;
cout << "BELATED RECEIVED: " << setw(11) << mon.pktRcvBelated << " AVG TIME: " << setw(11) << mon.pktRcvAvgBelatedTime << endl;
cout << "REORDER DISTANCE: " << setw(11) << mon.pktReorderDistance << endl;
cout << "WINDOW FLOW: " << setw(11) << mon.pktFlowWindow << " CONGESTION: " << setw(11) << mon.pktCongestionWindow
<< " FLIGHT: " << setw(11) << mon.pktFlightSize << endl;
cout << "LINK RTT: " << setw(9) << mon.msRTT << "ms BANDWIDTH: " << setw(7) << mon.mbpsBandwidth << "Mb/s " << endl;
cout << "BUFFERLEFT: SND: " << setw(11) << mon.byteAvailSndBuf << " RCV: " << setw(11) << mon.byteAvailRcvBuf << endl;
}


Expand Down
1 change: 1 addition & 0 deletions testing/testmediabase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ extern volatile bool transmit_throw_on_interrupt;
extern int transmit_bw_report;
extern unsigned transmit_stats_report;
extern size_t transmit_chunk_size;
extern bool transmit_printformat_json;


class Location
Expand Down