Fixed 32-bit compile issues

This commit is contained in:
Thulinma 2019-01-25 22:55:32 +01:00
parent 9671e385ce
commit 7565704fdc
32 changed files with 87 additions and 103 deletions

View file

@ -310,8 +310,8 @@ namespace DTSC {
std::string getIdentifier(); std::string getIdentifier();
std::string getWritableIdentifier(); std::string getWritableIdentifier();
unsigned int trackID; unsigned int trackID;
unsigned long long firstms; uint64_t firstms;
unsigned long long lastms; uint64_t lastms;
int bps; int bps;
int max_bps; int max_bps;
int missedFrags; int missedFrags;
@ -366,8 +366,8 @@ namespace DTSC {
bool live; bool live;
bool merged; bool merged;
uint16_t version; uint16_t version;
long long int moreheader; int64_t moreheader;
long long int bufferWindow; int64_t bufferWindow;
int64_t bootMsOffset;///< Millis to add to packet timestamps to get millis since system boot. int64_t bootMsOffset;///< Millis to add to packet timestamps to get millis since system boot.
std::string sourceURI; std::string sourceURI;
JSON::Value inputLocalVars; JSON::Value inputLocalVars;

View file

@ -502,7 +502,7 @@ namespace DTSC {
///\brief Returns the size of this packet. ///\brief Returns the size of this packet.
///\return The size of this packet. ///\return The size of this packet.
uint64_t Packet::getDataLen() const { size_t Packet::getDataLen() const {
return dataLen; return dataLen;
} }
@ -2032,8 +2032,8 @@ namespace DTSC {
result["lang"] = lang; result["lang"] = lang;
} }
result["trackid"] = trackID; result["trackid"] = trackID;
result["firstms"] = (long long)firstms; result["firstms"] = firstms;
result["lastms"] = (long long)lastms; result["lastms"] = lastms;
result["bps"] = bps; result["bps"] = bps;
result["maxbps"] = max_bps; result["maxbps"] = max_bps;
if (missedFrags) { if (missedFrags) {
@ -2065,22 +2065,22 @@ namespace DTSC {
result["tracks"][it->second.getWritableIdentifier()] = it->second.toJSON(); result["tracks"][it->second.getWritableIdentifier()] = it->second.toJSON();
} }
if (vod) { if (vod) {
result["vod"] = 1ll; result["vod"] = 1;
} }
if (live) { if (live) {
result["live"] = 1ll; result["live"] = 1;
} }
if (merged) { if (merged) {
result["merged"] = 1ll; result["merged"] = 1;
} }
if (bufferWindow) { if (bufferWindow) {
result["buffer_window"] = bufferWindow; result["buffer_window"] = bufferWindow;
} }
if (version) { if (version) {
result["version"] = (long long)version; result["version"] = version;
} }
if (bootMsOffset){ if (bootMsOffset){
result["bootoffset"] = (long long)bootMsOffset; result["bootoffset"] = bootMsOffset;
} }
if (sourceURI.size()){ if (sourceURI.size()){
result["source"] = sourceURI; result["source"] = sourceURI;

View file

@ -469,12 +469,6 @@ JSON::Value::Value(const char *val){
intVal = 0; intVal = 0;
} }
/// Sets this JSON::Value to the given integer.
JSON::Value::Value(long long int val){
myType = INTEGER;
intVal = val;
}
/// Sets this JSON::Value to the given integer. /// Sets this JSON::Value to the given integer.
JSON::Value::Value(uint32_t val){ JSON::Value::Value(uint32_t val){
myType = INTEGER; myType = INTEGER;
@ -654,14 +648,6 @@ JSON::Value &JSON::Value::operator=(const char *rhs){
return ((*this) = (std::string)rhs); return ((*this) = (std::string)rhs);
} }
/// Sets this JSON::Value to the given integer.
JSON::Value &JSON::Value::operator=(const long long int &rhs){
null();
myType = INTEGER;
intVal = rhs;
return *this;
}
/// Sets this JSON::Value to the given integer. /// Sets this JSON::Value to the given integer.
JSON::Value &JSON::Value::operator=(const int64_t &rhs){ JSON::Value &JSON::Value::operator=(const int64_t &rhs){
null(); null();

View file

@ -41,7 +41,6 @@ namespace JSON{
Value(std::istream &fromstream); Value(std::istream &fromstream);
Value(const std::string &val); Value(const std::string &val);
Value(const char *val); Value(const char *val);
Value(long long int val);
Value(int32_t val); Value(int32_t val);
Value(int64_t val); Value(int64_t val);
Value(uint32_t val); Value(uint32_t val);
@ -58,7 +57,6 @@ namespace JSON{
Value &operator=(const Value &rhs); Value &operator=(const Value &rhs);
Value &operator=(const std::string &rhs); Value &operator=(const std::string &rhs);
Value &operator=(const char *rhs); Value &operator=(const char *rhs);
Value &operator=(const long long int &rhs);
Value &operator=(const int64_t &rhs); Value &operator=(const int64_t &rhs);
Value &operator=(const int32_t &rhs); Value &operator=(const int32_t &rhs);
Value &operator=(const uint64_t &rhs); Value &operator=(const uint64_t &rhs);

View file

@ -62,7 +62,7 @@ int Analyser::run(Util::Config &conf){
void Analyser::init(Util::Config &conf){ void Analyser::init(Util::Config &conf){
JSON::Value opt; JSON::Value opt;
opt["arg_num"] = 1ll; opt["arg_num"] = 1;
opt["arg"] = "string"; opt["arg"] = "string";
opt["default"] = "-"; opt["default"] = "-";
opt["help"] = "Filename to analyse, or - for standard input (default)"; opt["help"] = "Filename to analyse, or - for standard input (default)";
@ -72,7 +72,7 @@ void Analyser::init(Util::Config &conf){
opt["long"] = "detail"; opt["long"] = "detail";
opt["short"] = "D"; opt["short"] = "D";
opt["arg"] = "num"; opt["arg"] = "num";
opt["default"] = 2ll; opt["default"] = 2;
opt["help"] = "Detail level for analysis (0 = none, 2 = default, 10 = max)"; opt["help"] = "Detail level for analysis (0 = none, 2 = default, 10 = max)";
conf.addOption("detail", opt); conf.addOption("detail", opt);
opt.null(); opt.null();

View file

@ -82,7 +82,7 @@ bool AnalyserDTSC::parsePacket(){
for (std::map<unsigned int, DTSC::Track>::iterator it = M.tracks.begin(); for (std::map<unsigned int, DTSC::Track>::iterator it = M.tracks.begin();
it != M.tracks.end(); it++){ it != M.tracks.end(); it++){
JSON::Value track; JSON::Value track;
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; track["codec"] = it->second.codec;
uint32_t shrtest_key = 0xFFFFFFFFul; uint32_t shrtest_key = 0xFFFFFFFFul;
uint32_t longest_key = 0; uint32_t longest_key = 0;
@ -106,12 +106,12 @@ bool AnalyserDTSC::parsePacket(){
} }
} }
} }
track["keys"]["ms_min"] = (long long)shrtest_key; track["keys"]["ms_min"] = shrtest_key;
track["keys"]["ms_max"] = (long long)longest_key; track["keys"]["ms_max"] = longest_key;
track["keys"]["frame_ms_min"] = (long long)shrtest_prt; track["keys"]["frame_ms_min"] = shrtest_prt;
track["keys"]["frame_ms_max"] = (long long)longest_prt; track["keys"]["frame_ms_max"] = longest_prt;
track["keys"]["frames_min"] = (long long)shrtest_cnt; track["keys"]["frames_min"] = shrtest_cnt;
track["keys"]["frames_max"] = (long long)longest_cnt; track["keys"]["frames_max"] = longest_cnt;
if (longest_prt > 500){ if (longest_prt > 500){
issues << "unstable connection (" << longest_prt << "ms " << it->second.codec issues << "unstable connection (" << longest_prt << "ms " << it->second.codec
<< " frame)! "; << " frame)! ";
@ -123,8 +123,8 @@ bool AnalyserDTSC::parsePacket(){
if (it->second.codec == "AAC"){hasAAC = true;} if (it->second.codec == "AAC"){hasAAC = true;}
if (it->second.codec == "H264"){hasH264 = true;} if (it->second.codec == "H264"){hasH264 = true;}
if (it->second.type == "video"){ if (it->second.type == "video"){
track["width"] = (long long)it->second.width; track["width"] = it->second.width;
track["height"] = (long long)it->second.height; track["height"] = it->second.height;
track["fpks"] = it->second.fpks; track["fpks"] = it->second.fpks;
if (it->second.codec == "H264"){ if (it->second.codec == "H264"){
h264::sequenceParameterSet sps; h264::sequenceParameterSet sps;

View file

@ -226,7 +226,7 @@ std::set<std::string> Controller::getActiveStreams(const std::string & prefix){
} }
/// Updates the given active connection with new stats data. /// Updates the given active connection with new stats data.
void Controller::statSession::update(unsigned long index, IPC::statExchange & data){ void Controller::statSession::update(uint64_t index, IPC::statExchange & data){
long long prevDown = getDown(); long long prevDown = getDown();
long long prevUp = getUp(); long long prevUp = getUp();
curConns[index].update(data); curConns[index].update(data);
@ -314,7 +314,7 @@ void Controller::statSession::wipeOld(uint64_t cutOff){
} }
} }
if (curConns.size()){ if (curConns.size()){
for (std::map<unsigned long, statStorage>::iterator it = curConns.begin(); it != curConns.end(); ++it){ for (std::map<uint64_t, statStorage>::iterator it = curConns.begin(); it != curConns.end(); ++it){
while (it->second.log.size() > 1 && it->second.log.begin()->first < cutOff){ while (it->second.log.size() > 1 && it->second.log.begin()->first < cutOff){
it->second.log.erase(it->second.log.begin()); it->second.log.erase(it->second.log.begin());
} }
@ -358,7 +358,7 @@ void Controller::statSession::ping(const Controller::sessIndex & index, uint64_t
} }
/// Archives the given connection. /// Archives the given connection.
void Controller::statSession::finish(unsigned long index){ void Controller::statSession::finish(uint64_t index){
oldConns.push_back(curConns[index]); oldConns.push_back(curConns[index]);
curConns.erase(index); curConns.erase(index);
} }
@ -375,7 +375,7 @@ Controller::statSession::statSession(){
} }
/// Moves the given connection to the given session /// Moves the given connection to the given session
void Controller::statSession::switchOverTo(statSession & newSess, unsigned long index){ void Controller::statSession::switchOverTo(statSession & newSess, uint64_t index){
//add to the given session first //add to the given session first
newSess.curConns[index] = curConns[index]; newSess.curConns[index] = curConns[index];
//if this connection has data, update firstSec/lastSec if needed //if this connection has data, update firstSec/lastSec if needed
@ -406,7 +406,7 @@ void Controller::statSession::switchOverTo(statSession & newSess, unsigned long
} }
} }
if (curConns.size()){ if (curConns.size()){
for (std::map<unsigned long, statStorage>::iterator it = curConns.begin(); it != curConns.end(); ++it){ for (std::map<uint64_t, statStorage>::iterator it = curConns.begin(); it != curConns.end(); ++it){
if (it->second.log.size()){ if (it->second.log.size()){
if (firstSec > it->second.log.begin()->first){ if (firstSec > it->second.log.begin()->first){
firstSec = it->second.log.begin()->first; firstSec = it->second.log.begin()->first;
@ -480,7 +480,7 @@ bool Controller::statSession::isViewer(){
} }
} }
if (curConns.size()){ if (curConns.size()){
for (std::map<unsigned long, statStorage>::iterator it = curConns.begin(); it != curConns.end(); ++it){ for (std::map<uint64_t, statStorage>::iterator it = curConns.begin(); it != curConns.end(); ++it){
if (it->second.log.size()){ if (it->second.log.size()){
upTotal += it->second.log.rbegin()->second.up + it->second.log.rbegin()->second.down; upTotal += it->second.log.rbegin()->second.up + it->second.log.rbegin()->second.down;
if (upTotal > COUNTABLE_BYTES){return true;} if (upTotal > COUNTABLE_BYTES){return true;}
@ -891,7 +891,7 @@ void Controller::fillClients(JSON::Value & req, JSON::Value & rep){
void Controller::fillActive(JSON::Value & req, JSON::Value & rep, bool onlyNow){ void Controller::fillActive(JSON::Value & req, JSON::Value & rep, bool onlyNow){
//collect the data first //collect the data first
std::set<std::string> streams; std::set<std::string> streams;
std::map<std::string, unsigned long> clients; std::map<std::string, uint64_t> clients;
unsigned int tOut = Util::epoch() - STATS_DELAY; unsigned int tOut = Util::epoch() - STATS_DELAY;
unsigned int tIn = Util::epoch() - STATS_INPUT_DELAY; unsigned int tIn = Util::epoch() - STATS_INPUT_DELAY;
//check all sessions //check all sessions
@ -934,7 +934,7 @@ void Controller::fillActive(JSON::Value & req, JSON::Value & rep, bool onlyNow){
IPC::semaphore metaLocker(liveSemName, O_CREAT | O_RDWR, (S_IRWXU|S_IRWXG|S_IRWXO), 1); IPC::semaphore metaLocker(liveSemName, O_CREAT | O_RDWR, (S_IRWXU|S_IRWXG|S_IRWXO), 1);
metaLocker.wait(); metaLocker.wait();
DTSC::Scan strm = DTSC::Packet(streamIndex.mapped, streamIndex.len, true).getScan(); DTSC::Scan strm = DTSC::Packet(streamIndex.mapped, streamIndex.len, true).getScan();
long long lms = 0; uint64_t lms = 0;
DTSC::Scan trcks = strm.getMember("tracks"); DTSC::Scan trcks = strm.getMember("tracks");
unsigned int trcks_ctr = trcks.getSize(); unsigned int trcks_ctr = trcks.getSize();
for (unsigned int i = 0; i < trcks_ctr; ++i){ for (unsigned int i = 0; i < trcks_ctr; ++i){

View file

@ -37,16 +37,16 @@ namespace Mist {
option["long"] = "json"; option["long"] = "json";
option["short"] = "j"; option["short"] = "j";
option["help"] = "Output MistIn info in JSON format, then exit"; option["help"] = "Output MistIn info in JSON format, then exit";
option["value"].append(0ll); option["value"].append(0);
config->addOption("json", option); config->addOption("json", option);
option.null(); option.null();
option["arg_num"] = 1ll; option["arg_num"] = 1;
option["arg"] = "string"; option["arg"] = "string";
option["help"] = "Name of the input file or - for stdin"; option["help"] = "Name of the input file or - for stdin";
option["value"].append("-"); option["value"].append("-");
config->addOption("input", option); config->addOption("input", option);
option.null(); option.null();
option["arg_num"] = 2ll; option["arg_num"] = 2;
option["arg"] = "string"; option["arg"] = "string";
option["help"] = "Name of the output file or - for stdout"; option["help"] = "Name of the output file or - for stdout";
option["value"].append("-"); option["value"].append("-");

View file

@ -26,19 +26,19 @@ namespace Mist {
option["long"] = "buffer"; option["long"] = "buffer";
option["short"] = "b"; option["short"] = "b";
option["help"] = "DVR buffer time in ms"; option["help"] = "DVR buffer time in ms";
option["value"].append(50000LL); option["value"].append(50000);
config->addOption("bufferTime", option); config->addOption("bufferTime", option);
capa["optional"]["DVR"]["name"] = "Buffer time (ms)"; 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"]["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"]["option"] = "--buffer";
capa["optional"]["DVR"]["type"] = "uint"; capa["optional"]["DVR"]["type"] = "uint";
capa["optional"]["DVR"]["default"] = 50000LL; capa["optional"]["DVR"]["default"] = 50000;
option["arg"] = "integer"; option["arg"] = "integer";
option["long"] = "resume"; option["long"] = "resume";
option["short"] = "R"; option["short"] = "R";
option["help"] = "Enable resuming support (1) or disable resuming support (0, default)"; option["help"] = "Enable resuming support (1) or disable resuming support (0, default)";
option["value"].append(0LL); option["value"].append(0);
config->addOption("resume", option); config->addOption("resume", option);
capa["optional"]["resume"]["name"] = "Resume support"; capa["optional"]["resume"]["name"] = "Resume support";
capa["optional"]["resume"]["help"] = "If enabled, the buffer will linger after source disconnect to allow resuming the stream later. If disabled, the buffer will instantly close on source disconnect."; capa["optional"]["resume"]["help"] = "If enabled, the buffer will linger after source disconnect to allow resuming the stream later. If disabled, the buffer will instantly close on source disconnect.";
@ -48,12 +48,12 @@ namespace Mist {
capa["optional"]["resume"]["select"][0u][1u] = "Disabled"; capa["optional"]["resume"]["select"][0u][1u] = "Disabled";
capa["optional"]["resume"]["select"][1u][0u] = "1"; capa["optional"]["resume"]["select"][1u][0u] = "1";
capa["optional"]["resume"]["select"][1u][1u] = "Enabled"; capa["optional"]["resume"]["select"][1u][1u] = "Enabled";
capa["optional"]["resume"]["default"] = 0LL; capa["optional"]["resume"]["default"] = 0;
option.null(); option.null();
capa["source_match"] = "push://*"; capa["source_match"] = "push://*";
capa["non-provider"] = true;//Indicates we don't provide data, only collect it capa["non-provider"] = true;//Indicates we don't provide data, only collect it
capa["priority"] = 9ll; capa["priority"] = 9;
capa["desc"] = "This input type is both used for push- and pull-based streams. It provides a buffer for live media data. The push://[host][@password] style source allows all enabled protocols that support push input to accept a push into MistServer, where you can accept incoming streams from everyone, based on a set password, and/or use hostname/IP whitelisting."; capa["desc"] = "This input type is both used for push- and pull-based streams. It provides a buffer for live media data. The push://[host][@password] style source allows all enabled protocols that support push input to accept a push into MistServer, where you can accept incoming streams from everyone, based on a set password, and/or use hostname/IP whitelisting.";
capa["codecs"][0u][0u].append("*"); capa["codecs"][0u][0u].append("*");
capa["codecs"][0u][1u].append("*"); capa["codecs"][0u][1u].append("*");
@ -206,7 +206,7 @@ namespace Mist {
nProxy.metaPages[0].master = false; nProxy.metaPages[0].master = false;
} }
myMeta.writeTo(nProxy.metaPages[0].mapped); myMeta.writeTo(nProxy.metaPages[0].mapped);
memset(nProxy.metaPages[0].mapped + myMeta.getSendLen(), 0, (nProxy.metaPages[0].len > myMeta.getSendLen() ? std::min(nProxy.metaPages[0].len - myMeta.getSendLen(), 4ll) : 0)); memset(nProxy.metaPages[0].mapped + myMeta.getSendLen(), 0, (nProxy.metaPages[0].len > myMeta.getSendLen() ? std::min((size_t)(nProxy.metaPages[0].len - myMeta.getSendLen()), (size_t)4) : 0));
liveMeta->post(); liveMeta->post();
} }

View file

@ -16,7 +16,7 @@ namespace Mist {
inputDTSC::inputDTSC(Util::Config * cfg) : Input(cfg) { inputDTSC::inputDTSC(Util::Config * cfg) : Input(cfg) {
capa["name"] = "DTSC"; capa["name"] = "DTSC";
capa["desc"] = "Load DTSC files as Video on Demand sources, or dtsc:// URLs from other MistServer instances for live sources. This is the optimal method to pull live sources from other MistServer (or compatible) instances."; capa["desc"] = "Load DTSC files as Video on Demand sources, or dtsc:// URLs from other MistServer instances for live sources. This is the optimal method to pull live sources from other MistServer (or compatible) instances.";
capa["priority"] = 9ll; capa["priority"] = 9;
capa["source_match"].append("/*.dtsc"); capa["source_match"].append("/*.dtsc");
capa["source_match"].append("dtsc://*"); capa["source_match"].append("dtsc://*");
capa["codecs"][0u][0u].append("H264"); capa["codecs"][0u][0u].append("H264");
@ -33,13 +33,13 @@ namespace Mist {
option["long"] = "buffer"; option["long"] = "buffer";
option["short"] = "b"; option["short"] = "b";
option["help"] = "Live stream DVR buffer time in ms"; option["help"] = "Live stream DVR buffer time in ms";
option["value"].append(50000LL); option["value"].append(50000);
config->addOption("bufferTime", option); config->addOption("bufferTime", option);
capa["optional"]["DVR"]["name"] = "Buffer time (ms)"; 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"]["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"]["option"] = "--buffer";
capa["optional"]["DVR"]["type"] = "uint"; capa["optional"]["DVR"]["type"] = "uint";
capa["optional"]["DVR"]["default"] = 50000LL; capa["optional"]["DVR"]["default"] = 50000;
} }
bool inputDTSC::needsLock(){ bool inputDTSC::needsLock(){

View file

@ -17,7 +17,7 @@ namespace Mist{
capa["source_match"].append("/*.mk3d"); capa["source_match"].append("/*.mk3d");
capa["source_match"].append("/*.mks"); capa["source_match"].append("/*.mks");
capa["source_match"].append("/*.webm"); capa["source_match"].append("/*.webm");
capa["priority"] = 9ll; capa["priority"] = 9;
capa["codecs"].append("H264"); capa["codecs"].append("H264");
capa["codecs"].append("HEVC"); capa["codecs"].append("HEVC");
capa["codecs"].append("VP8"); capa["codecs"].append("VP8");
@ -341,7 +341,7 @@ namespace Mist{
} }
if (E.getID() == EBML::EID_TIMECODESCALE){ if (E.getID() == EBML::EID_TIMECODESCALE){
uint64_t timeScaleVal = E.getValUInt(); uint64_t timeScaleVal = E.getValUInt();
myMeta.inputLocalVars["timescale"] = (long long)timeScaleVal; myMeta.inputLocalVars["timescale"] = timeScaleVal;
timeScale = ((double)timeScaleVal) / 1000000.0; timeScale = ((double)timeScaleVal) / 1000000.0;
} }
//Live streams stop parsing the header as soon as the first Cluster is encountered //Live streams stop parsing the header as soon as the first Cluster is encountered
@ -413,7 +413,7 @@ namespace Mist{
} }
} }
myMeta.inputLocalVars["maxframeoffset"] = (long long)maxEBMLFrameOffset; myMeta.inputLocalVars["maxframeoffset"] = maxEBMLFrameOffset;
bench = Util::getMicros(bench); bench = Util::getMicros(bench);
INFO_MSG("Header generated in %llu ms", bench / 1000); INFO_MSG("Header generated in %llu ms", bench / 1000);

View file

@ -19,7 +19,7 @@ namespace Mist {
capa["name"] = "FLV"; capa["name"] = "FLV";
capa["desc"] = "Allows loading FLV files for Video on Demand."; capa["desc"] = "Allows loading FLV files for Video on Demand.";
capa["source_match"] = "/*.flv"; capa["source_match"] = "/*.flv";
capa["priority"] = 9ll; capa["priority"] = 9;
capa["codecs"][0u][0u].append("H264"); capa["codecs"][0u][0u].append("H264");
capa["codecs"][0u][0u].append("H263"); capa["codecs"][0u][0u].append("H263");
capa["codecs"][0u][0u].append("VP6"); capa["codecs"][0u][0u].append("VP6");

View file

@ -9,7 +9,7 @@ namespace Mist{
capa["source_match"] = "h264-exec:*"; capa["source_match"] = "h264-exec:*";
//May be set to always-on mode //May be set to always-on mode
capa["always_match"].append("h264-exec:*"); capa["always_match"].append("h264-exec:*");
capa["priority"] = 0ll; capa["priority"] = 0;
capa["codecs"][0u][0u].append("H264"); capa["codecs"][0u][0u].append("H264");
frameCount = 0; frameCount = 0;
startTime = Util::bootMS(); startTime = Util::bootMS();

View file

@ -16,7 +16,7 @@ namespace Mist {
capa["name"] = "MP3"; capa["name"] = "MP3";
capa["desc"] = "This input allows you to stream MP3 Video on Demand files."; capa["desc"] = "This input allows you to stream MP3 Video on Demand files.";
capa["source_match"] = "/*.mp3"; capa["source_match"] = "/*.mp3";
capa["priority"] = 9ll; capa["priority"] = 9;
capa["codecs"][0u][0u].append("MP3"); capa["codecs"][0u][0u].append("MP3");
timestamp = 0; timestamp = 0;
} }
@ -155,9 +155,9 @@ namespace Mist {
static JSON::Value thisPack; static JSON::Value thisPack;
thisPack.null(); thisPack.null();
thisPack["trackid"] = 1; thisPack["trackid"] = 1;
thisPack["bpos"] = (long long)filePos; thisPack["bpos"] = (uint64_t)filePos;
thisPack["data"] = std::string(packHeader, dataSize); thisPack["data"] = std::string(packHeader, dataSize);
thisPack["time"] = (long long)timestamp; thisPack["time"] = timestamp;
//Write the json value to lastpack //Write the json value to lastpack
std::string tmpStr = thisPack.toNetPacked(); std::string tmpStr = thisPack.toNetPacked();
thisPacket.reInit(tmpStr.data(), tmpStr.size()); thisPacket.reInit(tmpStr.data(), tmpStr.size());

View file

@ -18,20 +18,20 @@ namespace Mist {
JSON::Value segment::toJSON(OGG::oggCodec myCodec){ JSON::Value segment::toJSON(OGG::oggCodec myCodec){
JSON::Value retval; JSON::Value retval;
retval["time"] = (long long int)time; retval["time"] = time;
retval["trackid"] = (long long int)tid; retval["trackid"] = tid;
std::string tmpString = ""; std::string tmpString = "";
for (unsigned int i = 0; i < parts.size(); i++){ for (unsigned int i = 0; i < parts.size(); i++){
tmpString += parts[i]; tmpString += parts[i];
} }
retval["data"] = tmpString; retval["data"] = tmpString;
// INFO_MSG("Setting bpos for packet on track %llu, time %llu, to %llu", tid, time, bytepos); // INFO_MSG("Setting bpos for packet on track %llu, time %llu, to %llu", tid, time, bytepos);
retval["bpos"] = (long long int)bytepos; retval["bpos"] = bytepos;
if (myCodec == OGG::THEORA){ if (myCodec == OGG::THEORA){
if (!theora::isHeader(tmpString.data(), tmpString.size())){ if (!theora::isHeader(tmpString.data(), tmpString.size())){
theora::header tmpHeader((char*)tmpString.data(), tmpString.size()); theora::header tmpHeader((char*)tmpString.data(), tmpString.size());
if (tmpHeader.getFTYPE() == 0){ if (tmpHeader.getFTYPE() == 0){
retval["keyframe"] = 1LL; retval["keyframe"] = 1;
} }
} }
} }
@ -433,7 +433,7 @@ namespace Mist {
} }
} }
INFO_MSG("Found %dms for track %lu at %llu bytepos %llu", seekTime, *it, tmpPos.time, tmpPos.bytepos); INFO_MSG("Found %dms for track %lu at %llu bytepos %llu", seekTime, *it, tmpPos.time, tmpPos.bytepos);
int backChrs=std::min(280ull, tmpPos.bytepos - 1); int backChrs=std::min((uint64_t)280, tmpPos.bytepos - 1);
fseek(inFile, tmpPos.bytepos - backChrs, SEEK_SET); fseek(inFile, tmpPos.bytepos - backChrs, SEEK_SET);
char buffer[300]; char buffer[300];
fread(buffer, 300, 1, inFile); fread(buffer, 300, 1, inFile);

View file

@ -16,9 +16,9 @@ namespace Mist {
return time < rhs.time || (time == rhs.time && tid < rhs.tid); return time < rhs.time || (time == rhs.time && tid < rhs.tid);
} }
std::vector<std::string> parts; std::vector<std::string> parts;
unsigned long long int time; uint64_t time;
unsigned long long int tid; uint64_t tid;
long long unsigned int bytepos; uint64_t bytepos;
bool keyframe; bool keyframe;
JSON::Value toJSON(OGG::oggCodec myCodec); JSON::Value toJSON(OGG::oggCodec myCodec);
}; };
@ -36,10 +36,10 @@ namespace Mist {
} }
return false; return false;
} }
long unsigned int trackID; uint64_t trackID;
long long unsigned int time; uint64_t time;
long long unsigned int bytepos; uint64_t bytepos;
long long unsigned int segmentNo; uint64_t segmentNo;
}; };
/* /*
class oggTrack { class oggTrack {

View file

@ -36,7 +36,7 @@ namespace Mist{
option["long"] = "noinput"; option["long"] = "noinput";
option["short"] = "N"; option["short"] = "N";
option["help"] = "Do not start input if not already started"; option["help"] = "Do not start input if not already started";
option["value"].append(0ll); option["value"].append(0);
cfg->addOption("noinput", option); cfg->addOption("noinput", option);
} }

View file

@ -44,7 +44,7 @@ namespace Mist{
capa["codecs"][0u][2u].append("+JSON"); capa["codecs"][0u][2u].append("+JSON");
capa["methods"][0u]["handler"] = "http"; capa["methods"][0u]["handler"] = "http";
capa["methods"][0u]["type"] = "html5/video/webm"; capa["methods"][0u]["type"] = "html5/video/webm";
capa["methods"][0u]["priority"] = 11ll; capa["methods"][0u]["priority"] = 11;
//EBML will only work with VP8/VP9/Opus except on Chrome //EBML will only work with VP8/VP9/Opus except on Chrome
JSON::Value blacklistNonChrome = JSON::fromString("[[\"blacklist\"], [\"whitelist\",[\"Chrome\",\"Chromium\"]], [\"blacklist\",[\"Edge\",\"OPR/\"]]]"); JSON::Value blacklistNonChrome = JSON::fromString("[[\"blacklist\"], [\"whitelist\",[\"Chrome\",\"Chromium\"]], [\"blacklist\",[\"Edge\",\"OPR/\"]]]");
capa["exceptions"]["codec:H264"] = blacklistNonChrome; capa["exceptions"]["codec:H264"] = blacklistNonChrome;

View file

@ -161,7 +161,7 @@ namespace Mist {
capa["codecs"][0u][1u].append("ULAW"); capa["codecs"][0u][1u].append("ULAW");
capa["methods"][0u]["handler"] = "http"; capa["methods"][0u]["handler"] = "http";
capa["methods"][0u]["type"] = "flash/11"; capa["methods"][0u]["type"] = "flash/11";
capa["methods"][0u]["priority"] = 6ll; capa["methods"][0u]["priority"] = 6;
capa["methods"][0u]["player_url"] = "/flashplayer.swf"; capa["methods"][0u]["player_url"] = "/flashplayer.swf";
} }

View file

@ -161,7 +161,7 @@ namespace Mist {
capa["codecs"][0u][1u].append("MP3"); capa["codecs"][0u][1u].append("MP3");
capa["methods"][0u]["handler"] = "http"; capa["methods"][0u]["handler"] = "http";
capa["methods"][0u]["type"] = "html5/application/vnd.apple.mpegurl"; capa["methods"][0u]["type"] = "html5/application/vnd.apple.mpegurl";
capa["methods"][0u]["priority"] = 9ll; capa["methods"][0u]["priority"] = 9;
//MP3 only works on Edge/Apple //MP3 only works on Edge/Apple
capa["exceptions"]["codec:MP3"] = JSON::fromString("[[\"blacklist\"],[\"whitelist\",[\"iPad\",\"iPhone\",\"iPod\",\"MacIntel\",\"Edge\"]]]"); capa["exceptions"]["codec:MP3"] = JSON::fromString("[[\"blacklist\"],[\"whitelist\",[\"iPad\",\"iPhone\",\"iPod\",\"MacIntel\",\"Edge\"]]]");
} }

View file

@ -57,7 +57,7 @@ namespace Mist {
capa["codecs"][0u][1u].append("AAC"); capa["codecs"][0u][1u].append("AAC");
capa["methods"][0u]["handler"] = "http"; capa["methods"][0u]["handler"] = "http";
capa["methods"][0u]["type"] = "silverlight"; capa["methods"][0u]["type"] = "silverlight";
capa["methods"][0u]["priority"] = 1ll; capa["methods"][0u]["priority"] = 1;
} }
void OutHSS::sendNext() { void OutHSS::sendNext() {

View file

@ -226,7 +226,7 @@ namespace Mist {
std::string ua = H.GetVar("sessId"); std::string ua = H.GetVar("sessId");
crc = checksum::crc32(0, ua.data(), ua.size()); crc = checksum::crc32(0, ua.data(), ua.size());
}else{ }else{
std::string ua = JSON::Value((long long)getpid()).asString(); std::string ua = JSON::Value(getpid()).asString();
crc = checksum::crc32(0, ua.data(), ua.size()); crc = checksum::crc32(0, ua.data(), ua.size());
} }
}else{ }else{
@ -339,7 +339,7 @@ namespace Mist {
int argnum = 0; int argnum = 0;
argarr[argnum++] = (char*)tmparg.c_str(); argarr[argnum++] = (char*)tmparg.c_str();
std::string temphost=getConnectedHost(); std::string temphost=getConnectedHost();
std::string debuglevel = JSON::Value((long long)Util::Config::printDebugLevel).asString(); std::string debuglevel = JSON::Value(Util::Config::printDebugLevel).asString();
argarr[argnum++] = (char*)"--ip"; argarr[argnum++] = (char*)"--ip";
argarr[argnum++] = (char*)(temphost.c_str()); argarr[argnum++] = (char*)(temphost.c_str());
argarr[argnum++] = (char*)"--stream"; argarr[argnum++] = (char*)"--stream";

View file

@ -366,9 +366,9 @@ namespace Mist {
} }
} }
if (json_resp["width"].asInt() < 1 || json_resp["height"].asInt() < 1){ if (json_resp["width"].asInt() < 1 || json_resp["height"].asInt() < 1){
json_resp["width"] = 640ll; json_resp["width"] = 640;
json_resp["height"] = 480ll; json_resp["height"] = 480;
if (!hasVideo){json_resp["height"] = 20ll;} if (!hasVideo){json_resp["height"] = 20;}
} }
if (myMeta.vod){ if (myMeta.vod){
json_resp["type"] = "vod"; json_resp["type"] = "vod";
@ -551,7 +551,7 @@ namespace Mist {
if (!myConn){return;} if (!myConn){return;}
for (std::map<unsigned int, DTSC::Track>::iterator trit = myMeta.tracks.begin(); trit != myMeta.tracks.end(); trit++){ for (std::map<unsigned int, DTSC::Track>::iterator trit = myMeta.tracks.begin(); trit != myMeta.tracks.end(); trit++){
if (trit->second.type == "video"){ if (trit->second.type == "video"){
trackSources += " <video src='"+ streamName + "?track=" + JSON::Value((long long)trit->first).asString() + "' height='" + JSON::Value((long long)trit->second.height).asString() + "' system-bitrate='" + JSON::Value((long long)trit->second.bps).asString() + "' width='" + JSON::Value((long long)trit->second.width).asString() + "' />\n"; trackSources += " <video src='"+ streamName + "?track=" + JSON::Value(trit->first).asString() + "' height='" + JSON::Value(trit->second.height).asString() + "' system-bitrate='" + JSON::Value(trit->second.bps).asString() + "' width='" + JSON::Value(trit->second.width).asString() + "' />\n";
} }
} }
} }

View file

@ -24,7 +24,7 @@ namespace Mist {
capa["codecs"][0u][1u].append("MP3"); capa["codecs"][0u][1u].append("MP3");
capa["methods"][0u]["handler"] = "http"; capa["methods"][0u]["handler"] = "http";
capa["methods"][0u]["type"] = "html5/video/mpeg"; capa["methods"][0u]["type"] = "html5/video/mpeg";
capa["methods"][0u]["priority"] = 1ll; capa["methods"][0u]["priority"] = 1;
} }
void OutHTTPTS::onHTTP(){ void OutHTTPTS::onHTTP(){

View file

@ -20,11 +20,11 @@ namespace Mist {
capa["codecs"][0u][0u].append("@+meta"); capa["codecs"][0u][0u].append("@+meta");
capa["methods"][0u]["handler"] = "http"; capa["methods"][0u]["handler"] = "http";
capa["methods"][0u]["type"] = "html5/text/javascript"; capa["methods"][0u]["type"] = "html5/text/javascript";
capa["methods"][0u]["priority"] = 0ll; capa["methods"][0u]["priority"] = 0;
capa["methods"][0u]["url_rel"] = "/$.json"; capa["methods"][0u]["url_rel"] = "/$.json";
capa["methods"][1u]["handler"] = "ws"; capa["methods"][1u]["handler"] = "ws";
capa["methods"][1u]["type"] = "html5/text/javascript"; capa["methods"][1u]["type"] = "html5/text/javascript";
capa["methods"][1u]["priority"] = 0ll; capa["methods"][1u]["priority"] = 0;
capa["methods"][1u]["url_rel"] = "/$.json"; capa["methods"][1u]["url_rel"] = "/$.json";
} }
@ -41,8 +41,8 @@ namespace Mist {
size_t dLen; size_t dLen;
thisPacket.getString("data", dPtr, dLen); thisPacket.getString("data", dPtr, dLen);
jPack["data"] = JSON::fromString(dPtr, dLen); jPack["data"] = JSON::fromString(dPtr, dLen);
jPack["time"] = (long long)thisPacket.getTime(); jPack["time"] = thisPacket.getTime();
jPack["track"] = (long long)thisPacket.getTrackId(); jPack["track"] = (uint64_t)thisPacket.getTrackId();
}else{ }else{
jPack = thisPacket.toJSON(); jPack = thisPacket.toJSON();
} }

View file

@ -27,7 +27,7 @@ namespace Mist {
capa["codecs"][0u][1u].append("ULAW"); capa["codecs"][0u][1u].append("ULAW");
capa["methods"][0u]["handler"] = "http"; capa["methods"][0u]["handler"] = "http";
capa["methods"][0u]["type"] = "flash/7"; capa["methods"][0u]["type"] = "flash/7";
capa["methods"][0u]["priority"] = 5ll; capa["methods"][0u]["priority"] = 5;
capa["methods"][0u]["player_url"] = "/oldflashplayer.swf"; capa["methods"][0u]["player_url"] = "/oldflashplayer.swf";
} }

View file

@ -13,7 +13,7 @@ namespace Mist {
capa["codecs"][0u][0u].append("MP3"); capa["codecs"][0u][0u].append("MP3");
capa["methods"][0u]["handler"] = "http"; capa["methods"][0u]["handler"] = "http";
capa["methods"][0u]["type"] = "html5/audio/mp3"; capa["methods"][0u]["type"] = "html5/audio/mp3";
capa["methods"][0u]["priority"] = 8ll; capa["methods"][0u]["priority"] = 8;
} }
void OutProgressiveMP3::sendNext(){ void OutProgressiveMP3::sendNext(){

View file

@ -24,7 +24,7 @@ namespace Mist {
capa["codecs"][0u][1u].append("MP3"); capa["codecs"][0u][1u].append("MP3");
capa["methods"][0u]["handler"] = "http"; capa["methods"][0u]["handler"] = "http";
capa["methods"][0u]["type"] = "html5/video/mp4"; capa["methods"][0u]["type"] = "html5/video/mp4";
capa["methods"][0u]["priority"] = 10ll; capa["methods"][0u]["priority"] = 10;
capa["methods"][0u]["nolive"] = 1; capa["methods"][0u]["nolive"] = 1;
} }
uint64_t OutProgressiveMP4::estimateFileSize() { uint64_t OutProgressiveMP4::estimateFileSize() {

View file

@ -23,7 +23,7 @@ namespace Mist {
capa["codecs"][0u][1u].append("opus"); capa["codecs"][0u][1u].append("opus");
capa["methods"][0u]["handler"] = "http"; capa["methods"][0u]["handler"] = "http";
capa["methods"][0u]["type"] = "html5/video/ogg"; capa["methods"][0u]["type"] = "html5/video/ogg";
capa["methods"][0u]["priority"] = 8ll; capa["methods"][0u]["priority"] = 8;
capa["methods"][0u]["nolive"] = 1; capa["methods"][0u]["nolive"] = 1;
} }

View file

@ -95,7 +95,7 @@ namespace Mist {
capa["codecs"][0u][1u].append("ULAW"); capa["codecs"][0u][1u].append("ULAW");
capa["methods"][0u]["handler"] = "rtmp"; capa["methods"][0u]["handler"] = "rtmp";
capa["methods"][0u]["type"] = "flash/10"; capa["methods"][0u]["type"] = "flash/10";
capa["methods"][0u]["priority"] = 7ll; capa["methods"][0u]["priority"] = 7;
capa["methods"][0u]["player_url"] = "/flashplayer.swf"; capa["methods"][0u]["player_url"] = "/flashplayer.swf";
cfg->addConnectorOptions(1935, capa); cfg->addConnectorOptions(1935, capa);
config = cfg; config = cfg;

View file

@ -19,11 +19,11 @@ namespace Mist {
capa["codecs"][0u][0u].append("TTXT"); capa["codecs"][0u][0u].append("TTXT");
capa["methods"][0u]["handler"] = "http"; capa["methods"][0u]["handler"] = "http";
capa["methods"][0u]["type"] = "html5/text/plain"; capa["methods"][0u]["type"] = "html5/text/plain";
capa["methods"][0u]["priority"] = 8ll; capa["methods"][0u]["priority"] = 8;
capa["methods"][0u]["url_rel"] = "/$.srt"; capa["methods"][0u]["url_rel"] = "/$.srt";
capa["methods"][1u]["handler"] = "http"; capa["methods"][1u]["handler"] = "http";
capa["methods"][1u]["type"] = "html5/text/vtt"; capa["methods"][1u]["type"] = "html5/text/vtt";
capa["methods"][1u]["priority"] = 9ll; capa["methods"][1u]["priority"] = 9;
capa["methods"][1u]["url_rel"] = "/$.vtt"; capa["methods"][1u]["url_rel"] = "/$.vtt";
} }

View file

@ -14,7 +14,7 @@ int main(int argc, char **argv){
Util::redirectLogsIfNeeded(); Util::redirectLogsIfNeeded();
Util::Config conf(argv[0]); Util::Config conf(argv[0]);
JSON::Value opt; JSON::Value opt;
opt["arg_num"] = 1ll; opt["arg_num"] = 1;
opt["arg"] = "string"; opt["arg"] = "string";
opt["default"] = "-"; opt["default"] = "-";
opt["help"] = "Filename to analyse, or - for standard input (default)"; opt["help"] = "Filename to analyse, or - for standard input (default)";