Merge branch 'development' into LTS_development
# Conflicts: # src/controller/controller_statistics.cpp # src/input/input_buffer.cpp # src/input/input_dtsc.cpp # src/input/input_ebml.cpp # src/input/input_flv.cpp # src/input/input_mp3.cpp # src/output/output_httpts.cpp # src/output/output_progressive_mp3.cpp # src/output/output_progressive_mp4.cpp
This commit is contained in:
commit
9e1539a2b9
32 changed files with 95 additions and 111 deletions
|
@ -334,8 +334,8 @@ namespace DTSC {
|
|||
std::string getIdentifier();
|
||||
std::string getWritableIdentifier();
|
||||
unsigned int trackID;
|
||||
unsigned long long firstms;
|
||||
unsigned long long lastms;
|
||||
uint64_t firstms;
|
||||
uint64_t lastms;
|
||||
int bps;
|
||||
int max_bps;
|
||||
int missedFrags;
|
||||
|
@ -393,8 +393,8 @@ namespace DTSC {
|
|||
bool live;
|
||||
bool merged;
|
||||
uint16_t version;
|
||||
long long int moreheader;
|
||||
long long int bufferWindow;
|
||||
int64_t moreheader;
|
||||
int64_t bufferWindow;
|
||||
int64_t bootMsOffset;///< Millis to add to packet timestamps to get millis since system boot.
|
||||
std::string sourceURI;
|
||||
JSON::Value inputLocalVars;
|
||||
|
|
|
@ -502,7 +502,7 @@ namespace DTSC {
|
|||
|
||||
///\brief Returns the size of this packet.
|
||||
///\return The size of this packet.
|
||||
uint64_t Packet::getDataLen() const {
|
||||
size_t Packet::getDataLen() const {
|
||||
return dataLen;
|
||||
}
|
||||
|
||||
|
@ -2125,8 +2125,8 @@ namespace DTSC {
|
|||
result["lang"] = lang;
|
||||
}
|
||||
result["trackid"] = trackID;
|
||||
result["firstms"] = (long long)firstms;
|
||||
result["lastms"] = (long long)lastms;
|
||||
result["firstms"] = firstms;
|
||||
result["lastms"] = lastms;
|
||||
result["bps"] = bps;
|
||||
result["maxbps"] = max_bps;
|
||||
if (missedFrags) {
|
||||
|
@ -2158,22 +2158,22 @@ namespace DTSC {
|
|||
result["tracks"][it->second.getWritableIdentifier()] = it->second.toJSON();
|
||||
}
|
||||
if (vod) {
|
||||
result["vod"] = 1ll;
|
||||
result["vod"] = 1;
|
||||
}
|
||||
if (live) {
|
||||
result["live"] = 1ll;
|
||||
result["live"] = 1;
|
||||
}
|
||||
if (merged) {
|
||||
result["merged"] = 1ll;
|
||||
result["merged"] = 1;
|
||||
}
|
||||
if (bufferWindow) {
|
||||
result["buffer_window"] = bufferWindow;
|
||||
}
|
||||
if (version) {
|
||||
result["version"] = (long long)version;
|
||||
result["version"] = version;
|
||||
}
|
||||
if (bootMsOffset){
|
||||
result["bootoffset"] = (long long)bootMsOffset;
|
||||
result["bootoffset"] = bootMsOffset;
|
||||
}
|
||||
if (sourceURI.size()){
|
||||
result["source"] = sourceURI;
|
||||
|
|
14
lib/json.cpp
14
lib/json.cpp
|
@ -469,12 +469,6 @@ JSON::Value::Value(const char *val){
|
|||
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.
|
||||
JSON::Value::Value(uint32_t val){
|
||||
myType = INTEGER;
|
||||
|
@ -654,14 +648,6 @@ JSON::Value &JSON::Value::operator=(const char *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.
|
||||
JSON::Value &JSON::Value::operator=(const int64_t &rhs){
|
||||
null();
|
||||
|
|
|
@ -41,7 +41,6 @@ namespace JSON{
|
|||
Value(std::istream &fromstream);
|
||||
Value(const std::string &val);
|
||||
Value(const char *val);
|
||||
Value(long long int val);
|
||||
Value(int32_t val);
|
||||
Value(int64_t val);
|
||||
Value(uint32_t val);
|
||||
|
@ -58,7 +57,6 @@ namespace JSON{
|
|||
Value &operator=(const Value &rhs);
|
||||
Value &operator=(const std::string &rhs);
|
||||
Value &operator=(const char *rhs);
|
||||
Value &operator=(const long long int &rhs);
|
||||
Value &operator=(const int64_t &rhs);
|
||||
Value &operator=(const int32_t &rhs);
|
||||
Value &operator=(const uint64_t &rhs);
|
||||
|
|
|
@ -93,7 +93,7 @@ int Analyser::run(Util::Config &conf){
|
|||
void Analyser::init(Util::Config &conf){
|
||||
JSON::Value opt;
|
||||
|
||||
opt["arg_num"] = 1ll;
|
||||
opt["arg_num"] = 1;
|
||||
opt["arg"] = "string";
|
||||
opt["default"] = "-";
|
||||
opt["help"] = "Filename to analyse, or - for standard input (default)";
|
||||
|
@ -117,7 +117,7 @@ void Analyser::init(Util::Config &conf){
|
|||
opt["long"] = "detail";
|
||||
opt["short"] = "D";
|
||||
opt["arg"] = "num";
|
||||
opt["default"] = 2ll;
|
||||
opt["default"] = 2;
|
||||
opt["help"] = "Detail level for analysis (0 = none, 2 = default, 10 = max)";
|
||||
conf.addOption("detail", opt);
|
||||
opt.null();
|
||||
|
|
|
@ -82,7 +82,7 @@ bool AnalyserDTSC::parsePacket(){
|
|||
for (std::map<unsigned int, DTSC::Track>::iterator it = M.tracks.begin();
|
||||
it != M.tracks.end(); it++){
|
||||
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;
|
||||
uint32_t shrtest_key = 0xFFFFFFFFul;
|
||||
uint32_t longest_key = 0;
|
||||
|
@ -106,12 +106,12 @@ bool AnalyserDTSC::parsePacket(){
|
|||
}
|
||||
}
|
||||
}
|
||||
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)! ";
|
||||
|
@ -123,8 +123,8 @@ bool AnalyserDTSC::parsePacket(){
|
|||
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;
|
||||
if (it->second.codec == "H264"){
|
||||
h264::sequenceParameterSet sps;
|
||||
|
|
|
@ -515,7 +515,7 @@ uint32_t Controller::statSession::kill(){
|
|||
}
|
||||
|
||||
/// 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){
|
||||
//update the sync byte: 0 = requesting fill, 2 = requesting refill, 1 = needs checking, > 2 = state known (100=denied, 10=accepted)
|
||||
if (!data.getSync()){
|
||||
sessIndex tmpidx(data);
|
||||
|
@ -665,7 +665,7 @@ void Controller::statSession::wipeOld(uint64_t cutOff){
|
|||
}
|
||||
}
|
||||
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){
|
||||
it->second.log.erase(it->second.log.begin());
|
||||
}
|
||||
|
@ -747,7 +747,7 @@ void Controller::statSession::ping(const Controller::sessIndex & index, uint64_t
|
|||
}
|
||||
|
||||
/// Archives the given connection.
|
||||
void Controller::statSession::finish(unsigned long index){
|
||||
void Controller::statSession::finish(uint64_t index){
|
||||
oldConns.push_back(curConns[index]);
|
||||
curConns.erase(index);
|
||||
}
|
||||
|
@ -766,7 +766,7 @@ Controller::statSession::statSession(){
|
|||
}
|
||||
|
||||
/// 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
|
||||
newSess.curConns[index] = curConns[index];
|
||||
//if this connection has data, update firstSec/lastSec if needed
|
||||
|
@ -797,7 +797,7 @@ void Controller::statSession::switchOverTo(statSession & newSess, unsigned long
|
|||
}
|
||||
}
|
||||
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 (firstSec > it->second.log.begin()->first){
|
||||
firstSec = it->second.log.begin()->first;
|
||||
|
@ -871,7 +871,7 @@ bool Controller::statSession::isViewer(){
|
|||
}
|
||||
}
|
||||
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()){
|
||||
upTotal += it->second.log.rbegin()->second.up + it->second.log.rbegin()->second.down;
|
||||
if (upTotal > COUNTABLE_BYTES){return true;}
|
||||
|
@ -1282,7 +1282,7 @@ void Controller::fillClients(JSON::Value & req, JSON::Value & rep){
|
|||
void Controller::fillActive(JSON::Value & req, JSON::Value & rep, bool onlyNow){
|
||||
//collect the data first
|
||||
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 tIn = Util::epoch() - STATS_INPUT_DELAY;
|
||||
//check all sessions
|
||||
|
@ -1325,7 +1325,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);
|
||||
metaLocker.wait();
|
||||
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");
|
||||
unsigned int trcks_ctr = trcks.getSize();
|
||||
for (unsigned int i = 0; i < trcks_ctr; ++i){
|
||||
|
|
|
@ -38,16 +38,16 @@ namespace Mist {
|
|||
option["long"] = "json";
|
||||
option["short"] = "j";
|
||||
option["help"] = "Output MistIn info in JSON format, then exit";
|
||||
option["value"].append(0ll);
|
||||
option["value"].append(0);
|
||||
config->addOption("json", option);
|
||||
option.null();
|
||||
option["arg_num"] = 1ll;
|
||||
option["arg_num"] = 1;
|
||||
option["arg"] = "string";
|
||||
option["help"] = "Name of the input file or - for stdin";
|
||||
option["value"].append("-");
|
||||
config->addOption("input", option);
|
||||
option.null();
|
||||
option["arg_num"] = 2ll;
|
||||
option["arg_num"] = 2;
|
||||
option["arg"] = "string";
|
||||
option["help"] = "Name of the output file or - for stdout";
|
||||
option["value"].append("-");
|
||||
|
|
|
@ -32,33 +32,33 @@ 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;
|
||||
/*LTS-start*/
|
||||
option.null();
|
||||
option["arg"] = "integer";
|
||||
option["long"] = "cut";
|
||||
option["short"] = "c";
|
||||
option["help"] = "Any timestamps before this will be cut from the live buffer";
|
||||
option["value"].append(0LL);
|
||||
option["value"].append(0);
|
||||
config->addOption("cut", option);
|
||||
capa["optional"]["cut"]["name"] = "Cut time (ms)";
|
||||
capa["optional"]["cut"]["help"] = "Any timestamps before this will be cut from the live buffer.";
|
||||
capa["optional"]["cut"]["option"] = "--cut";
|
||||
capa["optional"]["cut"]["type"] = "uint";
|
||||
capa["optional"]["cut"]["default"] = 0LL;
|
||||
capa["optional"]["cut"]["default"] = 0;
|
||||
option.null();
|
||||
|
||||
option["arg"] = "integer";
|
||||
option["long"] = "resume";
|
||||
option["short"] = "R";
|
||||
option["help"] = "Enable resuming support (1) or disable resuming support (0, default)";
|
||||
option["value"].append(0LL);
|
||||
option["value"].append(0);
|
||||
config->addOption("resume", option);
|
||||
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.";
|
||||
|
@ -68,26 +68,26 @@ namespace Mist {
|
|||
capa["optional"]["resume"]["select"][0u][1u] = "Disabled";
|
||||
capa["optional"]["resume"]["select"][1u][0u] = "1";
|
||||
capa["optional"]["resume"]["select"][1u][1u] = "Enabled";
|
||||
capa["optional"]["resume"]["default"] = 0LL;
|
||||
capa["optional"]["resume"]["default"] = 0;
|
||||
option.null();
|
||||
|
||||
option["arg"] = "integer";
|
||||
option["long"] = "segment-size";
|
||||
option["short"] = "S";
|
||||
option["help"] = "Target time duration in milliseconds for segments";
|
||||
option["value"].append(5000LL);
|
||||
option["value"].append(5000);
|
||||
config->addOption("segmentsize", option);
|
||||
capa["optional"]["segmentsize"]["name"] = "Segment size (ms)";
|
||||
capa["optional"]["segmentsize"]["help"] = "Target time duration in milliseconds for segments.";
|
||||
capa["optional"]["segmentsize"]["option"] = "--segment-size";
|
||||
capa["optional"]["segmentsize"]["type"] = "uint";
|
||||
capa["optional"]["segmentsize"]["default"] = 5000LL;
|
||||
capa["optional"]["segmentsize"]["default"] = 5000;
|
||||
option.null();
|
||||
/*LTS-end*/
|
||||
|
||||
capa["source_match"] = "push://*";
|
||||
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["codecs"][0u][0u].append("*");
|
||||
capa["codecs"][0u][1u].append("*");
|
||||
|
@ -344,7 +344,7 @@ namespace Mist {
|
|||
nProxy.metaPages[0].master = false;
|
||||
}
|
||||
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();
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace Mist {
|
|||
inputDTSC::inputDTSC(Util::Config * cfg) : Input(cfg) {
|
||||
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["priority"] = 9ll;
|
||||
capa["priority"] = 9;
|
||||
capa["source_match"].append("/*.dtsc");
|
||||
capa["source_match"].append("dtsc://*");
|
||||
capa["source_file"] = "$source";
|
||||
|
@ -34,26 +34,26 @@ namespace Mist {
|
|||
option["long"] = "buffer";
|
||||
option["short"] = "b";
|
||||
option["help"] = "Live stream 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;
|
||||
/*LTS-START*/
|
||||
option.null();
|
||||
option["arg"] = "integer";
|
||||
option["long"] = "segment-size";
|
||||
option["short"] = "S";
|
||||
option["help"] = "Target time duration in milliseconds for segments";
|
||||
option["value"].append(5000LL);
|
||||
option["value"].append(5000);
|
||||
config->addOption("segmentsize", option);
|
||||
capa["optional"]["segmentsize"]["name"] = "Segment size (ms)";
|
||||
capa["optional"]["segmentsize"]["help"] = "Target time duration in milliseconds for segments.";
|
||||
capa["optional"]["segmentsize"]["option"] = "--segment-size";
|
||||
capa["optional"]["segmentsize"]["type"] = "uint";
|
||||
capa["optional"]["segmentsize"]["default"] = 5000LL;
|
||||
capa["optional"]["segmentsize"]["default"] = 5000;
|
||||
/*LTS-END*/
|
||||
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace Mist{
|
|||
capa["source_match"].append("/*.mks");
|
||||
capa["source_match"].append("/*.webm");
|
||||
capa["source_file"] = "$source";
|
||||
capa["priority"] = 9ll;
|
||||
capa["priority"] = 9;
|
||||
capa["codecs"].append("H264");
|
||||
capa["codecs"].append("HEVC");
|
||||
capa["codecs"].append("VP8");
|
||||
|
@ -342,7 +342,7 @@ namespace Mist{
|
|||
}
|
||||
if (E.getID() == EBML::EID_TIMECODESCALE){
|
||||
uint64_t timeScaleVal = E.getValUInt();
|
||||
myMeta.inputLocalVars["timescale"] = (long long)timeScaleVal;
|
||||
myMeta.inputLocalVars["timescale"] = timeScaleVal;
|
||||
timeScale = ((double)timeScaleVal) / 1000000.0;
|
||||
}
|
||||
//Live streams stop parsing the header as soon as the first Cluster is encountered
|
||||
|
@ -414,7 +414,7 @@ namespace Mist{
|
|||
}
|
||||
}
|
||||
|
||||
myMeta.inputLocalVars["maxframeoffset"] = (long long)maxEBMLFrameOffset;
|
||||
myMeta.inputLocalVars["maxframeoffset"] = maxEBMLFrameOffset;
|
||||
|
||||
bench = Util::getMicros(bench);
|
||||
INFO_MSG("Header generated in %llu ms", bench / 1000);
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace Mist {
|
|||
capa["desc"] = "Allows loading FLV files for Video on Demand.";
|
||||
capa["source_match"] = "/*.flv";
|
||||
capa["source_file"] = "$source";
|
||||
capa["priority"] = 9ll;
|
||||
capa["priority"] = 9;
|
||||
capa["codecs"][0u][0u].append("H264");
|
||||
capa["codecs"][0u][0u].append("H263");
|
||||
capa["codecs"][0u][0u].append("VP6");
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace Mist{
|
|||
capa["source_match"] = "h264-exec:*";
|
||||
//May be set to always-on mode
|
||||
capa["always_match"].append("h264-exec:*");
|
||||
capa["priority"] = 0ll;
|
||||
capa["priority"] = 0;
|
||||
capa["codecs"][0u][0u].append("H264");
|
||||
frameCount = 0;
|
||||
startTime = Util::bootMS();
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace Mist {
|
|||
capa["desc"] = "This input allows you to stream MP3 Video on Demand files.";
|
||||
capa["source_match"] = "/*.mp3";
|
||||
capa["source_file"] = "$source";
|
||||
capa["priority"] = 9ll;
|
||||
capa["priority"] = 9;
|
||||
capa["codecs"][0u][0u].append("MP3");
|
||||
timestamp = 0;
|
||||
}
|
||||
|
@ -153,9 +153,9 @@ namespace Mist {
|
|||
static JSON::Value thisPack;
|
||||
thisPack.null();
|
||||
thisPack["trackid"] = 1;
|
||||
thisPack["bpos"] = (long long)filePos;
|
||||
thisPack["bpos"] = (uint64_t)filePos;
|
||||
thisPack["data"] = std::string(packHeader, dataSize);
|
||||
thisPack["time"] = (long long)timestamp;
|
||||
thisPack["time"] = timestamp;
|
||||
//Write the json value to lastpack
|
||||
std::string tmpStr = thisPack.toNetPacked();
|
||||
thisPacket.reInit(tmpStr.data(), tmpStr.size());
|
||||
|
|
|
@ -18,20 +18,20 @@ namespace Mist {
|
|||
|
||||
JSON::Value segment::toJSON(OGG::oggCodec myCodec){
|
||||
JSON::Value retval;
|
||||
retval["time"] = (long long int)time;
|
||||
retval["trackid"] = (long long int)tid;
|
||||
retval["time"] = time;
|
||||
retval["trackid"] = tid;
|
||||
std::string tmpString = "";
|
||||
for (unsigned int i = 0; i < parts.size(); i++){
|
||||
tmpString += parts[i];
|
||||
}
|
||||
retval["data"] = tmpString;
|
||||
// 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 (!theora::isHeader(tmpString.data(), tmpString.size())){
|
||||
theora::header tmpHeader((char*)tmpString.data(), tmpString.size());
|
||||
if (tmpHeader.getFTYPE() == 0){
|
||||
retval["keyframe"] = 1LL;
|
||||
retval["keyframe"] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -434,7 +434,7 @@ namespace Mist {
|
|||
}
|
||||
}
|
||||
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);
|
||||
char buffer[300];
|
||||
fread(buffer, 300, 1, inFile);
|
||||
|
|
|
@ -16,9 +16,9 @@ namespace Mist {
|
|||
return time < rhs.time || (time == rhs.time && tid < rhs.tid);
|
||||
}
|
||||
std::vector<std::string> parts;
|
||||
unsigned long long int time;
|
||||
unsigned long long int tid;
|
||||
long long unsigned int bytepos;
|
||||
uint64_t time;
|
||||
uint64_t tid;
|
||||
uint64_t bytepos;
|
||||
bool keyframe;
|
||||
JSON::Value toJSON(OGG::oggCodec myCodec);
|
||||
};
|
||||
|
@ -36,10 +36,10 @@ namespace Mist {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
long unsigned int trackID;
|
||||
long long unsigned int time;
|
||||
long long unsigned int bytepos;
|
||||
long long unsigned int segmentNo;
|
||||
uint64_t trackID;
|
||||
uint64_t time;
|
||||
uint64_t bytepos;
|
||||
uint64_t segmentNo;
|
||||
};
|
||||
/*
|
||||
class oggTrack {
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace Mist{
|
|||
option["long"] = "noinput";
|
||||
option["short"] = "N";
|
||||
option["help"] = "Do not start input if not already started";
|
||||
option["value"].append(0ll);
|
||||
option["value"].append(0);
|
||||
cfg->addOption("noinput", option);
|
||||
}
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ namespace Mist{
|
|||
capa["codecs"][0u][2u].append("+JSON");
|
||||
capa["methods"][0u]["handler"] = "http";
|
||||
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
|
||||
JSON::Value blacklistNonChrome = JSON::fromString("[[\"blacklist\"], [\"whitelist\",[\"Chrome\",\"Chromium\"]], [\"blacklist\",[\"Edge\",\"OPR/\"]]]");
|
||||
capa["exceptions"]["codec:H264"] = blacklistNonChrome;
|
||||
|
|
|
@ -163,7 +163,7 @@ namespace Mist {
|
|||
capa["codecs"][0u][1u].append("ULAW");
|
||||
capa["methods"][0u]["handler"] = "http";
|
||||
capa["methods"][0u]["type"] = "flash/11";
|
||||
capa["methods"][0u]["priority"] = 6ll;
|
||||
capa["methods"][0u]["priority"] = 6;
|
||||
capa["methods"][0u]["player_url"] = "/flashplayer.swf";
|
||||
}
|
||||
|
||||
|
|
|
@ -363,7 +363,7 @@ namespace Mist {
|
|||
capa["codecs"][0u][1u].append("MP2");
|
||||
capa["methods"][0u]["handler"] = "http";
|
||||
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
|
||||
capa["exceptions"]["codec:MP3"] = JSON::fromString("[[\"blacklist\"],[\"whitelist\",[\"iPad\",\"iPhone\",\"iPod\",\"MacIntel\",\"Edge\"]]]");
|
||||
capa["exceptions"]["codec:HEVC"] = JSON::fromString("[[\"blacklist\"],[\"whitelist\",[\"iPad\",\"iPhone\",\"iPod\",\"MacIntel\"]]]");
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace Mist {
|
|||
capa["codecs"][0u][1u].append("AAC");
|
||||
capa["methods"][0u]["handler"] = "http";
|
||||
capa["methods"][0u]["type"] = "silverlight";
|
||||
capa["methods"][0u]["priority"] = 1ll;
|
||||
capa["methods"][0u]["priority"] = 1;
|
||||
}
|
||||
|
||||
void OutHSS::sendNext() {
|
||||
|
|
|
@ -231,7 +231,7 @@ namespace Mist {
|
|||
std::string ua = H.GetVar("sessId");
|
||||
crc = checksum::crc32(0, ua.data(), ua.size());
|
||||
}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());
|
||||
}
|
||||
}else{
|
||||
|
@ -379,7 +379,7 @@ namespace Mist {
|
|||
int argnum = 0;
|
||||
argarr[argnum++] = (char*)tmparg.c_str();
|
||||
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*)(temphost.c_str());
|
||||
argarr[argnum++] = (char*)"--stream";
|
||||
|
|
|
@ -401,9 +401,9 @@ namespace Mist {
|
|||
}
|
||||
}
|
||||
if (json_resp["width"].asInt() < 1 || json_resp["height"].asInt() < 1){
|
||||
json_resp["width"] = 640ll;
|
||||
json_resp["height"] = 480ll;
|
||||
if (!hasVideo){json_resp["height"] = 20ll;}
|
||||
json_resp["width"] = 640;
|
||||
json_resp["height"] = 480;
|
||||
if (!hasVideo){json_resp["height"] = 20;}
|
||||
}
|
||||
if (myMeta.vod){
|
||||
json_resp["type"] = "vod";
|
||||
|
@ -596,7 +596,7 @@ namespace Mist {
|
|||
if (!myConn){return;}
|
||||
for (std::map<unsigned int, DTSC::Track>::iterator trit = myMeta.tracks.begin(); trit != myMeta.tracks.end(); trit++){
|
||||
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";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,14 +71,14 @@ namespace Mist{
|
|||
capa["codecs"][0u][1u].append("MP2");
|
||||
capa["methods"][0u]["handler"] = "http";
|
||||
capa["methods"][0u]["type"] = "html5/video/mpeg";
|
||||
capa["methods"][0u]["priority"] = 1ll;
|
||||
capa["methods"][0u]["priority"] = 1;
|
||||
capa["push_urls"].append("/*.ts");
|
||||
capa["push_urls"].append("ts-exec:*");
|
||||
|
||||
JSON::Value opt;
|
||||
opt["arg"] = "string";
|
||||
opt["default"] = "";
|
||||
opt["arg_num"] = 1ll;
|
||||
opt["arg_num"] = 1;
|
||||
opt["help"] = "Target filename to store TS file as, or - for stdout.";
|
||||
cfg->addOption("target", opt);
|
||||
}
|
||||
|
|
|
@ -20,11 +20,11 @@ namespace Mist {
|
|||
capa["codecs"][0u][0u].append("@+meta");
|
||||
capa["methods"][0u]["handler"] = "http";
|
||||
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"][1u]["handler"] = "ws";
|
||||
capa["methods"][1u]["type"] = "html5/text/javascript";
|
||||
capa["methods"][1u]["priority"] = 0ll;
|
||||
capa["methods"][1u]["priority"] = 0;
|
||||
capa["methods"][1u]["url_rel"] = "/$.json";
|
||||
}
|
||||
|
||||
|
@ -41,8 +41,8 @@ namespace Mist {
|
|||
size_t dLen;
|
||||
thisPacket.getString("data", dPtr, dLen);
|
||||
jPack["data"] = JSON::fromString(dPtr, dLen);
|
||||
jPack["time"] = (long long)thisPacket.getTime();
|
||||
jPack["track"] = (long long)thisPacket.getTrackId();
|
||||
jPack["time"] = thisPacket.getTime();
|
||||
jPack["track"] = (uint64_t)thisPacket.getTrackId();
|
||||
}else{
|
||||
jPack = thisPacket.toJSON();
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace Mist {
|
|||
capa["codecs"][0u][1u].append("ULAW");
|
||||
capa["methods"][0u]["handler"] = "http";
|
||||
capa["methods"][0u]["type"] = "flash/7";
|
||||
capa["methods"][0u]["priority"] = 5ll;
|
||||
capa["methods"][0u]["priority"] = 5;
|
||||
capa["methods"][0u]["player_url"] = "/oldflashplayer.swf";
|
||||
capa["push_urls"].append("/*.flv");
|
||||
|
||||
|
|
|
@ -13,12 +13,12 @@ namespace Mist {
|
|||
capa["codecs"][0u][0u].append("MP3");
|
||||
capa["methods"][0u]["handler"] = "http";
|
||||
capa["methods"][0u]["type"] = "html5/audio/mp3";
|
||||
capa["methods"][0u]["priority"] = 8ll;
|
||||
capa["methods"][0u]["priority"] = 8;
|
||||
|
||||
JSON::Value opt;
|
||||
opt["arg"] = "string";
|
||||
opt["default"] = "";
|
||||
opt["arg_num"] = 1ll;
|
||||
opt["arg_num"] = 1;
|
||||
opt["help"] = "Target filename to store MP3 file as, or - for stdout.";
|
||||
cfg->addOption("target", opt);
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace Mist{
|
|||
capa["codecs"][0u][1u].append("AC3");
|
||||
capa["methods"][0u]["handler"] = "http";
|
||||
capa["methods"][0u]["type"] = "html5/video/mp4";
|
||||
capa["methods"][0u]["priority"] = 10ll;
|
||||
capa["methods"][0u]["priority"] = 10;
|
||||
//MP4 live is broken on Apple
|
||||
capa["exceptions"]["live"] = JSON::fromString("[[\"blacklist\",[\"iPad\",\"iPhone\",\"iPod\",\"Safari\"]], [\"whitelist\",[\"Chrome\",\"Chromium\"]]]");
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace Mist {
|
|||
capa["codecs"][0u][1u].append("opus");
|
||||
capa["methods"][0u]["handler"] = "http";
|
||||
capa["methods"][0u]["type"] = "html5/video/ogg";
|
||||
capa["methods"][0u]["priority"] = 8ll;
|
||||
capa["methods"][0u]["priority"] = 8;
|
||||
capa["methods"][0u]["nolive"] = 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -194,7 +194,7 @@ namespace Mist{
|
|||
capa["codecs"][0u][1u].append("ULAW");
|
||||
capa["methods"][0u]["handler"] = "rtmp";
|
||||
capa["methods"][0u]["type"] = "flash/10";
|
||||
capa["methods"][0u]["priority"] = 7ll;
|
||||
capa["methods"][0u]["priority"] = 7;
|
||||
capa["methods"][0u]["player_url"] = "/flashplayer.swf";
|
||||
capa["optional"]["acceptable"]["name"] = "Acceptable connection types";
|
||||
capa["optional"]["acceptable"]["help"] = "Whether to allow only incoming pushes (2), only outgoing pulls (1), or both (0, default)";
|
||||
|
|
|
@ -18,11 +18,11 @@ namespace Mist {
|
|||
capa["codecs"][0u][0u].append("subtitle");
|
||||
capa["methods"][0u]["handler"] = "http";
|
||||
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"][1u]["handler"] = "http";
|
||||
capa["methods"][1u]["type"] = "html5/text/vtt";
|
||||
capa["methods"][1u]["priority"] = 9ll;
|
||||
capa["methods"][1u]["priority"] = 9;
|
||||
capa["methods"][1u]["url_rel"] = "/$.vtt";
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ int main(int argc, char **argv){
|
|||
Util::redirectLogsIfNeeded();
|
||||
Util::Config conf(argv[0]);
|
||||
JSON::Value opt;
|
||||
opt["arg_num"] = 1ll;
|
||||
opt["arg_num"] = 1;
|
||||
opt["arg"] = "string";
|
||||
opt["default"] = "-";
|
||||
opt["help"] = "Filename to analyse, or - for standard input (default)";
|
||||
|
|
Loading…
Add table
Reference in a new issue