WS/MP4 reliability edits:

- Stream selecting now obeys new "maxdelay" capa entry
- Output::liveSeek now takes an optional bool argument to indicate only rate control should be applied (no seeking)
- dataWaitTimeout is now configurable per-output, defaults to the old 25s
- WS/MP4 uses the new liveSeek with rate-control only
- WS/MP4 uses the new dataWaitTimeout and sets it to 4.5s
- WS/MP4 uses the new maxdelay capa, sets it to 5s
- WS/MP4 will now auto-reselect tracks if a track is dropped for data wait timeout or disappeared from metadata reasons
- Added support for jitter information in WS/MP4 protocol
- Robustify sendWebsocketCodecData being ran when sendHeader is ran
- Fix race condition when switching video tracks before previous video track has sent a single frame
This commit is contained in:
Thulinma 2021-07-08 14:02:50 +02:00
parent a0eb42f1dd
commit 200e1e4a1c
6 changed files with 113 additions and 73 deletions

View file

@ -2294,7 +2294,7 @@ namespace DTSC{
MEDIUM_MSG("Jitter lowered from %" PRIu64 " to %" PRIu64 " ms", maxJitter, curJitter);
maxJitter = curJitter;
}
curJitter = maxJitter*0.75;
curJitter = maxJitter*0.90;
}
++x;
trueTime[x % 8] = curMs;

View file

@ -1139,7 +1139,7 @@ std::set<size_t> Util::wouldSelect(const DTSC::Meta &M, const std::string &track
std::set<size_t> Util::getSupportedTracks(const DTSC::Meta &M, const JSON::Value &capa,
const std::string &type, const std::string &UA){
std::set<size_t> validTracks = M.getValidTracks();
uint64_t maxLastMs = 0;
std::set<size_t> toRemove;
for (std::set<size_t>::iterator it = validTracks.begin(); it != validTracks.end(); it++){
// Remove unrequested tracks
@ -1208,10 +1208,27 @@ std::set<size_t> Util::getSupportedTracks(const DTSC::Meta &M, const JSON::Value
toRemove.insert(*it);
}
}
//not removing this track? Keep track of highest lastMs
if (capa.isMember("maxdelay")){
uint64_t lMs = M.getLastms(*it);
if (lMs > maxLastMs){maxLastMs = lMs;}
}
}
for (std::set<size_t>::iterator it = toRemove.begin(); it != toRemove.end(); it++){
validTracks.erase(*it);
}
//if there is a max delay configured, remove tracks that are further behind than this
if (capa.isMember("maxdelay")){
uint64_t maxDelay = capa["maxdelay"].asInt();
if (maxDelay > maxLastMs){maxDelay = maxLastMs;}
toRemove.clear();
for (std::set<size_t>::iterator it = validTracks.begin(); it != validTracks.end(); it++){
if (M.getLastms(*it) < maxLastMs - maxDelay){toRemove.insert(*it);}
}
for (std::set<size_t>::iterator it = toRemove.begin(); it != toRemove.end(); it++){
validTracks.erase(*it);
}
}
return validTracks;
}