Fixed all ARM-related issues/warnings/etc

This commit is contained in:
Thulinma 2021-05-21 17:54:24 +02:00
parent dae32ede11
commit 6733bf2a20
44 changed files with 123 additions and 120 deletions

View file

@ -410,7 +410,10 @@ namespace CMAF{
trunBox.setSampleInformation(sampleInfo, trunOffset++); trunBox.setSampleInformation(sampleInfo, trunOffset++);
} }
}else{ }else{
WARN_MSG("Empty CMAF header for track %zu: %zu-%zu contains no packets (first: %" PRIu64 ", last: %" PRIu64 "), firstPart=%zu, lastPart=%zu", track, startTime, endTime, M.getFirstms(track), M.getLastms(track), firstPart, endPart); WARN_MSG("Empty CMAF header for track %zu: %" PRIu64 "-%" PRIu64 " contains no packets (first: %" PRIu64
", last: %" PRIu64 "), firstPart=%zu, lastPart=%zu",
track, startTime, endTime, M.getFirstms(track), M.getLastms(track), firstPart,
endPart);
} }
trafBox.setContent(trunBox, 2); trafBox.setContent(trunBox, 2);

View file

@ -55,7 +55,7 @@ namespace Comms{
protected: protected:
bool master; bool master;
size_t index; uint64_t index;
size_t currentSize; size_t currentSize;
IPC::semaphore sem; IPC::semaphore sem;
IPC::sharedPage dataPage; IPC::sharedPage dataPage;

View file

@ -318,7 +318,7 @@ namespace DTSC{
Bit::htobl(data + offset, Bit::btohl(data + offset) + appendLen); Bit::htobl(data + offset, Bit::btohl(data + offset) + appendLen);
} }
size_t Packet::getDataStringLen(){return Bit::btohl(data + getDataStringLenOffset());} uint32_t Packet::getDataStringLen(){return Bit::btohl(data + getDataStringLenOffset());}
/// Method can only be used when using internal functions to build the data. /// Method can only be used when using internal functions to build the data.
size_t Packet::getDataStringLenOffset(){ size_t Packet::getDataStringLenOffset(){
@ -472,11 +472,11 @@ 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{return dataLen;} uint32_t Packet::getDataLen() const{return dataLen;}
///\brief Returns the size of the payload of this packet. ///\brief Returns the size of the payload of this packet.
///\return The size of the payload of this packet. ///\return The size of the payload of this packet.
size_t Packet::getPayloadLen() const{ uint32_t Packet::getPayloadLen() const{
if (version == DTSC_V2){ if (version == DTSC_V2){
return dataLen - 20; return dataLen - 20;
}else{ }else{

View file

@ -123,9 +123,9 @@ namespace DTSC{
void nullMember(const std::string & memb); void nullMember(const std::string & memb);
size_t getTrackId() const; size_t getTrackId() const;
char *getData() const; char *getData() const;
size_t getDataLen() const; uint32_t getDataLen() const;
size_t getPayloadLen() const; uint32_t getPayloadLen() const;
size_t getDataStringLen(); uint32_t getDataStringLen();
size_t getDataStringLenOffset(); size_t getDataStringLenOffset();
JSON::Value toJSON() const; JSON::Value toJSON() const;
std::string toSummary() const; std::string toSummary() const;
@ -136,8 +136,8 @@ namespace DTSC{
packType version; packType version;
void resize(size_t size); void resize(size_t size);
char *data; char *data;
size_t bufferLen; uint32_t bufferLen;
size_t dataLen; uint32_t dataLen;
uint64_t prevNalSize; uint64_t prevNalSize;
}; };

View file

@ -493,14 +493,14 @@ bool FLV::Tag::DTSCAudioInit(const std::string & codec, unsigned int sampleRate,
return true; return true;
} }
bool FLV::Tag::DTSCMetaInit(const DTSC::Meta &M, std::set<long unsigned int> &selTracks){ bool FLV::Tag::DTSCMetaInit(const DTSC::Meta &M, std::set<size_t> &selTracks){
AMF::Object amfdata("root", AMF::AMF0_DDV_CONTAINER); AMF::Object amfdata("root", AMF::AMF0_DDV_CONTAINER);
amfdata.addContent(AMF::Object("", "onMetaData")); amfdata.addContent(AMF::Object("", "onMetaData"));
amfdata.addContent(AMF::Object("", AMF::AMF0_ECMA_ARRAY)); amfdata.addContent(AMF::Object("", AMF::AMF0_ECMA_ARRAY));
AMF::Object trinfo = AMF::Object("trackinfo", AMF::AMF0_STRICT_ARRAY); AMF::Object trinfo = AMF::Object("trackinfo", AMF::AMF0_STRICT_ARRAY);
int i = 0; int i = 0;
uint64_t mediaLen = 0; uint64_t mediaLen = 0;
for (std::set<long unsigned int>::iterator it = selTracks.begin(); it != selTracks.end(); it++){ for (std::set<size_t>::iterator it = selTracks.begin(); it != selTracks.end(); it++){
if (M.getLastms(*it) - M.getFirstms(*it) > mediaLen){ if (M.getLastms(*it) - M.getFirstms(*it) > mediaLen){
mediaLen = M.getLastms(*it) - M.getFirstms(*it); mediaLen = M.getLastms(*it) - M.getFirstms(*it);
} }

View file

@ -52,7 +52,7 @@ namespace FLV{
bool DTSCLoader(DTSC::Packet &packData, const DTSC::Meta &M, size_t idx); bool DTSCLoader(DTSC::Packet &packData, const DTSC::Meta &M, size_t idx);
bool DTSCVideoInit(DTSC::Meta &meta, uint32_t vTrack); bool DTSCVideoInit(DTSC::Meta &meta, uint32_t vTrack);
bool DTSCAudioInit(const std::string & codec, unsigned int sampleRate, unsigned int sampleSize, unsigned int channels, const std::string & initData); bool DTSCAudioInit(const std::string & codec, unsigned int sampleRate, unsigned int sampleSize, unsigned int channels, const std::string & initData);
bool DTSCMetaInit(const DTSC::Meta &M, std::set<long unsigned int> &selTracks); bool DTSCMetaInit(const DTSC::Meta &M, std::set<size_t> &selTracks);
void toMeta(DTSC::Meta &meta, AMF::Object &amf_storage); void toMeta(DTSC::Meta &meta, AMF::Object &amf_storage);
void toMeta(DTSC::Meta &meta, AMF::Object &amf_storage, size_t &reTrack, const std::map<std::string, std::string> &targetParams); void toMeta(DTSC::Meta &meta, AMF::Object &amf_storage, size_t &reTrack, const std::map<std::string, std::string> &targetParams);
bool MemLoader(char *D, unsigned int S, unsigned int &P); bool MemLoader(char *D, unsigned int S, unsigned int &P);

View file

@ -38,10 +38,10 @@ namespace h264{
return false; return false;
} }
std::deque<nalu::nalData> analysePackets(const char *data, unsigned long len){ std::deque<nalu::nalData> analysePackets(const char *data, size_t len){
std::deque<nalu::nalData> res; std::deque<nalu::nalData> res;
int offset = 0; size_t offset = 0;
// Make sure entire packet is within len // Make sure entire packet is within len
while (offset + 5 < len && Bit::btohl(data + offset) + offset + 4 <= len){ while (offset + 5 < len && Bit::btohl(data + offset) + offset + 4 <= len){
nalu::nalData entry; nalu::nalData entry;

View file

@ -110,7 +110,7 @@ namespace MP4{
fseek(newData, 0, SEEK_END); fseek(newData, 0, SEEK_END);
return true; return true;
} }
DONTEVEN_MSG("skipping size 0x%.8lX", size); DONTEVEN_MSG("skipping box of size %" PRIu64, size);
if (fseek(newData, pos + size, SEEK_SET) == 0){ if (fseek(newData, pos + size, SEEK_SET) == 0){
return true; return true;
}else{ }else{

View file

@ -2772,7 +2772,7 @@ namespace MP4{
if (count == index){ if (count == index){
setBox(box, offset); setBox(box, offset);
}else{ }else{
INFO_MSG("Should not be here! Index is %zu, count is %zu, offset is %zu, payloadSize is %zu", INFO_MSG("Should not be here! Index is %zu, count is %zu, offset is %zu, payloadSize is %" PRIu64,
index, count, offset, payloadSize()); index, count, offset, payloadSize());
} }
} }
@ -2916,7 +2916,7 @@ namespace MP4{
if (count == index){ if (count == index){
setBox(box, offset); setBox(box, offset);
}else{ }else{
INFO_MSG("Should not be here! Index is %zu, count is %zu, offset is %zu, payloadSize is %zu", INFO_MSG("Should not be here! Index is %zu, count is %zu, offset is %zu, payloadSize is %" PRIu64,
index, count, offset, payloadSize()); index, count, offset, payloadSize());
} }
} }

View file

@ -98,8 +98,8 @@ namespace OGG{
/// Reads an OGG Page from the source and if valid, removes it from source. /// Reads an OGG Page from the source and if valid, removes it from source.
bool Page::read(std::string &newData){ bool Page::read(std::string &newData){
int len = newData.size(); size_t len = newData.size();
int total = 0; size_t total = 0;
segments.clear(); segments.clear();
if (newData.size() < 27){return false;} if (newData.size() < 27){return false;}
if (newData.substr(0, 4) != "OggS"){ if (newData.substr(0, 4) != "OggS"){
@ -127,7 +127,7 @@ namespace OGG{
newData.erase(0, *it); newData.erase(0, *it);
} }
INFO_MSG("Erased %lu bytes from the input", len - newData.size()); INFO_MSG("Erased %zu bytes from the input", len - newData.size());
return true; return true;
} }
@ -203,12 +203,12 @@ namespace OGG{
void Page::setGranulePosition(long long unsigned int newVal){set_64(data + 6, newVal);} void Page::setGranulePosition(long long unsigned int newVal){set_64(data + 6, newVal);}
long unsigned int Page::getBitstreamSerialNumber(){ uint32_t Page::getBitstreamSerialNumber(){
// return ntohl(((long unsigned int*)(data+14))[0]); // return ntohl(((long unsigned int*)(data+14))[0]);
return get_32(data + 14); return get_32(data + 14);
} }
void Page::setBitstreamSerialNumber(long unsigned int newVal){set_32(data + 14, newVal);} void Page::setBitstreamSerialNumber(uint32_t newVal){set_32(data + 14, newVal);}
long unsigned int Page::getPageSequenceNumber(){return get_32(data + 18);} long unsigned int Page::getPageSequenceNumber(){return get_32(data + 18);}

View file

@ -45,8 +45,8 @@ namespace OGG{
void setHeaderType(char newVal); void setHeaderType(char newVal);
long long unsigned int getGranulePosition(); long long unsigned int getGranulePosition();
void setGranulePosition(long long unsigned int newVal); void setGranulePosition(long long unsigned int newVal);
long unsigned int getBitstreamSerialNumber(); uint32_t getBitstreamSerialNumber();
void setBitstreamSerialNumber(long unsigned int newVal); void setBitstreamSerialNumber(uint32_t newVal);
long unsigned int getCRCChecksum(); long unsigned int getCRCChecksum();
void setCRCChecksum(long unsigned int newVal); void setCRCChecksum(long unsigned int newVal);
long unsigned int getPageSequenceNumber(); long unsigned int getPageSequenceNumber();

View file

@ -498,7 +498,7 @@ bool RTMPStream::doHandshake(){
char Version; char Version;
// Read C0 // Read C0
if (handshake_in.size() < 1537){ if (handshake_in.size() < 1537){
FAIL_MSG("Handshake wasn't filled properly (%lu/1537) - aborting!", handshake_in.size()); FAIL_MSG("Handshake wasn't filled properly (%zu/1537) - aborting!", handshake_in.size());
return false; return false;
} }
Version = RTMPStream::handshake_in[0]; Version = RTMPStream::handshake_in[0];

View file

@ -771,7 +771,7 @@ namespace RTP{
return; return;
} }
if (fuaBuffer.size() && ((pl[2] & 0x80) || missed)){ if (fuaBuffer.size() && ((pl[2] & 0x80) || missed)){
WARN_MSG("H265 FU packet incompleted: %lu", fuaBuffer.size()); WARN_MSG("H265 FU packet incompleted: %zu", fuaBuffer.size());
Bit::htobl(fuaBuffer, fuaBuffer.size() - 4); // size-prepend Bit::htobl(fuaBuffer, fuaBuffer.size() - 4); // size-prepend
fuaBuffer[4] |= 0x80; // set error bit fuaBuffer[4] |= 0x80; // set error bit
handleHEVCSingle(msTime, fuaBuffer, fuaBuffer.size(), handleHEVCSingle(msTime, fuaBuffer, fuaBuffer.size(),
@ -794,7 +794,7 @@ namespace RTP{
} }
if (pl[2] & 0x40){// last packet if (pl[2] & 0x40){// last packet
VERYHIGH_MSG("H265 FU packet type %s (%u) completed: %lu", VERYHIGH_MSG("H265 FU packet type %s (%u) completed: %zu",
h265::typeToStr((fuaBuffer[4] & 0x7E) >> 1), h265::typeToStr((fuaBuffer[4] & 0x7E) >> 1),
(uint8_t)((fuaBuffer[4] & 0x7E) >> 1), fuaBuffer.size()); (uint8_t)((fuaBuffer[4] & 0x7E) >> 1), fuaBuffer.size());
Bit::htobl(fuaBuffer, fuaBuffer.size() - 4); // size-prepend Bit::htobl(fuaBuffer, fuaBuffer.size() - 4); // size-prepend
@ -923,7 +923,7 @@ namespace RTP{
} }
if (fuaBuffer.size() && ((pl[1] & 0x80) || missed)){ if (fuaBuffer.size() && ((pl[1] & 0x80) || missed)){
WARN_MSG("Ending unfinished FU-A"); WARN_MSG("Ending unfinished FU-A");
INSANE_MSG("H264 FU-A packet incompleted: %lu", fuaBuffer.size()); INSANE_MSG("H264 FU-A packet incompleted: %zu", fuaBuffer.size());
fuaBuffer.truncate(0); fuaBuffer.truncate(0);
return; return;
} }
@ -941,7 +941,7 @@ namespace RTP{
} }
if (pl[1] & 0x40){// last packet if (pl[1] & 0x40){// last packet
INSANE_MSG("H264 FU-A packet type %u completed: %lu", (unsigned int)(fuaBuffer[4] & 0x1F), INSANE_MSG("H264 FU-A packet type %u completed: %zu", (unsigned int)(fuaBuffer[4] & 0x1F),
fuaBuffer.size()); fuaBuffer.size());
uint8_t nalType = (fuaBuffer[4] & 0x1F); uint8_t nalType = (fuaBuffer[4] & 0x1F);
if (nalType == 7 || nalType == 8){ if (nalType == 7 || nalType == 8){

View file

@ -607,10 +607,10 @@ namespace SDP{
} }
/// Calculates H265 track metadata from sps and pps data stored in tracks[trackNo] /// Calculates H265 track metadata from sps and pps data stored in tracks[trackNo]
void State::updateH265Init(size_t tid){ void State::updateH265Init(uint64_t tid){
SDP::Track &RTrk = tracks[tid]; SDP::Track &RTrk = tracks[tid];
if (!RTrk.hevcInfo.haveRequired()){ if (!RTrk.hevcInfo.haveRequired()){
MEDIUM_MSG("Aborted meta fill for hevc track %lu: no info nal unit", tid); MEDIUM_MSG("Aborted meta fill for hevc track %" PRIu64 ": no info nal unit", tid);
return; return;
} }
myMeta->setInit(tid, RTrk.hevcInfo.generateHVCC()); myMeta->setInit(tid, RTrk.hevcInfo.generateHVCC());
@ -647,7 +647,7 @@ namespace SDP{
} }
size_t State::getTrackNoForChannel(uint8_t chan){ size_t State::getTrackNoForChannel(uint8_t chan){
for (std::map<size_t, Track>::iterator it = tracks.begin(); it != tracks.end(); ++it){ for (std::map<uint64_t, Track>::iterator it = tracks.begin(); it != tracks.end(); ++it){
if (chan == it->second.channel){return it->first;} if (chan == it->second.channel){return it->first;}
} }
return INVALID_TRACK_ID; return INVALID_TRACK_ID;
@ -671,7 +671,7 @@ namespace SDP{
while (loop){ while (loop){
if (tracks.size()){ if (tracks.size()){
for (std::map<size_t, Track>::iterator it = tracks.begin(); it != tracks.end(); ++it){ for (std::map<uint64_t, Track>::iterator it = tracks.begin(); it != tracks.end(); ++it){
if (!it->second.control.size()){ if (!it->second.control.size()){
it->second.control = "/track" + JSON::Value(it->first).asString(); it->second.control = "/track" + JSON::Value(it->first).asString();
INFO_MSG("Control track: %s", it->second.control.c_str()); INFO_MSG("Control track: %s", it->second.control.c_str());
@ -681,7 +681,7 @@ namespace SDP{
urlString.substr(urlString.size() - it->second.control.size()) == it->second.control) || urlString.substr(urlString.size() - it->second.control.size()) == it->second.control) ||
(pw.size() >= it->second.control.size() && (pw.size() >= it->second.control.size() &&
pw.substr(pw.size() - it->second.control.size()) == it->second.control)){ pw.substr(pw.size() - it->second.control.size()) == it->second.control)){
INFO_MSG("Parsing SETUP against track %lu", it->first); INFO_MSG("Parsing SETUP against track %" PRIu64, it->first);
if (!it->second.parseTransport(H.GetHeader("Transport"), cH, src, myMeta, it->first)){ if (!it->second.parseTransport(H.GetHeader("Transport"), cH, src, myMeta, it->first)){
return INVALID_TRACK_ID; return INVALID_TRACK_ID;
} }
@ -720,7 +720,7 @@ namespace SDP{
return ((double)M->getRate(tid) / 1000.0); return ((double)M->getRate(tid) / 1000.0);
} }
void State::updateInit(const size_t tid, const std::string &initData){ void State::updateInit(const uint64_t tid, const std::string &initData){
myMeta->setInit(tid, initData.data(), initData.size()); myMeta->setInit(tid, initData.data(), initData.size());
} }

View file

@ -47,8 +47,8 @@ namespace SDP{
void (*incomingPacketCallback)(const DTSC::Packet &pkt); void (*incomingPacketCallback)(const DTSC::Packet &pkt);
void parseSDP(const std::string &sdp); void parseSDP(const std::string &sdp);
void parseSDPEx(const std::string &sdp); void parseSDPEx(const std::string &sdp);
void updateH264Init(size_t trackNo); void updateH264Init(uint64_t trackNo);
void updateH265Init(size_t tid); void updateH265Init(uint64_t trackNo);
void updateInit(const uint64_t trackNo, const std::string &initData); void updateInit(const uint64_t trackNo, const std::string &initData);
size_t getTrackNoForChannel(uint8_t chan); size_t getTrackNoForChannel(uint8_t chan);
size_t parseSetup(HTTP::Parser &H, const std::string &host, const std::string &source); size_t parseSetup(HTTP::Parser &H, const std::string &host, const std::string &source);
@ -56,8 +56,8 @@ namespace SDP{
public: public:
DTSC::Meta *myMeta; DTSC::Meta *myMeta;
std::map<size_t, RTP::toDTSC> tConv; ///< Converters to DTSC std::map<uint64_t, RTP::toDTSC> tConv; ///< Converters to DTSC
std::map<size_t, Track> tracks; ///< List of selected tracks with SDP-specific session data. std::map<uint64_t, Track> tracks; ///< List of selected tracks with SDP-specific session data.
}; };
std::string mediaDescription(const DTSC::Meta *M, size_t tid); std::string mediaDescription(const DTSC::Meta *M, size_t tid);

View file

@ -847,7 +847,7 @@ namespace SDP{
M.setType(tid, "video"); M.setType(tid, "video");
M.setRate(tid, answerVideoFormat.getVideoRate()); M.setRate(tid, answerVideoFormat.getVideoRate());
M.setID(tid, answerVideoFormat.payloadType); M.setID(tid, answerVideoFormat.payloadType);
INFO_MSG("Setup video track %zu for payload type %zu", tid, answerVideoFormat.payloadType); INFO_MSG("Setup video track %zu for payload type %" PRIu64, tid, answerVideoFormat.payloadType);
return true; return true;
} }
@ -869,7 +869,7 @@ namespace SDP{
M.setChannels(tid, answerAudioFormat.getAudioNumChannels()); M.setChannels(tid, answerAudioFormat.getAudioNumChannels());
M.setSize(tid, answerAudioFormat.getAudioBitSize()); M.setSize(tid, answerAudioFormat.getAudioBitSize());
M.setID(tid, answerAudioFormat.payloadType); M.setID(tid, answerAudioFormat.payloadType);
INFO_MSG("Setup audio track %zu for payload time %zu", tid, answerAudioFormat.payloadType); INFO_MSG("Setup audio track %zu for payload time %" PRIu64, tid, answerAudioFormat.payloadType);
return true; return true;
} }
@ -1017,8 +1017,8 @@ namespace SDP{
usedProfile = "42e01f"; usedProfile = "42e01f";
} }
addLine("a=fmtp:%u profile-level-id=%s;level-asymmetry-allowed=1;packetization-mode=1", addLine("a=fmtp:%u profile-level-id=42e01f;level-asymmetry-allowed=1;packetization-mode=1",
fmtMedia->payloadType, usedProfile.c_str()); fmtMedia->payloadType);
}else if (fmtMedia->encodingName == "OPUS"){ }else if (fmtMedia->encodingName == "OPUS"){
addLine("a=fmtp:%u minptime=10;useinbandfec=1", fmtMedia->payloadType); addLine("a=fmtp:%u minptime=10;useinbandfec=1", fmtMedia->payloadType);
} }

View file

@ -331,7 +331,7 @@ void Util::packetSorter::getTrackList(std::set<size_t> &toFill) const{
JSON::Value Util::getStreamConfig(const std::string &streamname){ JSON::Value Util::getStreamConfig(const std::string &streamname){
JSON::Value result; JSON::Value result;
if (streamname.size() > 100){ if (streamname.size() > 100){
FAIL_MSG("Stream opening denied: %s is longer than 100 characters (%lu).", streamname.c_str(), FAIL_MSG("Stream opening denied: %s is longer than 100 characters (%zu).", streamname.c_str(),
streamname.size()); streamname.size());
return result; return result;
} }
@ -408,7 +408,7 @@ bool Util::startInput(std::string streamname, std::string filename, bool forkFir
const std::map<std::string, std::string> &overrides, pid_t *spawn_pid){ const std::map<std::string, std::string> &overrides, pid_t *spawn_pid){
sanitizeName(streamname); sanitizeName(streamname);
if (streamname.size() > 100){ if (streamname.size() > 100){
FAIL_MSG("Stream opening denied: %s is longer than 100 characters (%lu).", streamname.c_str(), FAIL_MSG("Stream opening denied: %s is longer than 100 characters (%zu).", streamname.c_str(),
streamname.size()); streamname.size());
return false; return false;
} }

View file

@ -1369,13 +1369,13 @@ namespace TS{
///\param selectedTracks tracks to include in PMT creation ///\param selectedTracks tracks to include in PMT creation
///\param myMeta ///\param myMeta
///\returns character pointer to a static 188B TS packet ///\returns character pointer to a static 188B TS packet
const char *createPMT(std::set<unsigned long> &selectedTracks, const DTSC::Meta &M, int contCounter){ const char *createPMT(std::set<size_t> &selectedTracks, const DTSC::Meta &M, int contCounter){
static ProgramMappingTable PMT; static ProgramMappingTable PMT;
PMT.setPID(4096); PMT.setPID(4096);
PMT.setTableId(2); PMT.setTableId(2);
// section length met 2 tracks: 0xB017 // section length met 2 tracks: 0xB017
int sectionLen = 0; int sectionLen = 0;
for (std::set<long unsigned int>::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){ for (std::set<size_t>::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){
std::string codec = M.getCodec(*it); std::string codec = M.getCodec(*it);
sectionLen += 5; sectionLen += 5;
if (codec == "ID3" || codec == "RAW"){sectionLen += M.getInit(*it).size();} if (codec == "ID3" || codec == "RAW"){sectionLen += M.getInit(*it).size();}
@ -1394,7 +1394,7 @@ namespace TS{
PMT.setLastSectionNumber(0); PMT.setLastSectionNumber(0);
PMT.setContinuityCounter(contCounter); PMT.setContinuityCounter(contCounter);
int vidTrack = -1; int vidTrack = -1;
for (std::set<unsigned long>::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){ for (std::set<size_t>::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){
if (M.getType(*it) == "video"){ if (M.getType(*it) == "video"){
vidTrack = *it; vidTrack = *it;
break; break;
@ -1404,7 +1404,7 @@ namespace TS{
PMT.setPCRPID(getUniqTrackID(M, vidTrack)); PMT.setPCRPID(getUniqTrackID(M, vidTrack));
PMT.setProgramInfoLength(0); PMT.setProgramInfoLength(0);
ProgramMappingEntry entry = PMT.getEntry(0); ProgramMappingEntry entry = PMT.getEntry(0);
for (std::set<long unsigned int>::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){ for (std::set<size_t>::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){
std::string codec = M.getCodec(*it); std::string codec = M.getCodec(*it);
entry.setElementaryPid(getUniqTrackID(M, *it)); entry.setElementaryPid(getUniqTrackID(M, *it));
std::string es_info; std::string es_info;

View file

@ -255,7 +255,7 @@ namespace TS{
size_t getUniqTrackID(const DTSC::Meta &M, size_t idx); size_t getUniqTrackID(const DTSC::Meta &M, size_t idx);
const char *createPMT(std::set<unsigned long> &selectedTracks, const DTSC::Meta &M, int contCounter = 0); const char *createPMT(std::set<size_t> &selectedTracks, const DTSC::Meta &M, int contCounter = 0);
const char *createSDT(const std::string &streamName, int contCounter = 0); const char *createSDT(const std::string &streamName, int contCounter = 0);
}// namespace TS }// namespace TS

View file

@ -635,7 +635,7 @@ namespace TS{
offset += pesPayload[offset] + 1; offset += pesPayload[offset] + 1;
} }
if (realPayloadSize < offset+packSize){ if (realPayloadSize < offset+packSize){
WARN_MSG("Encountered invalid Opus frame (%zu > %zu) - discarding!", offset+packSize, realPayloadSize); WARN_MSG("Encountered invalid Opus frame (%zu > %" PRIu64 ") - discarding!", offset+packSize, realPayloadSize);
break; break;
} }
out.push_back(DTSC::Packet()); out.push_back(DTSC::Packet());
@ -783,7 +783,7 @@ namespace TS{
} }
if (!packetReady){ if (!packetReady){
ERROR_MSG("Track %lu: PES without valid packets?", tid); ERROR_MSG("Track %zu: PES without valid packets?", tid);
return; return;
} }
@ -955,7 +955,7 @@ namespace TS{
switch (it->second){ switch (it->second){
case H264:{ case H264:{
if (!spsInfo.count(it->first) || !ppsInfo.count(it->first)){ if (!spsInfo.count(it->first) || !ppsInfo.count(it->first)){
MEDIUM_MSG("Aborted meta fill for h264 track %lu: no SPS/PPS", it->first); MEDIUM_MSG("Aborted meta fill for h264 track %zu: no SPS/PPS", it->first);
continue; continue;
} }
// First generate needed data // First generate needed data
@ -984,7 +984,7 @@ namespace TS{
}break; }break;
case H265:{ case H265:{
if (!hevcInfo.count(it->first) || !hevcInfo[it->first].haveRequired()){ if (!hevcInfo.count(it->first) || !hevcInfo[it->first].haveRequired()){
MEDIUM_MSG("Aborted meta fill for hevc track %lu: no info nal unit", it->first); MEDIUM_MSG("Aborted meta fill for hevc track %zu: no info nal unit", it->first);
continue; continue;
} }
addNewTrack = true; addNewTrack = true;
@ -1123,7 +1123,7 @@ namespace TS{
entry.advance(); entry.advance();
} }
} }
MEDIUM_MSG("Initialized track %lu as %s %s", idx, codec.c_str(), type.c_str()); MEDIUM_MSG("Initialized track %zu as %s %s", idx, codec.c_str(), type.c_str());
} }
} }

View file

@ -39,7 +39,7 @@ bool AnalyserH264::parsePacket(){
FAIL_MSG("Could not read a NAL unit at position %" PRIu64, prePos); FAIL_MSG("Could not read a NAL unit at position %" PRIu64, prePos);
return false; return false;
} }
HIGH_MSG("Read a %lu-byte NAL unit at position %" PRIu64, size, prePos); HIGH_MSG("Read a %zu-byte NAL unit at position %" PRIu64, size, prePos);
if (detail >= 2){nalPtr->toPrettyString(std::cout);} if (detail >= 2){nalPtr->toPrettyString(std::cout);}
//SPS unit? Find the FPS, if any. //SPS unit? Find the FPS, if any.
if (nalPtr->getType() == 7){ if (nalPtr->getType() == 7){

View file

@ -105,7 +105,7 @@ bool AnalyserHLS::parsePacket(){
if (!DL.get(part.uri)){return false;} if (!DL.get(part.uri)){return false;}
if (DL.getHeader("Content-Length") != ""){ if (DL.getHeader("Content-Length") != ""){
if (DL.data().size() != atoi(DL.getHeader("Content-Length").c_str())){ if (DL.data().size() != atoi(DL.getHeader("Content-Length").c_str())){
FAIL_MSG("Expected %s bytes of data, but only received %lu.", FAIL_MSG("Expected %s bytes of data, but only received %zu.",
DL.getHeader("Content-Length").c_str(), DL.data().size()); DL.getHeader("Content-Length").c_str(), DL.data().size());
return false; return false;
} }

View file

@ -28,10 +28,10 @@ bool AnalyserOGG::parsePacket(){
sn2Codec[oggPage.getBitstreamSerialNumber()] = "Opus"; sn2Codec[oggPage.getBitstreamSerialNumber()] = "Opus";
} }
if (sn2Codec[oggPage.getBitstreamSerialNumber()] != ""){ if (sn2Codec[oggPage.getBitstreamSerialNumber()] != ""){
INFO_MSG("Bitstream %" PRIu64 " recognized as %s", oggPage.getBitstreamSerialNumber(), INFO_MSG("Bitstream %" PRIu32 " recognized as %s", oggPage.getBitstreamSerialNumber(),
sn2Codec[oggPage.getBitstreamSerialNumber()].c_str()); sn2Codec[oggPage.getBitstreamSerialNumber()].c_str());
}else{ }else{
WARN_MSG("Bitstream %" PRIu64 " not recognized!", oggPage.getBitstreamSerialNumber()); WARN_MSG("Bitstream %" PRIu32 " not recognized!", oggPage.getBitstreamSerialNumber());
} }
} }

View file

@ -67,17 +67,17 @@ bool AnalyserRTMP::parsePacket(){
} }
// We now know for sure that we've parsed a packet // We now know for sure that we've parsed a packet
DETAIL_HI("Chunk info: [%#2X] CS ID %u, timestamp %u, len %u, type ID %u, Stream ID %u", DETAIL_HI("Chunk info: [%#2X] CS ID %u, timestamp %" PRIu64 ", len %u, type ID %u, Stream ID %u",
next.headertype, next.cs_id, next.timestamp, next.len, next.msg_type_id, next.msg_stream_id); next.headertype, next.cs_id, next.timestamp, next.len, next.msg_type_id, next.msg_stream_id);
switch (next.msg_type_id){ switch (next.msg_type_id){
case 0: // does not exist case 0: // does not exist
DETAIL_LOW("Error chunk @ %lu - CS%i, T%i, L%i, LL%i, MID%i", read_in - strbuf.size(), DETAIL_LOW("Error chunk @ %zu - CS%u, T%" PRIu64 ", L%i, LL%i, MID%i", read_in - strbuf.size(),
next.cs_id, next.timestamp, next.real_len, next.len_left, next.msg_stream_id); next.cs_id, next.timestamp, next.real_len, next.len_left, next.msg_stream_id);
return 0; return 0;
break; // happens when connection breaks unexpectedly break; // happens when connection breaks unexpectedly
case 1: // set chunk size case 1: // set chunk size
RTMPStream::chunk_rec_max = ntohl(*(int *)next.data.c_str()); RTMPStream::chunk_rec_max = ntohl(*(int *)next.data.c_str());
DETAIL_MED("CTRL: Set chunk size: %" PRIu64, RTMPStream::chunk_rec_max); DETAIL_MED("CTRL: Set chunk size: %zu", RTMPStream::chunk_rec_max);
break; break;
case 2: // abort message - we ignore this one case 2: // abort message - we ignore this one
DETAIL_MED("CTRL: Abort message: %" PRIu32, Bit::btohl(next.data.data())); DETAIL_MED("CTRL: Abort message: %" PRIu32, Bit::btohl(next.data.data()));
@ -85,7 +85,7 @@ bool AnalyserRTMP::parsePacket(){
break; break;
case 3: // ack case 3: // ack
RTMPStream::snd_window_at = Bit::btohl(next.data.data()); RTMPStream::snd_window_at = Bit::btohl(next.data.data());
DETAIL_MED("CTRL: Acknowledgement: %" PRIu64, RTMPStream::snd_window_at); DETAIL_MED("CTRL: Acknowledgement: %zu", RTMPStream::snd_window_at);
break; break;
case 4:{ case 4:{
int16_t ucmtype = Bit::btohs(next.data.data()); int16_t ucmtype = Bit::btohs(next.data.data());
@ -124,12 +124,12 @@ bool AnalyserRTMP::parsePacket(){
case 5: // window size of other end case 5: // window size of other end
RTMPStream::rec_window_size = Bit::btohl(next.data.data()); RTMPStream::rec_window_size = Bit::btohl(next.data.data());
RTMPStream::rec_window_at = RTMPStream::rec_cnt; RTMPStream::rec_window_at = RTMPStream::rec_cnt;
DETAIL_MED("CTRL: Window size: %" PRIu64, RTMPStream::rec_window_size); DETAIL_MED("CTRL: Window size: %zu", RTMPStream::rec_window_size);
break; break;
case 6: case 6:
RTMPStream::snd_window_size = Bit::btohl(next.data.data()); RTMPStream::snd_window_size = Bit::btohl(next.data.data());
// 4 bytes window size, 1 byte limit type (ignored) // 4 bytes window size, 1 byte limit type (ignored)
DETAIL_MED("CTRL: Set peer bandwidth: %" PRIu64, RTMPStream::snd_window_size); DETAIL_MED("CTRL: Set peer bandwidth: %zu", RTMPStream::snd_window_size);
break; break;
case 8: case 8:
case 9: case 9:

View file

@ -670,7 +670,7 @@ void Controller::statSession::update(uint64_t index, Comms::Statistics &statComm
uint64_t currPktLost = getPktLost(); uint64_t currPktLost = getPktLost();
uint64_t currPktRetrans = getPktRetransmit(); uint64_t currPktRetrans = getPktRetransmit();
if (currUp - prevUp < 0 || currDown - prevDown < 0){ if (currUp - prevUp < 0 || currDown - prevDown < 0){
INFO_MSG("Negative data usage! %lldu/%lldd (u%lld->%lld) in %s over %s, #%lu", currUp - prevUp, INFO_MSG("Negative data usage! %lldu/%lldd (u%lld->%lld) in %s over %s, #%" PRIu64, currUp - prevUp,
currDown - prevDown, prevUp, currUp, myStream.c_str(), myConnector.c_str(), index); currDown - prevDown, prevUp, currUp, myStream.c_str(), myConnector.c_str(), index);
}else{ }else{
if (!noBWCount){ if (!noBWCount){

View file

@ -529,7 +529,7 @@ namespace Mist{
if (M && M.getVod()){ if (M && M.getVod()){
meta.removeEmptyTracks(); meta.removeEmptyTracks();
parseHeader(); parseHeader();
INFO_MSG("Header parsed, %lu tracks", M.getValidTracks().size()); INFO_MSG("Header parsed, %zu tracks", M.getValidTracks().size());
} }
if (!streamName.size()){ if (!streamName.size()){
@ -1121,7 +1121,7 @@ namespace Mist{
WARN_MSG("No pages for track %zu found", *it); WARN_MSG("No pages for track %zu found", *it);
continue; continue;
} }
MEDIUM_MSG("Track %zu (%s) split into %zu pages", *it, M.getCodec(*it).c_str(), tPages.getEndPos()); MEDIUM_MSG("Track %zu (%s) split into %" PRIu64 " pages", *it, M.getCodec(*it).c_str(), tPages.getEndPos());
for (size_t j = tPages.getDeleted(); j < tPages.getEndPos(); j++){ for (size_t j = tPages.getDeleted(); j < tPages.getEndPos(); j++){
size_t pageNumber = tPages.getInt("firstkey", j); size_t pageNumber = tPages.getInt("firstkey", j);
size_t pageKeys = tPages.getInt("keycount", j); size_t pageKeys = tPages.getInt("keycount", j);

View file

@ -499,7 +499,7 @@ namespace Mist{
std::set<size_t> validTracks = M.getValidTracks(); std::set<size_t> validTracks = M.getValidTracks();
if (validTracks != prevValidTracks){ if (validTracks != prevValidTracks){
MEDIUM_MSG("Valid tracks count changed from %lu to %lu", prevValidTracks.size(), validTracks.size()); MEDIUM_MSG("Valid tracks count changed from %zu to %zu", prevValidTracks.size(), validTracks.size());
prevValidTracks = validTracks; prevValidTracks = validTracks;
if (Triggers::shouldTrigger("LIVE_TRACK_LIST")){ if (Triggers::shouldTrigger("LIVE_TRACK_LIST")){
JSON::Value triggerPayload; JSON::Value triggerPayload;
@ -566,7 +566,7 @@ namespace Mist{
if (tmpNum < meta.biggestFragment() / 2){tmpNum = meta.biggestFragment() / 2;} if (tmpNum < meta.biggestFragment() / 2){tmpNum = meta.biggestFragment() / 2;}
segmentSize = meta.getMinimumFragmentDuration(); segmentSize = meta.getMinimumFragmentDuration();
if (segmentSize != tmpNum){ if (segmentSize != tmpNum){
INFO_MSG("Setting segmentSize from %" PRIu64 " to new value of %" PRIu64, segmentSize, tmpNum); INFO_MSG("Setting segmentSize from %zu to new value of %" PRIu64, segmentSize, tmpNum);
segmentSize = tmpNum; segmentSize = tmpNum;
meta.setMinimumFragmentDuration(segmentSize); meta.setMinimumFragmentDuration(segmentSize);
} }

View file

@ -809,7 +809,7 @@ namespace Mist{
tsStream.getEarliestPacket(thisPacket); tsStream.getEarliestPacket(thisPacket);
tid = getOriginalTrackId(currentPlaylist, thisPacket.getTrackId()); tid = getOriginalTrackId(currentPlaylist, thisPacket.getTrackId());
if (!tid){ if (!tid){
INFO_MSG("Track %" PRIu64 " on PLS %" PRIu64 " -> %" PRIu32, thisPacket.getTrackId(), currentPlaylist, tid); INFO_MSG("Track %zu on PLS %" PRIu64 " -> %" PRIu32, thisPacket.getTrackId(), currentPlaylist, tid);
continue; continue;
} }
}else{ }else{
@ -1243,7 +1243,7 @@ namespace Mist{
pListIt != listEntries.end(); pListIt++){ pListIt != listEntries.end(); pListIt++){
segCount += pListIt->second.size(); segCount += pListIt->second.size();
if (pListIt->second.size()){ if (pListIt->second.size()){
INSANE_MSG("Playlist %u contains %lu segments, with the earliest segment starting @%zu ms", pListIt->first, pListIt->second.size(), firstTimeStamp); INSANE_MSG("Playlist %u contains %zu segments, with the earliest segment starting @%" PRIu64 " ms", pListIt->first, pListIt->second.size(), firstTimeStamp);
if (pListIt->second.front().timestamp < firstTimeStamp || tmpId < 0){ if (pListIt->second.front().timestamp < firstTimeStamp || tmpId < 0){
firstTimeStamp = pListIt->second.front().timestamp; firstTimeStamp = pListIt->second.front().timestamp;
tmpId = pListIt->first; tmpId = pListIt->first;

View file

@ -63,7 +63,7 @@ namespace Mist{
size_t id3size = (((int)header[6] & 0x7F) << 21) | (((int)header[7] & 0x7F) << 14) | size_t id3size = (((int)header[6] & 0x7F) << 21) | (((int)header[7] & 0x7F) << 14) |
(((int)header[8] & 0x7F) << 7) | (((int)header[8] & 0x7F) << 7) |
((header[9] & 0x7F) + 10 + ((header[5] & 0x10) ? 10 : 0)); ((header[9] & 0x7F) + 10 + ((header[5] & 0x10) ? 10 : 0));
INFO_MSG("id3 size: %lu bytes", id3size); INFO_MSG("id3 size: %zu bytes", id3size);
fseek(inFile, id3size, SEEK_SET); fseek(inFile, id3size, SEEK_SET);
}else{ }else{
fseek(inFile, 0, SEEK_SET); fseek(inFile, 0, SEEK_SET);

View file

@ -484,7 +484,7 @@ namespace Mist{
malSize = curPart.size; malSize = curPart.size;
} }
if (fread(data, curPart.size, 1, inFile) != 1){ if (fread(data, curPart.size, 1, inFile) != 1){
FAIL_MSG("read unsuccessful at %" PRIu64, ftell(inFile)); FAIL_MSG("read unsuccessful at %ld", ftell(inFile));
thisPacket.null(); thisPacket.null();
return; return;
} }

View file

@ -430,7 +430,7 @@ namespace Mist{
} }
tmpPos.segmentNo = backChrs - (loc - buffer); tmpPos.segmentNo = backChrs - (loc - buffer);
tmpPos.bytepos -= tmpPos.segmentNo; tmpPos.bytepos -= tmpPos.segmentNo;
INFO_MSG("Track %zu, segment %zu found at bytepos %" PRIu64, it->first, tmpPos.segmentNo, INFO_MSG("Track %zu, segment %" PRIu64 " found at bytepos %" PRIu64, it->first, tmpPos.segmentNo,
tmpPos.bytepos); tmpPos.bytepos);
currentPositions.insert(tmpPos); currentPositions.insert(tmpPos);

View file

@ -157,7 +157,7 @@ namespace Mist{
} }
if (sdpState.tracks.size()){ if (sdpState.tracks.size()){
bool atLeastOne = false; bool atLeastOne = false;
for (std::map<size_t, SDP::Track>::iterator it = sdpState.tracks.begin(); for (std::map<uint64_t, SDP::Track>::iterator it = sdpState.tracks.begin();
it != sdpState.tracks.end(); ++it){ it != sdpState.tracks.end(); ++it){
transportSet = false; transportSet = false;
extraHeaders.clear(); extraHeaders.clear();
@ -358,7 +358,7 @@ namespace Mist{
bool InputRTSP::handleUDP(){ bool InputRTSP::handleUDP(){
if (TCPmode){return false;} if (TCPmode){return false;}
bool r = false; bool r = false;
for (std::map<size_t, SDP::Track>::iterator it = sdpState.tracks.begin(); for (std::map<uint64_t, SDP::Track>::iterator it = sdpState.tracks.begin();
it != sdpState.tracks.end(); ++it){ it != sdpState.tracks.end(); ++it){
Socket::UDPConnection &s = it->second.data; Socket::UDPConnection &s = it->second.data;
it->second.sorter.setCallback(it->first, insertRTP); it->second.sorter.setCallback(it->first, insertRTP);

View file

@ -587,7 +587,7 @@ namespace Mist{
for (std::set<size_t>::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 (!liveStream.isDataTrack(*it)){continue;}
if (threadTimer.count(*it) && ((Util::bootSecs() - threadTimer[*it]) > (2 * THREAD_TIMEOUT))){ if (threadTimer.count(*it) && ((Util::bootSecs() - threadTimer[*it]) > (2 * THREAD_TIMEOUT))){
WARN_MSG("Thread for track %" PRIu64 " timed out %" PRIu64 WARN_MSG("Thread for track %zu timed out %" PRIu64
" seconds ago without a clean shutdown.", " seconds ago without a clean shutdown.",
*it, Util::bootSecs() - threadTimer[*it]); *it, Util::bootSecs() - threadTimer[*it]);
threadTimer.erase(*it); threadTimer.erase(*it);

View file

@ -220,7 +220,7 @@ namespace Mist{
uint64_t pageSize = tPages.getInt("size", pageIdx); uint64_t pageSize = tPages.getInt("size", pageIdx);
// Do nothing when there is not enough free space on the page to add the packet. // Do nothing when there is not enough free space on the page to add the packet.
if (pageSize - pageOffset < packDataLen){ if (pageSize - pageOffset < packDataLen){
FAIL_MSG("Track %" PRIu32 "p%" PRIu32 " : Pack %" PRIu64 "ms of %" PRIu64 "b exceeds size %" PRIu64 " @ bpos %" PRIu64, FAIL_MSG("Track %" PRIu32 "p%" PRIu32 " : Pack %" PRIu64 "ms of %zub exceeds size %" PRIu64 " @ bpos %" PRIu64,
packTrack, currPagNum, packTime, packDataLen, pageSize, pageOffset); packTrack, currPagNum, packTime, packDataLen, pageSize, pageOffset);
return; return;
} }
@ -386,7 +386,7 @@ namespace Mist{
} }
// Create the book keeping data for the new page // Create the book keeping data for the new page
nextPageNum = tPages.getInt("firstkey", endPage - 1) + tPages.getInt("keycount", endPage - 1); nextPageNum = tPages.getInt("firstkey", endPage - 1) + tPages.getInt("keycount", endPage - 1);
HIGH_MSG("Live page transition from %" PRIu32 ":%zu to %" PRIu32 ":%" PRIu32, packTrack, HIGH_MSG("Live page transition from %" PRIu32 ":%" PRIu64 " to %" PRIu32 ":%" PRIu32, packTrack,
tPages.getInt("firstkey", endPage - 1), packTrack, nextPageNum); tPages.getInt("firstkey", endPage - 1), packTrack, nextPageNum);
tPages.setInt("firstkey", nextPageNum, endPage); tPages.setInt("firstkey", nextPageNum, endPage);
tPages.setInt("firsttime", packTime, endPage); tPages.setInt("firsttime", packTime, endPage);

View file

@ -857,7 +857,7 @@ namespace Mist{
} }
if (mainTrack == ti->first){continue;}// skip self if (mainTrack == ti->first){continue;}// skip self
if (!M.trackValid(ti->first)){ if (!M.trackValid(ti->first)){
HIGH_MSG("Skipping track %lu, not in tracks", ti->first); HIGH_MSG("Skipping track %zu, not in tracks", ti->first);
continue; continue;
}// ignore missing tracks }// ignore missing tracks
if (M.getLastms(ti->first) < seekPos + needsLookAhead + extraKeepAway + M.getMinKeepAway(ti->first)){ if (M.getLastms(ti->first) < seekPos + needsLookAhead + extraKeepAway + M.getMinKeepAway(ti->first)){
@ -865,7 +865,7 @@ namespace Mist{
break; break;
} }
if (meta.getLastms(ti->first) == M.getFirstms(ti->first)){ if (meta.getLastms(ti->first) == M.getFirstms(ti->first)){
HIGH_MSG("Skipping track %lu, last equals first", ti->first); HIGH_MSG("Skipping track %zu, last equals first", ti->first);
continue; continue;
}// ignore point-tracks }// ignore point-tracks
if (meta.getLastms(ti->first) < seekPos){ if (meta.getLastms(ti->first) < seekPos){
@ -881,7 +881,7 @@ namespace Mist{
/*LTS-START*/ /*LTS-START*/
if (isRecordingToFile){ if (isRecordingToFile){
if (M.getLive()){ if (M.getLive()){
MEDIUM_MSG("Stream currently contains data from %lu ms to %lu ms", startTime(), endTime()); MEDIUM_MSG("Stream currently contains data from %" PRIu64 " ms to %" PRIu64 " ms", startTime(), endTime());
} }
// Overwrite recstart/recstop with recstartunix/recstopunix if set // Overwrite recstart/recstop with recstartunix/recstopunix if set
if (M.getLive() && if (M.getLive() &&
@ -952,7 +952,7 @@ namespace Mist{
INFO_MSG("Recording will start at timestamp %llu ms", atoll(targetParams["recstart"].c_str())); INFO_MSG("Recording will start at timestamp %llu ms", atoll(targetParams["recstart"].c_str()));
} }
else{ else{
INFO_MSG("Recording will start at timestamp %lu ms", endTime()); INFO_MSG("Recording will start at timestamp %" PRIu64 " ms", endTime());
} }
if (targetParams.count("recstop")){ if (targetParams.count("recstop")){
INFO_MSG("Recording will stop at timestamp %llu ms", atoll(targetParams["recstop"].c_str())); INFO_MSG("Recording will stop at timestamp %llu ms", atoll(targetParams["recstop"].c_str()));
@ -988,12 +988,12 @@ namespace Mist{
int64_t origStartUnix = startUnix; int64_t origStartUnix = startUnix;
startUnix += Util::epoch(); startUnix += Util::epoch();
if (startUnix < unixStreamBegin){ if (startUnix < unixStreamBegin){
INFO_MSG("Waiting for stream to reach playback starting point. Current last ms is '%lu'", streamAvail); INFO_MSG("Waiting for stream to reach playback starting point. Current last ms is '%" PRIu64 "'", streamAvail);
while (startUnix < Util::epoch() - (endTime() / 1000) && keepGoing()){ while (startUnix < Util::epoch() - (endTime() / 1000) && keepGoing()){
Util::wait(1000); Util::wait(1000);
stats(); stats();
startUnix = origStartUnix + Util::epoch(); startUnix = origStartUnix + Util::epoch();
HIGH_MSG("Waiting for stream to reach playback starting point. Current last ms is '%lu'", streamAvail); HIGH_MSG("Waiting for stream to reach playback starting point. Current last ms is '%" PRIu64 "'", streamAvail);
} }
} }
} }
@ -1034,11 +1034,11 @@ namespace Mist{
} }
int64_t streamAvail = M.getLastms(mainTrack); int64_t streamAvail = M.getLastms(mainTrack);
int64_t lastUpdated = Util::getMS(); int64_t lastUpdated = Util::getMS();
INFO_MSG("Waiting for stream to reach playback starting point. Current last ms is '%lu'", streamAvail); INFO_MSG("Waiting for stream to reach playback starting point. Current last ms is '%" PRIu64 "'", streamAvail);
while (Util::getMS() - lastUpdated < 5000 && startRec > streamAvail && keepGoing()){ while (Util::getMS() - lastUpdated < 5000 && startRec > streamAvail && keepGoing()){
Util::sleep(500); Util::sleep(500);
if (M.getLastms(mainTrack) > streamAvail){ if (M.getLastms(mainTrack) > streamAvail){
HIGH_MSG("Waiting for stream to reach playback starting point. Current last ms is '%lu'", streamAvail); HIGH_MSG("Waiting for stream to reach playback starting point. Current last ms is '%" PRIu64 "'", streamAvail);
stats(); stats();
streamAvail = M.getLastms(mainTrack); streamAvail = M.getLastms(mainTrack);
lastUpdated = Util::getMS(); lastUpdated = Util::getMS();
@ -1064,7 +1064,7 @@ namespace Mist{
MEDIUM_MSG("Initial seek to %" PRIu64 "ms", seekPos); MEDIUM_MSG("Initial seek to %" PRIu64 "ms", seekPos);
seek(seekPos); seek(seekPos);
}else{ }else{
ERROR_MSG("Aborting seek to %" PRIu64 " since stream only has available from %lu ms to %lu ms", seekPos, startTime(), endTime()); ERROR_MSG("Aborting seek to %" PRIu64 " since stream only has available from %" PRIu64 " ms to %" PRIu64 " ms", seekPos, startTime(), endTime());
} }
} }
@ -1116,7 +1116,7 @@ namespace Mist{
} }
} }
if (realTime != newSpeed){ if (realTime != newSpeed){
HIGH_MSG("Changing playback speed from %" PRIu64 " to %" PRIu64 "(%" PRIu64 " ms LA, %" PRIu64 " ms mKA, %lu eKA)", realTime, newSpeed, needsLookAhead, mKa, extraKeepAway); HIGH_MSG("Changing playback speed from %" PRIu64 " to %" PRIu64 "(%" PRIu64 " ms LA, %" PRIu64 " ms mKA, %" PRIu64 " eKA)", realTime, newSpeed, needsLookAhead, mKa, extraKeepAway);
firstTime = Util::bootMS() - (cTime * newSpeed / 1000); firstTime = Util::bootMS() - (cTime * newSpeed / 1000);
realTime = newSpeed; realTime = newSpeed;
} }
@ -1144,15 +1144,15 @@ namespace Mist{
} }
if (mainTrack == ti->first){continue;}// skip self if (mainTrack == ti->first){continue;}// skip self
if (meta.getLastms(ti->first) == meta.getFirstms(ti->first)){ if (meta.getLastms(ti->first) == meta.getFirstms(ti->first)){
HIGH_MSG("Skipping track %lu, last equals first", ti->first); HIGH_MSG("Skipping track %zu, last equals first", ti->first);
continue; continue;
}// ignore point-tracks }// ignore point-tracks
HIGH_MSG("Track %lu is good", ti->first); HIGH_MSG("Track %zu is good", ti->first);
} }
// if yes, seek here // if yes, seek here
if (good){ if (good){
HIGH_MSG("Skipping forward %" PRIu64 "ms (%" PRIu64 " ms LA, %" PRIu64 HIGH_MSG("Skipping forward %" PRIu64 "ms (%" PRIu64 " ms LA, %" PRIu64
" ms mKA, %lu eKA, > %" PRIu32 "ms, mSa %" PRIu64 " ms)", " ms mKA, %" PRIu64 " eKA, > %" PRIu32 "ms, mSa %" PRIu64 " ms)",
seekPos - cTime, needsLookAhead, mKa, extraKeepAway, seekCount * 100, maxSkipAhead); seekPos - cTime, needsLookAhead, mKa, extraKeepAway, seekCount * 100, maxSkipAhead);
if (seekCount < 20){++seekCount;} if (seekCount < 20){++seekCount;}
seek(seekPos); seek(seekPos);
@ -1316,7 +1316,7 @@ namespace Mist{
// delay the stream until metadata has caught up, if needed // delay the stream until metadata has caught up, if needed
if (needsLookAhead && M.getLive()){ if (needsLookAhead && M.getLive()){
// we sleep in 20ms increments, or less if the lookahead time itself is less // we sleep in 20ms increments, or less if the lookahead time itself is less
uint32_t sleepTime = std::min(20ul, needsLookAhead); uint32_t sleepTime = std::min((uint64_t)20, needsLookAhead);
// wait at most double the look ahead time, plus ten seconds // wait at most double the look ahead time, plus ten seconds
uint64_t timeoutTries = (needsLookAhead / sleepTime) * 2 + (10000 / sleepTime); uint64_t timeoutTries = (needsLookAhead / sleepTime) * 2 + (10000 / sleepTime);
uint64_t needsTime = thisTime + needsLookAhead; uint64_t needsTime = thisTime + needsLookAhead;
@ -1346,7 +1346,7 @@ namespace Mist{
meta.reloadReplacedPagesIfNeeded(); meta.reloadReplacedPagesIfNeeded();
} }
if (!timeoutTries){ if (!timeoutTries){
WARN_MSG("Waiting for lookahead (%zums in %zu tracks) timed out - resetting lookahead!", needsLookAhead, userSelect.size()); WARN_MSG("Waiting for lookahead (%" PRIu64 "ms in %zu tracks) timed out - resetting lookahead!", needsLookAhead, userSelect.size());
needsLookAhead = 0; needsLookAhead = 0;
} }
} }
@ -1452,8 +1452,8 @@ namespace Mist{
// depending on whether this is probably bad and the current debug level, print a message // depending on whether this is probably bad and the current debug level, print a message
size_t printLevel = (probablyBad ? DLVL_WARN : DLVL_INFO); size_t printLevel = (probablyBad ? DLVL_WARN : DLVL_INFO);
const Comms::Users &usr = userSelect.at(trackId); const Comms::Users &usr = userSelect.at(trackId);
DEBUG_MSG(printLevel, "Dropping %s (%s) track %zu@k%zu (nextP=%zu, lastP=%zu): %s", DEBUG_MSG(printLevel, "Dropping %s track %zu@k%zu (nextP=%" PRIu64 ", lastP=%" PRIu64 "): %s",
streamName.c_str(), meta.getCodec(trackId).c_str(), trackId, usr.getKeyNum() + 1, meta.getCodec(trackId).c_str(), trackId, usr.getKeyNum() + 1,
pageNumForKey(trackId, usr.getKeyNum() + 1), pageNumMax(trackId), reason.c_str()); pageNumForKey(trackId, usr.getKeyNum() + 1), pageNumMax(trackId), reason.c_str());
// now actually drop the track from the buffer // now actually drop the track from the buffer
buffer.dropTrack(trackId); buffer.dropTrack(trackId);
@ -1651,7 +1651,7 @@ namespace Mist{
} }
//every ~16 seconds, reconnect to metadata //every ~16 seconds, reconnect to metadata
if (emptyCount % 1600 == 0){ if (emptyCount % 1600 == 0){
INFO_MSG("Reconnecting to input; track %" PRIu64 " key %" PRIu32 " is on page %" PRIu32 " and we're currently serving %" PRIu32 " from %" PRIu32, nxt.tid, thisKey+1, nextKeyPage, thisKey, currentPage[nxt.tid]); INFO_MSG("Reconnecting to input; track %zu key %" PRIu32 " is on page %" PRIu32 " and we're currently serving %" PRIu32 " from %" PRIu32, nxt.tid, thisKey+1, nextKeyPage, thisKey, currentPage[nxt.tid]);
reconnect(); reconnect();
if (!meta){ if (!meta){
onFail("Could not connect to stream data", true); onFail("Could not connect to stream data", true);
@ -1768,7 +1768,7 @@ namespace Mist{
lastStats = now; lastStats = now;
VERYHIGH_MSG("Writing stats: %s, %s, %u, %lu, %lu", getConnectedHost().c_str(), streamName.c_str(), VERYHIGH_MSG("Writing stats: %s, %s, %u, %" PRIu64 ", %" PRIu64, getConnectedHost().c_str(), streamName.c_str(),
crc & 0xFFFFFFFFu, myConn.dataUp(), myConn.dataDown()); crc & 0xFFFFFFFFu, myConn.dataUp(), myConn.dataDown());
/*LTS-START*/ /*LTS-START*/
if (statComm.getStatus() & COMM_STATUS_REQDISCONNECT){ if (statComm.getStatus() & COMM_STATUS_REQDISCONNECT){

View file

@ -348,7 +348,7 @@ namespace Mist{
EBML::sendElemHead(myConn, EBML::EID_CUES, cuesSize); EBML::sendElemHead(myConn, EBML::EID_CUES, cuesSize);
uint64_t tmpsegSize = infoSize + tracksSize + seekheadSize + cuesSize + uint64_t tmpsegSize = infoSize + tracksSize + seekheadSize + cuesSize +
EBML::sizeElemHead(EBML::EID_CUES, cuesSize); EBML::sizeElemHead(EBML::EID_CUES, cuesSize);
for (std::map<uint64_t, uint64_t>::iterator it = clusterSizes.begin(); it != clusterSizes.end(); ++it){ for (std::map<size_t, size_t>::iterator it = clusterSizes.begin(); it != clusterSizes.end(); ++it){
EBML::sendElemCuePoint(myConn, it->first, idx + 1, tmpsegSize, 0); EBML::sendElemCuePoint(myConn, it->first, idx + 1, tmpsegSize, 0);
tmpsegSize += it->second; tmpsegSize += it->second;
} }
@ -358,8 +358,8 @@ namespace Mist{
/// Seeks to the given byte position by doing a regular seek and remembering the byte offset from /// Seeks to the given byte position by doing a regular seek and remembering the byte offset from
/// that point /// that point
void OutEBML::byteSeek(uint64_t startPos){ void OutEBML::byteSeek(size_t startPos){
INFO_MSG("Seeking to %" PRIu64 " bytes", startPos); INFO_MSG("Seeking to %zu bytes", startPos);
sentHeader = false; sentHeader = false;
newClusterTime = 0; newClusterTime = 0;
if (startPos == 0){ if (startPos == 0){
@ -377,10 +377,10 @@ namespace Mist{
} }
startPos -= headerSize; startPos -= headerSize;
sentHeader = true; // skip the header sentHeader = true; // skip the header
for (std::map<uint64_t, uint64_t>::iterator it = clusterSizes.begin(); it != clusterSizes.end(); ++it){ for (std::map<size_t, size_t>::iterator it = clusterSizes.begin(); it != clusterSizes.end(); ++it){
VERYHIGH_MSG("Cluster %" PRIu64 " (%" PRIu64 " bytes) -> %" PRIu64 " to go", it->first, it->second, startPos); VERYHIGH_MSG("Cluster %zu (%zu bytes) -> %zu to go", it->first, it->second, startPos);
if (startPos < it->second){ if (startPos < it->second){
HIGH_MSG("Seek to fragment at %" PRIu64 " ms", it->first); HIGH_MSG("Seek to fragment at %zu ms", it->first);
myConn.skipBytes(startPos); myConn.skipBytes(startPos);
seek(it->first); seek(it->first);
newClusterTime = it->first; newClusterTime = it->first;
@ -413,8 +413,8 @@ namespace Mist{
totalSize = EBML::sizeElemEBML(doctype) + EBML::sizeElemHead(EBML::EID_SEGMENT, segmentSize) + segmentSize; totalSize = EBML::sizeElemEBML(doctype) + EBML::sizeElemHead(EBML::EID_SEGMENT, segmentSize) + segmentSize;
} }
size_t byteEnd = totalSize - 1; uint64_t byteEnd = totalSize - 1;
size_t byteStart = 0; uint64_t byteStart = 0;
if (!M.getLive() && req.GetHeader("Range") != ""){ if (!M.getLive() && req.GetHeader("Range") != ""){
//Range request //Range request
if (parseRange(req.GetHeader("Range"), byteStart, byteEnd)){ if (parseRange(req.GetHeader("Range"), byteStart, byteEnd)){
@ -521,7 +521,7 @@ namespace Mist{
segmentSize = infoSize + tracksSize + seekheadSize + cuesSize + segmentSize = infoSize + tracksSize + seekheadSize + cuesSize +
EBML::sizeElemHead(EBML::EID_CUES, cuesSize); EBML::sizeElemHead(EBML::EID_CUES, cuesSize);
uint32_t cuesInside = 0; uint32_t cuesInside = 0;
for (std::map<uint64_t, uint64_t>::iterator it = clusterSizes.begin(); it != clusterSizes.end(); ++it){ for (std::map<size_t, size_t>::iterator it = clusterSizes.begin(); it != clusterSizes.end(); ++it){
cuesInside += EBML::sizeElemCuePoint(it->first, idx + 1, segmentSize, 0); cuesInside += EBML::sizeElemCuePoint(it->first, idx + 1, segmentSize, 0);
segmentSize += it->second; segmentSize += it->second;
} }

View file

@ -24,7 +24,7 @@ namespace Mist{
uint64_t newClusterTime; uint64_t newClusterTime;
// VoD-only // VoD-only
void calcVodSizes(); void calcVodSizes();
size_t segmentSize; // size of complete segment contents (excl. header) uint64_t segmentSize; // size of complete segment contents (excl. header)
size_t tracksSize; // size of Tracks (incl. header) size_t tracksSize; // size of Tracks (incl. header)
size_t infoSize; // size of Info (incl. header) size_t infoSize; // size of Info (incl. header)
size_t cuesSize; // size of Cues (excl. header) size_t cuesSize; // size of Cues (excl. header)

View file

@ -836,7 +836,7 @@ namespace Mist{
segfaults. segfaults.
*/ */
if (!thisPacket.getData()) { if (!thisPacket.getData()) {
FAIL_MSG("Current packet has no data, lookahead: %lu.", needsLookAhead); FAIL_MSG("Current packet has no data, lookahead: %" PRIu64, needsLookAhead);
return; return;
} }
@ -1185,7 +1185,7 @@ namespace Mist{
H.SendResponse("500", "Error generating MP4 header", myConn); H.SendResponse("500", "Error generating MP4 header", myConn);
return; return;
} }
INFO_MSG("Have %zu bytes, sending %zu bytes", headerData.size(), std::min(headerSize, byteEnd) - byteStart); INFO_MSG("Have %zu bytes, sending %" PRIu64 " bytes", headerData.size(), std::min(headerSize, byteEnd) - byteStart);
H.Chunkify(headerData + byteStart, std::min(headerSize, byteEnd) - byteStart, myConn); H.Chunkify(headerData + byteStart, std::min(headerSize, byteEnd) - byteStart, myConn);
leftOver -= std::min(headerSize, byteEnd) - byteStart; leftOver -= std::min(headerSize, byteEnd) - byteStart;
} }

View file

@ -66,7 +66,7 @@ namespace Mist{
size_t index = 0; size_t index = 0;
if (initData[0] == 0x02){//"special" case, requires interpretation similar to table if (initData[0] == 0x02){//"special" case, requires interpretation similar to table
if (initData.size() < 7){ if (initData.size() < 7){
FAIL_MSG("initData size too tiny (size: %lu)", initData.size()); FAIL_MSG("initData size too tiny (size: %zu)", initData.size());
return false; return false;
} }
size_t len1 = 0; size_t len1 = 0;
@ -94,7 +94,7 @@ namespace Mist{
output.push_back(initData.substr(index)); output.push_back(initData.substr(index));
}else{ }else{
if (initData.size() < 7){ if (initData.size() < 7){
FAIL_MSG("initData size too tiny (size: %lu)", initData.size()); FAIL_MSG("initData size too tiny (size: %zu)", initData.size());
return false; return false;
} }
unsigned int len = 0; unsigned int len = 0;

View file

@ -1329,7 +1329,7 @@ namespace Mist{
break; // happens when connection breaks unexpectedly break; // happens when connection breaks unexpectedly
case 1: // set chunk size case 1: // set chunk size
RTMPStream::chunk_rec_max = Bit::btohl(next.data.data()); RTMPStream::chunk_rec_max = Bit::btohl(next.data.data());
MEDIUM_MSG("CTRL: Set chunk size: %" PRIu64, RTMPStream::chunk_rec_max); MEDIUM_MSG("CTRL: Set chunk size: %zu", RTMPStream::chunk_rec_max);
break; break;
case 2: // abort message - we ignore this one case 2: // abort message - we ignore this one
MEDIUM_MSG("CTRL: Abort message"); MEDIUM_MSG("CTRL: Abort message");
@ -1438,7 +1438,7 @@ namespace Mist{
tagTime -= (tagTime - ltt) - 1; tagTime -= (tagTime - ltt) - 1;
} }
} }
uint64_t idx = reTrackToID[reTrack]; size_t idx = reTrackToID[reTrack];
if (idx != INVALID_TRACK_ID && !userSelect.count(idx)){ if (idx != INVALID_TRACK_ID && !userSelect.count(idx)){
userSelect[idx].reload(streamName, idx, COMM_STATUS_ACTIVE | COMM_STATUS_SOURCE); userSelect[idx].reload(streamName, idx, COMM_STATUS_ACTIVE | COMM_STATUS_SOURCE);
} }

View file

@ -506,7 +506,7 @@ namespace Mist{
/// Reads and handles RTP packets over UDP, if needed /// Reads and handles RTP packets over UDP, if needed
void OutRTSP::handleUDP(){ void OutRTSP::handleUDP(){
if (!isPushing()){return;} if (!isPushing()){return;}
for (std::map<size_t, SDP::Track>::iterator it = sdpState.tracks.begin(); for (std::map<uint64_t, SDP::Track>::iterator it = sdpState.tracks.begin();
it != sdpState.tracks.end(); ++it){ it != sdpState.tracks.end(); ++it){
Socket::UDPConnection &s = it->second.data; Socket::UDPConnection &s = it->second.data;
it->second.sorter.setCallback(it->first, insertRTP); it->second.sorter.setCallback(it->first, insertRTP);

View file

@ -134,7 +134,7 @@ namespace Mist{
while (i + 4 < (unsigned int)dataLen){ while (i + 4 < (unsigned int)dataLen){
ThisNaluSize = Bit::btohl(dataPointer + i); ThisNaluSize = Bit::btohl(dataPointer + i);
if (ThisNaluSize + i + 4 > dataLen){ if (ThisNaluSize + i + 4 > dataLen){
WARN_MSG("Too big NALU detected (%" PRIu32 " > %" PRIu64 ") - skipping!", WARN_MSG("Too big NALU detected (%" PRIu32 " > %zu) - skipping!",
ThisNaluSize + i + 4, dataLen); ThisNaluSize + i + 4, dataLen);
break; break;
} }

View file

@ -230,7 +230,7 @@ namespace Mist{
trackId = (S.ID << 16) + thisPacket.getTrackId(); trackId = (S.ID << 16) + thisPacket.getTrackId();
size_t idx = M.trackIDToIndex(trackId, getpid()); size_t idx = M.trackIDToIndex(trackId, getpid());
if (idx == INVALID_TRACK_ID || !M.getCodec(idx).size()){ if (idx == INVALID_TRACK_ID || !M.getCodec(idx).size()){
INFO_MSG("Initializing track %zi as %" PRIu64 " for playlist %" PRIu64, thisPacket.getTrackId(), trackId, S.ID); INFO_MSG("Initializing track %zi as %" PRIu64 " for playlist %zu", thisPacket.getTrackId(), trackId, S.ID);
S.S.initializeMetadata(meta, thisPacket.getTrackId(), trackId); S.S.initializeMetadata(meta, thisPacket.getTrackId(), trackId);
} }
} }

View file

@ -99,7 +99,7 @@ int main(int argc, char **argv){
for (uint64_t j = pages.getDeleted(); j < pages.getEndPos(); j++){ for (uint64_t j = pages.getDeleted(); j < pages.getEndPos(); j++){
char thisPageName[NAME_BUFFER_SIZE]; char thisPageName[NAME_BUFFER_SIZE];
snprintf(thisPageName, NAME_BUFFER_SIZE, SHM_TRACK_DATA, snprintf(thisPageName, NAME_BUFFER_SIZE, SHM_TRACK_DATA,
Util::streamName, i, pages.getInt("firstkey", j)); Util::streamName, i, (uint32_t)pages.getInt("firstkey", j));
IPC::sharedPage p(thisPageName, 0); IPC::sharedPage p(thisPageName, 0);
p.master = true; p.master = true;
} }