32-bit fixes
This commit is contained in:
parent
9e1539a2b9
commit
01d43796ad
28 changed files with 91 additions and 91 deletions
|
@ -169,10 +169,10 @@ namespace Mist {
|
|||
static JSON::Value thisPack;
|
||||
thisPack.null();
|
||||
thisPack["trackid"] = srtTrack;
|
||||
thisPack["bpos"] = (long long)srtSource.tellg();
|
||||
thisPack["bpos"] = (uint64_t)srtSource.tellg();
|
||||
thisPack["data"] = data;
|
||||
thisPack["index"] = index;
|
||||
thisPack["time"] = (long long)timestamp;
|
||||
thisPack["time"] = timestamp;
|
||||
thisPack["duration"] = duration;
|
||||
|
||||
std::string tmpStr = thisPack.toNetPacked();
|
||||
|
|
|
@ -9,8 +9,8 @@ namespace Mist {
|
|||
capa["name"] = "Balancer";
|
||||
capa["desc"] = "The load balancer input restarts itself as the input a load balancer tells it it should be. The syntax is in the form 'balance:http://HOST:PORT[?fallback=FALLBACK]', where HOST and PORT are the host and port of the load balancer and the FALLBACK is the full source URL that should be used if the load balancer cannot be reached.";
|
||||
capa["source_match"] = "balance:*";
|
||||
capa["priority"] = 9ll;
|
||||
capa["morphic"] = 1ll;
|
||||
capa["priority"] = 9;
|
||||
capa["morphic"] = 1;
|
||||
}
|
||||
|
||||
int inputBalancer::boot(int argc, char * argv[]){
|
||||
|
|
|
@ -204,7 +204,7 @@ namespace Mist {
|
|||
std::stringstream issues;
|
||||
for (std::map<unsigned int, DTSC::Track>::iterator it = myMeta.tracks.begin(); it != myMeta.tracks.end(); it++){
|
||||
JSON::Value & track = details[it->second.getWritableIdentifier()];
|
||||
track["kbits"] = (long long)((double)it->second.bps * 8 / 1024);
|
||||
track["kbits"] = (uint64_t)((double)it->second.bps * 8 / 1024);
|
||||
track["codec"] = it->second.codec;
|
||||
uint32_t shrtest_key = 0xFFFFFFFFul;
|
||||
uint32_t longest_key = 0;
|
||||
|
@ -221,19 +221,19 @@ namespace Mist {
|
|||
if ((k->getLength()/k->getParts()) > longest_prt){longest_prt = (k->getLength()/k->getParts());}
|
||||
if ((k->getLength()/k->getParts()) < shrtest_prt){shrtest_prt = (k->getLength()/k->getParts());}
|
||||
}
|
||||
track["keys"]["ms_min"] = (long long)shrtest_key;
|
||||
track["keys"]["ms_max"] = (long long)longest_key;
|
||||
track["keys"]["frame_ms_min"] = (long long)shrtest_prt;
|
||||
track["keys"]["frame_ms_max"] = (long long)longest_prt;
|
||||
track["keys"]["frames_min"] = (long long)shrtest_cnt;
|
||||
track["keys"]["frames_max"] = (long long)longest_cnt;
|
||||
track["keys"]["ms_min"] = shrtest_key;
|
||||
track["keys"]["ms_max"] = longest_key;
|
||||
track["keys"]["frame_ms_min"] = shrtest_prt;
|
||||
track["keys"]["frame_ms_max"] = longest_prt;
|
||||
track["keys"]["frames_min"] = shrtest_cnt;
|
||||
track["keys"]["frames_max"] = longest_cnt;
|
||||
if (longest_prt > 500){issues << "unstable connection (" << longest_prt << "ms " << it->second.codec << " frame)! ";}
|
||||
if (shrtest_cnt < 6){issues << "unstable connection (" << shrtest_cnt << " " << it->second.codec << " frames in key)! ";}
|
||||
if (it->second.codec == "AAC"){hasAAC = true;}
|
||||
if (it->second.codec == "H264"){hasH264 = true;}
|
||||
if (it->second.type=="video"){
|
||||
track["width"] = (long long)it->second.width;
|
||||
track["height"] = (long long)it->second.height;
|
||||
track["width"] = it->second.width;
|
||||
track["height"] = it->second.height;
|
||||
track["fpks"] = it->second.fpks;
|
||||
}
|
||||
}
|
||||
|
@ -496,7 +496,7 @@ namespace Mist {
|
|||
}
|
||||
/*LTS-START*/
|
||||
if (Triggers::shouldTrigger("STREAM_TRACK_REMOVE")) {
|
||||
std::string payload = config->getString("streamname") + "\n" + JSON::Value((long long)it->first).asString() + "\n";
|
||||
std::string payload = config->getString("streamname") + "\n" + JSON::Value((uint64_t)it->first).asString() + "\n";
|
||||
Triggers::doTrigger("STREAM_TRACK_REMOVE", payload, config->getString("streamname"));
|
||||
}
|
||||
/*LTS-END*/
|
||||
|
@ -786,13 +786,13 @@ namespace Mist {
|
|||
collidesWith = -1;
|
||||
}
|
||||
/*LTS-START*/
|
||||
unsigned long finalMap = collidesWith;
|
||||
uint64_t finalMap = collidesWith;
|
||||
if (finalMap == -1) {
|
||||
//No collision has been detected, assign a new final number
|
||||
finalMap = (myMeta.tracks.size() ? myMeta.tracks.rbegin()->first : 0) + 1;
|
||||
DEBUG_MSG(DLVL_DEVEL, "No colision detected for temporary track %lu from user %u, assigning final track number %lu", value, id, finalMap);
|
||||
if (Triggers::shouldTrigger("STREAM_TRACK_ADD")) {
|
||||
std::string payload = config->getString("streamname") + "\n" + JSON::Value((long long)finalMap).asString() + "\n";
|
||||
std::string payload = config->getString("streamname") + "\n" + JSON::Value(finalMap).asString() + "\n";
|
||||
Triggers::doTrigger("STREAM_TRACK_ADD", payload, config->getString("streamname"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace Mist {
|
|||
inputDTSC::inputDTSC(Util::Config * cfg) : Input(cfg) {
|
||||
capa["name"] = "DTSC";
|
||||
capa["desc"] = "Enables DTSC Input";
|
||||
capa["priority"] = 9ll;
|
||||
capa["priority"] = 9;
|
||||
capa["source_match"] = "/*.dtsc";
|
||||
capa["codecs"][0u][0u].append("H264");
|
||||
capa["codecs"][0u][0u].append("H263");
|
||||
|
|
|
@ -12,8 +12,8 @@ namespace Mist {
|
|||
capa["desc"] = "The folder input will make available all supported files in the given folder as streams under this stream name, in the format STREAMNAME+FILENAME. For example, if your stream is called 'files' and you have a file called 'movie.flv', you could access this file streamed as 'files+movie.flv'. This input does not support subdirectories. To support more complex libraries, look into the documentation for the STREAM_SOURCE trigger.";
|
||||
capa["source_match"] = "/*/";
|
||||
capa["source_file"] = "$source/$wildcard";
|
||||
capa["priority"] = 9ll;
|
||||
capa["morphic"] = 1ll;
|
||||
capa["priority"] = 9;
|
||||
capa["morphic"] = 1;
|
||||
}
|
||||
|
||||
int inputFolder::boot(int argc, char * argv[]){
|
||||
|
|
|
@ -264,7 +264,7 @@ namespace Mist{
|
|||
// All URLs can be set to always-on mode.
|
||||
capa["always_match"] = capa["source_match"];
|
||||
|
||||
capa["priority"] = 9ll;
|
||||
capa["priority"] = 9;
|
||||
capa["codecs"][0u][0u].append("H264");
|
||||
capa["codecs"][0u][1u].append("AAC");
|
||||
capa["codecs"][0u][1u].append("AC3");
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Mist {
|
|||
capa["name"] = "ISMV";
|
||||
capa["desc"] = "This input allows you to stream ISMV Video on Demand files.";
|
||||
capa["source_match"] = "/*.ismv";
|
||||
capa["priority"] = 9ll;
|
||||
capa["priority"] = 9;
|
||||
capa["codecs"][0u][0u].append("H264");
|
||||
capa["codecs"][0u][1u].append("AAC");
|
||||
|
||||
|
@ -97,7 +97,7 @@ namespace Mist {
|
|||
if (i) {
|
||||
lastBytePos ++;
|
||||
} else {
|
||||
lastPack["keyframe"] = 1LL;
|
||||
lastPack["keyframe"] = 1;
|
||||
lastBytePos = curBytePos;
|
||||
}
|
||||
lastPack["bpos"] = lastBytePos;
|
||||
|
@ -105,7 +105,7 @@ namespace Mist {
|
|||
lastPack["offset"] = (int)offsetConv;
|
||||
} else {
|
||||
if (i == 0) {
|
||||
lastPack["keyframe"] = 1LL;
|
||||
lastPack["keyframe"] = 1;
|
||||
lastPack["bpos"] = curBytePos;
|
||||
}
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ namespace Mist {
|
|||
return;
|
||||
}
|
||||
int tId = buffered.begin()->trackId;
|
||||
thisPack["time"] = (long long int)(buffered.begin()->time / 10000);
|
||||
thisPack["time"] = (uint64_t)(buffered.begin()->time / 10000);
|
||||
thisPack["trackid"] = tId;
|
||||
fseek(inFile, buffered.begin()->position, SEEK_SET);
|
||||
char * tmpData = (char*)malloc(buffered.begin()->size * sizeof(char));
|
||||
|
@ -140,15 +140,15 @@ namespace Mist {
|
|||
}
|
||||
if (myMeta.tracks[tId].type == "video") {
|
||||
if (buffered.begin()->isKeyFrame) {
|
||||
thisPack["keyframe"] = 1LL;
|
||||
thisPack["keyframe"] = 1;
|
||||
}
|
||||
thisPack["offset"] = buffered.begin()->offset / 10000;
|
||||
thisPack["offset"] = (uint64_t)(buffered.begin()->offset / 10000);
|
||||
} else {
|
||||
if (buffered.begin()->isKeyFrame) {
|
||||
thisPack["keyframe"] = 1LL;
|
||||
thisPack["keyframe"] = 1;
|
||||
}
|
||||
}
|
||||
thisPack["bpos"] = buffered.begin()->position;
|
||||
thisPack["bpos"] = (uint64_t)buffered.begin()->position;
|
||||
buffered.erase(buffered.begin());
|
||||
if (buffered.size() < 2 * selectedTracks.size()){
|
||||
for (std::set<unsigned long>::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){
|
||||
|
|
|
@ -161,7 +161,7 @@ namespace Mist{
|
|||
capa["desc"] = "This input allows streaming of MP4 files as Video on Demand.";
|
||||
capa["source_match"] = "/*.mp4";
|
||||
capa["source_file"] = "$source";
|
||||
capa["priority"] = 9ll;
|
||||
capa["priority"] = 9;
|
||||
capa["codecs"][0u][0u].append("HEVC");
|
||||
capa["codecs"][0u][0u].append("H264");
|
||||
capa["codecs"][0u][0u].append("H263");
|
||||
|
@ -502,12 +502,12 @@ namespace Mist{
|
|||
|
||||
static JSON::Value thisPack;
|
||||
thisPack.null();
|
||||
thisPack["trackid"] = (long long)curPart.trackID;
|
||||
thisPack["bpos"] = (long long)curPart.bpos; //(long long)fileSource.tellg();
|
||||
thisPack["trackid"] = (uint64_t)curPart.trackID;
|
||||
thisPack["bpos"] = curPart.bpos; //(long long)fileSource.tellg();
|
||||
thisPack["data"] = std::string(data+2,txtLen);
|
||||
thisPack["time"] = (long long)curPart.time;
|
||||
thisPack["time"] = curPart.time;
|
||||
if (curPart.duration){
|
||||
thisPack["duration"] = (long long)curPart.duration;
|
||||
thisPack["duration"] = curPart.duration;
|
||||
}
|
||||
thisPack["keyframe"] = true;
|
||||
// Write the json value to lastpack
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace Mist{
|
|||
capa["source_match"].append("rtsp://*");
|
||||
// These can/may be set to always-on mode
|
||||
capa["always_match"].append("rtsp://*");
|
||||
capa["priority"] = 9ll;
|
||||
capa["priority"] = 9;
|
||||
capa["codecs"][0u][0u].append("H264");
|
||||
capa["codecs"][0u][0u].append("HEVC");
|
||||
capa["codecs"][0u][0u].append("MPEG2");
|
||||
|
@ -51,7 +51,7 @@ namespace Mist{
|
|||
option["long"] = "buffer";
|
||||
option["short"] = "b";
|
||||
option["help"] = "DVR buffer time in ms";
|
||||
option["value"].append(50000LL);
|
||||
option["value"].append(50000);
|
||||
config->addOption("bufferTime", option);
|
||||
capa["optional"]["DVR"]["name"] = "Buffer time (ms)";
|
||||
capa["optional"]["DVR"]["help"] = "The target available buffer time for this live stream, in "
|
||||
|
@ -60,7 +60,7 @@ namespace Mist{
|
|||
"as well as the minimum duration needed for stable playback.";
|
||||
capa["optional"]["DVR"]["option"] = "--buffer";
|
||||
capa["optional"]["DVR"]["type"] = "uint";
|
||||
capa["optional"]["DVR"]["default"] = 50000LL;
|
||||
capa["optional"]["DVR"]["default"] = 50000;
|
||||
option.null();
|
||||
option["arg"] = "string";
|
||||
option["long"] = "transport";
|
||||
|
@ -93,7 +93,7 @@ namespace Mist{
|
|||
sndH.auth(username, password, authRequest);
|
||||
}
|
||||
sndH.SetHeader("User-Agent", "MistServer " PACKAGE_VERSION);
|
||||
sndH.SetHeader("CSeq", JSON::Value((long long)cSeq).asString());
|
||||
sndH.SetHeader("CSeq", JSON::Value(cSeq).asString());
|
||||
if (session.size()){sndH.SetHeader("Session", session);}
|
||||
if (extraHeaders && extraHeaders->size()){
|
||||
for (std::map<std::string, std::string>::const_iterator it = extraHeaders->begin();
|
||||
|
|
|
@ -8,7 +8,7 @@ namespace Mist{
|
|||
capa["decs"] = "This input allows streaming of SRT and WebVTT subtitle files as Video on Demand.";
|
||||
capa["source_match"].append("/*.srt");
|
||||
capa["source_match"].append("/*.vtt");
|
||||
capa["priority"] = 9ll;
|
||||
capa["priority"] = 9;
|
||||
capa["codecs"][0u][0u].append("subtitle");
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ namespace Mist{
|
|||
static JSON::Value thisPack;
|
||||
thisPack.null();
|
||||
thisPack["trackid"] = 1;
|
||||
thisPack["bpos"] = (long long)fileSource.tellg();
|
||||
thisPack["bpos"] = (uint64_t)fileSource.tellg();
|
||||
thisPack["data"] = data;
|
||||
thisPack["index"] = index;
|
||||
thisPack["time"] = timestamp;
|
||||
|
|
|
@ -128,7 +128,7 @@ namespace Mist {
|
|||
capa["always_match"].append("http-ts://*");
|
||||
capa["incoming_push_url"] = "udp://$host:$port";
|
||||
capa["incoming_push_url_match"] = "tsudp://*";
|
||||
capa["priority"] = 9ll;
|
||||
capa["priority"] = 9;
|
||||
capa["codecs"][0u][0u].append("H264");
|
||||
capa["codecs"][0u][0u].append("HEVC");
|
||||
capa["codecs"][0u][0u].append("MPEG2");
|
||||
|
@ -143,13 +143,13 @@ namespace Mist {
|
|||
option["long"] = "buffer";
|
||||
option["short"] = "b";
|
||||
option["help"] = "DVR buffer time in ms";
|
||||
option["value"].append(50000LL);
|
||||
option["value"].append(50000);
|
||||
config->addOption("bufferTime", option);
|
||||
capa["optional"]["DVR"]["name"] = "Buffer time (ms)";
|
||||
capa["optional"]["DVR"]["help"] = "The target available buffer time for this live stream, in milliseconds. This is the time available to seek around in, and will automatically be extended to fit whole keyframes as well as the minimum duration needed for stable playback.";
|
||||
capa["optional"]["DVR"]["option"] = "--buffer";
|
||||
capa["optional"]["DVR"]["type"] = "uint";
|
||||
capa["optional"]["DVR"]["default"] = 50000LL;
|
||||
capa["optional"]["DVR"]["default"] = 50000;
|
||||
}
|
||||
|
||||
inputTS::~inputTS() {
|
||||
|
@ -522,7 +522,7 @@ namespace Mist {
|
|||
}
|
||||
nProxy.userClient.keepAlive();
|
||||
|
||||
std::set<unsigned long> activeTracks = liveStream.getActiveTracks();
|
||||
std::set<size_t> activeTracks = liveStream.getActiveTracks();
|
||||
{
|
||||
tthread::lock_guard<tthread::mutex> guard(threadClaimMutex);
|
||||
if (hasStarted && !threadTimer.size()){
|
||||
|
@ -534,7 +534,7 @@ namespace Mist {
|
|||
hasStarted = false;
|
||||
}
|
||||
}
|
||||
for (std::set<unsigned long>::iterator it = activeTracks.begin(); it != activeTracks.end(); it++) {
|
||||
for (std::set<size_t>::iterator it = activeTracks.begin(); it != activeTracks.end(); it++) {
|
||||
if (!liveStream.isDataTrack(*it)){continue;}
|
||||
if (threadTimer.count(*it) && ((Util::bootSecs() - threadTimer[*it]) > (2 * THREAD_TIMEOUT))) {
|
||||
WARN_MSG("Thread for track %d timed out %d seconds ago without a clean shutdown.", *it, Util::bootSecs() - threadTimer[*it]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue